/* =========================================================================
   AMC Control Panel - design system
   ========================================================================= */

:root {
    /* surfaces */
    --bg:            #070b14;
    --bg-grad-a:     #0b1220;
    --bg-grad-b:     #070b14;
    --surface:       rgba(255, 255, 255, .035);
    --surface-2:     rgba(255, 255, 255, .055);
    --surface-solid: #0e1626;
    --line:          rgba(255, 255, 255, .08);
    --line-strong:   rgba(255, 255, 255, .16);

    /* text */
    --text:      #e8edf7;
    --text-dim:  #93a1bb;
    --text-mute: #64748b;

    /* brand + status */
    --brand:    #6366f1;
    --brand-2:  #22d3ee;
    --ok:       #22c55e;
    --warn:     #f59e0b;
    --bad:      #ef4444;
    --na:       #64748b;
    --pending:  #3f4c63;

    --ok-soft:   rgba(34, 197, 94, .14);
    --warn-soft: rgba(245, 158, 11, .14);
    --bad-soft:  rgba(239, 68, 68, .14);
    --na-soft:   rgba(100, 116, 139, .14);

    --radius:    16px;
    --radius-sm: 10px;
    --shadow:    0 18px 40px -18px rgba(0, 0, 0, .8);

    --sidebar-w: 248px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", "SF Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html {
    height: 100%;
    background: var(--bg);
    color-scheme: dark;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background:
        radial-gradient(1100px 600px at 78% -12%, rgba(99, 102, 241, .18), transparent 60%),
        radial-gradient(900px 520px at 8% 4%, rgba(34, 211, 238, .10), transparent 55%),
        linear-gradient(180deg, var(--bg-grad-a), var(--bg-grad-b));
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Class-based display rules (.btn, .row, ...) outrank the UA [hidden] rule,
   so anything toggled via el.hidden needs this to actually disappear. */
[hidden] { display: none !important; }

svg.ico { width: 16px; height: 16px; flex: 0 0 16px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.02em; }
p  { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(99, 102, 241, .4); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .2); background-clip: content-box; }

/* ------------------------------------------------------------------ shell */

.shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    padding: 22px 16px;
    border-right: 1px solid var(--line);
    background: rgba(7, 11, 20, .6);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    gap: 26px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
}

.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }

.brand-mark {
    width: 38px; height: 38px;
    border-radius: 11px;
    display: grid; place-items: center;
    font-weight: 800; font-size: 15px; letter-spacing: -.04em;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 8px 20px -8px var(--brand);
}

.brand-name  { font-weight: 680; font-size: 14.5px; letter-spacing: -.01em; }
.brand-sub   { font-size: 11px; color: var(--text-mute); letter-spacing: .04em; text-transform: uppercase; }

.nav-label {
    font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase;
    color: var(--text-mute); padding: 0 10px; margin-bottom: 8px;
}

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav a {
    display: flex; align-items: center; gap: 11px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-weight: 520;
    transition: background .15s, color .15s, transform .15s;
}

.nav a:hover { background: var(--surface); color: var(--text); }

.nav a.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, .22), rgba(99, 102, 241, .05));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, .3);
}

.nav a .ico { width: 17px; height: 17px; flex: 0 0 17px; opacity: .9; }
.nav a .count {
    margin-left: auto; font-size: 11px; font-weight: 640;
    background: var(--surface-2); padding: 1px 7px; border-radius: 99px;
}
.nav a .count.hot { background: var(--bad-soft); color: #fca5a5; }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }

.who {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--line);
}
.avatar {
    width: 30px; height: 30px; border-radius: 9px; flex: 0 0 30px;
    display: grid; place-items: center; font-size: 12px; font-weight: 700;
    background: linear-gradient(135deg, #334155, #1e293b); color: #cbd5e1;
}
.who-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.who-role {
    font-size: 11px; color: var(--text-mute);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.who > div { min-width: 0; }

/* ------------------------------------------------------------------- main */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 16px;
    padding: 16px 26px;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 11, 20, .72);
    backdrop-filter: blur(14px);
}

.topbar h1 { font-size: 19px; }
.topbar .sub { font-size: 12.5px; color: var(--text-mute); margin-top: 1px; }
.topbar .spacer { flex: 1; }

.content { padding: 24px 26px 60px; }

.menu-toggle { display: none; }

