/* Modern Tech-Lead UI Design System for ECSLab */

/* ========== CSS VARIABLES ========== */
:root {
    --dark-base: #0f172a;
    --dark-surface: #1e293b;
    --dark-elevated: #334155;
    --primary: #3b82f6;
    --primary-glow: #60a5fa;
    --accent-cyan: #06b6d4;
    --accent-violet: #8b5cf6;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-primary: #e2e8f0;      /* Softer white - better readability */
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-subtle: rgba(148,163,184,0.1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.3);
    --shadow-glow-blue: 0 0 20px rgba(59,130,246,0.15);
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--dark-elevated) var(--dark-base);
}

body {
    background-color: var(--dark-base);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;  /* เพิ่มจาก 15px เป็น 16px */
    overscroll-behavior: none;
}

/* ========== SIDEBAR ========== */
.sidebar {
    min-height: 100vh;
    background: var(--dark-surface);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.sidebar a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    border-radius: 10px;
    margin: 3px 10px;
    font-size: 15px;  /* เพิ่มจาก 14px เป็น 15px */
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    gap: 10px;
}

.sidebar a:hover {
    background: rgba(59,130,246,0.08);
    color: var(--text-primary);
    transform: translateX(2px);
}

.sidebar a.active {
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(99,102,241,0.08));
    color: var(--primary-glow);
    font-weight: 600;
}

.sidebar a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, var(--primary), var(--primary-glow));
    border-radius: 0 6px 6px 0;
    box-shadow: 0 0 8px rgba(59,130,246,0.4);
}

.sidebar i {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
    transition: all var(--transition-normal);
}

.sidebar a:hover i {
    transform: scale(1.15);
    color: var(--primary);
}

.sidebar a.active i {
    color: var(--primary-glow);
    filter: drop-shadow(0 0 6px rgba(59,130,246,0.5));
}

