/* ==========================================================================
   BR MODS // PREMIUM DESIGN LAYER + DAY & NIGHT MODE
   Loaded last on every page. Night mode keeps the original cyber look;
   Day mode is driven entirely by the --lm-* variables defined below, which
   the base stylesheets fall back from when they are not set.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ACCENT RGB CHANNELS (lets every accent-tinted surface follow the theme)
   -------------------------------------------------------------------------- */
:root,
[data-theme="cyan"]    { --primary-rgb: 0, 242, 254;   --accent-rgb: 79, 172, 254; }
[data-theme="purple"]  { --primary-rgb: 192, 132, 252; --accent-rgb: 232, 121, 249; }
[data-theme="emerald"] { --primary-rgb: 0, 230, 118;   --accent-rgb: 0, 176, 255; }
[data-theme="gold"]    { --primary-rgb: 255, 215, 0;   --accent-rgb: 255, 145, 0; }

:root {
    --chart-gap: #0e131f;
    --chart-tip-bg: rgba(10, 14, 23, 0.95);
    --chart-tip-title: #ffffff;
    --chart-tip-body: #91a0b8;
    --chart-tip-border: rgba(255, 255, 255, 0.15);
    --focus-ring: 0 0 0 3px rgba(var(--primary-rgb), 0.35);
}

/* --------------------------------------------------------------------------
   2. DAY MODE TOKENS
   -------------------------------------------------------------------------- */
html[data-mode="light"] {
    /* neutral channels the converted stylesheets read */
    --lm-ink: 15, 23, 42;
    --lm-well: 100, 116, 139;
    --lm-well-k: 0.32;
    --lm-surface: 255, 255, 255;
    --lm-surface-solid: #ffffff;
    --lm-shadow: 30, 41, 59;
    --lm-shadow-k: 0.16;

    /* text */
    --lm-text: #0f172a;
    --lm-muted: #475569;
    --lm-dim: #64748b;

    /* readable "ink" versions of the neon colours */
    --lm-primary-ink: #0891b2;
    --lm-accent-ink: #2563eb;
    --lm-gold-ink: #a16207;
    --lm-gold-ink-rgb: 161, 98, 7;
    --lm-success-ink: #059669;
    --lm-success-ink-rgb: 5, 150, 105;
    --lm-danger-ink: #dc2626;
    --lm-danger-ink-rgb: 220, 38, 38;
    --lm-warning-ink: #c2410c;
    --lm-warning-ink-rgb: 194, 65, 12;
    --lm-violet-ink: #7c3aed;
    --lm-violet-ink-rgb: 124, 58, 237;
    --lm-silver-ink: #475569;

    /* Page-local variable names used by the login / reset / landing pages
       (harmless elsewhere) so those pages theme correctly in Day mode */
    --text-title: #0f172a;
    --text-body: #1e293b;
    --bg-deep: #eef1f7;
    --card-glass: rgba(255, 255, 255, 0.92);
    --card-border: rgba(15, 23, 42, 0.10);
    --card-border-glow: rgba(8, 145, 178, 0.40);
    --cf-ink: #334155;

    /* base design-system tokens */
    --bg-dark: #f4f6fb;
    --bg-deep: #eef1f7;
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-card-hover: #ffffff;
    --bg-input: #f8fafc;
    --card-glass: rgba(255, 255, 255, 0.9);
    --border-color: rgba(15, 23, 42, 0.09);
    --border-highlight: rgba(15, 23, 42, 0.18);
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;
    --primary-dim: rgba(var(--primary-rgb), 0.12);
    --primary-glow: rgba(var(--primary-rgb), 0.28);
    --accent-glow: rgba(var(--accent-rgb), 0.25);
    --success-glow: rgba(0, 230, 118, 0.22);
    --warning-glow: rgba(255, 179, 0, 0.22);
    --danger-glow: rgba(255, 23, 68, 0.22);
    --gold-glow: rgba(255, 215, 0, 0.25);
    --glass-blur: blur(18px);
    --card-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 8px 24px -8px rgba(15, 23, 42, 0.12),
        0 0 0 1px rgba(15, 23, 42, 0.06);
    --btn-3d-shadow: 0 2px 0 rgba(15, 23, 42, 0.08), 0 6px 14px rgba(15, 23, 42, 0.1);

    /* Neon accents become deep, legible "ink" tones on white */
    --primary: #0891b2;
    --primary-rgb: 8, 145, 178;
    --accent: #2563eb;
    --accent-rgb: 37, 99, 235;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --gold: #a16207;
    --neon-purple: #7c3aed;
    --lm-darken: 42%;

    --chart-gap: #ffffff;
    --chart-tip-bg: rgba(255, 255, 255, 0.98);
    --chart-tip-title: #0f172a;
    --chart-tip-body: #475569;
    --chart-tip-border: rgba(15, 23, 42, 0.12);

    color-scheme: light;
}

html[data-mode="light"][data-theme="purple"] {
    --primary: #7c3aed; --primary-rgb: 124, 58, 237; --accent: #c026d3; --accent-rgb: 192, 38, 211;
    --lm-primary-ink: #7c3aed; --lm-accent-ink: #a21caf;
}
html[data-mode="light"][data-theme="emerald"] {
    --primary: #059669; --primary-rgb: 5, 150, 105; --accent: #0284c7; --accent-rgb: 2, 132, 199;
    --lm-primary-ink: #047857; --lm-accent-ink: #0369a1;
}
html[data-mode="light"][data-theme="gold"] {
    --primary: #b45309; --primary-rgb: 180, 83, 9; --accent: #c2410c; --accent-rgb: 194, 65, 12;
    --lm-primary-ink: #a16207; --lm-accent-ink: #c2410c;
}

