/**
 * Rekt Bot ダッシュボード - スタイルシート
 */

:root {
    --primary: #5865F2;
    --primary-dark: #4752C4;
    --success: #57F287;
    --warning: #FEB529;
    --danger: #ED4245;
    --dark: #1a1d25;
    --darker: #0f1115;
    --light: #ECEFF1;
    --text: #FFFFFF;
    --text-secondary: #B9BBBE;
    --border: #222838;
    --card-bg: #11151d;
    --input-bg: #0d1017;
    --border-color: #242b3b;
    --bg-secondary: #161b26;
    --shadow-strong: 0 12px 40px rgba(0,0,0,0.35);
    --shadow-soft: 0 8px 24px rgba(0,0,0,0.22);
    --sidebar-fixed-height: calc(100vh - 170px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--darker);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== ログインページ ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark), var(--darker));
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background-color: var(--dark);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.login-box h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--primary);
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100% !important;
    justify-content: flex-start !important;
}

.login-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.login-button img {
    width: 20px;
    height: 20px;
}

/* ===== ダッシュボード ===== */
.dashboard-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: radial-gradient(circle at 20% 20%, rgba(88,101,242,0.08), transparent 35%),
                radial-gradient(circle at 80% 10%, rgba(87,242,135,0.08), transparent 30%),
                #0f1115;
}

.dashboard-header {
    background-color: #101219;
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    min-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    position: relative;
    box-shadow: var(--shadow-strong);
}

.header-left h1 {
    font-size: 24px;
    color: #60A5FA;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 15px;
    background-color: rgba(88, 101, 242, 0.12);
    border-radius: 8px;
    border: 1px solid rgba(88, 101, 242, 0.3);
    position: relative;
    flex-shrink: 0;
    white-space: nowrap;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.user-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #60A5FA;
    object-fit: cover;
    flex-shrink: 0;
}

.user-profile span {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.role-badge {
    background-color: var(--primary) !important;
    color: white !important;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px !important;
    font-weight: 600;
}

.manage-btn {
    padding: 8px 16px;
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-right: 10px;
}

.manage-btn:hover {
    background-color: var(--primary-dark);
}

.logout-btn {
    padding: 8px 14px;
    background-color: rgba(237, 66, 69, 0.15);
    color: #FCA5A5;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(237, 66, 69, 0.4);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.logout-btn:hover {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* ===== ナビゲーションバー ===== */
.dashboard-nav {
    display: flex;
    gap: 0;
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
    height: 50px;
    position: relative;
    background: #222;
    border-bottom: 1px solid #333;
}

.dashboard-nav a {
    padding: 14px 20px;
    color: #B9BBBE;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
}

.dashboard-nav a:hover {
    background-color: rgba(88, 101, 242, 0.1);
    color: #fff;
}

.dashboard-nav a.active {
    color: #fff;
    background-color: rgba(88, 101, 242, 0.15);
    border-bottom-color: var(--primary);
}

.dashboard-main {
    padding: 20px 0 40px;
    max-width: 100%;
    margin: 0;
    width: 100%;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* 共通レイアウト: 3カラム（左/中央/右）を中央寄せで幅を抑える */
.layout-3col {
    display: flex;
    gap: 20px;
    width: 100%;
    justify-content: center;
    align-items: stretch;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 中央カラムの横幅を制御（テーブルが読める幅を確保） */
.layout-main {
    flex: 1;
    min-width: 0;
    max-width: 1120px;
}

/* サイドバー共通スタイル */
.sidebar-left,
.sidebar-right {
    flex-shrink: 0;
    overflow-y: auto;
    padding: 20px;
    height: var(--sidebar-fixed-height) !important;
    min-height: var(--sidebar-fixed-height) !important;
    max-height: var(--sidebar-fixed-height) !important;
}

.sidebar-left {
    width: 320px;
    background-color: rgba(0, 0, 0, 0.1);
    border-right: 1px solid var(--border);
}

.sidebar-right {
    width: 320px;
    background-color: rgba(0, 0, 0, 0.1);
    border-left: 1px solid var(--border);
}

/* サイドバー折りたたみ（ページ単位でbodyにsidebar-collapsedを付与） */
.sidebar-collapsed .sidebar-left,
.sidebar-collapsed .sidebar-right {
    display: none;
}

.sidebar-collapsed .dashboard-main > div {
    justify-content: flex-start;
}

.sidebar-collapsed .dashboard-main > div > div:nth-child(2) {
    max-width: 100%;
}

/* メインコンテンツ領域 */
.dashboard-main > div > div:nth-child(2) {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
}



/* ===== ダッシュボードセクション ===== */
.dashboard-section {
    background-color: var(--dark);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
}

.dashboard-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== ステータスグリッド ===== */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.status-card {
    background-color: var(--darker);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-card.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.status-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.status-card .value {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary);
}

.status-card .status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-indicator.online::before {
    content: '●';
    color: var(--success);
}

.status-indicator.offline::before {
    content: '●';
    color: var(--danger);
}

/* ===== テーブル ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background-color: var(--darker);
    border-bottom: 2px solid var(--border);
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background-color: rgba(88, 101, 242, 0.1);
}

.data-table tbody tr.loading {
    text-align: center;
    color: var(--text-secondary);
}

/* ===== ユーザーグリッド ===== */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.user-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(88, 101, 242, 0.25);
}

.user-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.user-card__profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-card__profile .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(88,101,242,0.4);
    object-fit: cover;
}

.user-card__profile .name {
    font-weight: 600;
    color: var(--text);
}

.user-card__profile .sub {
    font-size: 12px;
    color: var(--text-secondary);
}

.user-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 12px;
    font-size: 13px;
}

.user-meta .label {
    color: var(--text-secondary);
    font-weight: 600;
    margin-right: 6px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text);
    white-space: nowrap;
}

