/* ══════════════════════════════════════════
   Radio Health Spy — Premium Dark Dashboard
   ══════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f2a;
    --bg-card: rgba(15, 15, 42, 0.7);
    --bg-card-hover: rgba(20, 20, 55, 0.85);
    --bg-sidebar: rgba(8, 8, 24, 0.95);
    --bg-input: rgba(20, 20, 50, 0.6);

    --border: rgba(99, 102, 241, 0.12);
    --border-hover: rgba(99, 102, 241, 0.3);
    --border-focus: rgba(139, 92, 246, 0.5);

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;
    --accent-pink: #ec4899;
    --accent-green: #22c55e;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --accent-cyan: #06b6d4;

    --gradient-purple: linear-gradient(135deg, rgba(139,92,246,0.15) 0%, rgba(99,102,241,0.05) 100%);
    --gradient-blue: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(6,182,212,0.05) 100%);
    --gradient-pink: linear-gradient(135deg, rgba(236,72,153,0.15) 0%, rgba(139,92,246,0.05) 100%);
    --gradient-green: linear-gradient(135deg, rgba(34,197,94,0.15) 0%, rgba(6,182,212,0.05) 100%);

    --glass: rgba(255,255,255,0.03);
    --glass-border: rgba(255,255,255,0.06);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 30px rgba(139,92,246,0.1);

    --sidebar-width: 260px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(139,92,246,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(59,130,246,0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(236,72,153,0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139,92,246,0.5); }

/* ══════════════════════
   SIDEBAR
   ══════════════════════ */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    backdrop-filter: blur(20px);
    transition: transform var(--transition);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 8px rgba(139,92,246,0.4));
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(139,92,246,0.4)); }
    50% { filter: drop-shadow(0 0 16px rgba(139,92,246,0.7)); }
}

.logo-title {
    font-size: 1rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-align: left;
    width: 100%;
    position: relative;
}

.nav-btn:hover {
    background: var(--glass);
    color: var(--text-primary);
}

.nav-btn.active {
    background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(99,102,241,0.08));
    color: var(--accent-purple);
    font-weight: 600;
}

.nav-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-purple);
    border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 1.15rem; }

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--border);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.action-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.action-btn:hover::after { width: 200px; height: 200px; }

.action-primary {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border-color: transparent;
    color: white;
}
.action-primary:hover { box-shadow: 0 0 20px rgba(139,92,246,0.3); transform: translateY(-1px); }

.action-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
}
.action-secondary:hover { border-color: var(--border-hover); background: rgba(30,30,70,0.6); }

.action-accent {
    background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
    border-color: transparent;
    color: white;
}
.action-accent:hover { box-shadow: 0 0 20px rgba(236,72,153,0.3); transform: translateY(-1px); }

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.5rem 0.25rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-amber);
    animation: blink 2s infinite;
}