/* --------------------------------------------------------------------------
   3. DAY / NIGHT TOGGLE
   -------------------------------------------------------------------------- */
.daynight-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    padding: 0 14px 0 5px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(var(--lm-well, 0, 0, 0), calc(0.35 * var(--lm-well-k, 1)));
    color: var(--text-main);
    font: 700 12px/1 'Outfit', sans-serif;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.daynight-toggle:hover { border-color: rgba(var(--primary-rgb), 0.55); }
.daynight-toggle:active { transform: scale(0.97); }
.daynight-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.daynight-toggle-track {
    position: relative;
    width: 52px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, #1e2a4a, #0b1124);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    flex-shrink: 0;
    transition: background 0.35s ease;
}
/* tiny stars on the night track */
.daynight-toggle-track::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1.2px 1.2px at 32px 8px, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 40px 19px, #cbd5e1 50%, transparent 51%),
        radial-gradient(1px 1px at 26px 21px, #94a3b8 50%, transparent 51%);
    transition: opacity 0.3s ease;
}
.daynight-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #e2e8f0, #94a3b8);
    color: #1e293b;
    font-size: 11px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.35s ease, color 0.35s ease;
}
.daynight-toggle-thumb i { position: absolute; transition: opacity 0.25s ease, transform 0.35s ease; }
.daynight-icon-day { opacity: 0; transform: rotate(-90deg) scale(0.6); }
.daynight-icon-night { opacity: 1; }

