@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --border-color: #cbd5e1;
    --border-active: #3b82f6;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.15);
    --accent-cyan: #0891b2;
    --accent-green: #059669;
    --accent-yellow: #d97706;
    --accent-red: #dc2626;
    --accent-purple: #7c3aed;
    --accent-pink: #db2777;
    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(241, 245, 249, 0.8));
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(15, 23, 42, 0.08);
    --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Code block colors - consistent dark styling across themes */
    --code-bg-header: #0c1222;
    --code-bg-body: #151e2e;
    --code-text-primary: #f8fafc;
    --code-text-secondary: #cbd5e1;
    --code-text-muted: #64748b;
    --code-accent-green: #10b981;
    --code-accent-red: #ef4444;
}

[data-theme="dark"] {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2b3d;
    --bg-input: #0d1321;
    --border-color: #1e2d42;
    --border-active: #3b82f6;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --accent-pink: #ec4899;
    --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-card: linear-gradient(145deg, rgba(26, 35, 50, 0.8), rgba(15, 23, 42, 0.9));
    --glass-bg: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 30px rgba(59, 130, 246, 0.15);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== ANIMATED BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(6, 182, 212, 0.05) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

/* ===== NAVBAR ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.navbar-brand .logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.navbar-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav a:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.navbar-nav a.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.25);
}

/* ===== LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-content {
    padding: 40px 0;
    min-height: calc(100vh - 64px);
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    padding: 80px 0 60px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 400px;
    background: radial-gradient(ellipse, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 50px;
    color: var(--accent-blue);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.hero-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary), #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 36px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== CARDS ===== */
.card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

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

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

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

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== FEATURES GRID ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 60px;
}

.feature-card {
    padding: 32px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.feature-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.feature-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.feature-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.feature-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.feature-icon.yellow { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.feature-icon.pink { background: rgba(236, 72, 153, 0.15); color: var(--accent-pink); }

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-glow);
}

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

/* ===== AUTH FORMS ===== */
.auth-container {
    max-width: 440px;
    margin: 60px auto;
}

.auth-card {
    padding: 40px;
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
}

/* ===== DASHBOARD ===== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    min-height: calc(100vh - 64px);
}

.sidebar {
    position: sticky;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    padding: 24px 0;
    border-right: 1px solid var(--border-color);
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 20px;
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 2px solid transparent;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.sidebar-link.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    border-left-color: var(--accent-blue);
}

.sidebar-link .method {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 36px;
    text-align: center;
}

.method-get { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.method-post { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.method-delete { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.method-put { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }

/* API badges for stats and categories */
.sidebar-link .api-badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-badge-danhmuc {
    background: rgba(109, 40, 217, 0.08);
    color: #6d28d9;
}

[data-theme="dark"] .api-badge-danhmuc {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.api-badge-thongke {
    background: rgba(180, 83, 9, 0.08);
    color: #b45309;
}

[data-theme="dark"] .api-badge-thongke {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.main-content {
    padding: 32px 32px 32px 0;
    overflow-y: auto;
}

/* ===== API TOKEN BOX ===== */
.token-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 32px;
}

.token-box .label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    white-space: nowrap;
}

.token-box .value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    user-select: all;
}

.token-box .copy-btn {
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    color: var(--accent-blue);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.token-box .copy-btn:hover {
    background: rgba(59, 130, 246, 0.25);
}

/* ===== API ENDPOINT DOCS ===== */
.endpoint-section {
    display: none;
    margin-bottom: 48px;
    scroll-margin-top: 80px;
}

.endpoint-section.active {
    display: block;
}

.endpoint-section h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.endpoint-section .desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.endpoint-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition);
}

.endpoint-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.endpoint-header .method-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    min-width: 48px;
    text-align: center;
}

.endpoint-header .path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    flex: 1;
}

.endpoint-header .description {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.endpoint-header .toggle-icon {
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 0.8rem;
}

.endpoint-card.open .toggle-icon {
    transform: rotate(180deg);
}

.endpoint-body {
    display: none;
    padding: 0 20px 20px;
    border-top: 1px solid var(--border-color);
}

.endpoint-card.open .endpoint-body {
    display: block;
}

/* ===== CODE BLOCKS ===== */
.code-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    padding: 8px 8px 0;
    background: var(--code-bg-header);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    overflow-x: auto;
}

.code-tab {
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--code-text-muted);
    background: transparent;
    border: none;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.code-tab:hover {
    color: var(--code-text-secondary);
}

.code-tab.active {
    color: var(--code-text-primary);
    background: var(--code-bg-body);
}

.code-panel {
    display: none;
}

.code-panel.active {
    display: block;
}

.code-block {
    background: var(--code-bg-body);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    position: relative;
}

.code-block pre {
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: var(--code-text-secondary);
    white-space: pre;
}

.code-block .copy-code {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--code-text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.code-block .copy-code:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--code-text-primary);
}

/* ===== TRY IT SECTION ===== */
.try-it {
    margin-top: 16px;
    padding: 16px;
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-sm);
}

.try-it-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.try-it-header h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-blue);
}

.try-response {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    margin-top: 12px;
}

.try-response.visible {
    display: block;
}

.try-response pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--bg-input);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.try-response.error pre {
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.05);
}

.try-response table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.try-response thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-card);
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: 10px 14px;
    font-weight: 700;
    text-align: left;
}

.try-response tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.try-response tbody tr:hover {
    background: var(--bg-card-hover);
}

.copy-json-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 6px 12px;
    cursor: pointer;
    transition: var(--transition);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 4px;
}

.copy-json-btn:hover {
    background: var(--accent-blue);
    color: #ffffff;
    border-color: var(--accent-blue);
}

/* ===== ADMIN TABLE ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

thead th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
}

.status-2xx { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.status-4xx { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); }
.status-5xx { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.pagination a {
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.pagination a:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.pagination span.current {
    background: var(--gradient-primary);
    color: #fff;
}

/* ===== STATS CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== FILTERS ===== */
.filters-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filters-bar .form-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 150px;
}

.filters-bar .form-input {
    padding: 10px 14px;
    font-size: 0.82rem;
}

/* ===== ALERT ===== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent-green);
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar { padding: 0 16px; }
    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 0.95rem; }
    .features-grid { grid-template-columns: 1fr; }
    .dashboard-layout { grid-template-columns: 1fr; }
    .sidebar {
        position: relative;
        top: 0;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px 0;
    }
    .main-content { padding: 24px 0; }
    .container { padding: 0 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== LOADING SPINNER ===== */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== MONO TEXT ===== */
.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ===== TOOLTIP ===== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.tooltip:hover::after {
    opacity: 1;
}

/* ===== ROLE BADGE ===== */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.role-user { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }

/* ===== ADMIN GRID ===== */
.admin-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}
@media (max-width: 992px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== THEME TOGGLE HOVER ===== */
#themeToggle:hover {
    border-color: var(--accent-blue) !important;
    background: var(--bg-card-hover) !important;
    transform: scale(1.08);
}

/* ===== RESPONSE TABS ===== */
.resp-tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.resp-tab-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.resp-tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.resp-tab-btn.active {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
}

.resp-tab-panel {
    display: none;
}

.resp-tab-panel.active {
    display: block;
}

/* ===== CHART CONTROLS ===== */
.chart-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: flex-end;
    align-items: center;
}

.chart-controls span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-right: 4px;
}

.chart-type-btn {
    padding: 6px 12px;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.chart-type-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.chart-type-btn.active {
    background: var(--accent-blue) !important;
    color: #ffffff !important;
    border-color: var(--accent-blue) !important;
}
