/* ==========================================================================
   Scorpion Tool Pro — User Panel
   One token-based stylesheet for every panel page, matching the desktop
   app's themes: "glass" (dark glassmorphism, default) and "aurora" (light).
   ========================================================================== */

:root,
[data-theme="glass"] {
    --bg: #07070d;
    --glow-a: rgba(124, 58, 237, .28);
    --glow-b: rgba(6, 182, 212, .14);
    --glow-c: rgba(236, 72, 153, .07);
    --surface: rgba(255, 255, 255, .035);
    --surface-2: rgba(255, 255, 255, .055);
    --surface-3: rgba(255, 255, 255, .08);
    --surface-solid: #11111b;
    --sidebar: rgba(10, 10, 18, .72);
    --topbar: rgba(7, 7, 13, .55);
    --border: rgba(255, 255, 255, .075);
    --border-strong: rgba(255, 255, 255, .14);
    --text: #eef0f7;
    --text-2: #b5b9cb;
    --muted: #7d8299;
    --accent: #8b5cf6;
    --accent-2: #22d3ee;
    --accent-ink: #c4b5fd;
    --grad: linear-gradient(135deg, #8b5cf6 0%, #6366f1 45%, #22d3ee 100%);
    --grad-soft: linear-gradient(135deg, rgba(139, 92, 246, .18), rgba(34, 211, 238, .1));
    --ok: #34d399;   --ok-bg: rgba(52, 211, 153, .12);
    --bad: #fb7185;  --bad-bg: rgba(251, 113, 133, .12);
    --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12);
    --info: #60a5fa; --info-bg: rgba(96, 165, 250, .12);
    --log-bg: rgba(0, 0, 0, .38);
    --log-solid: #0b0b12;
    --input: rgba(0, 0, 0, .28);
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, .65);
    --shadow-sm: 0 8px 24px -12px rgba(0, 0, 0, .55);
    --ring: 0 0 0 3px rgba(139, 92, 246, .28);
    color-scheme: dark;
}

[data-theme="aurora"] {
    --bg: #eef0f8;
    --glow-a: rgba(167, 139, 250, .45);
    --glow-b: rgba(103, 232, 249, .38);
    --glow-c: rgba(244, 114, 182, .14);
    --surface: rgba(255, 255, 255, .58);
    --surface-2: rgba(255, 255, 255, .72);
    --surface-3: rgba(255, 255, 255, .9);
    --surface-solid: #f7f8fc;
    --sidebar: rgba(255, 255, 255, .55);
    --topbar: rgba(238, 240, 248, .6);
    --border: rgba(30, 27, 75, .08);
    --border-strong: rgba(30, 27, 75, .16);
    --text: #15162b;
    --text-2: #3f4361;
    --muted: #6b6f8a;
    --accent: #7c3aed;
    --accent-2: #0891b2;
    --accent-ink: #6d28d9;
    --grad: linear-gradient(135deg, #7c3aed 0%, #6366f1 45%, #06b6d4 100%);
    --grad-soft: linear-gradient(135deg, rgba(124, 58, 237, .12), rgba(6, 182, 212, .1));
    --ok: #059669;   --ok-bg: rgba(16, 185, 129, .13);
    --bad: #e11d48;  --bad-bg: rgba(225, 29, 72, .1);
    --warn: #b45309; --warn-bg: rgba(245, 158, 11, .15);
    --info: #2563eb; --info-bg: rgba(37, 99, 235, .1);
    --log-bg: rgba(255, 255, 255, .75);
    --log-solid: #fbfbfe;
    --input: rgba(255, 255, 255, .75);
    --shadow: 0 24px 60px -28px rgba(49, 46, 129, .35);
    --shadow-sm: 0 8px 24px -14px rgba(49, 46, 129, .3);
    --ring: 0 0 0 3px rgba(124, 58, 237, .2);
    color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 14.5px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color .3s ease, color .3s ease;
}
a { color: var(--accent-ink); text-decoration: none; }
a:hover { color: var(--text); }
::selection { background: rgba(139, 92, 246, .35); }
.mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }
.text-muted-2 { color: var(--muted) !important; }

