/* ============================================================================
   Admin panel — theme.css
   Shared, professional visual layer for every admin page (dashboard, files,
   database, terminal, commands, login). Cosmetic only: it restyles the
   Tailwind classes the pages already use and adds motion. Loaded after the
   page's own <style>; Tailwind's runtime styles load later, so overrides of
   utility classes use !important.
   ========================================================================= */

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

:root {
    color-scheme: dark;
    --bg:          #0a0c11;
    --bg-2:        #0e1117;
    --surface:     #12161f;
    --surface-2:   #171c27;
    --surface-3:   #1e2431;
    --line:        rgba(255, 255, 255, 0.07);
    --line-2:      rgba(255, 255, 255, 0.11);
    --text:        #e8eaf0;
    --text-2:      #b4bacb;
    --muted:       #7e879c;

    /* --accent stays the switchable brand colour (telemetry accent picker) */
    --accent:      #6366f1;
    --accent-hi:   #818cf8;
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --ok:          #22c55e;
    --warn:        #f59e0b;
    --bad:         #ef4444;
    --info:        #38bdf8;
    /* kept for scripts that read the old names */
    --cyan: #22d3ee; --magenta: #d946ef; --emerald: #10b981; --amber: #f59e0b; --red: #f43f5e;

    --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;
    --shadow-1: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px -16px rgba(0,0,0,.65);
    --shadow-2: 0 2px 6px rgba(0,0,0,.35), 0 24px 48px -20px rgba(0,0,0,.7);
    --ease:     cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
    --sidebar:  248px;
}

/* ---------- 1. Canvas -------------------------------------------------- */

html { background: var(--bg); }
body {
    background: transparent !important;
    color: var(--text-2);
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif !important;
    font-feature-settings: 'cv11', 'ss01';
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
/* Two soft light fields drifting slowly behind everything. */
html::before {
    content: '';
    position: fixed; inset: -20vmax;
    z-index: -2; pointer-events: none;
    background:
        radial-gradient(40vmax 30vmax at 18% 8%,  color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
        radial-gradient(36vmax 28vmax at 86% 2%,  rgba(139, 92, 246, .10), transparent 70%),
        radial-gradient(44vmax 32vmax at 60% 110%, rgba(56, 189, 248, .06), transparent 70%);
    animation: pro-drift 38s ease-in-out infinite alternate;
}
@keyframes pro-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-3vmax, 2vmax, 0) scale(1.06); }
}
#particle-canvas { display: none !important; }

/* ---------- 2. Typography --------------------------------------------- */

