:root {
    --bg-dark: #07090e;
    --bg-surface: rgba(15, 23, 42, 0.7);
    --bg-card: rgba(30, 41, 59, 0.5);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(56, 189, 248, 0.35);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #38bdf8;
    --accent-emerald: #10b981;
    --accent-indigo: #818cf8;
    --accent-purple: #c084fc;
    --accent-amber: #f59e0b;
    
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Ambient Glows */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}
.bg-glow-1 {
    width: 500px;
    height: 500px;
    top: -150px;
    left: -150px;
    background: radial-gradient(circle, #0284c7 0%, transparent 70%);
}
.bg-glow-2 {
    width: 600px;
    height: 600px;
    top: 25%;
    right: -200px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
}
.bg-glow-3 {
    width: 550px;
    height: 550px;
    bottom: -150px;
    left: 20%;
    background: radial-gradient(circle, #059669 0%, transparent 70%);
}

.app-layout {
    position: relative;
    z-index: 1;
    max-width: 1360px;
    margin: 0 auto;
    padding: 24px 32px 60px;
}

/* Header */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 20px rgba(2, 132, 199, 0.4);
}

.brand-icon svg {
    width: 24px;
    height: 24px;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cluster-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #10b981;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.cluster-badge.offline {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
    color: #f59e0b;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.pulse {
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.btn-primary {
    background: linear-gradient(135deg, #0284c7 0%, #6366f1 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}

/* Hero Architecture Banner */
.hero-banner {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.5) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 24px 30px;
    margin-bottom: 28px;
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.hero-text {
    max-width: 820px;
}

.pill-badge {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    color: var(--accent-cyan);
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.hero-text h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.hero-text p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.hero-text strong {
    color: #e2e8f0;
}

.hero-stats-quick {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-pill {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    padding: 10px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-width: 105px;
}

.quick-pill .label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-pill .val {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 22px;
    backdrop-filter: blur(20px);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.5);
}

.kpi-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.kpi-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.kpi-icon-pill {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.kpi-icon-pill.green {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}
.kpi-icon-pill.blue {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}
.kpi-icon-pill.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}
.kpi-icon-pill.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
}

.kpi-val {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 4px;
}

.kpi-card.highlight-green .kpi-val {
    color: #34d399;
    text-shadow: 0 0 20px rgba(52, 211, 153, 0.4);
}

.kpi-sub {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.kpi-card.highlight-green .kpi-sub {
    color: #6ee7b7;
}

.kpi-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.78rem;
}

.kpi-tag {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.7rem;
}
.kpi-tag.green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.kpi-tag.blue {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}
.kpi-tag.purple {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}
.kpi-tag.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
}

.kpi-footnote {
    color: var(--text-muted);
}

/* Cloud Quotas Remaining Section */
.quotas-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 24px 28px;
    margin-bottom: 30px;
    backdrop-filter: blur(20px);
}

.quotas-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.quotas-section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.section-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.quota-reset-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--accent-cyan);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 9999px;
}

.quota-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.quota-model-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.quota-model-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.5);
}

.gemini-card {
    border-left: 3px solid #38bdf8;
}

.gpt-card {
    border-left: 3px solid #10b981;
}

.claude-card {
    border-left: 3px solid #c084fc;
}

.q-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.q-provider-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.q-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.q-icon-badge.gemini {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.q-icon-badge.gpt {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.q-icon-badge.claude {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
}

.q-provider-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.q-model-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.q-role-tag {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.q-role-tag.active {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.q-role-tag.standby {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.q-meter-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.q-percent-val {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    line-height: 1;
}

.gemini-card .q-percent-val {
    color: #38bdf8;
}

.gpt-card .q-percent-val {
    color: #34d399;
}

.claude-card .q-percent-val {
    color: #c084fc;
}

.q-unit-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.q-progress-bar-wrap {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 14px;
}

.q-progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.gemini-fill {
    background: linear-gradient(90deg, #0284c7, #38bdf8);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.gpt-fill {
    background: linear-gradient(90deg, #059669, #34d399);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.claude-fill {
    background: linear-gradient(90deg, #7c3aed, #c084fc);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

.q-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.q-status-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.q-status-badge.green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

@media (max-width: 950px) {
    .quota-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 24px;
    backdrop-filter: blur(20px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.chart-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.chart-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.currency-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 2px;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent-cyan);
}

.tag-subtle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.74rem;
    padding: 3px 8px;
    border-radius: 6px;
}

.chart-canvas-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Table Section */
.table-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 30px;
    backdrop-filter: blur(20px);
}

.table-header {
    margin-bottom: 18px;
}

.table-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.table-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.88rem;
}

.data-table th {
    padding: 12px 16px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table .highlight-row td {
    background: rgba(16, 185, 129, 0.05);
    font-weight: 600;
}

.badge-model {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Specs Grid */
.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.spec-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 22px;
    backdrop-filter: blur(20px);
}

.spec-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.spec-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    padding-bottom: 8px;
}

.spec-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.spec-list .k {
    color: var(--text-muted);
}

.spec-list .v {
    color: var(--text-primary);
    font-weight: 600;
}

.mono {
    font-family: var(--font-mono);
}

.text-green {
    color: #34d399 !important;
}

.text-cyan {
    color: #38bdf8 !important;
}

/* Footer */
.dashboard-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.last-updated {
    font-size: 0.75rem;
    color: #475569;
}

/* Responsive */
@media (max-width: 1100px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .app-layout {
        padding: 16px;
    }
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .specs-grid {
        grid-template-columns: 1fr;
    }
    .top-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-controls {
        justify-content: space-between;
    }
}
