/* Ethics Growth Tracker – Support Desk */
:root {
  --bg: #f8f7fc;
  --surface: #ffffff;
  --surface-2: #f3f2fa;
  --ink: #1d1b2e;
  --ink-2: #44425a;
  --muted: #6e6c84;
  --line: #e9e7f3;
  --line-2: #dcd9ec;
  --brand: #5b3df5;
  --brand-ink: #4a2fe0;
  --brand-soft: #efebff;
  --grad: linear-gradient(120deg, #5b3df5 0%, #a43ff0 52%, #f0568c 100%);
  --ok: #0f9f6e; --ok-soft: #e3f7ef;
  --warn: #c27803; --warn-soft: #fff4dc;
  --info: #2563eb; --info-soft: #e6efff;
  --danger: #d6345a; --danger-soft: #ffe9ee;
  --slate: #5e6377; --slate-soft: #eeeff4;
  --shadow-1: 0 1px 2px rgba(29, 27, 46, .05);
  --shadow-2: 0 10px 30px -12px rgba(52, 33, 160, .22);
  --r-sm: 8px; --r: 12px; --r-lg: 18px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12111a; --surface: #1a1925; --surface-2: #222132; --ink: #f1f0f8; --ink-2: #cfcde0; --muted: #9b99b2;
    --line: #2b2a3c; --line-2: #37354b; --brand: #8b73ff; --brand-ink: #a493ff; --brand-soft: #2a2550;
    --ok-soft: #12332a; --warn-soft: #3a2c10; --info-soft: #172848; --danger-soft: #3d1724; --slate-soft: #272838;
    --ok: #3ccf9a; --warn: #f2b443; --info: #6c9bff; --danger: #ff6f8f; --slate: #a3a7bb;
    --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, .6); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12111a; --surface: #1a1925; --surface-2: #222132; --ink: #f1f0f8; --ink-2: #cfcde0; --muted: #9b99b2;
  --line: #2b2a3c; --line-2: #37354b; --brand: #8b73ff; --brand-ink: #a493ff; --brand-soft: #2a2550;
  --ok-soft: #12332a; --warn-soft: #3a2c10; --info-soft: #172848; --danger-soft: #3d1724; --slate-soft: #272838;
  --ok: #3ccf9a; --warn: #f2b443; --info: #6c9bff; --danger: #ff6f8f; --slate: #a3a7bb;
  --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, .6); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15.5px; font-weight: 650; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.spacer { height: 18px; }

