/* ================================================================
   TTA AI 대회 · 크레딧 사용량 대시보드
================================================================ */

/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Brand */
    --tta-blue:       #2979ff;
    --tta-blue-dark:  #1565c0;
    --header-bg:      #0d1b2a;

    /* Semantic */
    --primary:        #2979ff;
    --primary-hover:  #1565c0;
    --success:        #00c853;
    --warning:        #ff9800;
    --danger:         #f44336;

    /* Neutrals */
    --bg:             #f0f4f8;
    --surface:        #ffffff;
    --border:         #e0e7ef;
    --text:           #0d1b2a;
    --text-muted:     #607080;

    /* Category */
    --champion:       #5c35d4;
    --rookie:         #00897b;

    /* Spacing / Shape */
    --radius-sm:  6px;
    --radius:     12px;
    --radius-lg:  16px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
    --shadow:     0 2px 8px rgba(0,0,0,.10);
    --shadow-md:  0 4px 16px rgba(0,0,0,.12);
}

body {
    font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.layout { min-height: 100vh; display: flex; flex-direction: column; }
.main-content {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px 48px;
    flex: 1;
}

/* ================================================================
   HEADER
================================================================ */
.header {
    background: var(--header-bg);
    position: sticky; top: 0; z-index: 200;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header-inner {
    max-width: 1280px; margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex; align-items: center; gap: 16px;
}

/* Logo area */
.header-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.header-logo  { height: 36px; width: auto; object-fit: contain; }
.header-brand-text { display: flex; flex-direction: column; }
.header-service-name {
    font-size: 13px; font-weight: 500;
    color: rgba(255,255,255,.6);
    letter-spacing: .03em;
}

/* Team info (middle) */
.header-team {
    display: flex; align-items: center; gap: 10px;
    flex: 1; min-width: 0;
}
.team-name-label {
    font-size: 15px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.back-link {
    color: rgba(255,255,255,.7); text-decoration: none;
    font-size: 13px; white-space: nowrap;
    transition: color .15s;
}
.back-link:hover { color: #fff; }

/* Actions (right) */
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ── Category badges (header + table) ── */
.team-category-badge {
    display: inline-flex; align-items: center;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    white-space: nowrap;
}
.team-category-badge.champion { background: var(--champion); color: #fff; }
.team-category-badge.rookie   { background: var(--rookie);   color: #fff; }
/* default (header — before JS hydration) */
.team-category-badge:not(.champion):not(.rookie) { background: var(--champion); color: #fff; }

/* ================================================================
   BUTTONS
================================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 18px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    cursor: pointer; border: none; text-decoration: none;
    transition: background .15s, opacity .15s, box-shadow .15s;
    white-space: nowrap; line-height: 1;
}
.btn:active { opacity: .85; }

.btn-primary   { background: var(--primary);  color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }

.btn-secondary { background: #f0f4f8; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #e4eaf0; }

.btn-outline   { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg); }

.btn-ghost     { background: rgba(255,255,255,.10); color: rgba(255,255,255,.9); }
.btn-ghost:hover { background: rgba(255,255,255,.20); }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.9); }

.btn-login {
    background: var(--tta-blue); color: #fff;
    padding: 12px 24px; font-size: 15px; border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(41,121,255,.35);
}
.btn-login:hover { background: var(--tta-blue-dark); box-shadow: 0 4px 14px rgba(41,121,255,.4); }

.btn-full  { width: 100%; }
.btn-sm    { padding: 5px 12px; font-size: 12px; }

/* ================================================================
   LOGIN PAGE
================================================================ */
.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #0d1b2a 0%, #1a3a5c 50%, #0d47a1 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.login-container { width: 100%; max-width: 440px; }
.login-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.login-header {
    background: var(--header-bg);
    padding: 32px 40px 28px;
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    text-align: center;
}
.login-logo { height: 48px; width: auto; object-fit: contain; }
.login-title-wrap { }
.login-subtitle {
    font-size: 15px; font-weight: 500;
    color: rgba(255,255,255,.65);
    letter-spacing: .03em;
}
.login-form { padding: 32px 40px 36px; display: flex; flex-direction: column; gap: 18px; }
.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: rgba(255,255,255,.35);
}

/* SVG fallback logo */
.logo-svg-wrap { display: flex; align-items: center; }
.logo-svg { width: 100px; height: 50px; }

/* ================================================================
   FORMS
================================================================ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 12px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em;
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px; color: var(--text);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(41,121,255,.12);
}
.form-group input.readonly { background: var(--bg); color: var(--text-muted); }
.hint     { font-size: 12px; color: var(--text-muted); }
.required { color: var(--danger); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.form-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    padding-top: 14px; border-top: 1px solid var(--border); margin-top: 4px;
}
.inline-form {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

/* ================================================================
   ALERTS
================================================================ */
.alert {
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 13px; margin-bottom: 16px;
    display: flex; align-items: flex-start; gap: 8px;
}
.alert-error   { background: #fff5f5; border: 1px solid #fed7d7; color: #c53030; }
.alert-success { background: #f0fff4; border: 1px solid #c6f6d5; color: #276749; }
.alert-info    { background: #ebf8ff; border: 1px solid #bee3f8; color: #2b6cb0; }

/* ================================================================
   DATE BANNER
================================================================ */
.date-banner {
    display: flex; align-items: center; gap: 8px;
    background: #ebf4ff; border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13px; color: #1e40af;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.date-banner-icon { font-size: 15px; }
.date-banner-note { color: #6b94cc; font-size: 12px; }

/* ================================================================
   SUMMARY CARDS
================================================================ */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.summary-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 22px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative; overflow: hidden;
}
.summary-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--border);
}
.summary-card.card-total::before { background: var(--primary); }
.summary-card.card-cost::before  { background: #f59e0b; }

.summary-icon  { font-size: 22px; margin-bottom: 6px; }
.summary-label {
    font-size: 11px; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .07em;
    margin-bottom: 6px;
}
.summary-amount { font-size: 22px; font-weight: 800; color: var(--text); }
.summary-card.card-total .summary-amount { color: var(--primary); font-size: 26px; }
.summary-card.card-cost  .summary-amount { color: #d97706; }

/* ================================================================
   SECTION CARD
================================================================ */
.section-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow: hidden;
}
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap; gap: 10px;
}
.section-title-group { display: flex; align-items: center; gap: 8px; }
.section-title-group h2 { font-size: 15px; font-weight: 700; }
.section-icon { font-size: 18px; }
.section-sub  { font-size: 12px; color: var(--text-muted); }

/* Price tags */
.price-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.price-tag {
    font-size: 11px; padding: 3px 9px;
    border-radius: 20px;
    background: #eff6ff; color: var(--primary);
    font-weight: 600; white-space: nowrap;
}

/* ================================================================
   GPU CARDS (Team Dashboard)
================================================================ */
.gpu-list { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }

.gpu-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.gpu-card-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    background: #fff; border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.gpu-type-badge {
    background: var(--tta-blue); color: #fff;
    font-size: 13px; font-weight: 800;
    padding: 4px 14px; border-radius: 20px;
    letter-spacing: .05em;
}
.gpu-period {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-muted);
    flex: 1;
}
.period-label {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted);
}
.gpu-subtotal {
    font-size: 13px; color: var(--text-muted); margin-left: auto;
}
.gpu-subtotal strong { color: var(--primary); font-size: 15px; }

.gpu-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border-top: 1px solid var(--border);
}
.gpu-item {
    padding: 14px 16px;
    border-right: 1px solid var(--border);
}
.gpu-item:last-child { border-right: none; }
.gpu-item-header { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.gpu-item-name   { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.gpu-item-unit   { font-size: 11px; color: #9db0c4; }
.gpu-item-qty    { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.gpu-item-cost   { font-size: 13px; color: var(--primary); font-weight: 600; }

.gpu-note {
    padding: 10px 16px;
    font-size: 12px; color: var(--text-muted);
    border-top: 1px dashed var(--border);
    background: #fafcff;
}

/* ================================================================
   TABLES
================================================================ */
.table-scroll { overflow-x: auto; }
.usage-table { width: 100%; border-collapse: collapse; }
.usage-table th {
    padding: 10px 16px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    text-align: left;
    background: #f7fafc; color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.usage-table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f0f4f8;
    font-size: 13px; vertical-align: middle;
}
.usage-table tbody tr:last-child td { border-bottom: none; }
.usage-table tbody tr:hover { background: #f7fbff; }
.usage-table tfoot td {
    padding: 12px 16px;
    font-weight: 700; font-size: 13px;
    background: #f7fafc;
    border-top: 2px solid var(--border);
}
.text-right    { text-align: right; }
.amount-cell   { font-weight: 700; color: var(--primary); }
.note-cell     { color: var(--text-muted); font-size: 12px; max-width: 200px; }
.action-cell   { white-space: nowrap; }

/* Admin team table */
.admin-team-table .team-name-cell { min-width: 180px; }
.team-link {
    font-weight: 700; color: var(--text);
    text-decoration: none; display: block;
}
.team-link:hover { color: var(--primary); text-decoration: underline; }
.team-email { font-size: 12px; color: var(--text-muted); display: block; }

/* Tab bar */
.tab-bar {
    display: flex; gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 8px 12px 0;
    margin-bottom: -1px;
    position: relative; z-index: 1;
}
.tab-item {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 13px; font-weight: 600;
    color: var(--text-muted); text-decoration: none;
    border: 1px solid transparent; border-bottom: none;
    transition: all .15s;
}
.tab-item:hover   { color: var(--primary); background: #f0f7ff; }
.tab-item.active  { color: var(--primary); background: var(--surface); border-color: var(--border); margin-bottom: -1px; }
.tab-count {
    background: var(--bg); color: var(--text-muted);
    font-size: 11px; font-weight: 700;
    padding: 1px 7px; border-radius: 10px;
}
.tab-item.active .tab-count { background: #dbeafe; color: var(--primary); }

/* ================================================================
   PROVIDER BADGES
================================================================ */
.provider-badge {
    display: inline-block; padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 700;
}
.provider-badge.global   { background: #eff6ff; color: #1d4ed8; }
.provider-badge.domestic { background: #f0fdf4; color: #166534; }

/* ================================================================
   STATUS BADGES
================================================================ */
.status-badge {
    display: inline-block; padding: 3px 9px;
    border-radius: var(--radius-sm);
    font-size: 11px; font-weight: 700;
}
.status-badge.ok   { background: #f0fdf4; color: #166534; }
.status-badge.warn { background: #fffbeb; color: #92400e; }

/* ================================================================
   INFO GRID  (team-detail)
================================================================ */
.info-grid { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.info-row  { display: flex; gap: 16px; align-items: flex-start; }
.info-label { font-size: 12px; font-weight: 700; color: var(--text-muted); min-width: 100px; padding-top: 1px; }
.info-value { font-size: 14px; }

/* Info box */
.info-box {
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: var(--radius-sm); padding: 14px 16px;
    margin-bottom: 4px; font-size: 13px;
}
.info-box strong { display: block; margin-bottom: 4px; color: #92400e; }
.info-box p      { color: #78350f; margin-top: 3px; }

/* ================================================================
   EMPTY STATE
================================================================ */
.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
}
.empty-icon { font-size: 36px; margin-bottom: 10px; }
.empty-state p { font-size: 14px; }

/* ================================================================
   MODAL
================================================================ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 520px;
    box-shadow: 0 24px 64px rgba(0,0,0,.25);
    overflow: hidden;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
    background: none; border: none;
    font-size: 22px; cursor: pointer; color: var(--text-muted);
    line-height: 1; padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-form    { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-actions {
    display: flex; gap: 8px; justify-content: flex-end;
    padding-top: 16px; border-top: 1px solid var(--border); margin-top: 4px;
}

/* ================================================================
   GOOGLE AUTH BAR
================================================================ */
.google-auth-bar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 16px;
    margin-bottom: 20px; gap: 12px;
}
.google-auth-status { display: flex; align-items: center; font-size: 13px; }
.google-auth-ok  { color: #166534; display: flex; align-items: center; gap: 4px; }
.google-auth-warn { color: #92400e; }
.google-auth-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ================================================================
   SERVER IP BAR  (dashboard LLM section)
================================================================ */
.server-ip-bar {
    display: flex; align-items: center; gap: 8px;
    background: #f0f7ff; border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm); padding: 8px 16px;
    margin: 0 0 12px; font-size: 13px;
}
.server-ip-label { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.server-ip-value {
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 13px; color: #1e40af;
    background: #dbeafe; padding: 2px 8px;
    border-radius: 4px; letter-spacing: .03em;
}

/* LLM 구분 뱃지 */
.llm-type-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 10px;
}
.llm-type-badge.global   { background: #dbeafe; color: #1e40af; }
.llm-type-badge.domestic { background: #fce7f3; color: #9d174d; }

/* 제공자 뱃지 */
.provider-badge          { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.provider-badge.global   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.provider-badge.domestic { background: #fdf2f8; color: #86198f; border: 1px solid #f5d0fe; }

/* ================================================================
   TEAM TAB BAR (dashboard - multiple teams per email)
================================================================ */
.team-tab-bar { margin-bottom: 12px; }
.team-tab-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 10px; margin-right: 5px;
    vertical-align: middle;
}
.team-tab-badge.champion { background: #fef3c7; color: #92400e; }
.team-tab-badge.rookie   { background: #dcfce7; color: #166534; }

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 768px) {
    .main-content { padding: 16px 14px 32px; }
    .header-inner { padding: 0 14px; gap: 10px; }
    .header-service-name { display: none; }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .summary-card.card-total { grid-column: 1 / -1; }
    .summary-amount { font-size: 18px; }
    .summary-card.card-total .summary-amount { font-size: 22px; }

    .gpu-items { grid-template-columns: 1fr; }
    .gpu-item  { border-right: none; border-bottom: 1px solid var(--border); }
    .gpu-item:last-child { border-bottom: none; }

    .price-tags { display: none; }

    .login-header { padding: 24px 28px 20px; }
    .login-form   { padding: 24px 28px 28px; }

    .admin-team-table th:nth-child(3),
    .admin-team-table td:nth-child(3),
    .admin-team-table th:nth-child(4),
    .admin-team-table td:nth-child(4),
    .admin-team-table th:nth-child(5),
    .admin-team-table td:nth-child(5) { display: none; }
}

@media (max-width: 480px) {
    .summary-cards { grid-template-columns: 1fr; }
    .summary-card.card-total { grid-column: auto; }
    .tab-bar { overflow-x: auto; }
}

/* ════════════════════════════════════════════════════════════
   본선(FINALS) 테마 — 예선(블루)과 구분되는 바이올렛/골드 톤
   ════════════════════════════════════════════════════════════ */
body.finals {
    --primary:        #7c3aed;
    --primary-hover:  #6d28d9;
}
body.finals .header {
    background: linear-gradient(120deg, #1e1b4b 0%, #4c1d95 55%, #6d28d9 100%);
}
body.finals.login-page .login-bg,
body.finals .login-bg {
    background: linear-gradient(135deg, #14102b 0%, #2e1065 55%, #4c1d95 100%);
}
body.finals .summary-card.card-total::before { background: #f59e0b; }
body.finals .summary-card.card-total .summary-amount { color: #b45309; }

.finals-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    color: #1e1b4b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    vertical-align: middle;
}
.readonly-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(148,163,184,0.25);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    margin-right: 6px;
}
.login-desc { margin: 6px 0 0; font-size: 13px; color: rgba(255,255,255,0.75); }

/* ── 관리자 입력 폼 ── */
.admin-form .form-row { margin-bottom: 12px; }
.admin-form label {
    display: block; font-size: 12.5px; color: #6b7280;
    font-weight: 600; margin-bottom: 4px;
}
.admin-form label em { color: #ef4444; font-style: normal; }
.admin-form input, .admin-form select {
    width: 100%; box-sizing: border-box;
    padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 14px; background: #fff; color: #111827;
}
.admin-form-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px;
}
.mini-field label {
    display: block; font-size: 11.5px; color: #6b7280;
    font-weight: 600; margin-bottom: 3px;
}
.mini-field input, .mini-field select, .mini-input {
    padding: 7px 9px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 13px; background: #fff; color: #111827; box-sizing: border-box;
    max-width: 100%;
}

/* ── 전일 대비 표시 ── */
.delta-up   { color: #dc2626; font-weight: 700; }
.delta-flat { color: #6b7280; }

/* ── LLM 사용금액 차트 ── */
.usage-chart-wrap { width: 100%; overflow-x: auto; }
.usage-chart-svg  { width: 100%; height: auto; min-width: 560px; display: block; }
.chart-grid   { stroke: #e5e7eb; stroke-width: 1; }
.chart-ylabel { font-size: 11px; fill: #6b7280; text-anchor: end; }
.chart-xlabel { font-size: 11px; fill: #6b7280; text-anchor: middle; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 10px; }
.chart-legend-item {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: #374151;
}
.chart-legend-item i {
    width: 12px; height: 12px; border-radius: 3px; display: inline-block;
}
.chart-legend-item b { color: #111827; }
.chart-empty {
    padding: 44px 20px; text-align: center; color: #6b7280; font-size: 14px;
}
.chart-empty span { font-size: 12.5px; color: #9ca3af; }

/* ════════════════════════════════════════════════════════════
   본선 레이아웃 보정 — 카드 내부 여백 / 헤더 정렬 / 표 가독성
   ════════════════════════════════════════════════════════════ */

/* 1) 카드 안 콘텐츠가 가장자리에 붙지 않도록 공통 여백 */
.section-card > form,
.section-card > .admin-form,
.section-card > .info-grid,
.section-card > p,
.section-card > .usage-chart-wrap,
.section-card > .empty-state,
.section-card > .table-scroll,
.section-card > .usage-table {
    padding-left: 20px;
    padding-right: 20px;
}
.section-card > form,
.section-card > .admin-form,
.section-card > .info-grid,
.section-card > .usage-chart-wrap { padding-top: 18px; padding-bottom: 18px; }
.section-card > p { padding-top: 14px; padding-bottom: 0; }
.section-card > .table-scroll,
.section-card > .usage-table { padding-top: 4px; padding-bottom: 8px; }
/* 표는 좌우 패딩을 셀에서 처리 (헤더 배경이 끝까지 차도록) */
.section-card > .usage-table { padding-left: 0; padding-right: 0; }
.section-card > .usage-table th:first-child,
.section-card > .usage-table td:first-child { padding-left: 20px; }
.section-card > .usage-table th:last-child,
.section-card > .usage-table td:last-child  { padding-right: 20px; }
.section-card > .table-scroll { padding-left: 0; padding-right: 0; }
.section-card > .table-scroll .usage-table th:first-child,
.section-card > .table-scroll .usage-table td:first-child { padding-left: 20px; }
.section-card > .table-scroll .usage-table th:last-child,
.section-card > .table-scroll .usage-table td:last-child  { padding-right: 20px; }

/* 2) 헤더 좌측 브랜드: "관리자 + 본선" 한 줄 정렬 */
.header-brand-text {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}
.header-brand-text .finals-badge { margin-left: 0; }
.header-service-name { white-space: nowrap; line-height: 1.2; }

/* 3) 표 안 텍스트가 세로로 쪼개지지 않도록 */
.llm-type-badge, .provider-badge, .team-category-badge,
.status-badge, .finals-badge, .readonly-badge { white-space: nowrap; }
.usage-table td { vertical-align: middle; }
.usage-table .note-cell,
.usage-table td:last-child { white-space: nowrap; }
.usage-table .action-cell { white-space: nowrap; }
.usage-table .action-cell .btn { margin-right: 4px; }

/* 4) 카드 헤더 우측 액션 (팀 삭제 등) */
.section-header-actions { display: flex; align-items: center; gap: 8px; }

/* 5) 관리자 폼 그리드 여백 정리 */
.admin-form-grid { gap: 14px 28px; }
.admin-form .form-row { margin-bottom: 0; }
.admin-form-actions {
    grid-column: 1 / -1;
    display: flex; gap: 10px; align-items: center;
    margin-top: 4px;
}

/* 6) 인라인 편집 행/추가 폼: 줄바꿈 시 정렬 */
.inline-form-bar {
    display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
    padding-top: 4px;
}

@media (max-width: 900px) {
    .admin-form-grid { grid-template-columns: 1fr; }
}

/* 금액 셀은 줄바꿈 금지 (4,185,000 원 이 두 줄로 쪼개지는 문제) */
.usage-table td.text-right,
.usage-table th.text-right,
.usage-table .amount-cell { white-space: nowrap; }
/* 표 내부 입력은 과하게 넓어지지 않게 */
.usage-table .mini-input { min-width: 0; }

/* 인라인 편집 표: 넘침 최소화 (날짜/입력 폭 축소 + 셀 패딩 압축) */
.usage-table .mini-input[type="date"] { width: 148px; }
.usage-table .mini-input[type="number"] { width: 84px; }
.section-card > .table-scroll .usage-table th,
.section-card > .table-scroll .usage-table td { padding-left: 10px; padding-right: 10px; }
.section-card > .table-scroll .usage-table th:first-child,
.section-card > .table-scroll .usage-table td:first-child { padding-left: 20px; }
.section-card > .table-scroll .usage-table th:last-child,
.section-card > .table-scroll .usage-table td:last-child  { padding-right: 20px; }
.usage-table .action-cell .btn { padding: 5px 10px; font-size: 12px; }

/* 관리자 폼: 라벨 위 / 입력 아래 (기존 .form-row 의 2열 grid 무효화) */
.admin-form .form-row { display: block; }
.admin-form .form-row + .form-row { margin-top: 0; }

/* 팀 기본 정보 조회 모드: 2열 배치 + 긴 라벨 수용 */
#team-view {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 28px;
}
#team-view .info-label { min-width: 132px; flex: 0 0 132px; }
#team-view .info-value { word-break: break-all; }
@media (max-width: 900px) { #team-view { grid-template-columns: 1fr; } }

/* 네트워크 비용 — GPU·디스크와 동일 레벨의 비용 항목 (GPU 섹션 하단) */
.cost-item-bar {
    margin: 4px 20px 18px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.cost-item-view { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cost-item-name { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.cost-item-amount {
    font-size: 15px; font-weight: 800; color: var(--primary); white-space: nowrap;
}
.cost-item-meta { font-size: 12px; color: #9ca3af; }
.cost-item-view .btn { margin-left: auto; }
.cost-item-bar .inline-form-bar { padding-top: 0; }

/* ── 차트 툴팁 / 누적 그래프 ────────────────────────────────── */
.chart-plot { position: relative; }
.chart-guide { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 3 3; }
.chart-hit { cursor: crosshair; }

.chart-tooltip {
    position: absolute;
    z-index: 20;
    min-width: 168px;
    padding: 9px 11px;
    background: rgba(17, 24, 39, 0.96);
    color: #f9fafb;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.28);
    font-size: 12.5px;
    line-height: 1.5;
    pointer-events: none;
    white-space: nowrap;
}
.chart-tooltip .tip-date {
    font-weight: 700; font-size: 12px; color: #cbd5e1;
    padding-bottom: 5px; margin-bottom: 5px;
    border-bottom: 1px solid rgba(148,163,184,0.35);
}
.chart-tooltip .tip-row { display: flex; align-items: center; gap: 7px; }
.chart-tooltip .tip-row i {
    width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: 0 0 9px;
}
.chart-tooltip .tip-name { flex: 1; color: #e5e7eb; }
.chart-tooltip .tip-val  { font-weight: 700; }
.chart-tooltip .tip-total {
    margin-top: 5px; padding-top: 5px;
    border-top: 1px solid rgba(148,163,184,0.35);
    padding-left: 16px;
}
.chart-tooltip .tip-total .tip-val { color: #fbbf24; }

.chart-legend-total { color: #334155; font-weight: 700; }
.chart-legend-total b { color: #111827; }

/* 표 헤더 정렬 보정 — .usage-table th 의 text-align:left 가 .text-right 를 덮어쓰던 문제 */
.usage-table th.text-right  { text-align: right; }
.usage-table th.text-center { text-align: center; }

/* ── 토큰 사용량 버튼 / 레이어 팝업 ────────────────────────── */
.btn-token {
    background: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe;
    font-weight: 700; white-space: nowrap; cursor: pointer;
    padding: 5px 12px; border-radius: 6px; font-size: 12.5px;
}
.btn-token:hover { background: #e0e7ff; border-color: #a5b4fc; }

.token-modal { position: fixed; inset: 0; z-index: 1000; }
.token-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(15, 23, 42, 0.55);
}
.token-modal-box {
    position: relative;
    max-width: 820px; width: calc(100% - 40px);
    max-height: 82vh;
    margin: 7vh auto 0;
    background: #fff; border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.32);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.token-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.token-modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: #111827; }
.token-modal-close {
    background: transparent; border: none; font-size: 18px;
    color: #6b7280; cursor: pointer; line-height: 1; padding: 4px 8px;
}
.token-modal-close:hover { color: #111827; }

.token-modal-summary {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; padding: 14px 20px; background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.token-modal-summary > div { text-align: center; }
.token-modal-summary span { display: block; font-size: 11.5px; color: #6b7280; margin-bottom: 3px; }
.token-modal-summary b { font-size: 17px; font-weight: 800; color: #111827; }
.token-modal-summary .total b { color: var(--primary); }

.token-modal-body { overflow: auto; padding: 0; }
.token-table th { position: sticky; top: 0; z-index: 1; }
.token-table td { font-size: 13px; }

.token-modal-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px; border-top: 1px solid var(--border);
    font-size: 12px; color: #6b7280;
}

.token-tag {
    display: inline-block; padding: 2px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 700; white-space: nowrap;
}
.token-tag.input  { background: #dbeafe; color: #1d4ed8; }
.token-tag.output { background: #dcfce7; color: #15803d; }
.token-tag.other  { background: #f3f4f6; color: #6b7280; }

/* 토큰 모달 하단 액션 (원본 CSV 다운로드 + 닫기) */
.token-modal-actions { display: flex; align-items: center; gap: 8px; }
.token-modal-actions .btn { text-decoration: none; }

/* ── 토큰 사용량: 표/그래프 탭 ───────────────────────────────────────────── */
/* 모달은 흰 배경(라이트)이므로 축·범례 색을 본문 톤에 맞춘다 */
.token-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 20px 0;
    border-bottom: 1px solid var(--border);
    background: #fff;
}
.token-tab {
    padding: 7px 16px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.token-tab:hover { color: #374151; }
.token-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.token-chart-type {
    margin-left: auto;
    margin-bottom: 6px;
    padding: 5px 10px;
    font-size: 12px;
    color: #374151;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

/* ── 토큰 차트 (token-chart.js) ──────────────────────────────────────────── */
.token-view-chart { position: relative; min-height: 320px; padding: 8px 14px 4px; }
/* 툴팁(absolute)의 기준을 차트 wrap 으로 — JS 가 wrap 좌표로 위치를 계산하므로 기준이 같아야 정확히 안에 머문다 */
.token-view-chart .usage-chart-wrap { position: relative; }
.tc-svg { width: 100%; height: auto; display: block; }
.tc-grid { stroke: rgba(17, 24, 39, 0.09); stroke-width: 1; }
.tc-guide { stroke: rgba(124, 58, 237, 0.45); stroke-width: 1; stroke-dasharray: 3 3; }
.tc-axis-y { fill: #6b7280; font-size: 10px; text-anchor: end; }
.tc-axis-x { fill: #6b7280; font-size: 10px; text-anchor: middle; }
.tc-hit { cursor: crosshair; }

.tc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    padding: 8px 0 4px;
    font-size: 12px;
    color: #374151;
}
/* 범례는 클릭 가능한 버튼 — 끄면 흐려진다 */
.tc-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: opacity .15s, background .15s;
}
.tc-legend-item:hover { background: rgba(17, 24, 39, 0.06); }
.tc-legend-item.off { opacity: 0.4; text-decoration: line-through; }
.tc-legend-item i {
    width: 10px; height: 10px; border-radius: 2px;
    display: inline-block; flex-shrink: 0;
}

.tc-tooltip {
    position: absolute;
    z-index: 20;
    min-width: 150px;
    padding: 9px 11px;
    background: rgba(17, 24, 39, 0.96);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
    font-size: 12px;
    color: #f9fafb;
    pointer-events: none;
}
.tc-tip-date { font-weight: 700; margin-bottom: 5px; color: #c4b5fd; }
.tc-tip-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.tc-tip-row i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.tc-tip-row b { margin-left: auto; font-variant-numeric: tabular-nums; }
.tc-tip-row.total {
    margin-top: 4px;
    padding-top: 5px;
    border-top: 1px solid rgba(249, 250, 251, 0.25);
    font-weight: 700;
}

/* 모델별 합계 — 가로 막대 */
.tc-hbars { display: flex; flex-direction: column; gap: 9px; padding: 8px 4px; }
.tc-hbar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.tc-hbar-name {
    width: 210px;
    flex-shrink: 0;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tc-hbar-track {
    flex: 1;
    display: flex;
    height: 16px;
    background: rgba(17, 24, 39, 0.07);
    border-radius: 4px;
    overflow: hidden;
}
.tc-hbar-seg { height: 100%; }
.tc-hbar-val {
    width: 78px;
    text-align: right;
    color: #111827;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .tc-hbar-name { width: 110px; }
    .token-chart-type { max-width: 150px; }
}

/* 관리자 목록 — 최근 접속 (일시 + IP) */
.login-cell { font-size: 12px; white-space: nowrap; }
.login-cell small {
    display: block;
    color: #94a3b8;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.login-cell .never-login { color: #cbd5e1; }

/* ── 빌링 수집 키 설정 ─────────────────────────────────────────────────── */
.cred-note {
    background: rgba(251, 191, 36, 0.10);
    border: 1px solid rgba(251, 191, 36, 0.45);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #92400e;
    line-height: 1.65;
    margin-bottom: 18px;
}
.cred-row {
    display: grid;
    grid-template-columns: 210px 1fr 76px;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.cred-row:last-of-type { border-bottom: none; }
.cred-row > label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}
.cred-input { min-width: 0; }
.cred-row input[type="text"], .cred-row textarea {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
}

/* 현재 설정된 값 — 앞뒤 일부만 보여준다 */
.cred-current { margin-top: 4px; font-size: 11.5px; color: #6b7280; }
.cred-current code {
    background: rgba(17, 24, 39, 0.06);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11.5px;
    color: #374151;
    word-break: break-all;
}
.cred-current.missing { color: #b45309; }
.cred-row textarea { resize: vertical; font-size: 12px; }
.cred-row input::placeholder, .cred-row textarea::placeholder {
    color: #9ca3af;
    font-size: 12px;
}
.cred-status { text-align: right; }

/* 클라우드 구분 배지 */
.cred-provider {
    display: inline-block;
    min-width: 46px;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 700;
    text-align: center;
    color: #fff;
    background: #6b7280;
}
.cred-row .cred-provider,
.cred-row-view .cred-provider { flex-shrink: 0; }

/* 조회 전용(비신뢰 IP) 표시 */
.cred-row-view {
    display: grid;
    grid-template-columns: 60px 210px 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}
.cred-row-view .cred-label { color: #374151; font-weight: 600; }
.cred-row-view .cred-value { color: #6b7280; font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
    .cred-row, .cred-row-view { grid-template-columns: 1fr; gap: 6px; }
    .cred-status { text-align: left; }
}


/* 토큰 수동 수집 상태 문구 */
.token-sync-note { font-size: 11.5px; color: #94a3b8; white-space: nowrap; }

/* 팀 대시보드 — LLM 사용 내역 안내 */
.llm-notice {
    margin: 0 0 14px;
    padding: 11px 15px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 8px;
    font-size: 12.5px;
    color: #0c4a6e;
    line-height: 1.7;
}
.llm-notice > b { display: block; margin-bottom: 3px; font-size: 12px; }
.llm-notice ul { margin: 0; padding-left: 17px; }
.llm-notice li { margin: 1px 0; }

/* 팀 대시보드 — 토큰 사용량 새로고침 버튼 */
.btn-token-refresh {
    margin-left: 5px;
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;
    cursor: pointer;
    vertical-align: middle;
    transition: color .15s, border-color .15s;
}
.btn-token-refresh:hover { color: var(--primary); border-color: var(--primary); }

/* ══════════════════════════════════════════════════════════════════
   GPU 클러스터 모니터링 (캡처용) — 다크 · 고밀도. body.cluster-page 스코프
   ══════════════════════════════════════════════════════════════════ */
body.cluster-page { background:#0b1020; color:#e2e8f0;
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','Malgun Gothic',sans-serif; }
.cm-wrap { max-width:1760px; margin:0 auto; padding:14px 18px 26px; }

.cm-header { display:flex; align-items:center; justify-content:space-between;
    gap:14px; flex-wrap:wrap; padding-bottom:11px; border-bottom:1px solid rgba(148,163,184,.18); }
.cm-title { display:flex; align-items:center; gap:11px; }
.cm-logo { display:inline-flex; align-items:center; justify-content:center;
    width:34px; height:34px; border-radius:9px; font-size:16px;
    background:linear-gradient(135deg,#7c3aed,#a78bfa); color:#fff; }
.cm-title h1 { margin:0; font-size:16.5px; font-weight:800; letter-spacing:-.2px; }
.cm-title p { margin:1px 0 0; font-size:11px; color:#94a3b8; }
.cm-header-right { display:flex; align-items:center; gap:7px; }
.cm-live { display:inline-flex; align-items:center; gap:5px; margin-right:4px;
    font-size:11px; color:#94a3b8; font-weight:600; }
.cm-live i { width:6px; height:6px; border-radius:50%; background:#34d399;
    box-shadow:0 0 0 3px rgba(52,211,153,.18); animation:cm-pulse 1.6s infinite; }
.cm-live b { color:#cbd5e1; font-variant-numeric:tabular-nums; }
@keyframes cm-pulse { 50% { opacity:.35; } }
.cm-btn { padding:6px 12px; border-radius:6px; font-size:11.5px; font-weight:600;
    background:rgba(148,163,184,.14); color:#e2e8f0;
    border:1px solid rgba(148,163,184,.22); cursor:pointer; text-decoration:none; }
.cm-btn:hover { background:rgba(167,139,250,.22); border-color:#a78bfa; }
.cm-btn-ghost { background:transparent; }

/* KPI 8개 */
.cm-kpi { display:grid; grid-template-columns:repeat(8,1fr); gap:9px; margin:12px 0; }
.cm-card { padding:9px 11px; border-radius:9px; background:#141a30;
    border:1px solid rgba(148,163,184,.16); }
.cm-card span { display:block; font-size:10.5px; color:#94a3b8; margin-bottom:3px; }
.cm-card b { font-size:17px; font-weight:800; font-variant-numeric:tabular-nums; }
.cm-card em { display:block; margin-top:2px; font-size:9.5px; font-style:normal; color:#64748b; }
.cm-card.accent { background:linear-gradient(135deg,#221a45,#191f3a);
    border-color:rgba(167,139,250,.4); }
.cm-card.accent b { color:#c4b5fd; }

/* 시계열 8개 (4×2) */
.cm-charts { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; }
.cm-chart-box { padding:9px 11px 3px; border-radius:9px; background:#141a30;
    border:1px solid rgba(148,163,184,.16); }
.cm-chart-head { display:flex; align-items:center; gap:6px; font-size:11px;
    font-weight:700; color:#cbd5e1; margin-bottom:3px; }
.cm-chart-head .dot { width:8px; height:8px; border-radius:2px; flex-shrink:0; }
.cm-chart-head .cm-cur { margin-left:auto; font-size:13px; font-weight:800;
    color:#fff; font-variant-numeric:tabular-nums; }
.cm-svg { width:100%; height:auto; display:block; }
.cm-grid { stroke:rgba(148,163,184,.13); stroke-width:1; }
.cm-ax { fill:#64748b; font-size:8px; text-anchor:end; }

/* 분석 패널 */
.cm-panels { display:grid; grid-template-columns:1.5fr 1fr 1fr 1.1fr; gap:9px; margin-top:9px; }
.cm-panel { padding:10px 12px; border-radius:9px; background:#141a30;
    border:1px solid rgba(148,163,184,.16); }
.cm-panel-head { font-size:11.5px; font-weight:700; color:#cbd5e1; margin-bottom:7px; }
.cm-panel-head small { margin-left:6px; font-size:9.5px; color:#64748b; font-weight:500; }

/* 히트맵 20×8 */
.cm-heat { display:flex; flex-direction:column; gap:2px; }
.cm-hm-row { display:flex; align-items:center; gap:2px; }
.cm-hm-row span { width:15px; font-size:8px; color:#64748b; text-align:right;
    font-variant-numeric:tabular-nums; }
.cm-hm-row i { flex:1; height:7px; border-radius:1px; }

/* 히스토그램 */
.cm-hist { display:flex; align-items:flex-end; gap:6px; height:104px; padding-top:6px; }
.cm-hist-col { flex:1; display:flex; flex-direction:column; align-items:center;
    justify-content:flex-end; height:100%; }
.cm-hist-col i { display:block; width:100%; background:linear-gradient(180deg,#a78bfa,#7c3aed);
    border-radius:2px 2px 0 0; min-height:2px; transition:height .5s; }
.cm-hist-col b { font-size:10px; margin-top:3px; font-variant-numeric:tabular-nums; }
.cm-hist-col span { font-size:8px; color:#64748b; }

/* 팀별 점유 */
.cm-teams { display:flex; flex-direction:column; gap:6px; }
.cm-tb { display:flex; align-items:center; gap:6px; font-size:10.5px; }
.cm-tb > span { width:78px; color:#cbd5e1; white-space:nowrap; overflow:hidden;
    text-overflow:ellipsis; }
.cm-tb-track { flex:1; height:7px; background:rgba(148,163,184,.14);
    border-radius:4px; overflow:hidden; }
.cm-tb-track i { display:block; height:100%; background:linear-gradient(90deg,#7c3aed,#a78bfa); }
.cm-tb > b { width:22px; text-align:right; font-variant-numeric:tabular-nums; }
.cm-empty { font-size:10.5px; color:#64748b; }

/* 작업 큐 + 이벤트 */
.cm-jobs { display:grid; grid-template-columns:repeat(2,1fr); gap:6px; }
.cm-jt { padding:6px 8px; border-radius:6px; background:rgba(148,163,184,.08); }
.cm-jt span { display:block; font-size:9.5px; color:#94a3b8; }
.cm-jt b { font-size:15px; font-weight:800; font-variant-numeric:tabular-nums; }
.cm-events { list-style:none; margin:0; padding:0; }
.cm-events li { display:flex; gap:6px; padding:3px 0; font-size:9.5px; color:#cbd5e1;
    border-bottom:1px solid rgba(148,163,184,.08); }
.cm-events li span { color:#64748b; flex-shrink:0; width:34px; }
.cm-events li.lv-warn { color:#fcd34d; }
.cm-events li.lv-ok { color:#6ee7b7; }

/* 노드 20 (10×2) */
.cm-section-title { margin:14px 0 8px; font-size:12.5px; font-weight:700; color:#cbd5e1; }
.cm-section-title small { margin-left:7px; font-size:10px; color:#64748b; font-weight:500; }
.cm-nodes { display:grid; grid-template-columns:repeat(10,1fr); gap:8px; }
.cm-node { padding:8px 9px; border-radius:8px; background:#141a30;
    border:1px solid rgba(148,163,184,.16); transition:opacity .2s; }
.cm-node.is-off { opacity:.42; }
.cm-node-head { display:flex; align-items:center; gap:4px; margin-bottom:6px; }
.cm-node-head b { font-size:11px; font-variant-numeric:tabular-nums; }
.cm-badge { padding:1px 4px; border-radius:3px; font-size:8px; font-weight:700; }
.cm-badge.run { background:rgba(52,211,153,.18); color:#6ee7b7; }
.cm-badge.busy { background:rgba(167,139,250,.22); color:#c4b5fd; }
.cm-badge.idle { background:rgba(56,189,248,.16); color:#7dd3fc; }
.cm-badge.off { background:rgba(148,163,184,.16); color:#cbd5e1; }
.cm-gpus { display:flex; gap:2px; height:26px; margin-bottom:6px; }
.cm-gpu { flex:1; display:flex; align-items:flex-end;
    background:rgba(148,163,184,.10); border-radius:2px; overflow:hidden; }
.cm-gpu i { display:block; width:100%; border-radius:2px 2px 0 0; transition:height .5s; }
.cm-mini { display:flex; flex-direction:column; gap:2px; margin-bottom:6px; }
.cm-m { display:flex; align-items:center; gap:4px; font-size:8.5px; color:#94a3b8; }
.cm-m > span { width:8px; }
.cm-m > b { width:16px; text-align:right; color:#e2e8f0; font-variant-numeric:tabular-nums; }
.cm-t { flex:1; height:4px; background:rgba(148,163,184,.14); border-radius:2px; overflow:hidden; }
.cm-t i { display:block; height:100%; transition:width .5s; }
.cm-foot { display:flex; justify-content:space-between; padding-top:5px;
    border-top:1px solid rgba(148,163,184,.12); font-size:8.5px; color:#64748b;
    font-variant-numeric:tabular-nums; }
.cm-hot { color:#fbbf24; font-weight:700; }

/* 스위치 */
.cm-switch { position:relative; display:inline-block; width:26px; height:14px;
    cursor:pointer; margin-left:auto; flex-shrink:0; }
.cm-switch input { opacity:0; width:0; height:0; }
.cm-switch span { position:absolute; inset:0; border-radius:999px;
    background:rgba(148,163,184,.3); transition:background .2s; }
.cm-switch span::before { content:''; position:absolute; left:2px; top:2px;
    width:10px; height:10px; border-radius:50%; background:#fff; transition:transform .2s; }
.cm-switch input:checked + span { background:#7c3aed; }
.cm-switch input:checked + span::before { transform:translateX(12px); }

.cm-footer { margin-top:16px; font-size:10px; color:#64748b; text-align:center; }

@media (max-width:1500px) {
    .cm-kpi { grid-template-columns:repeat(4,1fr); }
    .cm-charts { grid-template-columns:repeat(2,1fr); }
    .cm-panels { grid-template-columns:repeat(2,1fr); }
    .cm-nodes { grid-template-columns:repeat(5,1fr); }
}