.status-dot.online { background: var(--accent-green); animation: none; }
.status-dot.offline { background: var(--accent-red); animation: none; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ══════════════════════
   MAIN CONTENT
   ══════════════════════ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.mobile-header {
    display: none;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.hamburger {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* Page header */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.page-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ── Tabs ── */
.tab-content {
    display: none;
    animation: fadeIn 0.35s ease;
}

.tab-content.active { display: block; }

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

/* ══════════════════════
   CARDS
   ══════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    transition: all var(--transition);
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-glow);
}

.card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* ── Metrics Grid ── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all var(--transition);
    cursor: default;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.metric-card.gradient-purple { background: var(--gradient-purple); }
.metric-card.gradient-blue { background: var(--gradient-blue); }
.metric-card.gradient-pink { background: var(--gradient-pink); }
.metric-card.gradient-green { background: var(--gradient-green); }

.metric-icon { font-size: 2rem; }

.metric-info { display: flex; flex-direction: column; }

.metric-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
    font-weight: 500;
}

/* ── Grids ── */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ── Form elements ── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.input-dark, .select-dark {
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    transition: all var(--transition);
}

.input-dark:focus, .select-dark:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(139,92,246,0.1);
}

textarea.input-dark { resize: vertical; min-height: 80px; }

.select-dark {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    cursor: pointer;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
    font-size: 0.9rem;
}

/* ══════════════════════
   VIRAL LIST
   ══════════════════════ */
.viral-list {
    max-height: 70vh;
    overflow-y: auto;
}

.viral-item {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.viral-item:hover { background: var(--glass); }

.viral-rank {
    font-size: 1.5rem;
    font-weight: 800;
    min-width: 2.5rem;
    text-align: center;
    color: var(--text-muted);
}

.viral-rank.top-1 { color: #ffd700; }
.viral-rank.top-2 { color: #c0c0c0; }
.viral-rank.top-3 { color: #cd7f32; }

.viral-info {
    flex: 1;
    min-width: 0;
}

.viral-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.viral-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.viral-score-badge {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 70px;
    justify-content: center;
}

.score-high { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.score-mid  { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.score-low  { background: rgba(34,197,94,0.15); color: var(--accent-green); }

/* ══════════════════════
   CHANNEL GRID
   ══════════════════════ */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.channel-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all var(--transition);
    position: relative;
}

.channel-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.channel-card.is-mine {
    border-color: rgba(139,92,246,0.3);
    background: rgba(139,92,246,0.05);
}

.channel-card.is-mine::after {
    content: '⭐ Kênh của tôi';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.channel-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-right: 5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.channel-stat {
    text-align: center;
    padding: 0.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
}

.channel-stat-value {
    font-size: 1rem;
    font-weight: 700;
    display: block;
}

.channel-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.channel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.channel-actions button {
    flex: 1;
    padding: 0.4rem;
    font-size: 0.72rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all var(--transition);
}

.channel-actions button:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

/* ══════════════════════
   REPORTS
   ══════════════════════ */
.reports-sidebar-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    min-height: 60vh;
}

.reports-list {
    max-height: 65vh;
    overflow-y: auto;
}

.report-item {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

.report-item:hover { background: var(--glass); }
.report-item.active { background: rgba(139,92,246,0.1); border-left: 3px solid var(--accent-purple); }

.report-item-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.report-item-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.report-content-area {
    max-height: 75vh;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.7;
    font-size: 0.9rem;
}

/* ══════════════════════
   MEDICAL FLAGS
   ══════════════════════ */
.medical-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: all var(--transition);
}

.medical-card:hover { border-color: var(--border-hover); }

.medical-card.severity-critical { border-left: 4px solid var(--accent-red); }
.medical-card.severity-warning { border-left: 4px solid var(--accent-amber); }
.medical-card.severity-info { border-left: 4px solid var(--accent-blue); }

.medical-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.medical-flag {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.82rem;
}

.medical-flag-severity {
    font-weight: 700;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.sev-critical { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.sev-warning { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.sev-info { background: rgba(59,130,246,0.15); color: var(--accent-blue); }

/* ══════════════════════
   API KEYS DETAIL
   ══════════════════════ */
.key-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.key-name {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
}

.key-status {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    text-transform: uppercase;
}

.key-status.active { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.key-status.exhausted { background: rgba(239,68,68,0.15); color: var(--accent-red); }

.key-progress {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.key-progress-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.key-progress-bar.low { background: var(--accent-green); }
.key-progress-bar.mid { background: var(--accent-amber); }
.key-progress-bar.high { background: var(--accent-red); }

.key-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ══════════════════════
   TABLE
   ══════════════════════ */
.table-responsive { overflow-x: auto; }

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

th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

tr:hover td { background: rgba(255,255,255,0.02); }

/* ══════════════════════
   TOAST
   ══════════════════════ */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 3.5s forwards;
    max-width: 400px;
}

.toast-success { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); color: var(--accent-green); }
.toast-error { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); color: var(--accent-red); }
.toast-info { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.3); color: var(--accent-blue); }

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

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

/* ══════════════════════
   LOADING SPINNER
   ══════════════════════ */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.2);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 0.5rem;
}

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

/* ══════════════════════
   LOGIN OVERLAY
   ══════════════════════ */
.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 15, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(20px);
    animation: fadeIn 0.4s ease;
}

.login-overlay.hidden {
    display: none;
}

.login-card {
    background: rgba(15, 15, 42, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6), 0 0 60px rgba(139,92,246,0.08);
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
    filter: drop-shadow(0 0 20px rgba(139,92,246,0.6));
    animation: pulse-glow 3s ease-in-out infinite;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.25rem;
}

.login-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.login-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    color: var(--accent-red);
    margin-bottom: 1rem;
}

.login-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1.25rem;
}

/* ══════════════════════
   SIDEBAR USER INFO
   ══════════════════════ */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1rem;
    padding: 0.65rem 0.75rem;
    background: rgba(139, 92, 246, 0.07);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-md);
}

.sidebar-user-avatar {
    font-size: 1.4rem;
    line-height: 1;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-purple);
}

.btn-logout {
    background: none;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all var(--transition);
    flex-shrink: 0;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
}

/* ══════════════════════
   ADMIN USERS TABLE
   ══════════════════════ */
.admin-user-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.admin-user-row:hover {
    background: var(--glass);
}

.admin-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.admin-user-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.admin-user-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.role-badge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.role-admin {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.role-user {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
}

/* ══════════════════════
   RESPONSIVE
   ══════════════════════ */
@media (max-width: 1024px) {
    .grid-2col { grid-template-columns: 1fr; }
    .reports-sidebar-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    .mobile-header { display: flex; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .channel-grid { grid-template-columns: 1fr; }
}