/* ---------- buttons & fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 18px -8px rgba(91, 61, 245, .7); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.solid { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn.danger.fill { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.icon { width: 38px; padding: 0; }
.btn.sm.icon { width: 32px; }
.btn svg { width: 17px; height: 17px; flex: none; }

label.field { display: block; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
label.field > small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.input, select.input, textarea.input { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: #140f33; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before, .auth-art::after { content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .85; }
.auth-art::before { width: 520px; height: 520px; background: #6a46ff; top: -140px; left: -120px; }
.auth-art::after { width: 460px; height: 460px; background: #f0568c; bottom: -160px; right: -120px; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .glow { position: absolute; width: 360px; height: 360px; border-radius: 50%; background: #b347f2; filter: blur(80px); top: 38%; left: 30%; opacity: .7; z-index: 0; }
.auth-art h1 { font-size: 40px; line-height: 1.12; max-width: 460px; font-weight: 750; letter-spacing: -.02em; }
.auth-art p { opacity: .82; max-width: 420px; margin-top: 14px; font-size: 16px; }
.auth-flow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.auth-flow span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 6px 12px; border-radius: 99px; font-size: 13px; backdrop-filter: blur(6px); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; }
.auth-card .stack { margin-top: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 6px 16px -6px rgba(164, 63, 240, .8); flex: none; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: -2px; }
.auth-art .brand small { color: rgba(255,255,255,.7); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 4px 8px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 12px; color: var(--muted); padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 550; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .count { margin-left: auto; font-size: 12px; background: var(--surface-2); padding: 1px 8px; border-radius: 99px; color: var(--muted); }
.nav a.active .count { background: var(--surface); color: var(--brand-ink); }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; cursor: pointer; }
.who:hover { background: var(--surface-2); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.who .name { font-weight: 650; font-size: 13.5px; line-height: 1.2; }
.who .role { font-size: 12px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { padding-left: 38px; background: var(--surface); }
.search svg { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; color: var(--muted); }
.page { padding: 26px 28px 60px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .grow p { color: var(--muted); margin-top: 4px; }
.menu-btn { display: none; }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-2); }
  .shell.nav-open .side { transform: none; }
  .menu-btn { display: inline-flex; }
  .top, .page { padding-left: 16px; padding-right: 16px; }
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card.pad { padding: 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 18px 20px; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1100px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: block; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow-2); }
.stat .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13px; }
.stat .value { font-size: 30px; font-weight: 750; margin-top: 6px; letter-spacing: -.02em; }
.stat .dot { width: 8px; height: 8px; border-radius: 50%; }
.stat.hero { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 14px 30px -16px rgba(91, 61, 245, .9); }
.stat.hero .label { color: rgba(255,255,255,.85); }

.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-New { background: var(--info-soft); color: var(--info); }
.st-In-Progress { background: var(--warn-soft); color: var(--warn); }
.st-Resolved { background: var(--ok-soft); color: var(--ok); }
.st-Closed { background: var(--slate-soft); color: var(--slate); }
.pr { font-size: 12.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 5px; }
.pr i { width: 14px; height: 10px; display: inline-flex; gap: 2px; align-items: flex-end; }
.pr i b { width: 3px; background: var(--line-2); border-radius: 1px; }
.pr i b:nth-child(1) { height: 4px; } .pr i b:nth-child(2) { height: 7px; } .pr i b:nth-child(3) { height: 10px; }
.pr-Low i b:nth-child(1) { background: var(--slate); }
.pr-Medium i b:nth-child(-n+2) { background: var(--info); }
.pr-High i b { background: var(--warn); }
.pr-Urgent { color: var(--danger); } .pr-Urgent i b { background: var(--danger); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.brand { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12.5px; font-weight: 650; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
table.t td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--surface-2); }
.t-subject { font-weight: 600; color: var(--ink); max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.t-num { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 12px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 7px 13px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: 13.5px; }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.tabs button .n { margin-left: 6px; font-size: 12px; color: var(--muted); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.filters .input { width: auto; height: 36px; min-width: 150px; }
.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }

.empty { text-align: center; padding: 46px 20px; }
.empty .art { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); }
.empty .art svg { width: 30px; height: 30px; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 16px; }

/* ---------- ticket detail ---------- */
.tk-grid { display: grid; grid-template-columns: 1fr 330px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .tk-grid { grid-template-columns: 1fr; } }
.stepper { display: flex; align-items: center; gap: 0; margin-top: 16px; }
.stepper .s { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.stepper .s i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-style: normal; font-size: 11px; background: var(--surface); }
.stepper .s.done i { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepper .s.now { color: var(--ink); }
.stepper .s.now i { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.stepper .bar { flex: 1; height: 2px; background: var(--line-2); margin: 0 10px; min-width: 18px; }
.stepper .bar.done { background: var(--brand); }

.thread { padding: 4px 0; }
.msg { display: flex; gap: 12px; padding: 16px 20px; }
.msg + .msg { border-top: 1px solid var(--line); }
.msg .bubble { flex: 1; min-width: 0; }
.msg .meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.msg .meta b { font-weight: 650; }
.msg .text { white-space: pre-wrap; word-wrap: break-word; color: var(--ink-2); }
.msg.internal { background: repeating-linear-gradient(-45deg, var(--warn-soft), var(--warn-soft) 10px, color-mix(in srgb, var(--warn-soft) 70%, var(--surface)) 10px, color-mix(in srgb, var(--warn-soft) 70%, var(--surface)) 20px); }
.msg.system { padding: 10px 20px; align-items: center; }
.msg.system .text { color: var(--muted); font-size: 13.5px; }
.msg.system .sys-ico { width: 34px; display: grid; place-items: center; color: var(--muted); }
.msg.system.resolution { background: var(--ok-soft); }
.msg.system.resolution .text { color: var(--ink); }

.files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.file { display: inline-flex; align-items: center; gap: 9px; padding: 7px 11px 7px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); max-width: 280px; color: var(--ink); }
.file:hover { border-color: var(--brand); text-decoration: none; }
.file .ext { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: var(--slate); flex: none; text-transform: uppercase; }
.file .fn, .file .fs { display: block; }
.file .fn { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .fs { font-size: 11.5px; color: var(--muted); }
.file img.thumb { width: 30px; height: 30px; object-fit: cover; border-radius: 8px; flex: none; }

.composer { border-top: 1px solid var(--line); padding: 16px 20px; }
.composer textarea { min-height: 96px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 16px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.drop b { color: var(--brand); }
.chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chosen span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 8px; padding: 4px 6px 4px 10px; font-size: 12.5px; font-weight: 600; }
.chosen button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 4px; }
.seg { display: inline-flex; background: var(--surface-2); padding: 3px; border-radius: 10px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg button.on.warn { color: var(--warn); }

.props { padding: 6px 20px 14px; }
.prop { display: grid; grid-template-columns: 112px 1fr; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; font-size: 13.5px; }
.prop:last-child { border-bottom: 0; }
.prop > span:first-child { color: var(--muted); font-weight: 550; }
.prop select.input { height: 34px; }
.callout { border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: flex-start; }
.callout > svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.callout.ok { background: var(--ok-soft); color: var(--ink); }
.callout.ok > svg { color: var(--ok); }
.callout.info { background: var(--brand-soft); }
.callout.info > svg { color: var(--brand); }
.callout.warn { background: var(--warn-soft); }
.callout.warn > svg { color: var(--warn); }

.timeline { padding: 6px 20px 16px; }
.tl { display: flex; gap: 10px; padding: 8px 0; font-size: 13px; color: var(--ink-2); }
.tl .d { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-top: 7px; flex: none; }
.tl .when { color: var(--muted); font-size: 12px; }

.stars { display: inline-flex; gap: 4px; }
.stars button { border: 0; background: none; cursor: pointer; font-size: 26px; color: var(--line-2); padding: 0; line-height: 1; }
.stars button.on { color: #f5a524; }

/* ---------- charts ---------- */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bars .b { display: grid; grid-template-columns: minmax(110px, 160px) 1fr 40px; gap: 12px; align-items: center; font-size: 13px; }
.bars .b .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-weight: 550; }
.bars .track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bars .fill { height: 100%; border-radius: 99px; background: var(--grad); }
.bars .v { text-align: right; font-weight: 700; }
.trend svg { width: 100%; height: 190px; display: block; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- lists ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- categories ---------- */
.cat { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cat:last-child { border-bottom: 0; }
.cat.off { opacity: .6; }
.subs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sub { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 11px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 550; background: var(--surface); }
.sub.off { opacity: .5; text-decoration: line-through; }
.sub button { border: 0; background: transparent; cursor: pointer; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.sub button:hover { background: var(--surface-2); color: var(--ink); }
.sub button svg { width: 14px; height: 14px; }

/* ---------- notifications dropdown ---------- */
.bell { position: relative; }
.bell .badge { pointer-events: none; position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.pop { position: absolute; right: 0; top: 46px; width: 380px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); z-index: 60; overflow: hidden; }
.pop .list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: inherit; cursor: pointer; }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif.unread { background: color-mix(in srgb, var(--brand-soft) 60%, var(--surface)); }
.notif .ico { width: 32px; height: 32px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.notif .ico svg { width: 16px; height: 16px; }
.notif .tt { font-weight: 650; font-size: 13.5px; }
.notif .bd { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); background: var(--brand-soft); margin-bottom: 18px; }
.banner svg { width: 20px; height: 20px; color: var(--brand); flex: none; }

/* ---------- modal & toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 16, 45, .42); backdrop-filter: blur(3px); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: 0 30px 70px -20px rgba(20, 16, 45, .5); animation: pop .18s; }
.modal.wide { max-width: 720px; }
.modal-head { padding: 20px 22px 0; display: flex; gap: 12px; align-items: flex-start; }
.modal-body { padding: 16px 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-2); max-width: 380px; font-weight: 550; animation: pop .2s; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.toast.err { background: var(--danger); color: #fff; }
.toast small { display: block; opacity: .75; font-weight: 500; }
.err-text { color: var(--danger); font-size: 13px; font-weight: 600; }
.loader { display: grid; place-items: center; padding: 60px; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--brand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- help ---------- */
.help h3 { margin: 18px 0 8px; }
.help ol, .help ul { padding-left: 20px; margin: 6px 0; }
.help li { margin: 4px 0; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.dash-grid > *, .tk-grid > * { min-width: 0; }
@media (max-width: 640px) { .top .btn.primary span { display: none; } .top .btn.primary { width: 38px; padding: 0; } .page-head h1 { font-size: 22px; } }

/* ---------- simple sign-in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px 28px; box-shadow: var(--shadow-2); }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; text-align: center; }
.login-brand .brand-mark { width: 44px; height: 44px; font-size: 18px; border-radius: 12px; }
.login-name { font-size: 19px; font-weight: 700; }
.stats.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .stats.four { grid-template-columns: repeat(2, 1fr); } }