h1, h2, h3, h4 { color: #fff; letter-spacing: -0.02em; }
h1.uppercase, h2.uppercase, h3.uppercase, h4.uppercase { text-transform: none !important; }
.italic { font-style: normal !important; }
.font-black { font-weight: 700 !important; }
.font-bold  { font-weight: 600 !important; }
.tracking-tighter { letter-spacing: -0.02em !important; }
.tracking-widest, [class*="tracking-[0."] { letter-spacing: 0.05em !important; }
/* the micro labels (7-10px) were hard to read; floor them */
.text-\[7px\], .text-\[8px\], .text-\[9px\] { font-size: 11px !important; line-height: 1.45 !important; }
.text-\[10px\] { font-size: 11.5px !important; }
.text-\[11px\] { font-size: 12px !important; }
.text-gray-600, .text-zinc-600 { color: #6b7487 !important; }
.text-gray-500, .text-zinc-500 { color: var(--muted) !important; }
.text-gray-400, .text-zinc-400 { color: #a3abbd !important; }
.text-gray-300 { color: var(--text-2) !important; }
.font-mono, code, pre, kbd, .mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace !important; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); color: #fff; }

/* ---------- 3. Surfaces ----------------------------------------------- */

.bg-\[\#0b0e14\], .bg-\[\#0d1117\] { background-color: transparent !important; }
.bg-\[\#161b22\], .bg-\[\#161b22\]\/80, .bg-\[\#161b22\]\/95, .bg-\[\#161b22\]\/50,
.bg-\[\#1c2128\], .bg-zinc-900, .bg-zinc-900\/90, .bg-zinc-900\/95 {
    background-color: var(--surface) !important;
}
.bg-\[\#21262d\], .bg-zinc-800 { background-color: var(--surface-3) !important; }
.hover\:bg-zinc-700:hover, .hover\:bg-zinc-800:hover, .hover\:bg-\[\#21262d\]:hover { background-color: #262d3c !important; }
.bg-black\/40, .bg-black\/30 { background-color: rgba(5, 7, 12, .55) !important; }
.border-\[\#30363d\], .border-white\/10, .border-white\/5, .border-zinc-800, .border-\[\#30363d\]\/50 { border-color: var(--line-2) !important; }
.divide-white\/5 > * + * { border-color: var(--line) !important; }

.rounded-\[2\.5rem\], .rounded-\[2rem\], .rounded-3xl { border-radius: var(--r-xl) !important; }
.rounded-2xl { border-radius: var(--r-lg) !important; }
.rounded-xl  { border-radius: var(--r-md) !important; }
.shadow-2xl, .shadow-lg { box-shadow: var(--shadow-2) !important; }
.backdrop-blur-3xl, .backdrop-blur-xl { backdrop-filter: blur(14px) saturate(140%) !important; }

.stat-card, .glass, .glass-table, .pro-card {
    background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)) , var(--surface) !important;
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow-1);
    backdrop-filter: none !important;
    transition: transform .35s var(--ease-out), border-color .25s var(--ease), box-shadow .35s var(--ease-out), background-color .25s var(--ease) !important;
}
.stat-card:hover, .pro-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 38%, var(--line-2)) !important;
    box-shadow: var(--shadow-2), 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}
/* coloured status edge: slimmer and inset instead of a thick bar */
.stat-card.border-l-4 { border-left-width: 1px !important; position: relative; overflow: hidden; }
.stat-card.border-l-4::before {
    content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0;
    background: currentColor; opacity: .9;
}
.border-l-indigo-500::before { color: var(--accent); }
.border-l-emerald-500::before { color: var(--ok); }
.border-l-blue-500::before { color: var(--info); }
.border-l-purple-500::before { color: #a78bfa; }
.border-l-amber-500::before, .border-l-yellow-500::before { color: var(--warn); }
.border-l-red-500::before { color: var(--bad); }
.border-l-zinc-500::before { color: #64748b; }

/* ---------- 4. Controls ----------------------------------------------- */

button, a, input, select, textarea { transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease-out), opacity .2s var(--ease); }
button:not(:disabled), [role="button"] { cursor: pointer; }
button:not(:disabled):active, a[class*="bg-"]:active { transform: scale(.97); }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, white); outline-offset: 2px; border-radius: 8px; }

.bg-indigo-600, .bg-indigo-500 { background-color: var(--accent) !important; }
.hover\:bg-indigo-500:hover, .hover\:bg-indigo-600:hover { background-color: color-mix(in srgb, var(--accent) 85%, white) !important; }
.text-indigo-400, .text-indigo-500 { color: var(--accent-hi) !important; }
.shadow-indigo-500\/20, .shadow-indigo-500\/40 { box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 70%, transparent) !important; }
.bg-red-600 { background-color: #dc2626 !important; }
.bg-emerald-600, .bg-emerald-700 { background-color: #16a34a !important; }
.hover\:bg-emerald-500:hover, .hover\:bg-emerald-600:hover { background-color: #22c55e !important; }

input, textarea, select, .search-input {
    background-color: var(--surface-2) !important;
    border: 1px solid var(--line-2) !important;
    color: var(--text) !important;
    border-radius: var(--r-md);
    backdrop-filter: none !important;
}
input::placeholder, textarea::placeholder { color: #6b7487 !important; }
input:focus, textarea:focus, select:focus, .search-input:focus {
    outline: none !important;
    border-color: color-mix(in srgb, var(--accent) 70%, transparent) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent) !important;
}
#edit, #highlight-layer textarea { background: transparent !important; border: 0 !important; box-shadow: none !important; }
/* the terminal draws its own prompt line and cursor */
#command-input, #command-input:focus { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; color: #e6edf3 !important; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; background: none !important; border: 0 !important; box-shadow: none !important; }

.sort-btn, .pagination-btn {
    background: var(--surface-2) !important;
    border: 1px solid var(--line-2) !important;
    color: var(--text-2) !important;
    backdrop-filter: none !important;
}
.sort-btn:hover, .pagination-btn:hover:not(:disabled) { border-color: color-mix(in srgb, var(--accent) 55%, transparent) !important; color: #fff !important; background: var(--surface-3) !important; }
.announce-btn {
    background: var(--accent-soft) !important;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent) !important;
    color: #fff !important;
}
.announce-btn:hover { background: color-mix(in srgb, var(--accent) 28%, transparent) !important; }

/* ---------- 5. Modals ------------------------------------------------- */

.modal-overlay { background: rgba(4, 6, 10, .66) !important; backdrop-filter: blur(6px) !important; }
.modal-overlay.active > div, #modal-overlay.flex > div {
    animation: pro-pop .32s var(--ease-out) both;
    background: var(--surface) !important;
    border: 1px solid var(--line-2) !important;
    box-shadow: 0 30px 80px -24px rgba(0,0,0,.85) !important;
}
#modal-title { font-size: 1.15rem !important; }
#modal-desc { text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; color: var(--text-2) !important; line-height: 1.55; }

/* ---------- 6. Tables ------------------------------------------------- */

table { border-collapse: separate; border-spacing: 0; }
thead { background: var(--surface-2) !important; }
thead th { color: var(--muted) !important; font-weight: 600 !important; }
tbody tr { transition: background-color .2s var(--ease); }
tbody tr:hover { background: rgba(255,255,255,.025); }
table.uppercase, table .uppercase { text-transform: none !important; }

/* ---------- 7. Dashboard layout: sidebar on desktop, tab bar on phones --- */

.pro-brand { display: none; }
nav.tab-bar {
    background: rgba(18, 22, 31, .92) !important;
    border: 1px solid var(--line-2) !important;
    border-radius: 18px !important;
    box-shadow: var(--shadow-2) !important;
    gap: 2px;
}
nav.tab-bar .nav-link {
    color: var(--muted) !important;
    border-bottom: 0 !important;
    border-radius: 12px !important;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    font-size: 10.5px !important; letter-spacing: 0 !important; text-transform: none !important; font-weight: 600 !important;
    position: relative;
}
nav.tab-bar .nav-link svg { width: 18px; height: 18px; }
nav.tab-bar .nav-link:hover { color: var(--text) !important; background: rgba(255,255,255,.04); }
nav.tab-bar .nav-link.nav-active {
    color: #fff !important;
    background: var(--accent-soft) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.pro-nav-label, .pro-nav-page, .pro-nav-spacer { display: none; }

.pro-topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin-bottom: 28px;
}
.pro-topbar h1 { font-size: 1.6rem; font-weight: 700; color: #fff; margin: 0; line-height: 1.2; }
.pro-topbar .pro-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-family: 'JetBrains Mono', monospace; }
.pro-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pro-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 14px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--line-2);
    color: var(--text-2); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap;
}
.pro-chip svg { width: 16px; height: 16px; opacity: .8; }
.pro-chip:hover { color: #fff; border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--surface-3); transform: translateY(-1px); }
/* "bots user" keeps its exact text (a project check requires it); icon via CSS */
.pro-ico-bot { text-transform: capitalize; }
.pro-ico-bot::before {
    content: ''; width: 16px; height: 16px; opacity: .8; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='10' rx='2'/%3E%3Ccircle cx='12' cy='5' r='2'/%3E%3Cpath d='M12 7v4M8 16h.01M16 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='10' rx='2'/%3E%3Ccircle cx='12' cy='5' r='2'/%3E%3Cpath d='M12 7v4M8 16h.01M16 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pro-chip.primary { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 80%, transparent); }
.pro-chip.primary:hover { background: color-mix(in srgb, var(--accent) 86%, white); }
.pro-chip.danger { color: #fca5a5; }
.pro-chip.danger:hover { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); color: #fff; }
.pro-section-title { font-size: 1.35rem !important; font-weight: 700 !important; }

@media (min-width: 1024px) {
    body.pro-dashboard { padding-left: var(--sidebar); padding-bottom: 32px !important; }
    body.pro-dashboard nav.tab-bar {
        position: fixed !important; inset: 0 auto 0 0 !important; transform: none !important;
        width: var(--sidebar) !important; max-width: none !important;
        flex-direction: column !important; justify-content: flex-start !important; align-items: stretch !important;
        padding: 20px 14px !important; gap: 2px !important;
        border-radius: 0 !important; border-width: 0 1px 0 0 !important;
        background: rgba(13, 16, 23, .94) !important; box-shadow: none !important;
        overflow-y: auto;
    }
    body.pro-dashboard nav.tab-bar .nav-link,
    body.pro-dashboard .pro-nav-page {
        flex: none !important; flex-direction: row !important; justify-content: flex-start !important;
        gap: 12px; padding: 10px 12px !important; font-size: 13.5px !important; font-weight: 500 !important;
        border-radius: 10px !important; text-align: left;
    }
    body.pro-dashboard .pro-nav-page {
        display: flex; align-items: center; color: var(--muted); text-decoration: none; background: none; border: 0; width: 100%;
    }
    body.pro-dashboard .pro-nav-page svg { width: 18px; height: 18px; }
    body.pro-dashboard .pro-nav-page:hover { color: var(--text); background: rgba(255,255,255,.04); }
    body.pro-dashboard .pro-nav-page.danger:hover { color: #fca5a5; background: rgba(239,68,68,.08); }
    body.pro-dashboard nav.tab-bar .nav-link.nav-active::before {
        content: ''; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
    }
    body.pro-dashboard .pro-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
    body.pro-dashboard .pro-brand-mark {
        width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff;
        background: linear-gradient(135deg, var(--accent), #8b5cf6); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 80%, transparent);
    }
    body.pro-dashboard .pro-brand-mark svg { width: 18px; height: 18px; }
    body.pro-dashboard .pro-brand strong { display: block; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
    body.pro-dashboard .pro-brand small { display: block; color: var(--muted); font-size: 11.5px; }
    body.pro-dashboard .pro-nav-label { display: block; padding: 16px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #5f687c; }
    body.pro-dashboard .pro-nav-spacer { display: block; flex: 1; min-height: 12px; }
    body.pro-dashboard #nav-pending-count { position: static !important; margin-left: auto; font-size: 11px !important; padding: 1px 7px !important; }
    body.pro-dashboard .pro-chips .pro-nav-dup { display: none; }
    /* the live telemetry card sat on top of the sidebar's lower links */
    body.pro-dashboard .zct { left: auto !important; right: 20px !important; }
}
/* the floating telemetry card must not cover an open dialog */
.modal-overlay.active ~ .zct, .modal-overlay.active ~ .zcp-fab { display: none !important; }
/* telemetry card in the panel's colours */
.zct {
    background: rgba(18, 22, 31, .96) !important;
    border: 1px solid var(--line-2) !important;
    border-radius: 14px !important;
    box-shadow: var(--shadow-2) !important;
    font-family: 'Inter', sans-serif !important;
}
/* action buttons read better in sentence case */
.tab-content button.uppercase, .modal-overlay button.uppercase, #custom-modal button { text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; font-weight: 600 !important; }
.tab-content button.uppercase { padding-top: .6rem !important; padding-bottom: .6rem !important; }

/* ---------- 7b. Developer credit --------------------------------------- */

.pro-dev { display: none; }
.pro-footer { margin-top: 40px; padding: 18px 0 8px; border-top: 1px solid var(--line); text-align: center; font-size: 12.5px; color: var(--muted); }
.pro-footer a { color: var(--text-2); font-weight: 600; text-decoration: none; border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent); }
.pro-footer a:hover { color: #fff; border-bottom-color: var(--accent); }
@media (min-width: 1024px) {
    body.pro-dashboard .pro-dev {
        display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 10px; border-radius: 12px; text-decoration: none;
        background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, transparent), rgba(139, 92, 246, .08));
        border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    }
    body.pro-dashboard .pro-dev:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-1px); }
    body.pro-dashboard .pro-footer { display: none; }
}
.pro-dev-avatar { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), #8b5cf6); }
.pro-dev-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pro-dev-text small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #5f687c; }
.pro-dev-text strong { font-size: 13px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pro-dev-text em { font-style: normal; font-size: 11px; color: var(--muted); }

/* ---------- 7c. New bot account ---------------------------------------- */

.nb-card { margin-top: 24px; }
.nb-card-row { display: flex; align-items: center; gap: 18px; }
.nb-card-icon { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #8b5cf6); box-shadow: 0 12px 26px -14px color-mix(in srgb, var(--accent) 85%, transparent); }
.nb-card-icon svg { width: 24px; height: 24px; }
.nb-card-text { flex: 1; min-width: 0; }
.nb-card-text h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; }
.nb-card-text p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.nb-card-status:not(:empty) { margin-top: 8px !important; color: var(--accent-hi) !important; font-weight: 600; }
.nb-open { flex: none; }
@media (max-width: 760px) { .nb-card-row { flex-direction: column; align-items: flex-start; } .nb-open { width: 100%; justify-content: center; } }

.nb-dialog { background: var(--surface) !important; border: 1px solid var(--line-2); box-shadow: 0 30px 80px -24px rgba(0,0,0,.85); }
.nb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.nb-head h3 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.nb-sub { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.nb-x { font-size: 26px; line-height: 1; color: var(--muted); padding: 2px 8px; border-radius: 8px; }
.nb-x:hover { color: #fff; background: rgba(255,255,255,.06); }
.nb-form [hidden], .nb-progress[hidden], .nb-form[hidden] { display: none !important; }
.nb-label { display: block; margin: 14px 0 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.nb-label:first-child { margin-top: 0; }
.nb-input { width: 100%; box-sizing: border-box; padding: 11px 13px; font-size: 14px; border-radius: 12px; }
.nb-textarea { font-family: 'Inter', sans-serif !important; line-height: 1.55; resize: vertical; min-height: 180px; }
.nb-hint { margin: 7px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.nb-hint code { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); }
.nb-safety { padding: 10px 12px; border-radius: 10px; background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.22); color: #fcd9a1; }
.nb-options { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-top: 16px; }
.nb-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.nb-delay { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.nb-delay input { width: 70px; padding: 6px 8px; border-radius: 8px; font-size: 14px; text-align: center; }
.nb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.nb-progress { animation: pro-fade-up .4s var(--ease-out) both; }
.nb-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.nb-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), #8b5cf6, var(--info)); transition: width .6s var(--ease-out); }
.nb-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.nb-stats b { color: #fff; font-weight: 700; }
.nb-stats .ok b { color: #86efac; } .nb-stats .bad b { color: #fca5a5; }
.nb-now { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--text); }
.nb-now.ok { border-color: rgba(34,197,94,.35); color: #bbf7d0; }
.nb-now.bad { border-color: rgba(239,68,68,.4); color: #fecaca; }
.nb-log { list-style: none; margin: 12px 0 0; padding: 0; max-height: 280px; overflow-y: auto; border-radius: 12px; border: 1px solid var(--line); }
.nb-log li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 9px 12px; font-size: 13px; border-top: 1px solid var(--line); }
.nb-log li:first-child { border-top: 0; animation: pro-fade-up .35s var(--ease-out) both; }
.nb-name { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.nb-tag.added, .nb-tag.sent { background: rgba(34,197,94,.12); color: #86efac; }
.nb-tag.already { background: rgba(56,189,248,.12); color: #7dd3fc; }
.nb-tag.failed { background: rgba(239,68,68,.12); color: #fca5a5; }
.nb-err { grid-column: 1 / -1; font-size: 12px; color: #fca5a5; }
@media (max-width: 520px) {
    .nb-log li { display: flex; flex-wrap: wrap; gap: 6px; }
    .nb-log li .nb-name { flex: 1 0 100%; }
}

/* ---------- 8. Status pieces ------------------------------------------ */

.indicator-dot, #status-indicator { box-shadow: 0 0 0 4px rgba(255,255,255,.04); }
.pro-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ---------- 9. Terminal, editor --------------------------------------- */

#terminal, .terminal, #output { font-family: 'JetBrains Mono', monospace !important; }
pre[class*="language-"], code[class*="language-"] { font-family: 'JetBrains Mono', monospace !important; text-shadow: none !important; }

/* ---------- 10. Scrollbars -------------------------------------------- */

* { scrollbar-width: thin; scrollbar-color: #2a3242 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #262d3b; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3a4357; background-clip: padding-box; border: 2px solid transparent; }

/* ---------- 11. Loading ----------------------------------------------- */

.loading-shimmer {
    background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 45%, var(--surface) 90%) !important;
    background-size: 220% 100% !important;
    animation: pro-shimmer 1.4s linear infinite !important;
}
@keyframes pro-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.animate-spin-slow { animation: pro-spin .9s linear infinite !important; }
@keyframes pro-spin { to { transform: rotate(360deg); } }

/* ============================================================================
   MOTION (driven by motion.js; everything is off for reduced motion)
   ========================================================================= */

@keyframes pro-fade-up { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@keyframes pro-fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes pro-pop     { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pro-slide-in { from { opacity: 0; transform: translate3d(-12px, 0, 0); } to { opacity: 1; transform: none; } }

/* page enter / leave */
body { animation: pro-fade .35s var(--ease) both; }
body.pro-leave { opacity: 0; transform: translateY(-4px); transition: opacity .18s var(--ease), transform .18s var(--ease); }

/* scroll + list reveals */
.pro-reveal { opacity: 0; transform: translate3d(0, 16px, 0); }
.pro-reveal.pro-in { animation: pro-fade-up .6s var(--ease-out) both; animation-delay: var(--pro-delay, 0ms); }
.tab-content.active { animation: pro-fade-up .45s var(--ease-out) both !important; }

/* button press ripple */
.pro-ripple-host { position: relative; overflow: hidden; }
.pro-ripple {
    position: absolute; border-radius: 50%; pointer-events: none;
    background: rgba(255,255,255,.28); transform: scale(0);
    animation: pro-ripple .6s var(--ease-out) forwards;
}
@keyframes pro-ripple { to { transform: scale(2.6); opacity: 0; } }

/* number change highlight */
.pro-bump { animation: pro-bump .5s var(--ease-out); }
@keyframes pro-bump { 0% { color: #fff; text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 80%, transparent); } 100% { text-shadow: none; } }

/* toasts */
.pro-toasts { position: fixed; z-index: 10000; right: 18px; top: 76px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.pro-toast {
    pointer-events: auto; min-width: 240px; max-width: 380px;
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; border-radius: 12px;
    background: rgba(22, 27, 38, .97); border: 1px solid var(--line-2);
    color: var(--text); font-size: 13.5px; line-height: 1.45;
    box-shadow: var(--shadow-2);
    animation: pro-toast-in .4s var(--ease-out) both;
}
.pro-toast.out { animation: pro-toast-out .25s var(--ease) both; }
.pro-toast i { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.pro-toast.ok i { background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.pro-toast.bad i { background: var(--bad); box-shadow: 0 0 0 4px rgba(239,68,68,.15); }
@keyframes pro-toast-in { from { opacity: 0; transform: translate3d(16px, 0, 0) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes pro-toast-out { to { opacity: 0; transform: translate3d(16px, 0, 0); } }

/* top progress bar for page navigation and slow requests */
.pro-progress { position: fixed; z-index: 10001; left: 0; top: 0; height: 2px; width: 0; background: linear-gradient(90deg, var(--accent), #8b5cf6, var(--info)); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent); transition: width .3s var(--ease), opacity .3s var(--ease); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
    .pro-reveal { opacity: 1; transform: none; }
    html::before { animation: none; }
}

/* ============================================================================
   Mobile, iOS and smoothness (kept from the previous theme; mobile.js uses these)
   ========================================================================= */

@media (max-width: 820px) {
    input, select, textarea { font-size: 16px !important; } /* stops iOS zooming in */
}
body { padding-bottom: env(safe-area-inset-bottom, 0px); }
nav[class*="fixed bottom-"] { bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important; }
.zcp-fab { bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important; }
/* phones: keep the palette button above the dashboard's bottom tab bar */
@media (max-width: 1023px) { body.pro-dashboard .zcp-fab { bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; } }
.zct      { bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important; }
@supports (height: 100dvh) { .zcp-veil { height: 100dvh; } }

* { -webkit-tap-highlight-color: transparent; }
button, a, .chip, .zcp-it, .zct-h, [onclick] { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
input, textarea, pre, code, .zcp-in, #edit, .selectable { -webkit-user-select: text !important; user-select: text !important; }
body { overscroll-behavior-y: none; }
.zcp-list, .zct, #modal-body, .custom-scrollbar, .overflow-y-auto, .overflow-x-auto { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

@media (max-width: 820px) {
    nav[class*="fixed bottom-"] button { min-height: 52px; }
    .zcp-it { padding-top: 13px; padding-bottom: 13px; }
    button, .chip { min-height: 38px; }
    .stat-card:hover, .pro-card:hover { transform: none; }
    .pro-topbar { flex-direction: column; align-items: flex-start; }
    .pro-chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; }
}

#user-grid > div, #thread-list > div, #currency-list > div, #grid > div { content-visibility: auto; contain-intrinsic-size: 150px; }
html { scroll-behavior: smooth; }

@media (display-mode: standalone) { body { padding-top: env(safe-area-inset-top, 0px); } }

.zc-ptr {
    position: fixed; top: 0; left: 50%; transform: translate(-50%, -60px); z-index: 9996;
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(18, 22, 31, .96); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    box-shadow: 0 10px 30px -12px #000; pointer-events: none;
}
.zc-ptr svg { width: 16px; height: 16px; color: var(--accent); }
.zc-ptr.spin svg { animation: zc-spin .8s linear infinite; }
@keyframes zc-spin { to { transform: rotate(360deg); } }