/* Sidebar icon colors */
.sidebar a i.bi-speedometer2 { color: #3b82f6; }         /* หน้าแรก - ฟ้า */
.sidebar a i.bi-bar-chart-line { color: #8b5cf6; }       /* Dashboard - ม่วง */
.sidebar a i.bi-key { color: #f59e0b; }                   /* API Tokens - เหลืองทอง */
.sidebar a i.bi-graph-up { color: #10b981; }              /* Usage - เขียว */
.sidebar a i.bi-gear { color: #6b7280; }                  /* Settings - เทา */
.sidebar a i.bi-people { color: #06b6d4; }                /* สมาชิก - ฟ้าคราม */
.sidebar a i.bi-calendar-heart { color: #ec4899; }        /* ต่ออายุ - ชมพู */
.sidebar a i.bi-lock { color: #f97316; }                  /* เปลี่ยนรหัส - ส้ม */
.sidebar a i.bi-cpu { color: #6366f1; }                   /* Models - ม่วงคราม */
.sidebar a i.bi-tag { color: #eab308; }                   /* แผนราคา - เหลือง */
.sidebar a i.bi-globe { color: #14b8a6; }                 /* Anthropic - เขียวน้ำทะเล */
.sidebar a i.bi-file-text { color: #a855f7; }             /* API Docs - ม่วงอ่อน */
.sidebar a i.bi-question-circle { color: #0ea5e9; }       /* คู่มือ - ฟ้า */
.sidebar a i.bi-envelope { color: #ef4444; }              /* ติดต่อเรา - แดง */
.sidebar a i.bi-journal-text { color: #78716c; }         /* ข้อตกลง - น้ำตาล */
.sidebar a i.bi-shield-check { color: #22c55e; }          /* นโยบาย - เขียว */
.sidebar a i.bi-person-plus { color: #3b82f6; }           /* สมัคร - ฟ้า */
.sidebar a i.bi-box-arrow-right { color: #ef4444; }       /* Login/Logout - แดง */

.sidebar h4 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar hr {
    border-color: var(--border-subtle) !important;
    margin: 16px 12px !important;
}

/* ========== CARDS ========== */
.card {
    background: var(--dark-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md), var(--shadow-glow-blue);
    border-color: rgba(59,130,246,0.2);
    transform: translateY(-1px);
}

.card-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.card-text {
    color: var(--text-secondary);
}

/* ========== STAT CARDS (Premium) ========== */
.stat-cards-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.stat-card-item {
    min-width: 0;
}

.stat-card-body {
    position: relative;
    background: rgba(30,41,59,0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 20px 18px 22px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: default;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stat-card-body:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    border-color: hsla(var(--stat-hue, 217), 70%, 55%, 0.25);
}

/* Icon circle */
.stat-icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-card-body:hover .stat-icon-wrap {
    transform: scale(1.08);
}

.stat-icon-wrap.primary {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
}
.stat-icon-wrap.violet {
    background: rgba(139,92,246,0.15);
    color: #a78bfa;
}
.stat-icon-wrap.success {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
}
.stat-icon-wrap.cyan {
    background: rgba(6,182,212,0.15);
    color: #22d3ee;
}
.stat-icon-wrap.warning {
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
}

/* Info area */
.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    font-weight: 500;
}

/* Progress bar inside stat card */
.stat-progress-track {
    margin-top: 8px;
    height: 4px;
    background: rgba(6,182,212,0.12);
    border-radius: 4px;
    overflow: hidden;
}

.stat-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #06b6d4, #22d3ee);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.stat-progress-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 3px;
    display: block;
    opacity: 0.75;
}

/* Glow orbs (decorative) */
.stat-glow {
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0.08;
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.stat-card-body:hover .stat-glow {
    opacity: 0.18;
    transform: scale(1.3);
}

.stat-glow.primary { background: #3b82f6; }
.stat-glow.violet { background: #8b5cf6; }
.stat-glow.success { background: #22c55e; }
.stat-glow.cyan { background: #06b6d4; }
.stat-glow.warning { background: #f59e0b; }

/* Responsive: tablet → 3 cols */
@media (max-width: 992px) {
    .stat-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsive: mobile → 2 cols */
@media (max-width: 600px) {
    .stat-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat-card-body {
        padding: 16px 14px 18px;
    }
    .stat-value {
        font-size: 1.4rem;
    }
}

/* ========== HOME STATS (Premium) ========== */
.home-stats-section {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
}

.home-stats-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.home-stats-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(139,92,246,0.2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #818cf8;
    flex-shrink: 0;
}

.home-stats-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

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

/* Grid */
.home-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* Card */
.hstat-card {
    position: relative;
    background: rgba(30,41,59,0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 22px 20px 20px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: default;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hstat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.hstat-card:hover .hstat-icon-box {
    transform: scale(1.08);
}

/* Icon box */
.hstat-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.hstat-icon-box.blue {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
}
.hstat-icon-box.violet {
    background: rgba(139,92,246,0.15);
    color: #a78bfa;
}
.hstat-icon-box.green {
    background: rgba(34,197,94,0.15);
    color: #4ade80;
}
.hstat-icon-box.amber {
    background: rgba(245,158,11,0.15);
    color: #fbbf24;
}

/* Info */
.hstat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hstat-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.hstat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    font-weight: 500;
}

/* Glow orb */
.hstat-glow {
    position: absolute;
    top: -35px;
    right: -35px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    filter: blur(45px);
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    pointer-events: none;
}

.hstat-card:hover .hstat-glow {
    opacity: 0.15;
    transform: scale(1.4);
}

.hstat-glow.blue { background: #3b82f6; }
.hstat-glow.violet { background: #8b5cf6; }
.hstat-glow.green { background: #22c55e; }
.hstat-glow.amber { background: #f59e0b; }

/* Charts wrapper */
.home-charts-wrapper {
    margin-top: 24px;
}

.home-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.home-chart-box {
    background: rgba(30,41,59,0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 16px 16px 10px;
}

.home-chart-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* LIGHT THEME DISABLED - Force dark theme only */

/*
[data-bs-theme="light"] .home-stats-header-icon {
    background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(139,92,246,0.12));
    color: #6366f1;
}

[data-bs-theme="light"] .hstat-card {
    background: rgba(255,255,255,0.85);
    border-color: rgba(0,0,0,0.06);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

[data-bs-theme="light"] .hstat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    border-color: rgba(59,130,246,0.2);
}

[data-bs-theme="light"] .hstat-icon-box.blue {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
}
[data-bs-theme="light"] .hstat-icon-box.violet {
    background: rgba(139,92,246,0.1);
    color: #7c3aed;
}
[data-bs-theme="light"] .hstat-icon-box.green {
    background: rgba(34,197,94,0.1);
    color: #16a34a;
}
[data-bs-theme="light"] .hstat-icon-box.amber {
    background: rgba(245,158,11,0.1);
    color: #d97706;
}

[data-bs-theme="light"] .hstat-glow { opacity: 0 !important; }

[data-bs-theme="light"] .home-chart-box {
    background: rgba(255,255,255,0.75);
    border-color: rgba(0,0,0,0.06);
}
*/

/* Responsive */
@media (max-width: 768px) {
    .home-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .hstat-card {
        padding: 18px 16px 16px;
    }
    .hstat-value {
        font-size: 1.35rem;
    }
    .home-charts-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== EXPIRY WARNING CARD ========== */
#expiry-card {
    border-width: 1px;
    transition: all var(--transition-normal);
}

#expiry-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========== TABLES ========== */
.table {
    color: var(--text-secondary);
    margin-bottom: 0;
}

.table thead th {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom-color: var(--border-subtle);
    background: rgba(15,23,42,0.5);
    padding: 12px 16px;
}

.table tbody td {
    border-bottom-color: var(--border-subtle);
    padding: 14px 16px;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(59,130,246,0.04);
}

/* ========== BADGES ========== */
.badge {
    padding: 0.35em 0.75em;
    font-weight: 500;
    border-radius: 6px;
    font-size: 0.75rem;
}

.bg-success { background: rgba(34,197,94,0.15) !important; color: var(--success) !important; border: 1px solid rgba(34,197,94,0.2); }
.bg-danger { background: rgba(239,68,68,0.15) !important; color: var(--danger) !important; border: 1px solid rgba(239,68,68,0.2); }
.bg-warning { background: rgba(245,158,11,0.15) !important; color: var(--warning) !important; border: 1px solid rgba(245,158,11,0.2); }

/* ========== BUTTONS ========== */
.btn {
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary);
    border: none;
    box-shadow: 0 0 12px rgba(59,130,246,0.2);
}

.btn-primary:hover {
    background: #2563eb;
    box-shadow: 0 0 20px rgba(59,130,246,0.35);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: rgba(59,130,246,0.4);
    color: var(--primary-glow);
}

.btn-outline-primary:hover {
    background: rgba(59,130,246,0.1);
    border-color: var(--primary);
}

/* ========== ALERTS ========== */
.alert-info {
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    color: var(--primary-glow);
}

.alert-warning {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    color: var(--warning);
}

.alert-danger {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    color: var(--danger);
}

/* ========== FORMS ========== */
.form-control {
    background: rgba(30,41,59,0.5);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 15px;  /* เพิ่มจาก 14px เป็น 15px */
    transition: all var(--transition-fast);
}

/* Improve textarea readability in dark theme */
textarea.form-control {
    background: rgba(15,23,42,0.7);  /* Darker, more opaque for better contrast */
    color: #e2e8f0;                   /* Slightly softer white */
    font-size: 15px;                  /* เพิ่มจาก 14px เป็น 15px */
}

textarea.form-control::placeholder {
    color: #94a3b8;  /* Softer gray for placeholder */
}

.form-control:focus {
    background: rgba(30,41,59,0.9);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
    color: #f8fafc;
}

textarea.form-control:focus {
    color: #f1f5f9;  /* Brighter white for textarea focus */
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ========== MODALS ========== */
.modal-content {
    background: var(--dark-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom-color: var(--border-subtle);
}

.modal-footer {
    border-top-color: var(--border-subtle);
}

/* ========== CHARTS ========== */
canvas {
    max-height: 100% !important;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--dark-base);
}

::-webkit-scrollbar-thumb {
    background: var(--dark-elevated);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ========== ANIMATIONS ========== */
.page-content {
    animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.8); }
}

/* ── Active Users Card — Pills (Responsive) ── */
.active-user-pill-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    min-height: inherit;
}
.active-user-pill {
    font-size: 0.85rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 0.375rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
    transition: box-shadow 0.2s;
    max-width: 100%;
}
.active-user-pill.recent {
    border-color: #86efac;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(34,197,94,0.3), 0 4px 12px rgba(34,197,94,0.15);
}
.active-user-pill .dot {
    width: 10px; height: 10px;
    border-radius: 50%; flex-shrink: 0;
    background: #fff;
    border: 1.5px solid #d1d5db;
    position: relative;
}
.active-user-pill.recent .dot {
    background: #22c55e;
    border: none;
}
.active-user-pill .pulse-dot-el {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s infinite;
    position: absolute; top: 0; left: 0;
}
.active-user-pill .pill-username {
    color: #374151;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.active-user-pill.recent .pill-username {
    color: #166534;
}
.active-user-pill .pill-token {
    font-size: 0.7rem;
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
    font-weight: 400;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.active-user-pill.recent .pill-token {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}
.active-user-pill .pill-model {
    font-size: 0.7rem;
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
    font-weight: 400;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.active-user-pill .pill-time {
    color: #9ca3af;
    flex-shrink: 0;
}
.active-user-pill.recent .pill-time {
    color: #16a34a;
}
@media (max-width: 576px) {
    .active-user-pill {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }
    .active-user-pill .pill-username { max-width: 80px; }
    .active-user-pill .pill-token   { max-width: 80px; }
    .active-user-pill .pill-model   { max-width: 70px; }
    .active-users-card-header .card-title-text { font-size: 0.9rem; }
}

/* ===================================================================
   HERO / HOMEPAGE — Modern Animated Design
   =================================================================== */

/* ── Floating Particles ── */
.hero-particles {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none;
    z-index: 0;
}
.hero-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    animation: float-particle linear infinite;
}
.hero-particle:nth-child(1)  { width: 6px; height: 6px; left: 10%; top: 20%; animation-duration: 18s; animation-delay: 0s; }
.hero-particle:nth-child(2)  { width: 10px; height: 10px; left: 25%; top: 60%; animation-duration: 22s; animation-delay: 1s; background: rgba(59,130,246,0.12); }
.hero-particle:nth-child(3)  { width: 4px; height: 4px; left: 40%; top: 10%; animation-duration: 15s; animation-delay: 2s; }
.hero-particle:nth-child(4)  { width: 12px; height: 12px; left: 55%; top: 70%; animation-duration: 25s; animation-delay: 0.5s; background: rgba(139,92,246,0.10); }
.hero-particle:nth-child(5)  { width: 5px; height: 5px; left: 70%; top: 30%; animation-duration: 20s; animation-delay: 3s; }
.hero-particle:nth-child(6)  { width: 8px; height: 8px; left: 85%; top: 80%; animation-duration: 17s; animation-delay: 1.5s; background: rgba(6,182,212,0.10); }
.hero-particle:nth-child(7)  { width: 7px; height: 7px; left: 15%; top: 85%; animation-duration: 19s; animation-delay: 2.5s; }
.hero-particle:nth-child(8)  { width: 9px; height: 9px; left: 65%; top: 15%; animation-duration: 23s; animation-delay: 0.8s; background: rgba(34,197,94,0.10); }
.hero-particle:nth-child(9)  { width: 3px; height: 3px; left: 50%; top: 45%; animation-duration: 14s; animation-delay: 4s; }
.hero-particle:nth-child(10) { width: 11px; height: 11px; left: 35%; top: 90%; animation-duration: 21s; animation-delay: 1.2s; background: rgba(245,158,11,0.10); }
.hero-particle:nth-child(11) { width: 6px; height: 6px; left: 90%; top: 50%; animation-duration: 16s; animation-delay: 3.5s; }
.hero-particle:nth-child(12) { width: 14px; height: 14px; left: 5%; top: 40%; animation-duration: 24s; animation-delay: 0.3s; background: rgba(59,130,246,0.08); }

@keyframes float-particle {
    0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-120vh) translateX(80px) scale(0.5); opacity: 0; }
}

/* ── Floating Geometric Shapes ── */
.hero-shapes {
    position: absolute; inset: 0; overflow: hidden; pointer-events: none;
    z-index: 0;
}
.hero-shape {
    position: absolute;
    border: 1px solid rgba(255,255,255,0.04);
    animation: shape-drift ease-in-out infinite alternate;
}
.hero-shape:nth-child(1) {
    width: 80px; height: 80px; border-radius: 20px;
    top: 15%; left: 8%;
    animation-duration: 12s; animation-delay: 0s;
    border-color: rgba(59,130,246,0.08);
}
.hero-shape:nth-child(2) {
    width: 60px; height: 60px; border-radius: 50%;
    top: 60%; left: 85%;
    animation-duration: 15s; animation-delay: 1s;
    border-color: rgba(139,92,246,0.08);
}
.hero-shape:nth-child(3) {
    width: 100px; height: 100px; border-radius: 30px;
    top: 70%; left: 12%;
    animation-duration: 18s; animation-delay: 2s;
    border-color: rgba(6,182,212,0.06);
    transform: rotate(45deg);
}
.hero-shape:nth-child(4) {
    width: 40px; height: 40px; border-radius: 10px;
    top: 25%; left: 75%;
    animation-duration: 10s; animation-delay: 0.5s;
    border-color: rgba(34,197,94,0.08);
}
.hero-shape:nth-child(5) {
    width: 50px; height: 50px; border-radius: 50%;
    top: 45%; left: 50%;
    animation-duration: 14s; animation-delay: 1.5s;
    border-color: rgba(245,158,11,0.06);
    transform: scale(0.8);
}
@keyframes shape-drift {
    0%   { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, -40px) rotate(15deg); }
}

/* ── Hero Section ── */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #0c1929 0%, #132244 30%, #1a1a3e 60%, #0f192c 100%);
    border-radius: 24px;
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: center;
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(59,130,246,0.08) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 50%, rgba(139,92,246,0.06) 0%, transparent 50%);
    z-index: 0;
}
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(15,25,44,0.6) 100%);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem 2rem;
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(59,130,246,0.15);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 50px;
    padding: 6px 16px;
    font-size: 0.8rem;
    color: var(--primary-glow);
    margin-bottom: 1.25rem;
    animation: fadeInUp 0.6s ease-out both;
}
.hero-badge-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
}
.hero-title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease-out 0.15s both;
}
.hero-title .gradient-text {
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #60a5fa);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 4s ease-in-out infinite;
}
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.hero-subtitle {
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.7;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    animation: fadeInUp 0.6s ease-out 0.45s both;
}
.hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    background-size: 200% 200%;
    animation: hero-btn-shimmer 3s ease-in-out infinite;
    box-shadow: 0 4px 20px rgba(59,130,246,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}
@keyframes hero-btn-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.hero-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59,130,246,0.4);
    color: #fff;
}
.hero-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}
.hero-btn-secondary:hover {
    background: rgba(255,255,255,0.10);
    border-color: rgba(255,255,255,0.20);
    transform: translateY(-2px);
    color: var(--text-primary);
}
.hero-social-links {
    display: flex;
    gap: 12px;
    margin-top: 1.25rem;
    animation: fadeInUp 0.6s ease-out 0.5s both;
}
.hero-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #1877f2;
    background: rgba(24,119,242,0.1);
    border: 1px solid rgba(24,119,242,0.2);
    font-size: 1.2rem;
    text-decoration: none;
    transition: all 0.3s ease;
}
.hero-social-link:hover {
    background: #1877f2;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(24,119,242,0.3);
}
.hero-stats-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 32px;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    animation: fadeInUp 0.6s ease-out 0.6s both;
}
.hero-stat-item {
    display: flex;
    flex-direction: column;
}
.hero-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.hero-stat-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Feature Cards ── */
.features-section {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}
.features-header {
    text-align: center;
    margin-bottom: 2rem;
}
.features-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.features-header p {
    color: var(--text-secondary);
    font-size: 0.92rem;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.feature-card {
    background: var(--dark-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: default;
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--fc-accent, #3b82f6), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.feature-card:hover::before { opacity: 1; }
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--fc-accent, #3b82f6);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3), 0 0 20px rgba(59,130,246,0.06);
}
.feature-icon-box {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    background: rgba(59,130,246,0.12);
    color: var(--primary-glow);
    transition: all 0.3s ease;
}
.feature-card:hover .feature-icon-box {
    transform: scale(1.1) rotate(-5deg);
    background: rgba(59,130,246,0.2);
}
.feature-card h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ── Redesigned Stats Cards ── */
.home-stats-section.modern {
    margin-top: 1rem;
}
.home-stats-section.modern .home-stats-header { display: none; }
.home-stats-section.modern .home-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.hstat-card {
    background: var(--dark-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 16px;
}
.hstat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255,255,255,0.10);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.hstat-icon-box {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}
.hstat-card:hover .hstat-icon-box { transform: scale(1.1); }
.hstat-icon-box.blue   { background: rgba(59,130,246,0.12); color: #60a5fa; }
.hstat-icon-box.violet { background: rgba(139,92,246,0.12); color: #a78bfa; }
.hstat-icon-box.green  { background: rgba(34,197,94,0.12); color: #4ade80; }
.hstat-icon-box.amber  { background: rgba(245,158,11,0.12); color: #fbbf24; }
.hstat-info { display: flex; flex-direction: column; }
.hstat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}
.hstat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.hstat-glow { display: none; }

/* ── Charts Wrapper ── */
.home-charts-wrapper {
    margin-top: 1.25rem;
}

/* ── Models Preview ── */
.models-preview {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}
.models-preview-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.models-preview-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.models-preview-header p {
    color: var(--text-secondary);
    font-size: 0.92rem;
}
.models-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.model-preview-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--dark-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}
.model-preview-chip:hover {
    border-color: rgba(59,130,246,0.3);
    background: rgba(59,130,246,0.05);
    transform: translateY(-2px);
}
.model-preview-chip .model-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
}
.model-preview-chip .model-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── CTA Banner ── */
.cta-banner {
    position: relative;
    background: linear-gradient(135deg, #1a1a3e 0%, #0f192c 50%, #132244 100%);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    overflow: hidden;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.cta-banner::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(59,130,246,0.03), transparent, rgba(139,92,246,0.03), transparent);
    animation: cta-rotate 20s linear infinite;
    z-index: 0;
}
@keyframes cta-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}
.cta-banner p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 1.5rem;
    font-size: 0.95rem;
}

/* ── Responsive ── */
@media (max-width: 992px) {
    .home-stats-section.modern .home-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .hero-section { min-height: 360px; }
}
@media (max-width: 576px) {
    .home-stats-section.modern .home-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .hstat-card { padding: 1rem; }
    .hstat-value { font-size: 1.2rem; }
    .hero-section { min-height: auto; }
    .feature-card { padding: 1.25rem; }
    .models-preview-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== SIDEBAR TOGGLE (mobile) ========== */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: background var(--transition-fast);
}
.sidebar-toggle:hover {
    background: rgba(59,130,246,0.1);
}

/* Off-canvas overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1020;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.show {
    opacity: 1;
}

/* ========== MOBILE HEADER ========== */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1010;
    background: var(--dark-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 16px;
    align-items: center;
    gap: 12px;
}
.mobile-header .mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    body {
        padding-top: 56px;
        overscroll-behavior: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 80vw;
        min-height: 100vh;
        z-index: 1030;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        border-right: 1px solid var(--border-subtle);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar h4 {
        display: flex;
        padding: 16px;
        margin-bottom: 8px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .sidebar hr {
        margin: 8px 16px !important;
    }

    .sidebar a {
        margin: 2px 8px;
        padding: 10px 14px;
        font-size: 14px;
    }

    .sidebar a i {
        font-size: 18px;
        width: 24px;
        text-align: center;
        margin-right: 12px;
    }

    .sidebar a.active::before {
        display: block;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        padding: 16px;
        overscroll-behavior: none;
    }

    /* Header row on mobile */
    .page-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .page-header h2 {
        font-size: 1.2rem;
        width: 100%;
    }
    .page-header .header-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }

    /* Chart containers on mobile */
    .chart-container {
        min-height: 200px !important;
    }

    /* Model cards: 2 columns on mobile */
    #models-grid .col-md-6 {
        width: 50%;
    }

    /* Simplify tables on mobile */
    .table thead th,
    .table tbody td {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    /* Token display wraps on mobile */
    .token-display {
        font-size: 0.7rem;
        word-break: break-all;
        padding: 8px;
    }

    /* Stat cards */
    .stat-cards-grid {
        gap: 10px;
    }
    .stat-card-body {
        padding: 14px 12px 16px;
    }
    .stat-value {
        font-size: 1.3rem;
    }
    .stat-icon-wrap {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 10px;
    }

    /* Modal on mobile */
    .modal-dialog {
        margin: 8px;
    }

    /* Admin tabs wrap on mobile */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    .nav-tabs .nav-link {
        white-space: nowrap;
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    /* Pre blocks on mobile */
    pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.75rem;
    }

    /* Expiry card on mobile */
    #expiry-card .card-body {
        flex-direction: column;
        text-align: center;
    }
    #expiry-card .card-body > div:first-child {
        flex-direction: column !important;
    }
    #expiry-card .card-body i {
        margin-right: 0 !important;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    #models-grid .col-md-6 {
        width: 100%;
    }

    .page-header .header-actions {
        flex-wrap: wrap;
    }

    .token-display {
        font-size: 0.65rem;
    }
}

/* ========== TOKEN DISPLAY ========== */
.token-display {
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    background: rgba(15,23,42,0.5);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    color: var(--accent-cyan);
}

/* ========== NAV TABS ========== */
.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    font-weight: 500;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    border-bottom-color: var(--primary);
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
    border-color: transparent;
}

/* ========== TAB ICONS (Admin) ========== */
.tab-icon {
    font-size: 1.1rem;
    margin-right: 6px;
    vertical-align: -2px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.nav-link.active .tab-icon {
    color: var(--primary-glow);
}

.nav-link:hover .tab-icon {
    color: var(--text-primary);
}

/* ========== CHART CONTAINER DARK ========== */
.chart-container-dark {
    background: rgba(15,23,42,0.5);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    padding: 16px;
    min-height: 320px;
}

/* ========== PRE CODE BLOCKS ========== */
pre.bg-dark {
    background: rgba(15,23,42,0.8) !important;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

/* ========== HOME PAGE CARDS ========== */
#home-page .card {
    background: rgba(30,41,59,0.6);
    backdrop-filter: blur(8px);
}

/* ========== SETTINGS FORM ========== */
#settings-form .form-control {
    background: rgba(30,41,59,0.5);
}

/* ========== RENEW PAGE ========== */
#renew-page .card {
    background: rgba(30,41,59,0.7);
}

/* ========== DOCS PAGE ========== */
#docs-page .card {
    background: rgba(30,41,59,0.7);
}

/* ========== HELP PAGE ========== */
#help-page .card {
    background: rgba(30,41,59,0.7);
}

/* ========== CODE BLOCKS IN DOCS ========== */
.token-display {
    word-break: break-all;
}

/* ========== LOADING SPINNER ========== */
.loading-spinner {
    display: none;
}

.loading .loading-spinner {
    display: inline-block;
}

/* ========== HEADER AREA ========== */
.d-flex.justify-content-between.align-items-center.mb-4 {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 24px !important;
}

#user-email {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========== PAGE TITLE ========== */
#page-title {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* ========== RESPONSIVE TABLE ========== */
.table-responsive {
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== IMG THUMBNAIL (SLIP PREVIEW) ========== */
.img-thumbnail {
    background: rgba(30,41,59,0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

/* ========== SMALL TEXT ========== */
small, .small {
    color: var(--text-muted);
}

/* ========== TEXT MUTED (DARK THEME) ========== */
.text-muted {
    color: #94a3b8 !important;  /* Darker gray for better contrast */
}

/* Override for text-muted inside conversation messages - even darker */
#conv-messages .text-muted {
    color: #e2e8f0 !important;  /* Softer white for contrast against dark background */
}

/* ========== BORDER PRIMARY ========== */
.border-primary {
    border-color: rgba(59,130,246,0.3) !important;
}

/* ========== BORDER DANGER ========== */
.border-danger {
    border-color: rgba(239,68,68,0.3) !important;
}

/* ========== BORDER WARNING ========== */
.border-warning {
    border-color: rgba(245,158,11,0.3) !important;
}

/* ========== EXPIRY WARNING TEXT ========== */
#expiry-title {
    color: var(--text-primary);
}

#expiry-desc {
    color: var(--text-secondary);
}

/* ========== FORM LABEL ========== */
.form-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* ========== FORM TEXT ========== */
.form-text {
    color: var(--text-muted);
    font-size: 12px;
}

/* ========== BTN SM ========== */
.btn-sm {
    border-radius: 6px;
    font-size: 13px;
}

/* ========== LIST UNSTYLED ========== */
.list-unstyled li {
    color: var(--text-secondary);
}

/* ========== CODE ========== */
code,
pre code {
    color: var(--accent-cyan);
    background: rgba(15,23,42,0.5);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ========== H5 ========== */
h5 {
    color: var(--text-primary);
    font-weight: 600;
}

/* ========== HR ========== */
hr {
    border-color: var(--border-subtle);
    opacity: 0.5;
}

/* ========== ALERT HEADING ========== */
.alert-heading {
    color: inherit;
    font-weight: 600;
}

/* ========== P ========== */
p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ========== OL LI ========== */
ol li {
    color: var(--text-secondary);
}

/* ========== UL LI ========== */
ul li {
    color: var(--text-secondary);
}

/* ========== TABLE HOVER ========== */
.table-hover tbody tr:hover td {
    color: var(--text-primary);
}

/* ========== CANVAS CONTAINER FOR CHARTS ========== */
[style*="min-height:300px"] {
    background: rgba(15,23,42,0.3);
    border-radius: 8px;
    padding: 8px;
}

/* ========== DARK MODE OVERRIDES ========== */
[data-bs-theme="dark"] {
    --bs-body-bg: var(--dark-base);
    --bs-body-color: var(--text-primary);
}

/* ========== LIGHT THEME DISABLED - Force dark theme only ========== */
/*
[data-bs-theme="light"] {
    --bs-body-bg: #f1f5f9;
}

[data-bs-theme="light"] .stat-card-body {
    background: rgba(255,255,255,0.85);
    border-color: rgba(148,163,184,0.25);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

[data-bs-theme="light"] .stat-card-body:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    border-color: hsla(var(--stat-hue, 217), 50%, 55%, 0.3);
}

[data-bs-theme="light"] .stat-glow {
    opacity: 0.06;
}

[data-bs-theme="light"] .stat-card-body:hover .stat-glow {
    opacity: 0.14;
}

[data-bs-theme="light"] .stat-progress-track {
    background: rgba(6,182,212,0.1);
}
*/

/* ========== FOCUS STATES ========== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ════════════════════════════════════════ */
/*  CLAUDE CODE SUPPORT CARD                */
/* ════════════════════════════════════════ */
.claude-support-card {
    position: relative;
    background: linear-gradient(135deg, #1c1917 0%, #1a120e 30%, #0f172a 100%);
    border: 1px solid rgba(251, 146, 60, 0.15);
    border-radius: 18px;
    padding: 2rem 2.5rem;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(251,146,60,0.05), 0 8px 32px rgba(0,0,0,0.25);
    transition: border-color 0.3s, box-shadow 0.3s;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}
.claude-support-card:hover {
    border-color: rgba(251, 146, 60, 0.3);
    box-shadow: 0 0 60px rgba(251,146,60,0.1), 0 8px 32px rgba(0,0,0,0.3);
}
.claude-glow {
    position: absolute;
    top: -50%;
    right: -5%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(251,146,60,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.claude-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}
.claude-left {
    flex: 1;
    min-width: 0;
}
.claude-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.claude-illustration {
    width: 120px;
    height: 120px;
    opacity: 0.8;
}
.claude-illustration svg {
    width: 100%;
    height: 100%;
}

.claude-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.claude-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(251, 146, 60, 0.12);
    color: #fb923c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.claude-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: #f1f5f9;
}
.claude-subtitle {
    font-size: 0.85rem;
    color: rgba(251, 146, 60, 0.75);
    margin: 0;
    margin-top: 0.1rem;
}
.claude-desc p {
    color: rgba(148,163,184,0.9);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0 0 1rem 0;
    max-width: 560px;
}
.claude-desc code {
    background: rgba(251,146,60,0.1);
    color: #fb923c;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
}

.claude-code-block {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 0.85rem;
}
.claude-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.35);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.75rem;
    color: rgba(148,163,184,0.7);
}
.claude-copy-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(148,163,184,0.8);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}
.claude-copy-btn:hover {
    background: rgba(251,146,60,0.15);
    border-color: rgba(251,146,60,0.25);
    color: #fb923c;
}
.claude-code-pre {
    background: #0a0a0f;
    margin: 0;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #e2e8f0;
}
.claude-code-pre code {
    color: #e2e8f0;
}

.claude-note {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: rgba(148,163,184,0.6);
    line-height: 1.5;
}
.claude-note i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}
.claude-note code {
    background: rgba(251,146,60,0.1);
    color: #fb923c;
    padding: 0.05em 0.35em;
    border-radius: 3px;
    font-size: 0.85em;
}
.claude-note a {
    color: #fb923c;
    text-decoration: underline;
    text-decoration-color: rgba(251,146,60,0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s;
}
.claude-note a:hover {
    text-decoration-color: rgba(251,146,60,0.8);
    color: #fbbf24;
}

@media (max-width: 768px) {
    .claude-support-card {
        padding: 1.5rem 1.25rem;
    }
    .claude-content {
        flex-direction: column;
    }
    .claude-right {
        display: none;
    }
    .claude-title {
        font-size: 1.1rem;
    }
    .claude-desc p {
        max-width: 100%;
    }
    .claude-code-pre {
        font-size: 0.75rem;
        padding: 0.75rem 1rem;
    }
}

/* ════════════════════════════════════════ */
/*  ANTHROPIC API SUPPORT CARD              */
/* ════════════════════════════════════════ */
.anthropic-support-card {
    position: relative;
    background: linear-gradient(135deg, #0f1a2e 0%, #0e1628 30%, #0a0f1a 100%);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 18px;
    padding: 2rem 2.5rem;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(6,182,212,0.05), 0 8px 32px rgba(0,0,0,0.25);
    transition: border-color 0.3s, box-shadow 0.3s;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
}
.anthropic-support-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 60px rgba(6,182,212,0.1), 0 8px 32px rgba(0,0,0,0.3);
}
.anthropic-glow {
    position: absolute;
    top: -50%;
    right: -5%;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(6,182,212,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.anthropic-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    z-index: 1;
}
.anthropic-left {
    flex: 1;
    min-width: 0;
}
.anthropic-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.anthropic-illustration {
    width: 120px;
    height: 120px;
    opacity: 0.8;
}
.anthropic-illustration svg {
    width: 100%;
    height: 100%;
}

.anthropic-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.anthropic-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.anthropic-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    color: #f1f5f9;
}
.anthropic-subtitle {
    font-size: 0.85rem;
    color: rgba(6, 182, 212, 0.75);
    margin: 0;
    margin-top: 0.1rem;
}
.anthropic-desc p {
    color: rgba(148,163,184,0.9);
    font-size: 0.9rem;
    line-height: 1.65;
    margin: 0 0 1rem 0;
    max-width: 560px;
}
.anthropic-desc code {
    background: rgba(6,182,212,0.1);
    color: #22d3ee;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Code Blocks Grid (side-by-side on desktop) */
.anthropic-code-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.anthropic-code-block {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}
.anthropic-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.35);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.75rem;
    color: rgba(148,163,184,0.7);
}
.anthropic-copy-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(148,163,184,0.8);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.72rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}
.anthropic-copy-btn:hover {
    background: rgba(6,182,212,0.15);
    border-color: rgba(6,182,212,0.25);
    color: #22d3ee;
}
.anthropic-code-pre {
    background: #0a0a0f;
    margin: 0;
    padding: 1rem 1.2rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: #e2e8f0;
    max-height: 200px;
}
.anthropic-code-pre code {
    color: #e2e8f0;
}

.anthropic-note {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: rgba(148,163,184,0.6);
    line-height: 1.5;
}
.anthropic-note i {
    margin-top: 0.15rem;
    flex-shrink: 0;
}
.anthropic-note code {
    background: rgba(6,182,212,0.1);
    color: #22d3ee;
    padding: 0.05em 0.35em;
    border-radius: 3px;
    font-size: 0.85em;
}
.anthropic-note a {
    color: #22d3ee;
    text-decoration: underline;
    text-decoration-color: rgba(6,182,212,0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s;
}
.anthropic-note a:hover {
    text-decoration-color: rgba(6,182,212,0.8);
    color: #67e8f9;
}

@media (max-width: 768px) {
    .anthropic-support-card {
        padding: 1.5rem 1.25rem;
    }
    .anthropic-content {
        flex-direction: column;
    }
    .anthropic-right {
        display: none;
    }
    .anthropic-title {
        font-size: 1.1rem;
    }
    .anthropic-desc p {
        max-width: 100%;
    }
    .anthropic-code-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    .anthropic-code-pre {
        font-size: 0.72rem;
        padding: 0.75rem 1rem;
        max-height: 160px;
    }
}
/* Force tables inside .table-responsive to scroll horizontally on mobile */
.table-responsive > .table {
    white-space: nowrap;
}