.scp-bg {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60rem 40rem at 8% -10%, var(--glow-a), transparent 60%),
        radial-gradient(50rem 36rem at 105% 30%, var(--glow-b), transparent 60%),
        radial-gradient(40rem 30rem at 40% 120%, var(--glow-c), transparent 60%),
        var(--bg);
}
.scp-bg::after {
    content: ""; position: absolute; inset: 0; opacity: .5;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 0%, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 0%, transparent 75%);
}

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: var(--muted); }

/* ---------- Shell ---------- */
.scp-shell { display: flex; min-height: 100vh; }
.scp-sidebar {
    position: sticky; top: 0; height: 100vh; width: 264px; flex: 0 0 264px;
    display: flex; flex-direction: column; gap: 6px;
    padding: 22px 16px 18px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
            backdrop-filter: blur(22px) saturate(140%);
    z-index: 40;
}
.scp-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; color: var(--text); }
.scp-brand:hover { color: var(--text); }
.scp-brand img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border-strong), 0 0 22px -4px rgba(212, 175, 95, .55); }
.scp-brand > span { display: flex; flex-direction: column; font-weight: 700; font-size: 1.02rem; letter-spacing: -.02em; line-height: 1.15; }
.scp-brand-name { white-space: nowrap; }
.scp-brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.scp-brand small { font-size: .7rem; font-weight: 600; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }

.scp-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.scp-nav-label { font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.scp-nav-link {
    position: relative; display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    color: var(--text-2); font-weight: 550; font-size: .9rem;
    transition: background .18s ease, color .18s ease;
}
.scp-nav-link i { width: 18px; text-align: center; color: var(--muted); transition: color .18s ease; }
.scp-nav-link:hover { background: var(--surface-2); color: var(--text); }
.scp-nav-link:hover i { color: var(--text); }
.scp-nav-link.is-active {
    color: #fff; font-weight: 650;
    background: var(--grad);
    box-shadow: 0 10px 28px -10px rgba(124, 58, 237, .75), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.scp-nav-link.is-active i { color: #fff; }

.scp-sidebar-foot { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.scp-help {
    display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px;
    background: var(--grad-soft); border: 1px solid var(--border); color: var(--text);
}
.scp-help:hover { color: var(--text); border-color: var(--border-strong); }
.scp-help > i:first-child { font-size: 1.35rem; color: #29a9eb; }
.scp-help span { display: flex; flex-direction: column; flex: 1; line-height: 1.25; font-size: .85rem; }
.scp-help small { color: var(--muted); font-size: .75rem; }
.scp-help-go { font-size: .7rem; color: var(--muted); }
.scp-logout:hover { background: var(--bad-bg); color: var(--bad); }
.scp-logout:hover i { color: var(--bad); }

.scp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scp-topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 16px;
    padding: 16px 32px; min-height: 76px;
    background: var(--topbar);
    border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
            backdrop-filter: blur(18px) saturate(140%);
}
.scp-title { flex: 1; min-width: 0; }
.scp-title h1 { margin: 0; font-size: 1.35rem; font-weight: 750; letter-spacing: -.025em; }
.scp-title p { margin: 2px 0 0; color: var(--muted); font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scp-top-actions { display: flex; align-items: center; gap: 10px; }

.scp-chip {
    display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
    padding: 6px 12px; border-radius: 999px; font-size: .78rem; font-weight: 650;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
}
.scp-chip i { font-size: .75rem; color: var(--muted); }
.scp-chip-pro { background: var(--grad-soft); border-color: rgba(139, 92, 246, .35); color: var(--text); }
.scp-chip-pro i { color: #f5b942; }
.scp-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.scp-chip-days.is-ok { color: var(--ok); }
.scp-chip-days.is-warn { color: var(--warn); }
.scp-chip-days.is-bad { color: var(--bad); }

.scp-icon-btn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
    cursor: pointer; transition: .18s ease;
}
.scp-icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.scp-menu-btn { display: none; }
[data-theme="glass"] .scp-when-light, [data-theme="aurora"] .scp-when-dark { display: none; }

.scp-user {
    display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 14px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer;
}
.scp-user:hover { border-color: var(--border-strong); }
.scp-avatar {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
    background: var(--grad); color: #fff; font-weight: 800; font-size: .95rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.scp-user-name { display: flex; flex-direction: column; text-align: left; font-size: .84rem; font-weight: 650; line-height: 1.2; max-width: 160px; }
.scp-user-name, .scp-user-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scp-user-name small { color: var(--muted); font-weight: 500; font-size: .72rem; }
.scp-user-caret { font-size: .65rem; color: var(--muted); }

.scp-menu {
    --bs-dropdown-bg: transparent;
    background: var(--surface-solid) !important; border: 1px solid var(--border-strong) !important;
    border-radius: 14px !important; padding: 6px !important; margin-top: 8px !important;
    box-shadow: var(--shadow); min-width: 210px;
}
.scp-menu .dropdown-item { display: flex; align-items: center; gap: 10px; color: var(--text-2); border-radius: 9px; padding: 9px 12px; font-size: .86rem; font-weight: 550; }
.scp-menu .dropdown-item i { width: 16px; text-align: center; color: var(--muted); }
.scp-menu .dropdown-item:hover, .scp-menu .dropdown-item:focus { background: var(--surface-3); color: var(--text); }
.scp-menu .dropdown-divider { border-color: var(--border); margin: 6px 4px; }
.scp-menu .scp-danger-item:hover, .scp-menu .scp-danger-item:hover i { color: var(--bad); background: var(--bad-bg); }

.scp-content { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 28px 32px 40px; }
.scp-footer { padding: 18px 32px 26px; color: var(--muted); font-size: .78rem; text-align: center; }
.scp-footer a { color: var(--muted); } .scp-footer a:hover { color: var(--text); }

/* ---------- Cards ---------- */
.glass {
    position: relative;
    isolation: isolate; /* keeps the ::before highlight under the content */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
            backdrop-filter: blur(20px) saturate(140%);
}
.glass::before { /* hairline top highlight */
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 40%);
}
[data-theme="aurora"] .glass::before { background: linear-gradient(180deg, rgba(255, 255, 255, .7), transparent 40%); opacity: .6; }
.glass-pad { padding: 22px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.card-head h2 { font-size: 1rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: .8rem; }
.card-head .spacer { flex: 1; }
.card-icon {
    display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px;
    background: var(--grad-soft); color: var(--accent-ink); border: 1px solid var(--border);
}
.link-more { font-size: .8rem; font-weight: 650; color: var(--accent-ink); display: inline-flex; align-items: center; gap: 6px; }
.link-more:hover { gap: 9px; }
.link-more, .link-more:hover { transition: gap .18s ease; }

/* ---------- Hero ---------- */
.hero {
    display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center;
    padding: 30px 32px; overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; right: -120px; top: -160px; width: 460px; height: 460px; border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, .35), transparent 65%); pointer-events: none;
}
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.hero h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); font-weight: 800; letter-spacing: -.035em; margin: 8px 0 8px; }
.hero h2 .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead-sm { color: var(--text-2); max-width: 560px; margin: 0 0 20px; font-size: .95rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.ring { position: relative; width: 168px; height: 168px; z-index: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-label b { font-size: 2.3rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.ring-label span { font-size: .72rem; color: var(--muted); font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin-top: 6px; }
.ring-label small { font-size: .72rem; color: var(--text-2); margin-top: 4px; }

/* ---------- Stats ---------- */
.stat { display: flex; flex-direction: column; gap: 14px; padding: 20px; height: 100%; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: .74rem; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-size: .9rem; }
.stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
.stat-value small { font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.stat-foot { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tone-violet { background: rgba(139, 92, 246, .14); color: #a78bfa; }
.tone-cyan   { background: rgba(34, 211, 238, .13); color: #22d3ee; }
.tone-green  { background: var(--ok-bg); color: var(--ok); }
.tone-amber  { background: var(--warn-bg); color: var(--warn); }
.tone-rose   { background: var(--bad-bg); color: var(--bad); }
[data-theme="aurora"] .tone-violet { color: #7c3aed; }
[data-theme="aurora"] .tone-cyan { color: #0891b2; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); transition: width 1s ease; }
.meter.is-ok > span { background: linear-gradient(90deg, #10b981, #34d399); }

/* ---------- Buttons ---------- */
.btn-scp, .btn-ghost, .btn-danger-soft {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 12px; font-weight: 650; font-size: .88rem;
    border: 1px solid transparent; cursor: pointer; transition: .18s ease; white-space: nowrap;
}
.btn-scp { background: var(--grad); color: #fff; box-shadow: 0 10px 26px -10px rgba(124, 58, 237, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-scp:hover { color: #fff; filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--border-strong); color: var(--text); }
.btn-danger-soft { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.btn-danger-soft:hover { background: var(--bad); color: #fff; }
.btn-scp:disabled, .btn-ghost:disabled, .btn-danger-soft:disabled,
.btn-scp.disabled { opacity: .45; cursor: not-allowed; transform: none; filter: grayscale(.4); box-shadow: none; }
.btn-sm-scp { padding: 7px 12px; font-size: .8rem; border-radius: 10px; }
.btn-scp .spinner, .btn-danger-soft .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field-label { display: block; font-size: .78rem; font-weight: 650; color: var(--text-2); margin-bottom: 7px; }
.input-wrap { position: relative; }
.input-wrap > i.lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; pointer-events: none; }
.input-scp {
    width: 100%; padding: 11px 14px; border-radius: 12px;
    background: var(--input); border: 1px solid var(--border); color: var(--text);
    font: inherit; font-size: .9rem; transition: border-color .18s ease, box-shadow .18s ease;
}
.input-wrap > i.lead ~ .input-scp { padding-left: 40px; }
.input-scp::placeholder { color: var(--muted); }
.input-scp:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input-scp[readonly], .input-scp:disabled { color: var(--muted); cursor: not-allowed; background: var(--surface); }
.input-action { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; }
.input-action:hover { color: var(--text); background: var(--surface-2); }
.field-hint { font-size: .78rem; color: var(--muted); margin-top: 7px; display: flex; align-items: center; gap: 6px; }
.field-hint.is-warn { color: var(--warn); }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 9px; }
.strength span { height: 4px; border-radius: 9px; background: var(--surface-3); transition: background .2s ease; }
.strength[data-level="1"] span:nth-child(-n+1) { background: var(--bad); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--warn); }
.strength[data-level="3"] span:nth-child(-n+3) { background: #a3e635; }
.strength[data-level="4"] span { background: var(--ok); }

/* ---------- Alerts / pills ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .86rem; border: 1px solid transparent; margin-bottom: 14px; animation: fadeUp .25s ease both; }
.notice i { margin-top: 2px; }
.notice-ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.notice-bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.notice-warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.notice-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok); }
.pill-bad { background: var(--bad-bg); color: var(--bad); }
.pill-warn { background: var(--warn-bg); color: var(--warn); }
.pill-muted { background: var(--surface-3); color: var(--text-2); }
.pill-violet { background: var(--grad-soft); color: var(--accent-ink); }

/* ---------- Lists ---------- */
.op-list { list-style: none; margin: 0; padding: 0; }
.op-row {
    display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center;
    padding: 12px 10px; border-radius: 14px; color: var(--text); transition: background .15s ease;
}
.op-row + .op-row { border-top: 1px solid var(--border); }
a.op-row:hover, button.op-row:hover { background: var(--surface-2); color: var(--text); }
.op-status { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; font-size: .9rem; }
.op-status.ok { background: var(--ok-bg); color: var(--ok); }
.op-status.bad { background: var(--bad-bg); color: var(--bad); }
.op-main { min-width: 0; }
.op-title { font-weight: 650; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .76rem; color: var(--muted); margin-top: 2px; }
.op-meta span { display: inline-flex; align-items: center; gap: 5px; }
.op-side { text-align: right; font-size: .76rem; color: var(--muted); white-space: nowrap; }

.empty { text-align: center; padding: 42px 16px; color: var(--muted); }
.empty i { font-size: 2rem; margin-bottom: 12px; display: block; opacity: .6; }
.empty b { display: block; color: var(--text); font-size: 1rem; margin-bottom: 4px; }

.kv { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.kv span { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.kv b { font-size: .98rem; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- History ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; padding: 12px; }
.toolbar form.search { flex: 1 1 320px; display: flex; gap: 8px; }
.toolbar form.search .input-wrap { flex: 1; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 13px; background: var(--input); border: 1px solid var(--border); }
.seg a { padding: 7px 14px; border-radius: 10px; font-size: .82rem; font-weight: 650; color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; }
.seg a:hover { color: var(--text); background: var(--surface-2); }
.seg a.is-on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.seg a .n { font-size: .7rem; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.seg a.is-on .n { background: var(--grad); color: #fff; }

.log-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.log-table th { font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.log-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: .87rem; }
.log-table tbody tr { cursor: pointer; transition: background .15s ease; }
.log-table tbody tr:hover { background: var(--surface-2); }
.log-table tbody tr:last-child td { border-bottom: 0; }
.log-table .op-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.log-table .op-cell .op-status { width: 32px; height: 32px; border-radius: 10px; flex: 0 0 auto; }
.log-table .op-cell b { font-weight: 650; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.log-table .op-cell small { display: block; color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.workid { display: inline-flex; align-items: center; gap: 8px; font-family: "JetBrains Mono", monospace; font-size: .8rem; padding: 4px 6px 4px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.copy-btn { border: 0; background: transparent; color: var(--muted); width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; cursor: pointer; font-size: .75rem; }
.copy-btn:hover { color: var(--text); background: var(--surface-3); }
.copy-btn.is-done { color: var(--ok); }
.row-go { color: var(--muted); transition: transform .15s ease, color .15s ease; }
.log-table tbody tr:hover .row-go { color: var(--text); transform: translateX(3px); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--muted); }
.pager-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pager-links a, .pager-links span { min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 650; }
.pager-links a:hover { border-color: var(--border-strong); color: var(--text); }
.pager-links .is-on { background: var(--grad); color: #fff; border-color: transparent; }
.pager-links .is-off { opacity: .4; pointer-events: none; }
.pager-links .gap { border: 0; background: none; min-width: 20px; }

/* modal */
.modal-backdrop.show { opacity: .6; }
.scp-modal .modal-content {
    background: var(--surface-solid); color: var(--text);
    border: 1px solid var(--border-strong); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden;
}
.scp-modal .modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; gap: 14px; align-items: flex-start; }
.scp-modal .modal-title { font-weight: 750; font-size: 1.1rem; letter-spacing: -.02em; }
.scp-modal .modal-body { padding: 18px 22px; }
.scp-modal .modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; gap: 8px; }
.scp-modal .x-btn { margin-left: auto; }
.log-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.log-meta .pill { font-weight: 600; }

/* The app's console, rendered from QTextEdit::toHtml(). */
.log-view {
    font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
    font-size: 12.5px; line-height: 1.7;
    color: var(--text);
    background: var(--log-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    max-height: min(62vh, 640px);
    overflow: auto;
    white-space: pre-wrap; word-break: break-word;
    tab-size: 4;
}
.log-view.is-html { white-space: normal; } /* newlines between Qt's <p>s are not content */
.log-view p, .log-view li { margin: 0 !important; white-space: pre-wrap; }
.log-view p.is-empty { height: .55em; }
.log-view span { font-family: inherit !important; font-size: inherit !important; }
.log-view a { color: var(--accent-ink); text-decoration: underline; }
.log-view hr { border: 0; border-top: 1px solid var(--border); }

/* ---------- Reset PC ---------- */
.device {
    display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 18px;
    background: var(--grad-soft); border: 1px solid var(--border);
}
.device-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: var(--grad); color: #fff; font-size: 1.4rem; box-shadow: 0 12px 30px -12px rgba(124, 58, 237, .8); flex: 0 0 auto; }
.device-icon.is-off { background: var(--surface-3); color: var(--muted); box-shadow: none; }
.device-serial { font-family: "JetBrains Mono", monospace; font-size: 1.05rem; font-weight: 700; overflow-wrap: anywhere; }
.slots { display: flex; gap: 6px; flex-wrap: wrap; }
.slots span { width: 22px; height: 8px; border-radius: 99px; background: var(--surface-3); }
.slots span.on { background: var(--grad); }
.countdown { font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: 1.5rem; letter-spacing: .02em; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 30px; }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline .node { position: absolute; left: 0; top: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .55rem; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-strong); }
.timeline .node.is-reset { background: var(--grad); color: #fff; border-color: transparent; }
.timeline .node.is-unlink { background: var(--bad-bg); color: var(--bad); }
.timeline .t-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .86rem; font-weight: 650; }
.timeline .t-head time { font-weight: 500; color: var(--muted); font-size: .78rem; }
.timeline .t-body { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-family: "JetBrains Mono", monospace; font-size: .78rem; color: var(--text-2); }
.timeline .t-body code { color: inherit; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.timeline .t-body i { color: var(--muted); font-size: .7rem; }

.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rules li { display: flex; gap: 10px; font-size: .84rem; color: var(--text-2); }
.rules li i { color: var(--accent-ink); margin-top: 3px; width: 14px; text-align: center; }

/* ---------- Account ---------- */
.profile-card { text-align: center; padding: 28px 22px; overflow: hidden; }
.profile-card::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 92px; background: var(--grad); opacity: .9; z-index: 0; }
.profile-card > * { position: relative; z-index: 1; }
.profile-avatar { width: 92px; height: 92px; border-radius: 28px; margin: 22px auto 12px; display: grid; place-items: center; font-size: 2.3rem; font-weight: 800; color: #fff; background: var(--grad); border: 4px solid var(--surface-solid); box-shadow: var(--shadow-sm); }
.profile-card h3 { font-size: 1.2rem; font-weight: 750; margin: 0; letter-spacing: -.02em; }
.profile-card .handle { color: var(--muted); font-size: .85rem; }

/* ---------- Toasts ---------- */
.scp-toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.scp-toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border-strong); color: var(--text); box-shadow: var(--shadow); font-size: .85rem; font-weight: 600; animation: fadeUp .2s ease both; }
.scp-toast i { color: var(--ok); }

/* ---------- Motion ---------- */
/* transform only: content must never stay invisible if animations are paused */
@keyframes riseUp { from { transform: translateY(10px); } to { transform: none; } }
.rise { animation: riseUp .45s cubic-bezier(.2, .8, .2, 1) both; }
.rise-2 { animation-delay: .05s; } .rise-3 { animation-delay: .1s; } .rise-4 { animation-delay: .15s; } .rise-5 { animation-delay: .2s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Bootstrap bits used inside pages ---------- */
.row { --bs-gutter-x: 1.25rem; --bs-gutter-y: 1.25rem; }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--surface-3); }
.btn-close { filter: none; }
[data-theme="glass"] .btn-close { filter: invert(1) grayscale(1) brightness(2); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .hero { grid-template-columns: 1fr; }
    .ring { margin: 0 auto; }
}
@media (max-width: 960px) {
    .scp-sidebar { position: fixed; left: 0; top: 0; transform: translateX(-105%); transition: transform .25s ease; box-shadow: var(--shadow); background: var(--surface-solid); }
    body.nav-open .scp-sidebar { transform: none; }
    .scp-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 35; }
    body.nav-open .scp-scrim { opacity: 1; pointer-events: auto; }
    .scp-menu-btn { display: inline-grid; }
    .scp-topbar { padding: 12px 16px; min-height: 64px; gap: 10px; }
    .scp-content { padding: 20px 16px 32px; }
    .scp-chip { display: none; }
    .scp-user-name, .scp-user-caret { display: none; }
    .scp-user { padding: 3px; }
    .log-table .col-model, .log-table .col-date { display: none; }
}
@media (max-width: 600px) {
    .scp-title p { display: none; }
    .scp-title h1 { font-size: 1.1rem; }
    .hero { padding: 22px; }
    .log-table .col-work { display: none; }
    .log-table .op-cell b, .log-table .op-cell small { max-width: 44vw; }
    .toolbar .seg { width: 100%; justify-content: space-between; }
    .toolbar .seg a { flex: 1; justify-content: center; padding: 7px 4px; gap: 5px; font-size: .78rem; }
    .toolbar .seg a i { display: none; }
    .log-table th:last-child, .log-table td:last-child { display: none; }
    .log-table th, .log-table td { padding: 12px 10px; }
    .log-table .op-cell { gap: 10px; }
    .op-side .hide-sm { display: none; }
}