/* ----------------------------------------------------------------- pieces */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.card-head {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 14px; }
.card-head .spacer { flex: 1; }
.card-head .hint { font-size: 11.5px; color: var(--text-mute); }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row   { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.push  { margin-left: auto; }

/* ------------------------------------------------------------- stat tiles */

.stat {
    position: relative; overflow: hidden;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat::after {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, var(--tint, var(--brand)), transparent 75%);
    opacity: .85;
}

.stat-label {
    font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--text-mute); display: flex; align-items: center; gap: 7px;
}
.stat-value {
    font-size: 30px; font-weight: 700; letter-spacing: -.035em;
    line-height: 1.15; margin-top: 8px;
    font-variant-numeric: tabular-nums;
}
.stat-value small { font-size: 15px; font-weight: 600; color: var(--text-mute); margin-left: 2px; }
.stat-foot { margin-top: 6px; font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.stat-spark { margin-top: 10px; height: 34px; }

.delta { font-weight: 640; font-variant-numeric: tabular-nums; }
.delta.up   { color: #4ade80; }
.delta.down { color: #f87171; }
.delta.flat { color: var(--text-mute); }

/* --------------------------------------------------------------- badges */

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: 99px;
    font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
    border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

.badge.working, .badge.ok       { background: var(--ok-soft);   color: #6ee7a0; border-color: rgba(34, 197, 94, .25); }
.badge.issue,   .badge.warn     { background: var(--warn-soft); color: #fcd34d; border-color: rgba(245, 158, 11, .25); }
.badge.down,    .badge.bad      { background: var(--bad-soft);  color: #fca5a5; border-color: rgba(239, 68, 68, .25); }
.badge.na, .badge.pending, .badge.muted { background: var(--na-soft); color: #a3b1c6; border-color: rgba(100, 116, 139, .25); }
.badge.brand { background: rgba(99, 102, 241, .16); color: #a5b4fc; border-color: rgba(99, 102, 241, .3); }

.badge.critical { background: var(--bad-soft); color: #fca5a5; border-color: rgba(239, 68, 68, .3); }
.badge.high     { background: rgba(249, 115, 22, .14); color: #fdba74; border-color: rgba(249, 115, 22, .3); }
.badge.medium   { background: var(--warn-soft); color: #fcd34d; border-color: rgba(245, 158, 11, .25); }
.badge.low      { background: var(--na-soft); color: #a3b1c6; border-color: rgba(100, 116, 139, .25); }

.pill {
    font-size: 11px; padding: 2px 8px; border-radius: 6px;
    background: var(--surface-2); color: var(--text-dim); font-weight: 560;
}

/* -------------------------------------------------------------- buttons */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--text);
    font: inherit; font-size: 13px; font-weight: 580;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s, opacity .15s;
    white-space: nowrap;
}
.btn:hover  { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .24); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn.primary {
    background: linear-gradient(135deg, var(--brand), #4f46e5);
    border-color: transparent; color: #fff;
    box-shadow: 0 10px 24px -12px var(--brand);
}
.btn.primary:hover { filter: brightness(1.08); }

.btn.ok    { background: rgba(34, 197, 94, .18);  border-color: rgba(34, 197, 94, .35);  color: #86efac; }
.btn.danger{ background: rgba(239, 68, 68, .14);  border-color: rgba(239, 68, 68, .3);   color: #fca5a5; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); }
.btn.sm    { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.icon  { padding: 7px; width: 32px; }

.btn-group { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.btn-group a, .btn-group button {
    padding: 6px 12px; font-size: 12.5px; font-weight: 560;
    background: transparent; border: 0; color: var(--text-dim); cursor: pointer; font-family: inherit;
}
.btn-group a + a, .btn-group button + button { border-left: 1px solid var(--line); }
.btn-group a:hover, .btn-group button:hover { background: var(--surface-2); color: var(--text); }
.btn-group .on { background: rgba(99, 102, 241, .22); color: #fff; }

/* --------------------------------------------------------------- forms */

label.fld { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-dim); font-weight: 560; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="date"], input[type="number"], select, textarea {
    width: 100%;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: rgba(3, 7, 15, .55);
    color: var(--text);
    font: inherit; font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(99, 102, 241, .65);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .16);
}
input::placeholder, textarea::placeholder { color: #4b5a72; }
textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%2393a1bb' stroke-width='1.5' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
input[type="color"] { padding: 2px; height: 36px; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }

.err { color: #fca5a5; font-size: 12px; margin-top: 4px; }

/* --------------------------------------------------------------- tables */

table.data { width: 100%; border-collapse: collapse; }
table.data th {
    text-align: left; font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
    color: var(--text-mute); font-weight: 600;
    padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid rgba(255, 255, 255, .045); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: rgba(255, 255, 255, .022); }
table.data .num { font-variant-numeric: tabular-nums; text-align: right; }

.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------ dashboard */

.hero {
    display: flex; align-items: center; gap: 26px;
    padding: 22px 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background:
        radial-gradient(600px 200px at 90% 0%, rgba(99, 102, 241, .16), transparent 70%),
        var(--surface);
    box-shadow: var(--shadow);
}
.hero-gauge { flex: 0 0 auto; }
.hero-copy  { min-width: 0; flex: 1; }
.hero-copy h2 { font-size: 22px; letter-spacing: -.03em; }
.hero-copy p  { color: var(--text-dim); margin-top: 6px; font-size: 13px; }
.hero-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 10px; border-radius: 8px;
    background: rgba(3, 7, 15, .45); border: 1px solid var(--line);
    font-size: 12px; color: var(--text-dim);
}
.chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.chip .dot { width: 7px; height: 7px; border-radius: 99px; }

/* platform cards */
.plat {
    padding: 16px; border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--surface);
    display: flex; flex-direction: column; gap: 12px;
    transition: border-color .18s, transform .18s;
}
.plat:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.plat-top { display: flex; align-items: center; gap: 11px; }
.plat-icon {
    width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--tint) 18%, transparent);
    color: var(--tint);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 30%, transparent);
}
.plat-icon svg { width: 17px; height: 17px; }
.plat-name { font-weight: 620; font-size: 14px; }
.plat-meta {
    font-size: 11.5px; color: var(--text-mute);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.meter { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; display: flex; }
.meter i { display: block; height: 100%; }
.meter i.ok   { background: linear-gradient(90deg, #16a34a, #4ade80); }
.meter i.warn { background: #f59e0b; }
.meter i.bad  { background: #ef4444; }

.plat-foot { display: flex; align-items: baseline; gap: 8px; font-size: 12px; color: var(--text-mute); }
.plat-foot b { font-size: 17px; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* calendar heat strip */
.heat { display: flex; gap: 4px; flex-wrap: wrap; }
.heat span {
    width: 15px; height: 15px; border-radius: 4px;
    background: var(--pending);
    position: relative; cursor: default;
    transition: transform .12s;
}
.heat span:hover { transform: scale(1.25); z-index: 2; }
.heat span.l0 { background: rgba(239, 68, 68, .85); }
.heat span.l1 { background: rgba(245, 158, 11, .85); }
.heat span.l2 { background: rgba(132, 204, 22, .8); }
.heat span.l3 { background: rgba(34, 197, 94, .95); }
.heat span.miss { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, .35); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-mute); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

/* ------------------------------------------------------------- checklist */

.plat-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }

.plat-block > header {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 16px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--tint) 12%, transparent), transparent 60%);
    border-bottom: 1px solid var(--line);
}
.plat-block > header .plat-name { font-size: 14.5px; }

.mods { display: flex; flex-direction: column; }

.mod {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px 16px;
    align-items: center;
    padding: 11px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    transition: background .15s;
}
.mod:last-child { border-bottom: 0; }
.mod:hover { background: rgba(255, 255, 255, .022); }
.mod.is-working { box-shadow: inset 3px 0 0 var(--ok); }
.mod.is-issue   { box-shadow: inset 3px 0 0 var(--warn); background: rgba(245, 158, 11, .04); }
.mod.is-down    { box-shadow: inset 3px 0 0 var(--bad);  background: rgba(239, 68, 68, .05); }
.mod.is-na      { box-shadow: inset 3px 0 0 var(--na); opacity: .72; }
.mod.is-pending { box-shadow: inset 3px 0 0 var(--pending); }

.mod-name { font-weight: 560; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.mod-desc { font-size: 11.5px; color: var(--text-mute); margin-top: 2px; }
.mod-remark { grid-column: 1 / -1; }
.mod-remark input { font-size: 12.5px; padding: 7px 10px; }

.seg { display: inline-flex; background: rgba(3, 7, 15, .5); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button {
    border: 0; background: transparent; cursor: pointer;
    font: inherit; font-size: 12px; font-weight: 580;
    color: var(--text-mute);
    padding: 5px 11px; border-radius: 7px;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .14s, color .14s;
}
.seg button:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.seg button .dot { width: 7px; height: 7px; border-radius: 99px; background: currentColor; opacity: .85; }
.seg button[data-on="1"][data-status="working"] { background: var(--ok-soft);   color: #6ee7a0; }
.seg button[data-on="1"][data-status="issue"]   { background: var(--warn-soft); color: #fcd34d; }
.seg button[data-on="1"][data-status="down"]    { background: var(--bad-soft);  color: #fca5a5; }
.seg button[data-on="1"][data-status="na"]      { background: var(--na-soft);   color: #cbd5e1; }

.btn.warn-ghost {
    background: var(--warn-soft);
    border-color: rgba(245, 158, 11, .35);
    color: #fcd34d;
}
.btn.warn-ghost:hover { background: rgba(245, 158, 11, .22); border-color: rgba(245, 158, 11, .5); }

.mod.flash { animation: modflash 1.4s ease; }

@keyframes modflash {
    0%, 100% { background: transparent; }
    15%      { background: rgba(99, 102, 241, .28); }
}

.mod:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.progress-wrap { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .35s ease; }

.sticky-bar {
    position: sticky; bottom: 0; z-index: 15;
    margin-top: 18px;
    padding: 13px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--line-strong);
    background: rgba(10, 16, 28, .92);
    backdrop-filter: blur(12px);
    box-shadow: 0 -10px 30px -14px rgba(0, 0, 0, .9);
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}

/* ---------------------------------------------------------------- manage */

.mod-item { border-bottom: 1px solid rgba(255, 255, 255, .04); }
.mod-item:last-of-type { border-bottom: 0; }
.mod-item[open] { background: rgba(3, 7, 15, .35); }
.mod-item[open] > .mod-line .pill { background: rgba(99, 102, 241, .22); color: #a5b4fc; }

.mod-line {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px;
    list-style: none; cursor: pointer;
    transition: background .15s;
}
.mod-line::-webkit-details-marker { display: none; }
.mod-line:hover { background: rgba(255, 255, 255, .03); }
.mod-line.off { opacity: .5; }
.mod-line .grip { color: var(--text-mute); cursor: grab; display: grid; place-items: center; }
.mod-line.dragging { opacity: .4; background: rgba(99, 102, 241, .1); }
.mod-line.drop-target { box-shadow: inset 0 2px 0 var(--brand); }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input[type="text"] { min-width: 180px; flex: 1; }

details.editor { border-top: 1px solid var(--line); }
details.editor > summary {
    cursor: pointer; list-style: none; padding: 10px 16px;
    font-size: 12.5px; color: var(--text-dim); font-weight: 560;
    display: flex; align-items: center; gap: 8px;
}
details.editor > summary::-webkit-details-marker { display: none; }
details.editor > summary:hover { color: var(--text); background: var(--surface); }
details.editor[open] > summary { color: var(--text); }
details.editor .editor-body { padding: 14px 16px 16px; background: rgba(3, 7, 15, .3); }

.mod-item .editor-body { padding: 4px 16px 16px 40px; }
.mod-item .pill { display: inline-flex; align-items: center; gap: 5px; }
.mod-item .pill svg { width: 12px; height: 12px; }

/* ----------------------------------------------------------- screenshots */

.dropzone {
    display: flex; align-items: center; gap: 13px;
    padding: 16px 18px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: rgba(3, 7, 15, .35);
    cursor: pointer;
    transition: border-color .16s, background .16s;
}
.dropzone:hover { border-color: rgba(99, 102, 241, .55); background: rgba(99, 102, 241, .06); }
.dropzone.over  { border-color: var(--brand); background: rgba(99, 102, 241, .12); }

.dropzone .dz-icon { width: 26px; height: 26px; flex: 0 0 26px; color: var(--text-mute); }
.dropzone .dz-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-dim); }
.dropzone .dz-text b { color: var(--text); font-weight: 600; }

.thumb-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.thumb {
    position: relative; margin: 0;
    width: 82px; height: 82px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: rgba(3, 7, 15, .5);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.thumb figcaption {
    position: absolute; inset: auto 0 0 0;
    padding: 3px 5px; font-size: 9.5px; line-height: 1.3;
    background: rgba(0, 0, 0, .72); color: #cbd5e1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.thumb-x { position: absolute; top: 3px; right: 3px; }
.thumb-x button {
    width: 19px; height: 19px; border-radius: 6px;
    border: 0; cursor: pointer; font-size: 14px; line-height: 1;
    background: rgba(0, 0, 0, .68); color: #fca5a5;
}
.thumb-x button:hover { background: var(--bad); color: #fff; }

details.add-shots { margin-top: 6px; }
details.add-shots > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    color: var(--text-mute); font-weight: 550;
}
details.add-shots > summary::-webkit-details-marker { display: none; }
details.add-shots > summary:hover { color: var(--text-dim); }
details.add-shots svg { width: 13px; height: 13px; }

/* ------------------------------------------------------------- lightbox */

.lightbox {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    background: rgba(3, 6, 12, .93);
    backdrop-filter: blur(6px);
    padding: 40px 64px;
    animation: fadein .16s ease;
}
.lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.lightbox img {
    max-width: 100%; max-height: calc(100vh - 130px);
    border-radius: var(--radius-sm);
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .9);
    object-fit: contain;
}
.lightbox figcaption { font-size: 12.5px; color: var(--text-dim); text-align: center; }

.lightbox-close, .lightbox-nav {
    position: absolute; border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, .07); color: var(--text);
    border-radius: 50%; cursor: pointer; line-height: 1;
    display: grid; place-items: center;
    transition: background .15s;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255, 255, 255, .18); }
.lightbox-close { top: 18px; right: 20px; width: 38px; height: 38px; font-size: 24px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 30px; }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }

@keyframes fadein { from { opacity: 0; } }

@media (max-width: 860px) {
    .lightbox { padding: 56px 12px; }
    .lightbox-nav { width: 36px; height: 36px; font-size: 24px; }
}

/* ---------------------------------------------------------------- misc */

.empty { text-align: center; padding: 44px 20px; color: var(--text-mute); }
.empty svg { width: 34px; height: 34px; opacity: .35; margin-bottom: 10px; }
.empty h4 { color: var(--text-dim); font-size: 14px; margin-bottom: 4px; }

.flash {
    position: fixed; right: 20px; bottom: 20px; z-index: 100;
    display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}
.toast {
    padding: 11px 15px; border-radius: var(--radius-sm);
    background: rgba(14, 22, 38, .96); border: 1px solid var(--line-strong);
    box-shadow: var(--shadow); font-size: 13px;
    display: flex; align-items: center; gap: 9px;
    animation: rise .25s ease both;
}
.toast.ok  { border-color: rgba(34, 197, 94, .4); }
.toast.bad { border-color: rgba(239, 68, 68, .4); }
.toast.out { animation: fade .3s ease both; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { to { opacity: 0; transform: translateY(6px); } }

.mono { font-family: var(--mono); font-size: 12.5px; }
.dim  { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.hr { height: 1px; background: var(--line); margin: 4px 0; }

.tooltip {
    position: fixed; z-index: 200; pointer-events: none;
    padding: 7px 10px; border-radius: 8px; font-size: 12px;
    background: rgba(10, 16, 28, .97); border: 1px solid var(--line-strong);
    box-shadow: var(--shadow); white-space: nowrap; opacity: 0;
    transition: opacity .12s;
}
.tooltip.on { opacity: 1; }

/* --------------------------------------------------------------- charts */

.chart { width: 100%; display: block; }
.chart .grid-line { stroke: rgba(255, 255, 255, .06); stroke-width: 1; }
.chart .axis-text { fill: #64748b; font-size: 10px; font-family: var(--font); }
.chart .hover-line { stroke: rgba(255, 255, 255, .25); stroke-width: 1; stroke-dasharray: 3 3; }

/* ---------------------------------------------------------------- login */

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; padding: 30px; }
.login-card .brand { justify-content: center; margin-bottom: 22px; }

/* ---------------------------------------------------------------- print */

@media print {
    body { background: #fff; color: #111; }
    .sidebar, .topbar, .no-print, .flash { display: none !important; }
    .content { padding: 0; }
    .card, .plat-block { border-color: #ddd; box-shadow: none; background: #fff; }
    table.data th { color: #444; border-color: #ddd; }
    table.data td { border-color: #eee; }
    .badge { border: 1px solid #ccc; color: #111 !important; background: #f6f6f6 !important; }
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 1180px) {
    .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .g-2-1, .g-1-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
    .sidebar {
        position: fixed; inset: 0 auto 0 0;
        transform: translateX(-100%); transition: transform .22s ease;
    }
    .sidebar.open { transform: none; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 18px 14px 60px; }
    .topbar { padding: 13px 14px; }
    .g-4, .g-2 { grid-template-columns: minmax(0, 1fr); }
    .hero { flex-direction: column; align-items: flex-start; }
    .hero-actions { flex-direction: row; width: 100%; }
    .mod { grid-template-columns: minmax(0, 1fr); }
    .seg { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
