:root, [data-theme="light"] {
    --bg: #eef2f7; --surface: #ffffff; --surface2: #f7f9fc;
    --text: #0f172a; --muted: #64748b; --border: #dbe3ee;
    --primary: #2563eb; --primary-glow: rgba(37,99,235,.25);
    --danger: #ef4444; --success: #10b981; --warning: #f59e0b; --purple: #64748b;
    --sidebar: #0f172a; --sidebar-text: #cbd5e1; --sidebar-active: #1e293b;
    --radius: 14px; --shadow: 0 10px 40px rgba(15,23,42,.08);
    --font: 'Manrope', 'Segoe UI', sans-serif;
    --display: 'Sora', 'Manrope', sans-serif;
}
[data-theme="dark"] {
    --bg: #0b1220; --surface: #111827; --surface2: #0f172a;
    --text: #f8fafc; --muted: #94a3b8; --border: rgba(255,255,255,.08);
    --primary: #3b82f6; --primary-glow: rgba(59,130,246,.3);
    --sidebar: #070d18; --sidebar-text: #94a3b8; --sidebar-active: #111827;
    --shadow: 0 10px 40px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
}
body.app-shell {
    background:
        radial-gradient(900px 420px at 12% -8%, rgba(37, 99, 235, .18), transparent 55%),
        radial-gradient(700px 360px at 88% 0%, rgba(16, 185, 129, .1), transparent 50%),
        var(--bg);
}
[data-theme="light"] body.app-shell {
    background:
        radial-gradient(900px 420px at 10% -10%, rgba(59, 130, 246, .12), transparent 55%),
        radial-gradient(700px 360px at 90% 0%, rgba(16, 185, 129, .07), transparent 50%),
        var(--bg);
}