.pill.warning {
    border-color: #fbbf24;
    color: #fbbf24;
}

.pill.success {
    border-color: #57F287;
    color: #57F287;
}

.pill.danger {
    border-color: #ED4245;
    color: #ED4245;
}

.user-status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.recheck-btn {
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.recheck-btn:hover {
    background: var(--primary-dark);
}

.user-edit-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    align-items: center;
}

.user-edit-form input,
.user-edit-form select {
    background: var(--input-bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 6px;
}

.user-edit-form .update-btn {
    width: 100%;
    justify-self: end;
}

.copy-btn {
    padding: 6px 10px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* ===== アクショングリッド ===== */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background-color: var(--darker);
    border: 2px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
}

.action-btn:hover {
    border-color: var(--primary);
    background-color: rgba(88, 101, 242, 0.1);
    color: var(--primary);
    transform: translateY(-4px);
}

.action-btn .icon {
    font-size: 32px;
}

/* ===== 通知グリッド ===== */
.notification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: var(--darker);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.notification-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.notification-item label {
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.notification-item label .label-text {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-item label .label-desc {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== モーダル ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--dark);
    border-radius: 8px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-content h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 20px;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--danger);
}

/* ===== トーストメッセージ ===== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--darker);
    color: var(--text);
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid var(--primary);
    max-width: 400px;
    z-index: 999;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== サイドバー共通カードスタイル ===== */
.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

.sidebar-title {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 0.95em;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        height: auto;
        min-height: 64px;
        padding: 10px 15px;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-section {
        padding: 15px;
    }
    
    .data-table {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }

    .dashboard-nav {
        overflow-x: auto;
    }

/* ===== グループリスト ===== */
.groups-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.group-card {
    background-color: var(--darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.group-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--text);
}

.group-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.stat-badge {
    background-color: rgba(88, 101, 242, 0.2);
    color: #60A5FA;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    border: 1px solid rgba(88, 101, 242, 0.3);
}

/* ===== ページヘッダー ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.page-header h2 {
    font-size: 20px;
    color: var(--text);
    margin: 0;
}

.page-header p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.9em;
}

    .dashboard-nav a {
        padding: 12px 15px;
        font-size: 12px;
    }
}
/* ===== ローディングオーバーレイ ===== */
#global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

#global-loading-overlay.show {
    opacity: 1;
}

.loading-content {
    background: var(--dark);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.loading-content p {
    color: var(--text);
    margin-top: 16px;
    font-size: 1.1em;
}

/* スピナーアニメーション */
.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid rgba(88, 101, 242, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ボタン内スピナー */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* ===== フォームバリデーション ===== */
input.validation-error,
select.validation-error,
textarea.validation-error {
    border-color: var(--danger) !important;
    background-color: rgba(237, 66, 69, 0.1) !important;
}

.input-error-message {
    color: var(--danger);
    font-size: 0.85em;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-error-message::before {
    content: '⚠️';
}

/* バリデーション成功 */
input.validation-success,
select.validation-success,
textarea.validation-success {
    border-color: var(--success) !important;
}

/* ===== プログレスバー ===== */
.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(88, 101, 242, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #7289DA);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== スケルトンローダー ===== */
.skeleton {
    background: linear-gradient(90deg, var(--darker) 25%, var(--dark) 50%, var(--darker) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 16px;
    margin: 8px 0;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin: 12px 0;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== レスポンシブ改善 ===== */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 20px;
    }
    
    .channel-input-wrapper {
        flex-direction: column;
    }
    
    .copy-btn {
        width: 100%;
    }
    
    .tooltip .tooltiptext {
        width: 90vw;
        left: 50%;
        margin-left: -45vw;
    }
    
    .stat-badge {
        font-size: 0.8em;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .toast {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    
    .fab {
        padding: 12px 16px;
        font-size: 0.9em;
    }
}
/* ===== レスポンシブテーブル ===== */
.responsive-table table {
    width: 100%;
    border-collapse: collapse;
}

.responsive-table th,
.responsive-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.responsive-table th {
    background: rgba(88, 101, 242, 0.1);
    font-weight: 600;
}

.role-update-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.role-select {
    padding: 6px 10px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
}

.update-btn {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.update-btn:hover {
    background: var(--primary-dark);
}

/* ===== モバイル対応（992px以下）===== */
@media (max-width: 992px) {
    /* 3カラムレイアウトを1カラムに */
    .dashboard-main > div {
        flex-direction: column !important;
    }
    
    .sidebar-left,
    .sidebar-right {
        width: 100% !important;
        max-width: 100%;
    }
    
    /* レスポンシブテーブル - カード形式 */
    .responsive-table thead {
        display: none;
    }
    
    .responsive-table tbody tr {
        display: block;
        margin-bottom: 16px;
        background: var(--card-bg);
        border-radius: 8px;
        padding: 12px;
        border: 1px solid var(--border-color);
    }
    
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .responsive-table td:last-child {
        border-bottom: none;
    }
    
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        margin-right: 10px;
        min-width: 120px;
    }
    
    .responsive-table td[data-label="操作"] {
        flex-direction: column;
        align-items: stretch;
    }
    
    .responsive-table td[data-label="操作"]::before {
        margin-bottom: 8px;
    }
    
    .role-update-form {
        flex-direction: column;
        width: 100%;
    }
    
    .role-select,
    .update-btn {
        width: 100%;
    }
}

/* ===== スマホ対応（480px以下）===== */
@media (max-width: 480px) {
    .dashboard-header {
        padding: 10px 15px !important;
        height: auto !important;
        min-height: 60px !important;
    }
    
    .dashboard-header h1 {
        font-size: 1.1em !important;
    }
    
    .dashboard-nav {
        flex-wrap: wrap;
    }
    
    .dashboard-nav a {
        font-size: 0.85em;
        padding: 8px 12px;
    }
    
    .responsive-table td::before {
        min-width: 90px;
        font-size: 0.85em;
    }
    
    .user-info {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== ステータスバッジ ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.status-badge.online {
    background: rgba(67, 181, 129, 0.15);
    color: #43b581;
}

.status-badge.online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #43b581;
    animation: pulse 2s infinite;
}

.status-badge.offline {
    background: rgba(237, 66, 69, 0.15);
    color: #ED4245;
}

.status-badge.offline::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ED4245;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ===== サーバーグリッド ===== */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

/* ===== サーバーカード ===== */
.server-card {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.server-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    border-color: var(--primary);
}

.server-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.server-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.server-status strong {
    color: var(--text);
    font-size: 1.1em;
}

.server-card-address {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.server-card-world {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    font-size: 0.9em;
}

.world-label,
.world-time-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.world-name,
.game-time {
    color: var(--text);
    font-weight: 600;
}

.world-name.placeholder,
.game-time.placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.server-card-description {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
}

.server-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85em;
    font-weight: 500;
}

.stat-value {
    color: var(--text);
    font-size: 1em;
    font-weight: 600;
}

.server-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 600;
}

.tag-telnet {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
}

.tag-ftp {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.server-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.btn-icon {
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.btn-favorite {
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.2s;
}

.btn-favorite:hover {
    transform: scale(1.2);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.9em;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    color: var(--text);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-sm:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-sm.btn-danger {
    background: rgba(237, 66, 69, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.btn-sm.btn-danger:hover {
    background: var(--danger);
    color: white;
}

/* ===== レスポンシブ対応 ===== */
@media (max-width: 1200px) {
    .server-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .server-grid {
        grid-template-columns: 1fr;
    }
    
    .server-card-stats {
        grid-template-columns: 1fr;
    }
    
    .dashboard-main > div {
        flex-direction: column;
    }
    
    .sidebar-left,
    .sidebar-right {
        width: 100%;
        height: var(--sidebar-fixed-height) !important;
        min-height: var(--sidebar-fixed-height) !important;
        max-height: var(--sidebar-fixed-height) !important;
    }
}

/* ===== サイドバーステータス行スタイル ===== */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9em;
    gap: 12px;
}

.stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label-left {
    color: #999;
    font-weight: 500;
    flex: 0 0 auto;
    text-align: left;
}

.stat-value-right {
    color: var(--text-color);
    font-weight: 600;
    flex: 1;
    text-align: right;
    word-break: break-word;
}
