﻿/* =====================================================
   NAX Admin Panel â€” Dark Glassmorphism Design System
   ===================================================== */

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

/* ---- CSS Variables ---- */
:root {
    --bg-primary:      #0a0a0f;
    --bg-secondary:    #0f0f1a;
    --bg-card:         #13131f;
    --bg-hover:        #1a1a2e;

    --glass-bg:        rgba(255, 255, 255, 0.04);
    --glass-border:    rgba(255, 255, 255, 0.08);
    --glass-hover:     rgba(255, 255, 255, 0.07);

    --accent-purple:   #8b5cf6;
    --accent-blue:     #3b82f6;
    --accent-cyan:     #06b6d4;
    --accent-green:    #10b981;
    --accent-yellow:   #f59e0b;
    --accent-red:      #ef4444;
    --accent-pink:     #ec4899;

    --gradient-primary:   linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    --gradient-green:     linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-yellow:    linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-pink:      linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    --gradient-cyan:      linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --gradient-red:       linear-gradient(135deg, #ef4444 0%, #ec4899 100%);

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

    --sidebar-width:   260px;
    --topbar-height:   70px;
    --radius-sm:       8px;
    --radius-md:       14px;
    --radius-lg:       20px;
    --radius-xl:       28px;

    --shadow-glow-purple: 0 0 30px rgba(139, 92, 246, 0.2);
    --shadow-glow-blue:   0 0 30px rgba(59, 130, 246, 0.2);
    --shadow-card:        0 4px 24px rgba(0, 0, 0, 0.4);

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

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

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;
    background-image:
        radial-gradient(ellipse at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 70%);
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; }
input, textarea, select, button { font-family: inherit; }

/* ---- Layout ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: rgba(13, 13, 26, 0.95);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

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

.sidebar-logo-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.sidebar-brand {
    font-weight: 800;
    font-size: 1.05rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-version {
    font-size: .7rem;
    color: var(--text-muted);
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: .25rem;
    display: none;
    transition: color .2s;
}
.sidebar-close:hover { color: var(--text-primary); }

.sidebar-nav {
    flex: 1;
    padding: 1rem .75rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
}

.nav-section-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: .75rem .5rem .25rem;
    margin-top: .5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem .85rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: .875rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--glass-hover);
    color: var(--text-primary);
    transform: translateX(3px);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.2), rgba(59, 130, 246, 0.1));
    color: var(--text-primary);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--gradient-primary);
    border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 1.1rem; flex-shrink: 0; }

.nav-item.nav-logout { margin-top: .5rem; }
.nav-item.nav-logout:hover { background: rgba(239, 68, 68, 0.1); color: #f87171; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.admin-badge {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.admin-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.admin-name { font-size: .875rem; font-weight: 600; }
.admin-role { font-size: .7rem; color: var(--text-muted); }

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Top Bar ---- */
.topbar {
    height: var(--topbar-height);
    background: rgba(13, 13, 26, 0.8);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.hamburger {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.4rem;
    padding: .5rem;
    border-radius: 8px;
    transition: var(--transition);
    display: none;
}
.hamburger:hover { background: var(--glass-bg); color: var(--text-primary); }

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.page-breadcrumb {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: .5rem .9rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: .4rem;
}
.topbar-btn:hover { background: var(--glass-hover); color: var(--text-primary); }

.topbar-time {
    font-size: .8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ---- Page Content ---- */
.page-content {
    padding: 2rem;
    flex: 1;
}

/* ---- Cards ---- */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: var(--shadow-card);
}

.card-header {
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.card-body { padding: 1.5rem 1.75rem; }

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    opacity: 0.08;
}

.stat-card.purple::before { background: var(--accent-purple); }
.stat-card.blue::before   { background: var(--accent-blue); }
.stat-card.green::before  { background: var(--accent-green); }
.stat-card.yellow::before { background: var(--accent-yellow); }
.stat-card.cyan::before   { background: var(--accent-cyan); }
.stat-card.red::before    { background: var(--accent-red); }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: rgba(255,255,255,0.12);
}

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

.stat-card.purple .stat-icon { background: linear-gradient(135deg, rgba(139,92,246,.2), rgba(139,92,246,.05)); }
.stat-card.blue .stat-icon   { background: linear-gradient(135deg, rgba(59,130,246,.2), rgba(59,130,246,.05)); }
.stat-card.green .stat-icon  { background: linear-gradient(135deg, rgba(16,185,129,.2), rgba(16,185,129,.05)); }
.stat-card.yellow .stat-icon { background: linear-gradient(135deg, rgba(245,158,11,.2), rgba(245,158,11,.05)); }
.stat-card.cyan .stat-icon   { background: linear-gradient(135deg, rgba(6,182,212,.2), rgba(6,182,212,.05)); }
.stat-card.red .stat-icon    { background: linear-gradient(135deg, rgba(239,68,68,.2), rgba(239,68,68,.05)); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: .35rem;
}

.stat-card.purple .stat-value { color: #a78bfa; }
.stat-card.blue .stat-value   { color: #60a5fa; }
.stat-card.green .stat-value  { color: #34d399; }
.stat-card.yellow .stat-value { color: #fbbf24; }
.stat-card.cyan .stat-value   { color: #22d3ee; }
.stat-card.red .stat-value    { color: #f87171; }

.stat-label {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-trend {
    font-size: .7rem;
    margin-top: .5rem;
    display: flex;
    align-items: center;
    gap: .25rem;
}

.stat-trend.up   { color: #34d399; }
.stat-trend.down { color: #f87171; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }

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

thead th {
    padding: .85rem 1rem;
    text-align: left;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

tbody td {
    padding: .9rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text-secondary);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
    transition: background .2s;
}
tbody tr:hover { background: rgba(255,255,255,.03); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 600;
    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(139,92,246,.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(139,92,246,.4); }

.btn-success {
    background: var(--gradient-green);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16,185,129,.3);
}
.btn-success:hover { transform: translateY(-2px); }

.btn-danger {
    background: var(--gradient-red);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239,68,68,.25);
}
.btn-danger:hover { transform: translateY(-2px); }

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

.btn-sm { padding: .4rem .8rem; font-size: .78rem; }
.btn-lg { padding: .9rem 2rem; font-size: 1rem; }

.btn-icon {
    padding: .5rem;
    border-radius: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover { background: var(--glass-hover); color: var(--text-primary); }
.btn-icon.danger:hover { background: rgba(239,68,68,.1); color: #f87171; border-color: rgba(239,68,68,.3); }
.btn-icon.success:hover { background: rgba(16,185,129,.1); color: #34d399; border-color: rgba(16,185,129,.3); }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.5rem; }

.form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: .5rem;
    letter-spacing: .04em;
}

.form-control {
    width: 100%;
    padding: .8rem 1rem;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: .9rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139,92,246,.1);
    background: rgba(139,92,246,.04);
}

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

textarea.form-control { resize: vertical; min-height: 120px; }

select.form-control { cursor: pointer; }
select.form-control option { background: var(--bg-card); }

.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .35rem; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }

/* File Upload */
.file-upload-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.file-upload-zone:hover,
.file-upload-zone.drag-over {
    border-color: var(--accent-purple);
    background: rgba(139,92,246,.05);
}

.file-upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-upload-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.file-upload-text { font-size: .9rem; color: var(--text-secondary); }
.file-upload-hint { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* ---- Badges / Tags ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .7rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}

.badge-purple { background: rgba(139,92,246,.15); color: #a78bfa; border: 1px solid rgba(139,92,246,.2); }
.badge-green  { background: rgba(16,185,129,.15);  color: #34d399;  border: 1px solid rgba(16,185,129,.2); }
.badge-yellow { background: rgba(245,158,11,.15);  color: #fbbf24;  border: 1px solid rgba(245,158,11,.2); }
.badge-red    { background: rgba(239,68,68,.15);   color: #f87171;  border: 1px solid rgba(239,68,68,.2); }
.badge-blue   { background: rgba(59,130,246,.15);  color: #60a5fa;  border: 1px solid rgba(59,130,246,.2); }
.badge-cyan   { background: rgba(6,182,212,.15);   color: #22d3ee;  border: 1px solid rgba(6,182,212,.2); }

/* ---- Alerts / Flash Messages ---- */
.alert {
    padding: .9rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    border: 1px solid;
    animation: slideDown .3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert-success { background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.25); color: #34d399; }
.alert-error   { background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.25);  color: #f87171; }
.alert-info    { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.25); color: #60a5fa; }
.alert-warning { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.25); color: #fbbf24; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(.95);
    transition: var(--transition);
    box-shadow: 0 25px 60px rgba(0,0,0,.6);
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 1.05rem; font-weight: 700; }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: .25rem;
    transition: color .2s;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 1.5rem 1.75rem; }

.modal-footer {
    padding: 1rem 1.75rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
}

/* ---- Search Bar ---- */
.search-box {
    position: relative;
    max-width: 320px;
}

.search-icon {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: .9rem;
}

.search-input {
    width: 100%;
    padding: .65rem 1rem .65rem 2.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: .875rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    border-color: var(--accent-purple);
    background: rgba(139,92,246,.04);
}

/* ---- Activity List ---- */
.activity-list { display: flex; flex-direction: column; gap: .75rem; }

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: .85rem;
    background: rgba(255,255,255,.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.activity-item:hover { background: rgba(255,255,255,.04); }

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.activity-text { font-size: .875rem; color: var(--text-secondary); }
.activity-time { font-size: .72rem; color: var(--text-muted); margin-top: .2rem; }

/* ---- Charts ---- */
.chart-wrap { position: relative; height: 220px; }

/* ---- Dashboard Grid ---- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-grid .card-full { grid-column: 1 / -1; }

/* ---- File Grid ---- */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.file-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.file-card:hover { border-color: var(--accent-purple); transform: translateY(-3px); }

.file-card img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: .75rem;
}

.file-name {
    font-size: .78rem;
    color: var(--text-secondary);
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.file-card .file-delete {
    position: absolute;
    top: .5rem;
    right: .5rem;
    background: rgba(239,68,68,.9);
    border: none;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: .75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-card:hover .file-delete { opacity: 1; }

.file-icon-large { font-size: 3rem; margin-bottom: .5rem; }

/* ---- Settings ---- */
.settings-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.settings-section-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: .65rem;
    font-weight: 700;
    font-size: .95rem;
}

.settings-section-body { padding: 1.75rem; }

/* ---- Thumbnail Preview ---- */
.thumb-preview {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-top: .75rem;
    border: 1px solid var(--glass-border);
    display: none;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        left: calc(-1 * var(--sidebar-width));
    }
    .sidebar.open { left: 0; box-shadow: 4px 0 40px rgba(0,0,0,.5); }
    .sidebar-close { display: block; }
    .main-content { margin-left: 0; }
    .hamburger { display: flex; }
    .page-content { padding: 1rem; }
    .topbar { padding: 0 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .topbar-time { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}

/* ---- Overlay (mobile sidebar) ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
}

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

/* ---- Loading Spinner ---- */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Thumbnail in table ---- */
.table-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    gap: .4rem;
    margin-top: 1.5rem;
}

.page-btn {
    padding: .45rem .8rem;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 500;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.page-btn:hover, .page-btn.current {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}

/* ---- Toggle Switch ---- */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255,255,255,.1);
    border-radius: 999px;
    transition: .4s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: .4s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent-purple); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }

/* ---- Particles canvas ---- */
#particles-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .3;
}

/* Fix for gradient text invisibility during edit */
[contenteditable="true"]:focus {
    -webkit-text-fill-color: #fff !important;
    color: #fff !important;
}