html[data-mode="light"] .daynight-toggle-track {
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    box-shadow: inset 0 1px 3px rgba(2, 132, 199, 0.4);
}
html[data-mode="light"] .daynight-toggle-track::before { opacity: 0; }
html[data-mode="light"] .daynight-toggle-thumb {
    transform: translateX(22px);
    background: linear-gradient(145deg, #fde68a, #f59e0b);
    color: #7c2d12;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.55);
}
html[data-mode="light"] .daynight-icon-day { opacity: 1; transform: none; }
html[data-mode="light"] .daynight-icon-night { opacity: 0; transform: rotate(90deg) scale(0.6); }

.daynight-toggle--floating {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    background: rgba(var(--lm-surface, 10, 14, 23), 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px rgba(var(--lm-shadow, 0, 0, 0), calc(0.45 * var(--lm-shadow-k, 1)));
}

@media (max-width: 768px) {
    .daynight-toggle { padding: 0 5px; height: 38px; }
    .daynight-toggle-label { display: none; }
    .daynight-toggle--floating { top: 12px; right: 12px; }
}

/* --------------------------------------------------------------------------
   4. PREMIUM POLISH (BOTH MODES)
   -------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
::selection { background: rgba(var(--primary-rgb), 0.3); color: inherit; }

/* Keyboard focus that is visible but never noisy for mouse users */
:where(button, a, [tabindex]:not(input):not(select):not(textarea)):focus-visible {
    outline: 2px solid rgba(var(--primary-rgb), 0.75);
    outline-offset: 2px;
}
:is(input, select, textarea),
:is(input, select, textarea):focus,
:is(input, select, textarea):focus-visible {
    outline: none !important;
}

/* Numbers that update live should not jitter */
.font-mono, .stat-value, .kpi-value, #liveTime, [id$="Count"], [id^="stat"] {
    font-variant-numeric: tabular-nums;
}

/* Slim, theme-aware scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(var(--lm-ink, 255, 255, 255), 0.18) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(var(--lm-ink, 255, 255, 255), 0.16);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(var(--primary-rgb), 0.55); }

/* Topbar title never collides with the actions on narrower desktops */
.topbar { gap: 18px; }
.topbar-left { min-width: 0; flex: 1 1 auto; }
.page-title-group { min-width: 0; }
.page-title-group h1,
.page-title-group .subtitle {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.page-title-group h1 { line-height: 1.25; padding-bottom: 1px; }
.topbar-right { flex-shrink: 0; }
/* Make room for the Day/Night switch so actions never spill off-screen */
@media (max-width: 1500px) {
    .daynight-toggle { padding: 0 5px; }
    .daynight-toggle-label { display: none; }
}
@media (max-width: 1380px) {
    .topbar-right .clock-display { display: none; }
    .topbar-right { gap: 10px; }
}
@media (max-width: 1180px) {
    .page-title-group .subtitle { display: none; }
    #topCreateKeyBtn > span { display: none; }
    #topCreateKeyBtn { padding-left: 14px; padding-right: 14px; }
}

/* Phone bottom nav: 9 reseller tabs no longer get pushed off-screen —
   items fill the bar when they fit and swipe horizontally when they don't */
.mobile-bottom-nav {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.mobile-bottom-nav::-webkit-scrollbar { display: none; }
.mobile-nav-item {
    flex: 1 0 auto;
    min-width: 62px;
    padding-left: 6px;
    padding-right: 6px;
    scroll-snap-align: center;
}

/* Buttons feel tactile */
.btn, .btn-3d { transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.btn:active:not(:disabled), .btn-3d:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled, button:disabled { cursor: not-allowed; }

/* Respect users who disable motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    #cyberParticlesCanvas { display: none; }
}

/* --------------------------------------------------------------------------
   5. DAY MODE — COMPONENT TREATMENT
   -------------------------------------------------------------------------- */
html[data-mode="light"] body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(1200px 600px at 0% -10%, rgba(var(--primary-rgb), 0.10), transparent 60%),
        radial-gradient(900px 500px at 100% 110%, rgba(var(--accent-rgb), 0.09), transparent 60%);
    background-attachment: fixed;
    color: var(--text-main);
}
html[data-mode="light"] .ambient-glow { opacity: 0.12; filter: blur(170px); }
html[data-mode="light"] .glow-2 { background: #a78bfa; }
html[data-mode="light"] .cyber-grid { opacity: 0.55; }
html[data-mode="light"] #cyberParticlesCanvas { opacity: 0.55; }
html[data-mode="light"] .card-glass-layer { display: none; }

/* Glow-heavy text shadows read as blur on white — flatten them */
html[data-mode="light"] .brand-br,
html[data-mode="light"] .brand-mods,
html[data-mode="light"] h1, html[data-mode="light"] h2, html[data-mode="light"] h3,
html[data-mode="light"] h4, html[data-mode="light"] h5,
html[data-mode="light"] [class*="text-"],
html[data-mode="light"] [class*="value"],
html[data-mode="light"] [class*="title"] {
    text-shadow: none !important;
}

/* White gradient headings -> deep slate gradients */
html[data-mode="light"] .page-title-group h1,
html[data-mode="light"] .portal-title {
    background: linear-gradient(135deg, #0f172a, #334155);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
html[data-mode="light"] .hud-title-text h2 {
    background: linear-gradient(90deg, #0f172a 0%, #334155 60%, #64748b 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}
html[data-mode="light"] .vault-title-section h2 {
    background: linear-gradient(135deg, #0f172a 15%, #a16207 65%, #c2410c 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
}

/* Surfaces */
html[data-mode="light"] .sidebar {
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 1px 0 0 rgba(15, 23, 42, 0.06), 12px 0 32px -18px rgba(15, 23, 42, 0.18);
}
html[data-mode="light"] .topbar {
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 10px 30px -20px rgba(15, 23, 42, 0.25);
}
html[data-mode="light"] .card-3d,
html[data-mode="light"] .panel-card {
    background: var(--bg-card);
}
html[data-mode="light"] .card-3d:hover {
    border-color: rgba(var(--primary-rgb), 0.35);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.06),
        0 14px 34px -10px rgba(15, 23, 42, 0.18),
        0 0 0 1px rgba(var(--primary-rgb), 0.18);
}

/* Navigation */
html[data-mode="light"] .nav-item { color: #334155; }
html[data-mode="light"] .nav-item:hover { color: #0f172a; background: rgba(15, 23, 42, 0.04); }
html[data-mode="light"] .nav-item.active {
    color: var(--lm-primary-ink);
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.16), rgba(var(--primary-rgb), 0.03));
}
html[data-mode="light"] .nav-item.active i { color: var(--lm-primary-ink); }
html[data-mode="light"] .nav-section-title { color: #64748b; }

/* Text utility colours need darker inks on white */
html[data-mode="light"] .text-accent,
html[data-mode="light"] .text-primary  { color: var(--lm-primary-ink) !important; }
html[data-mode="light"] .text-gold     { color: var(--lm-gold-ink) !important; }
html[data-mode="light"] .text-success  { color: var(--lm-success-ink) !important; }
html[data-mode="light"] .text-danger   { color: var(--lm-danger-ink) !important; }
html[data-mode="light"] .text-warning  { color: var(--lm-warning-ink) !important; }
html[data-mode="light"] .text-muted    { color: var(--lm-muted) !important; }
html[data-mode="light"] .text-white    { color: var(--lm-text) !important; }

/* Buttons: keep white labels on saturated fills */
html[data-mode="light"] .btn-danger,
html[data-mode="light"] .btn-success,
html[data-mode="light"] .btn-purple,
html[data-mode="light"] .btn-violet { color: #ffffff; }
html[data-mode="light"] .btn-secondary {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
html[data-mode="light"] .btn-secondary:hover { border-color: rgba(var(--primary-rgb), 0.5); color: var(--lm-primary-ink); }
html[data-mode="light"] .btn-icon:not(.btn-danger):not(.btn-primary):not(.btn-success) { color: #334155; }
html[data-mode="light"] .btn-icon.btn-danger { color: #ffffff; }

/* Forms */
html[data-mode="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
html[data-mode="light"] select,
html[data-mode="light"] textarea {
    color: #0f172a;
}
html[data-mode="light"] input::placeholder,
html[data-mode="light"] textarea::placeholder { color: #94a3b8; opacity: 1; }
html[data-mode="light"] select option { background: #ffffff; color: #0f172a; }
html[data-mode="light"] input:-webkit-autofill,
html[data-mode="light"] input:-webkit-autofill:hover,
html[data-mode="light"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a !important;
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
    box-shadow: 0 0 0 1000px #f8fafc inset !important;
    caret-color: #0f172a;
}

/* Tables */
html[data-mode="light"] table th { color: #475569; }
html[data-mode="light"] table td { color: #1e293b; }
html[data-mode="light"] tbody tr:hover { background: rgba(var(--primary-rgb), 0.05); }

/* Leaderboard contender ranks use per-seller neon accents */
html[data-mode="light"] .contender-rank {
    color: color-mix(in srgb, var(--contender-accent, var(--primary)), #000 42%) !important;
}

/* Code / mono chips */
html[data-mode="light"] code,
html[data-mode="light"] pre { color: #0f172a; }

/* Modal backdrops stay dimmed (not white) in Day mode */
html[data-mode="light"] .modal-overlay,
html[data-mode="light"] .modal-backdrop,
html[data-mode="light"] .drawer-overlay,
html[data-mode="light"] .sidebar-backdrop {
    background: rgba(15, 23, 42, 0.45) !important;
}

/* --------------------------------------------------------------------------
   6. PREMIUM COMPONENT UPGRADES (BOTH MODES)
   -------------------------------------------------------------------------- */

/* Accent top-edge on stat / KPI cards */
.stat-card, .kpi-card, .card-3d {
    position: relative;
    overflow: hidden;
}
.stat-card::before, .kpi-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent, var(--primary)));
    opacity: 0.85;
    z-index: 2;
}

/* Active nav indicator bar */
.nav-item { position: relative; }
.nav-item.active::after {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    box-shadow: 0 0 10px rgba(var(--primary-rgb), 0.55);
}

/* Button lift on hover */
.btn-3d:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--btn-3d-shadow, 0 4px 12px rgba(0,0,0,0.2));
}

/* Shimmer progress bars */
.progress-bar {
    position: relative;
    overflow: hidden;
}
.progress-bar::after {
    content: "";
    position: absolute;
    top: 0; left: -100%; bottom: 0;
    width: 60%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    animation: progressShimmer 2.8s ease-in-out infinite;
}
@keyframes progressShimmer {
    0%   { left: -60%; }
    100% { left: 160%; }
}

/* Card subtle lift on hover */
.card-3d {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-3d:hover {
    transform: translateY(-3px);
}

/* Badge / chip polish */
.badge, .status-badge, .chip {
    transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.badge:hover, .status-badge:hover, .chip:hover {
    transform: scale(1.04);
}

/* Tooltip styling */
[data-tooltip]::after,
.tooltip-text {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* --------------------------------------------------------------------------
   7. ENTRANCE CHOREOGRAPHY
   -------------------------------------------------------------------------- */
@keyframes br-rise {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.stat-card, .kpi-card, .panel-card, .card-3d,
.hud-header, table, .chart-container {
    animation: br-rise 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stat-card:nth-child(1), .kpi-card:nth-child(1) { animation-delay: 0.04s; }
.stat-card:nth-child(2), .kpi-card:nth-child(2) { animation-delay: 0.10s; }
.stat-card:nth-child(3), .kpi-card:nth-child(3) { animation-delay: 0.16s; }
.stat-card:nth-child(4), .kpi-card:nth-child(4) { animation-delay: 0.22s; }
.stat-card:nth-child(5), .kpi-card:nth-child(5) { animation-delay: 0.28s; }
.stat-card:nth-child(6), .kpi-card:nth-child(6) { animation-delay: 0.34s; }
.panel-card { animation-delay: 0.12s; }
table { animation-delay: 0.18s; }
.chart-container { animation-delay: 0.22s; }

/* Sidebar nav items stagger in from the left */
@keyframes nav-slide {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: none; }
}
.nav-item {
    animation: nav-slide 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.nav-item:nth-child(1) { animation-delay: 0.06s; }
.nav-item:nth-child(2) { animation-delay: 0.10s; }
.nav-item:nth-child(3) { animation-delay: 0.14s; }
.nav-item:nth-child(4) { animation-delay: 0.18s; }
.nav-item:nth-child(5) { animation-delay: 0.22s; }
.nav-item:nth-child(6) { animation-delay: 0.26s; }
.nav-item:nth-child(7) { animation-delay: 0.30s; }
.nav-item:nth-child(8) { animation-delay: 0.34s; }
.nav-item:nth-child(9) { animation-delay: 0.38s; }

/* Tab content fade in */
@keyframes tab-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.tab-content, .section-body, .content-area {
    animation: tab-fade 0.3s ease both;
}

/* Smooth transition on tab switches */
.stat-card, .kpi-card, .panel-card, .card-3d,
table, .chart-container, .hud-header {
    will-change: opacity, transform;
}

/* --------------------------------------------------------------------------
   8. KEYAUTH-STYLE LICENSE MANAGER
   -------------------------------------------------------------------------- */
.keyauth-create-panel {
    padding: 20px 22px;
    margin-bottom: 20px;
    border-radius: 16px;
}
.kap-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.kap-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.kap-title-icon {
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    flex-shrink: 0;
    border-radius: 12px;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--accent, var(--primary)));
    box-shadow: 0 6px 18px -6px rgba(var(--primary-rgb), 0.6);
}
.kap-title h3 { margin: 0; font: 800 17px/1.2 'Outfit', sans-serif; letter-spacing: 0.2px; }
.kap-title p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }

.kap-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px 16px;
    align-items: end;
}
.kap-field { display: flex; flex-direction: column; gap: 6px; grid-column: span 2; min-width: 0; }
.kap-field > label {
    font: 700 10.5px/1 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
}
.kap-tier-field { grid-column: span 3; }
.kap-field.kap-grow { grid-column: span 5; }
.kap-field.kap-submit { grid-column: span 2; }
.kap-field.kap-submit .btn { width: 100%; height: 44px; font-weight: 700; }
.kap-tier { display: flex; gap: 8px; }
.kap-tier .mode-toggle { flex: 1; }
.kap-grid .form-control { height: 44px; }

@media (max-width: 1200px) {
    .kap-field { grid-column: span 3; }
    .kap-tier-field { grid-column: span 6; }
    .kap-field.kap-grow { grid-column: span 6; }
    .kap-field.kap-submit { grid-column: span 6; }
}
@media (max-width: 680px) {
    .kap-field, .kap-tier-field, .kap-field.kap-grow, .kap-field.kap-submit { grid-column: span 12; }
}

/* --------------------------------------------------------------------------
   9. DASHBOARD — RECENT LICENSES WIDGET
   -------------------------------------------------------------------------- */
.recent-licenses-card { margin-top: 4px; }
.recent-licenses-list { display: flex; flex-direction: column; gap: 2px; }
.recent-lic-row {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.3fr) 56px 96px;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    transition: background-color 0.15s ease;
}
.recent-lic-row:hover { background: rgba(var(--primary-rgb), 0.06); }
.recent-lic-row + .recent-lic-row { border-top: 1px solid var(--border-color); }
.rl-key { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rl-key code {
    font: 600 13px/1 'JetBrains Mono', monospace;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.rl-dot.rl-success { background: var(--success); box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.2); }
.rl-dot.rl-warning { background: var(--warning); }
.rl-dot.rl-danger  { background: var(--danger); }
.rl-dot.rl-muted   { background: var(--text-dim); }
.rl-owner { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-days { font: 600 12px/1 'JetBrains Mono', monospace; color: var(--text-dim); text-align: right; }
.rl-status { text-align: right; }
@media (max-width: 680px) {
    .recent-lic-row { grid-template-columns: minmax(0, 1fr) 76px; }
    .rl-owner, .rl-days { display: none; }
}

/* --------------------------------------------------------------------------
   10. ULTIMATE DASHBOARD — quick metrics, trend chart, panels
   -------------------------------------------------------------------------- */
.quick-metrics-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}
.qm-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 13px;
}
.qm-icon {
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 11px;
    font-size: 15px;
    color: #fff;
}
.qm-icon.qm-primary { background: linear-gradient(135deg, var(--primary), var(--accent, var(--primary))); }
.qm-icon.qm-success { background: linear-gradient(135deg, #10b981, #059669); }
.qm-icon.qm-gold    { background: linear-gradient(135deg, #f59e0b, #d97706); }
.qm-icon.qm-violet  { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.qm-value { font: 800 20px/1 'Outfit', sans-serif; color: var(--text-main); letter-spacing: 0.2px; }
.qm-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

/* Primary row: trend (2fr) + donut (1fr) */
.analytics-primary-row {
    display: grid;
    grid-template-columns: 1.9fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.trend-panel { display: flex; flex-direction: column; }
.trend-chart-box { position: relative; flex: 1; min-height: 210px; padding: 12px 10px 4px; }

/* Status Distribution panel: center the donut + legend so there's no dead space */
html body .analytics-primary-row > .panel-card:last-child { display: flex; flex-direction: column; }
html body .analytics-primary-row > .panel-card:last-child .chart-container-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    padding: 12px 18px 16px;
    flex-wrap: wrap;
}
html body .analytics-primary-row > .panel-card:last-child .chart-canvas-box {
    width: 128px !important;
    height: 128px !important;
    flex-shrink: 0;
}
html body .analytics-primary-row > .panel-card:last-child .chart-legend-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 150px;
}
.trend-range-toggle { display: inline-flex; gap: 4px; background: rgba(var(--lm-ink, 255,255,255), 0.05); padding: 3px; border-radius: 9px; }
.trend-range-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font: 700 11px/1 'Outfit', sans-serif;
    padding: 6px 11px;
    border-radius: 7px;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}
.trend-range-btn:hover { color: var(--text-main); }
.trend-range-btn.active {
    background: rgba(var(--primary-rgb), 0.16);
    color: var(--lm-primary-ink, var(--primary));
}

/* Secondary row: 3 panels */
.analytics-secondary-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
.dash-resellers-list, .dash-expiring-list { padding: 8px 14px 14px; min-height: 180px; }
.dash-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 28px 10px; }

/* Top resellers rows */
.dash-res-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.dash-res-row + .dash-res-row { border-top: 1px solid var(--border-color); }
.res-rank {
    display: grid; place-items: center;
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 8px;
    font: 800 12px/1 'Outfit', sans-serif;
    color: #fff; background: var(--text-dim);
}
.res-rank.rank-gold   { background: linear-gradient(135deg, #fbbf24, #d97706); }
.res-rank.rank-silver { background: linear-gradient(135deg, #cbd5e1, #94a3b8); }
.res-rank.rank-bronze { background: linear-gradient(135deg, #d8a46b, #b45309); }
.res-rank.rank-std    { background: rgba(var(--primary-rgb), 0.2); color: var(--lm-primary-ink, var(--primary)); }
.res-main { flex: 1; min-width: 0; }
.res-name { font-size: 13px; font-weight: 600; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-bar { height: 5px; margin-top: 5px; border-radius: 4px; background: rgba(var(--lm-ink, 255,255,255), 0.07); overflow: hidden; }
.res-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--accent, var(--primary))); transition: width 0.5s cubic-bezier(0.22,1,0.36,1); }
.res-count { font: 700 14px/1 'JetBrains Mono', monospace; color: var(--text-main); flex-shrink: 0; }

/* Expiring soon rows */
.dash-exp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; }
.dash-exp-row + .dash-exp-row { border-top: 1px solid var(--border-color); }
.de-key { display: flex; align-items: center; gap: 9px; min-width: 0; }
.de-key code { font: 600 12.5px/1 'JetBrains Mono', monospace; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.de-left { font-size: 12px; font-weight: 700; flex-shrink: 0; }

/* Hardware insights stacked (now in a narrow column) */
.hwid-insights-stack { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 16px; }
.hwid-insights-stack .insight-metric {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0;
}
.hwid-insights-stack .insight-metric + .insight-metric { border-top: 1px solid var(--border-color); }
.hwid-insights-stack .metric-val { font: 800 20px/1 'Outfit', sans-serif; }
.hwid-insights-stack .metric-lbl { font-size: 12px; color: var(--text-muted); text-align: right; }

@media (max-width: 1100px) {
    .analytics-primary-row { grid-template-columns: 1fr; }
    .analytics-secondary-row { grid-template-columns: 1fr; }
    .quick-metrics-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .quick-metrics-strip { grid-template-columns: 1fr; }
}

/* ==========================================================================
   11. ULTIMATE PREMIUM COMPONENT LAYER  (lifts every tab at once)
   ========================================================================== */

/* --- Panels: refined surface, radius, layered depth --- */
html body .panel-card,
html body .analytics-card,
html body .generator-card,
html body .generator-preview-sidebar > .panel-card {
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow:
        0 1px 0 rgba(var(--lm-ink, 255,255,255), 0.04) inset,
        0 18px 44px -26px rgba(var(--lm-shadow, 0,0,0), calc(0.9 * var(--lm-shadow-k, 1)));
    transition: transform 0.25s cubic-bezier(.22,1,.36,1), box-shadow 0.25s ease, border-color 0.25s ease;
}

/* --- Panel headers: premium gradient wash + accent marker --- */
html body .panel-header {
    position: relative;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.06), transparent);
    border-bottom: 1px solid var(--border-color);
}
html body .panel-header > span:first-child,
html body .panel-title-wrap h3 {
    letter-spacing: 0.2px;
}

/* Icon chips inside headers get an accent tint */
html body .panel-header i.text-accent,
html body .panel-header i.text-gold,
html body .generator-header i,
html body .hud-title-text i {
    filter: drop-shadow(0 0 10px rgba(var(--primary-rgb), 0.35));
}

/* --- Big section titles → premium gradient text --- */
html body .generator-header h2,
html body .hud-title-text h2,
html body .studio-title h2 {
    background: linear-gradient(120deg, var(--text-main), color-mix(in srgb, var(--primary), var(--text-main) 35%));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.2px;
}

/* --- Inputs / selects / textareas: premium fill + focus --- */
html body .form-control,
html body input.form-control,
html body select.filter-select,
html body .search-input-box input,
html body textarea.form-control {
    border-radius: 11px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
html body .form-control:focus,
html body select.filter-select:focus,
html body .search-input-box input:focus,
html body textarea.form-control:focus {
    border-color: var(--border-highlight);
    box-shadow: none;
    outline: none;
}

/* --- Preset chips & toggles: refined active pill --- */
html body .preset-chip,
html body .smart-chip,
html body .mode-toggle,
html body .view-mode-btn {
    border-radius: 10px;
    transition: all 0.16s ease;
}
html body .preset-chip.active,
html body .mode-toggle.active {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.18), rgba(var(--primary-rgb), 0.06));
    border-color: rgba(var(--primary-rgb), 0.55);
    box-shadow: 0 2px 10px -3px rgba(var(--primary-rgb), 0.4);
}
html body .smart-chip.active {
    background: linear-gradient(135deg, var(--primary), var(--accent, var(--primary)));
    color: #fff; border-color: transparent;
    box-shadow: 0 4px 14px -4px rgba(var(--primary-rgb), 0.55);
}

/* --- KPI / stat cards: icon glow + lift --- */
html body .stat-card .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.18), rgba(var(--primary-rgb), 0.04));
    border: 1px solid rgba(var(--primary-rgb), 0.25);
    box-shadow: 0 6px 18px -8px rgba(var(--primary-rgb), 0.5);
}
html body .stat-card:hover { transform: translateY(-3px); }

/* --- Section / studio headers across tabs --- */
html body .hud-header,
html body .studio-header,
html body .vault-header {
    border-radius: 16px;
}

/* --- Buttons: premium primary sheen --- */
html body .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent, var(--primary)));
    border: none;
    box-shadow: 0 6px 18px -6px rgba(var(--primary-rgb), 0.55);
}
html body .btn-primary:hover:not(:disabled) {
    box-shadow: 0 10px 26px -6px rgba(var(--primary-rgb), 0.7);
    filter: brightness(1.05);
}

/* --- Tables: premium header + row hover --- */
html body table.table-3d thead th,
html body table thead th {
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 10.5px;
}
html body table.table-3d tbody tr { transition: background-color 0.14s ease; }

/* --- Reseller / key cards: lift + accent ring on hover --- */
html body .reseller-pro-card,
html body .key-pro-card {
    transition: transform 0.22s cubic-bezier(.22,1,.36,1), box-shadow 0.22s ease, border-color 0.22s ease;
}
html body .reseller-pro-card:hover,
html body .key-pro-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--primary-rgb), 0.4);
    box-shadow: 0 20px 44px -22px rgba(var(--primary-rgb), 0.5);
}

/* --- Scrollable/ terminal-style HUD panels get a subtle inner glow --- */
html body .hwid-command-interface,
html body .hardware-command-interface {
    box-shadow:
        0 0 0 1px var(--border-color) inset,
        0 18px 44px -26px rgba(var(--lm-shadow, 0,0,0), calc(0.9 * var(--lm-shadow-k, 1)));
}

/* ==========================================================================
   12. ULTRA-PREMIUM DESIGN SYSTEM
   premium.css loads LAST, so these !important rules override the flat
   treatment workspace.css forces (shadows, borders, hover, buttons, etc.).
   Performance: depth comes from shadows + gradients, NOT backdrop-blur;
   animations are transform/opacity only.
   ========================================================================== */

/* Richer, deeper page backdrop */
html:not([data-mode="light"]) body {
    background-color: #070a11 !important;
    background-image:
        radial-gradient(1100px 640px at -6% -10%, rgba(var(--primary-rgb), 0.16), transparent 55%),
        radial-gradient(1000px 620px at 106% 6%, rgba(var(--accent-rgb), 0.12), transparent 55%),
        radial-gradient(1000px 760px at 50% 125%, rgba(var(--primary-rgb), 0.08), transparent 60%) !important;
    background-attachment: fixed !important;
}
html[data-mode="light"] body {
    background-image:
        radial-gradient(1200px 620px at -4% -10%, rgba(var(--primary-rgb), 0.13), transparent 55%),
        radial-gradient(1000px 560px at 104% 4%, rgba(var(--accent-rgb), 0.11), transparent 58%),
        radial-gradient(1000px 720px at 50% 122%, rgba(var(--primary-rgb), 0.06), transparent 60%) !important;
    background-attachment: fixed !important;
}

/* Premium card surfaces: depth, tinted border, generous radius */
html body :is(.panel-card, .analytics-card, .generator-card, .qm-card, .stat-card,
               .keyauth-create-panel, .metric-card, .reseller-pro-card, .key-pro-card,
               .dealer-podium-card, .contender-card, .vault-card) {
    position: relative;
    border: 1px solid rgba(var(--primary-rgb), 0.15) !important;
    border-radius: 15px !important;
    box-shadow:
        inset 0 1px 0 rgba(var(--lm-ink, 255,255,255), 0.06),
        0 16px 40px -28px rgba(var(--lm-shadow, 0,0,0), calc(1.1 * var(--lm-shadow-k, 1))) !important;
    transition: transform .26s cubic-bezier(.22,1,.36,1), box-shadow .26s ease, border-color .26s ease !important;
}

/* Hover lift + accent glow (overrides workspace transform:none) */
html body :is(.panel-card, .analytics-card, .generator-card, .qm-card, .stat-card,
               .metric-card, .reseller-pro-card, .key-pro-card):hover {
    transform: translateY(-4px) !important;
    border-color: rgba(var(--primary-rgb), 0.42) !important;
    box-shadow:
        0 0 0 1px rgba(var(--primary-rgb), 0.2),
        0 30px 62px -26px rgba(var(--primary-rgb), 0.4) !important;
}

/* Bright gradient accent bar across the top of major panels */
html body :is(.panel-card, .analytics-card, .generator-card, .keyauth-create-panel)::after {
    content: "";
    position: absolute; left: 0; right: 0; top: 0; height: 2px;
    border-radius: 15px 15px 0 0;
    background: linear-gradient(90deg, transparent, rgba(var(--primary-rgb), 0.95), rgba(var(--accent-rgb), 0.75), transparent);
    opacity: .55;
    pointer-events: none;
}

/* Compact, confident KPI / metric numbers — correctly scaled at 100% zoom */
html body :is(.stat-value, .kpi-value, .metric-value) {
    font-size: 26px !important;
    font-weight: 800 !important;
    letter-spacing: -0.4px !important;
    line-height: 1.08 !important;
}
html body .stat-total .stat-value {
    background: linear-gradient(135deg, var(--text-main) 5%, var(--primary)) !important;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}
html body .qm-value { font-size: 20px !important; font-weight: 800 !important; }

/* Glowing gradient icon tiles (overrides workspace box-shadow:none / transform:none) */
html body :is(.stat-icon-wrapper, .qm-icon, .metric-icon-box) {
    box-shadow: 0 8px 22px -8px rgba(var(--primary-rgb), 0.55) !important;
}
html body .stat-icon-wrapper {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.22), rgba(var(--primary-rgb), 0.05)) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.3) !important;
    color: var(--lm-primary-ink, var(--primary)) !important;
}

/* Sidebar: premium rounded items + active gradient pill + glowing indicator */
html body .nav-item { border-radius: 11px !important; }
html body .nav-item.active {
    background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.22), rgba(var(--primary-rgb), 0.04)) !important;
    box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.22) !important;
    color: var(--lm-primary-ink, var(--primary)) !important;
}
html body .nav-item.active::after {
    content: "" !important; display: block !important;
    position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    box-shadow: 0 0 12px 1px rgba(var(--primary-rgb), 0.7);
}

/* Section headers: subtle gradient wash + confident type */
html body .panel-header {
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.05), transparent) !important;
}
html body :is(.panel-header h3, .panel-header > span:first-child, .panel-title-wrap h3) {
    font-size: 14px !important; font-weight: 700 !important;
}

/* Primary buttons: gradient fill, depth, lift (overrides workspace flat) */
html body :is(.btn-primary, #topCreateKeyBtn, .btn-portal-submit, .luxury-mint-btn) {
    background: linear-gradient(135deg, var(--primary), var(--accent, var(--primary))) !important;
    border: none !important;
    box-shadow: 0 8px 22px -8px rgba(var(--primary-rgb), 0.6) !important;
    transition: transform .16s ease, box-shadow .2s ease, filter .2s ease !important;
}
html body :is(.btn-primary, #topCreateKeyBtn, .btn-portal-submit):hover:not(:disabled) {
    transform: translateY(-2px) !important;
    filter: brightness(1.07);
    box-shadow: 0 12px 30px -8px rgba(var(--primary-rgb), 0.78) !important;
}

/* Secondary / icon buttons: subtle premium hover */
html body :is(.btn-secondary, .btn-icon):hover:not(:disabled) {
    border-color: rgba(var(--primary-rgb), 0.5) !important;
    box-shadow: 0 6px 16px -8px rgba(var(--primary-rgb), 0.4) !important;
}

/* Clean neutral input focus — NO coloured border / ring on text boxes */
html body :is(.form-control, .form-input, .filter-select, .sync-select, .search-input, textarea):focus,
html body :is(.form-control, .form-input, .filter-select, .sync-select, .search-input, textarea):focus-visible {
    border-color: var(--border-highlight) !important;
    box-shadow: none !important;
    outline: none !important;
}
/* Command palette + login capsule: drop the coloured focus glow too */
html body .luxury-input-capsule:focus-within {
    border-color: var(--border-highlight) !important;
    box-shadow: none !important;
}
html body .palette-header,
html body .palette-header input { box-shadow: none !important; }

/* Active filter / preset chips: vivid gradient pills */
html body :is(.smart-chip, .filter-chip, .page-pill-btn).active {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.95), rgba(var(--accent-rgb), 0.78)) !important;
    color: #fff !important; border-color: transparent !important;
    box-shadow: 0 4px 14px -4px rgba(var(--primary-rgb), 0.55) !important;
}
html body .preset-chip.active, html body .mode-toggle.active {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.2), rgba(var(--primary-rgb), 0.06)) !important;
    border-color: rgba(var(--primary-rgb), 0.55) !important;
    color: var(--lm-primary-ink, var(--primary)) !important;
}