/* ——— Login ——— */
.login-body { min-height: 100vh; position: relative; overflow: hidden; }
.login-bg {
    position: fixed; inset: 0; z-index: 0;
    background:
        radial-gradient(circle at 18% 18%, rgba(37,99,235,.45) 0%, transparent 42%),
        radial-gradient(circle at 82% 72%, rgba(16,185,129,.22) 0%, transparent 38%),
        linear-gradient(135deg, #070d18, #0f172a);
}
.login-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.login-card.modern {
    width: 100%; max-width: 480px;
    background: rgba(17,24,39,.92);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 22px;
    padding: 1.85rem;
    backdrop-filter: blur(18px);
    box-shadow: 0 25px 60px rgba(0,0,0,.45);
    color: #f8fafc;
    animation: panelFade .35s ease;
}
.login-brand { text-align: center; margin-bottom: 1rem; }
.login-logo { font-size: 2.5rem; margin-bottom: .25rem; }
.login-card h1 {
    margin: 0;
    font-size: 1.55rem;
    font-family: var(--display);
    letter-spacing: -.03em;
}
.subtitle { color: #94a3b8; margin: .35rem 0 0; font-size: .9rem; }
.security-banner { border-radius: 12px; padding: .85rem 1rem; margin: 1rem 0; font-size: .82rem; line-height: 1.45; }
.security-banner.warn { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.35); color: #fde68a; }
.security-banner p { margin: .35rem 0 0; }
.ip-panel { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .82rem; }
.ip-row { display: flex; justify-content: space-between; gap: .75rem; padding: .25rem 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.ip-row:last-child { border-bottom: none; }
.ip-row code { color: #93c5fd; font-weight: 700; }
.vpn-flag { margin-top: .5rem; color: #fca5a5; font-size: .78rem; }
.text-danger { color: #f87171; }
.login-form label { display: block; font-size: .78rem; color: #94a3b8; margin: .5rem 0 .25rem; }
.login-footer { text-align: center; font-size: .72rem; color: #64748b; margin-top: 1rem; }

/* ——— App shell ——— */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 272px;
    background: linear-gradient(180deg, rgba(7,13,24,.96), rgba(11,18,32,.98));
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
    backdrop-filter: blur(12px);
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.35rem 1.1rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-icon { font-size: 1.5rem; }
.sidebar-brand strong { display: block; color: #fff; font-family: var(--display); letter-spacing: -.02em; }
.sidebar-brand small { color: #64748b; font-size: .72rem; }
.sidebar-nav { flex: 1; padding: .85rem .6rem; overflow-y: auto; }
.nav-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .7rem .9rem; margin-bottom: .18rem;
    border-radius: 12px; color: var(--sidebar-text);
    text-decoration: none; font-size: .88rem; font-weight: 600; transition: .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(59,130,246,.22), rgba(59,130,246,.08));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--primary);
}
.nav-icon { width: 1.25rem; text-align: center; }
.nav-icon svg { width: 1.1rem; height: 1.1rem; }
.sidebar-foot { padding: 1rem; border-top: 1px solid rgba(255,255,255,.06); }
.staff-chip { display: flex; gap: .65rem; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; background: transparent; }
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(17,24,39,.72);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 5;
    backdrop-filter: blur(14px);
}
[data-theme="light"] .topbar { background: rgba(255,255,255,.82); }
.topbar-title { display: flex; align-items: center; gap: .65rem; }
.topbar-title h1 { margin: 0; font-size: 1.1rem; font-family: var(--display); letter-spacing: -.02em; }
.page-icon { font-size: 1.35rem; }
.page-icon svg { width: 1.1rem; height: 1.1rem; }
.topbar-actions { display: flex; gap: .5rem; align-items: center; }
.content { padding: 1.5rem 1.6rem 2.5rem; max-width: 1400px; width: 100%; animation: panelFade .35s ease; }
@keyframes panelFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

/* ——— Components ——— */
.page-header { margin-bottom: 1.1rem; }
.page-header.flex-between { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.card {
    background: rgba(17,24,39,.78);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.2rem 1.3rem;
    margin-bottom: 1rem;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
}
[data-theme="light"] .card { background: rgba(255,255,255,.92); box-shadow: 0 10px 30px rgba(15,23,42,.06); }
.card.highlight { border-color: var(--primary); background: linear-gradient(135deg, var(--surface), var(--surface2)); }
.card h3 { font-family: var(--display); font-size: 1.02rem; margin: 0 0 .85rem; letter-spacing: -.01em; }
.form-card { max-width: 640px; }
.stats-grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.stats-grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stats-grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat-card { border-radius: var(--radius); padding: 1.1rem 1.2rem; color: #fff; position: relative; overflow: hidden; }
.stat-card.gradient-blue { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.stat-card.gradient-green { background: linear-gradient(135deg, #10b981, #059669); }
.stat-card.gradient-purple { background: linear-gradient(135deg, #334155, #1e293b); }
.stat-card.gradient-slate { background: linear-gradient(135deg, #475569, #334155); }
.stat-card.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.stat-card.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1.1; font-family: var(--display); }
.stat-label { font-size: .82rem; opacity: .92; margin-top: .25rem; }
.mini-card {
    background: rgba(17,24,39,.72);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
[data-theme="light"] .mini-card { background: rgba(255,255,255,.95); }
.mini-icon { font-size: 1.35rem; }
.mini-card strong { display: block; font-size: 1.15rem; font-family: var(--display); }
.mini-card small { color: var(--muted); font-size: .75rem; }
.revenue-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .75rem; }
.revenue-grid strong { display: block; font-size: 1.1rem; color: var(--primary); }
.status-list { list-style: none; padding: 0; margin: 0; }
.status-list li { padding: .45rem 0; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .5rem; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .5rem; }
.feature-item { background: var(--surface2); border-radius: 8px; padding: .55rem .75rem; font-size: .85rem; }
.big-num { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.input, .textarea, select.input { width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface2); color: var(--text); margin-bottom: .65rem; font-size: .92rem; }
.input:focus { outline: 2px solid var(--primary-glow); border-color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: .55rem 1rem; border: none; border-radius: 10px; cursor: pointer; font-weight: 600; background: var(--border); color: var(--text); text-decoration: none; font-size: .88rem; transition: .15s; }
.btn:hover { filter: brightness(1.05); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-glow { box-shadow: 0 8px 24px var(--primary-glow); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--border); }
.btn-sm { padding: .35rem .65rem; font-size: .78rem; }
.full { width: 100%; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table-wrap.scroll-x { overflow-x: scroll; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th, td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface2); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:hover td { background: rgba(37,99,235,.03); }
.badge { padding: .2rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700; text-transform: capitalize; white-space: nowrap; }
.badge-premiumplus { background: #ede9fe; color: #5b21b6; }
.badge-free { background: #f1f5f9; color: #475569; }
.badge-active, .badge-approved { background: #d1fae5; color: #065f46; }
.badge-inactive, .badge-pending { background: #fef3c7; color: #92400e; }
.badge-banned, .badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-deleted { background: #fecaca; color: #7f1d1d; }
.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .88rem; }
.alert.ok { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert.err { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.hint, .muted { color: var(--muted); font-size: .88rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.search-form { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search-form .input { margin: 0; flex: 1; }
.stack-form { margin-bottom: .75rem; }
.bar-chart { display: flex; align-items: flex-end; gap: .5rem; height: 120px; padding-top: 1rem; }
.bar-chart.tall { height: 180px; }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .25rem; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 44px; background: var(--primary); border-radius: 6px 6px 0 0; min-height: 4px; }
.bar.green { background: var(--success); }
.bar-item small { font-size: .65rem; color: var(--muted); }
.perm-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.perm-row strong { min-width: 140px; }
table.matrix td.yes { color: var(--success); text-align: center; }
table.matrix td.no { color: var(--muted); text-align: center; }
.filter-tabs { display: flex; gap: .35rem; flex-wrap: wrap; }
.filter-tabs a { padding: .35rem .75rem; border-radius: 999px; text-decoration: none; font-size: .78rem; background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.filter-tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.code-pill { background: var(--surface2); padding: .2rem .55rem; border-radius: 6px; font-weight: 700; letter-spacing: .08em; }
.inline-form { display: inline-flex; gap: .25rem; }
label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .25rem; font-weight: 600; }

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; }
    .sidebar-nav { display: flex; flex-wrap: wrap; gap: .25rem; padding: .5rem; }
    .nav-item { padding: .45rem .65rem; font-size: .78rem; }
    .sidebar-foot { display: none; }
}

/* ——— 2026 refresh ——— */
.btn-icon { width: 2.25rem; height: 2.25rem; padding: 0; border-radius: 10px; }
.btn-icon svg { width: 1rem; height: 1rem; }
.topbar-actions .btn { box-shadow: none; }
.topbar { border-bottom: 1px solid color-mix(in srgb, var(--border) 85%, transparent); }
.content { max-width: 1500px; }
.card { background: var(--surface); border: 1px solid var(--border); }
.nav-item.active { box-shadow: inset 3px 0 0 var(--primary); }

.login-tools { display: flex; justify-content: flex-end; gap: .4rem; margin-bottom: .75rem; }
.chip { display: inline-flex; align-items: center; justify-content: center; padding: .3rem .6rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); color: #e2e8f0; text-decoration: none; font-size: .72rem; background: rgba(255,255,255,.06); }
html[data-theme="light"] .chip { color: #0f172a; background: #eef2f7; border-color: #dbe3ee; }