/* Tables: premium uppercase header + smooth row hover */
html body table thead th {
    text-transform: uppercase; letter-spacing: 0.6px;
    background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.08), var(--bg-input)) !important;
}
html body tbody tr { transition: background-color .14s ease; }

/* Status / key badges: keep crisp, add subtle depth */
html body :is(.badge, .key-status-pill, .status-badge) {
    box-shadow: 0 2px 8px -4px rgba(var(--lm-shadow, 0,0,0), calc(0.6 * var(--lm-shadow-k, 1))) !important;
}

/* Daynight toggle: premium pill */
html body .daynight-toggle { border-radius: 999px !important; }

/* ==========================================================================
   13. PREMIUM PERSONALIZED SIDEBAR (admin + reseller)
   ========================================================================== */
html body .sidebar {
    background:
        linear-gradient(180deg, rgba(var(--primary-rgb), 0.05), transparent 220px),
        var(--bg-surface) !important;
    border-right: 1px solid var(--border-color) !important;
}
/* Brand lockup */
html body .brand-container { padding-top: 14px; padding-bottom: 6px; }
html body .brand-text h2, html body .brand-titles h1 { letter-spacing: -0.5px; }
/* Balance / app card at the top → premium accent panel */
html body .sidebar-app-card .app-card-inner,
html body .sidebar-balance-card {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.16), rgba(var(--primary-rgb), 0.03)) !important;
    border: 1px solid rgba(var(--primary-rgb), 0.22) !important;
    border-radius: 13px !important;
}
html body .app-icon-wrap {
    background: linear-gradient(135deg, var(--primary), var(--accent, var(--primary))) !important;
    color: #fff !important;
    box-shadow: 0 6px 16px -6px rgba(var(--primary-rgb), 0.6) !important;
    border: none !important;
}
/* Section labels */
html body .nav-section-title { color: var(--text-dim); letter-spacing: 1.4px; }
/* Nav hover/active already premium; refine hover tint */
html body .nav-item:hover:not(.active) { background: rgba(var(--primary-rgb), 0.08) !important; }
html body .nav-item .badge { background: rgba(var(--primary-rgb), 0.16); color: var(--lm-primary-ink, var(--primary)); }
/* Accent theme dots → crisp ring when active */
html body .theme-dot.active { outline-color: var(--primary) !important; }
/* User profile card → premium */
html body .user-profile-card {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), transparent) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 9px !important;
}
html body .user-avatar {
    background: linear-gradient(135deg, var(--primary), var(--accent, var(--primary))) !important;
    color: #fff !important;
    box-shadow: 0 5px 14px -5px rgba(var(--primary-rgb), 0.6) !important;
}

/* ==========================================================================
   14. EMPTY-STATE / SINGLE-CARD PANELS — fill the space, no dead left/right/bottom
   ========================================================================== */
/* Vertically centre lonely state cards so there is no empty top/bottom gap,
   and widen them so the side gutters shrink on large screens. */
html body :is(#ownerKeyLockedView, #ownerKeyActiveView,
               .tab-content > .cyber-vault-lockout-container,
               .single-state-wrap) {
    min-height: calc(100dvh - 190px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
html body .cyber-vault-lockout-container {
    max-width: 1040px !important;
    width: 100%;
    margin: 0 auto !important;
}
/* Claimed owner-key card + other single centred cards widen a touch */
html body #ownerKeyClaimedView > .panel-card { max-width: 1040px !important; }

/* HWID diagnostic HUD "awaiting input" empty column fills its panel height */
html body .hwid-diagnostic-hud,
html body .live-hardware-diagnostic,
html body .hardware-scanner-ready {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    flex: 1;
}

/* ==========================================================================
   15. RESELLER DASHBOARD — match the admin KPI layout (4 cards across)
   ========================================================================== */
html body #tab-reseller-dashboard .analytics-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px !important;
    margin-bottom: 14px !important;
}
html body #tab-reseller-dashboard .metric-card { padding: 14px 16px !important; min-height: 0 !important; }
html body #tab-reseller-dashboard .metric-value { font-size: 26px !important; font-weight: 800 !important; }
html body #tab-reseller-dashboard .metric-subtext { font-size: 10.5px; color: var(--text-muted); }
@media (max-width: 1100px) {
    html body #tab-reseller-dashboard .analytics-row { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
    html body #tab-reseller-dashboard .analytics-row { grid-template-columns: 1fr !important; }
}


/* ==========================================================================
   ELIMINATE NESTED INNER BORDERS & FOCUS OUTLINE BOXES IN ALL TEXTBOXES
   ========================================================================== */
html body :is(input, select, textarea) {
    outline: none !important;
}
html body :is(input, select, textarea):focus,
html body :is(input, select, textarea):focus-visible {
    outline: none !important;
}

/* Any input inside any container wrapper must NEVER have a nested inner border or box */
html body :is(.hwid-input-container, .palette-header, .luxury-input-capsule, .luxury-input-wrap, .search-input-box, .search-input-group, .input-group) :is(input, .form-control, .hwid-input-field, .portal-input, .luxury-input, [type="text"], [type="search"], [type="password"]) {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

html body :is(.hwid-input-container, .palette-header, .luxury-input-capsule, .luxury-input-wrap, .search-input-box, .search-input-group, .input-group) :is(input, .form-control, .hwid-input-field, .portal-input, .luxury-input, [type="text"], [type="search"], [type="password"]):focus,
html body :is(.hwid-input-container, .palette-header, .luxury-input-capsule, .luxury-input-wrap, .search-input-box, .search-input-group, .input-group) :is(input, .form-control, .hwid-input-field, .portal-input, .luxury-input, [type="text"], [type="search"], [type="password"]):focus-visible {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}
