/* STTT One Player panel — design system.
   Tokens first (dark by default, light via the system setting or the Appearance menu, six accents,
   two densities), then layout, then components. Nothing here depends on a build step. */

:root {
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;

  --bg: #080a0f; --bg-2: #0c0f15;
  --surface: #11141c; --surface-2: #161a24; --surface-3: #1d2230; --hover: rgba(255, 255, 255, .045);
  --border: #1f2532; --border-2: #2b3244; --ring: rgba(255, 255, 255, .06);
  --text: #eef0f6; --text-2: #c3c8d6; --muted: #8b93a7; --faint: #5b6478;

  --accent: #e5384f; --accent-fg: #fff;
  --accent-2: color-mix(in srgb, var(--accent) 62%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 15%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 38%, transparent);

  --ok: #34d399; --warn: #fbbf24; --bad: #fb7185; --info: #60a5fa;
  --ok-soft: rgba(52, 211, 153, .13); --warn-soft: rgba(251, 191, 36, .13); --bad-soft: rgba(251, 113, 133, .14); --info-soft: rgba(96, 165, 250, .13);

  --radius: 14px; --radius-sm: 10px; --radius-xs: 7px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .035) inset, 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-pop: 0 18px 50px -12px rgba(0, 0, 0, .75), 0 0 0 1px var(--border-2);
  --glow: radial-gradient(900px 420px at 8% -8%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%);

  --side-w: 248px; --top-h: 60px;
  --row-pad: 12px; --card-pad: 20px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5f9; --bg-2: #eceff5;
  --surface: #ffffff; --surface-2: #f6f8fb; --surface-3: #eceff5; --hover: rgba(15, 23, 42, .045);
  --border: #e2e6ee; --border-2: #cdd4e0; --ring: rgba(15, 23, 42, .06);
  --text: #121623; --text-2: #3a4256; --muted: #667089; --faint: #98a1b5;
  --ok: #0f9d6b; --warn: #b7791f; --bad: #d6334f; --info: #2563eb;
  --ok-soft: rgba(15, 157, 107, .11); --warn-soft: rgba(183, 121, 31, .12); --bad-soft: rgba(214, 51, 79, .1); --info-soft: rgba(37, 99, 235, .1);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -14px rgba(16, 24, 40, .18);
  --shadow-pop: 0 18px 50px -14px rgba(16, 24, 40, .35), 0 0 0 1px var(--border-2);
  --glow: radial-gradient(900px 420px at 8% -8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    --bg: #f3f5f9; --bg-2: #eceff5;
    --surface: #ffffff; --surface-2: #f6f8fb; --surface-3: #eceff5; --hover: rgba(15, 23, 42, .045);
    --border: #e2e6ee; --border-2: #cdd4e0; --ring: rgba(15, 23, 42, .06);
    --text: #121623; --text-2: #3a4256; --muted: #667089; --faint: #98a1b5;
    --ok: #0f9d6b; --warn: #b7791f; --bad: #d6334f; --info: #2563eb;
    --ok-soft: rgba(15, 157, 107, .11); --warn-soft: rgba(183, 121, 31, .12); --bad-soft: rgba(214, 51, 79, .1); --info-soft: rgba(37, 99, 235, .1);
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -14px rgba(16, 24, 40, .18);
    --shadow-pop: 0 18px 50px -14px rgba(16, 24, 40, .35), 0 0 0 1px var(--border-2);
    --glow: radial-gradient(900px 420px at 8% -8%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%);
    color-scheme: light;
  }
}
:root[data-accent="violet"] { --accent: #8b5cf6; }
:root[data-accent="blue"] { --accent: #3b82f6; }
:root[data-accent="teal"] { --accent: #14b8a6; }
:root[data-accent="amber"] { --accent: #f59e0b; --accent-fg: #1a1203; }
:root[data-accent="green"] { --accent: #22c55e; --accent-fg: #04210f; }
:root[data-accent="pink"] { --accent: #ec4899; }
:root[data-density="compact"] { --row-pad: 7px; --card-pad: 15px; }

/* ---- base ---------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); letter-spacing: -.003em; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; background: var(--glow); pointer-events: none; z-index: 0; }
a { color: var(--accent-2); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent-line); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-feature-settings: "zero"; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.grow { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); background-clip: padding-box; border: 2px solid transparent; }
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ic.sm { width: 15px; height: 15px; } .ic.lg { width: 22px; height: 22px; }

/* ---- shell --------------------------------------------------------------------------------------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
.app.collapsed { --side-w: 76px; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: color-mix(in srgb, var(--surface) 86%, var(--bg)); border-right: 1px solid var(--border); padding: 14px 12px; z-index: 30; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 16px; cursor: pointer; user-select: none; }
.brand .mark { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 17px; color: var(--accent-fg);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 18px -4px var(--accent-line), 0 0 0 1px rgba(255, 255, 255, .12) inset; }
.brand .name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; white-space: nowrap; }
.brand .name small { display: block; font-weight: 500; font-size: 11px; letter-spacing: .02em; color: var(--muted); margin-top: -2px; }
.side-nav { flex: 1; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--faint); padding: 16px 10px 6px; white-space: nowrap; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; margin: 1px 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-2); font: inherit; font-weight: 500; cursor: pointer; text-align: left; white-space: nowrap; transition: background .12s, color .12s; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item .ic { color: var(--muted); transition: color .12s; }
.nav-item.on { background: var(--accent-soft); color: var(--text); }
.nav-item.on .ic { color: var(--accent-2); }
.nav-item.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-item .badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-fg); font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; }
.nav-item .badge.warn { background: var(--warn); color: #1a1203; }
.app.collapsed .brand .name, .app.collapsed .nav-label, .app.collapsed .nav-item span.t, .app.collapsed .side-foot .who-t { display: none; }
.app.collapsed .nav-item { justify-content: center; padding: 11px 0; } .app.collapsed .nav-item .badge { position: absolute; top: 3px; right: 6px; margin: 0; min-width: 16px; line-height: 16px; font-size: 10px; padding: 0 4px; }
.app.collapsed .nav-item.on::before { left: -12px; }
.app.collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
.side-foot { border-top: 1px solid var(--border); margin: 8px -4px 0; padding: 12px 4px 0; display: flex; align-items: center; gap: 10px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 8px 4px 4px; margin: -4px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; } .who:hover { background: var(--hover); }
.app.collapsed .side-foot { flex-direction: column; gap: 6px; } .app.collapsed .side-foot .grow { display: none; } .app.collapsed .who { padding: 0; margin: 0; background: none; } .app.collapsed #collapse-btn .ic { transform: rotate(180deg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent-fg); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.who-t { min-width: 0; line-height: 1.25; } .who-t b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .who-t span { font-size: 12px; color: var(--muted); }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid var(--border); }
.search-trigger { display: flex; align-items: center; gap: 10px; flex: 0 1 460px; min-width: 0; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: inherit; cursor: pointer; text-align: left; transition: border-color .12s, background .12s; }
.search-trigger:hover { border-color: var(--border-2); background: var(--surface-2); }
.search-trigger span.ph { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; background: var(--surface-2); color: var(--muted); font: 600 11px/16px var(--font); text-align: center; }
.live { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.live:hover { border-color: var(--border-2); }
.live .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); animation: pulse 2s infinite; }
.live.paused .pulse { background: var(--faint); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.icon-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid transparent; background: none; color: var(--text-2); cursor: pointer; position: relative; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .dotbadge { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.menu-btn { display: none; }
.content { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 28px 28px 80px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .titles { flex: 1 1 280px; min-width: 0; }
.page-title { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-sub { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a, .crumbs button { color: var(--muted); background: none; border: 0; padding: 0; font: inherit; cursor: pointer; } .crumbs a:hover, .crumbs button:hover { color: var(--text); text-decoration: none; }
.view { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, ::before, ::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---- layout helpers ------------------------------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row.center { align-items: center; } .row.tight { gap: 8px; }
.row > .f1 { flex: 1 1 180px; min-width: 0; } .row > .fit { flex: 0 0 auto; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.auto-lg { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.main-side { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.fields.wide { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
@media (max-width: 1100px) { .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .main-side { grid-template-columns: 1fr; } .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* ---- cards ---------------------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--card-pad); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.accent { border-color: var(--accent-line); background: linear-gradient(180deg, var(--accent-soft), transparent 55%), var(--surface); }
.card.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); background: linear-gradient(180deg, var(--warn-soft), transparent 60%), var(--surface); }
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; min-height: 28px; }
.card.flush > .card-head { margin: 0; padding: 16px var(--card-pad); border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.card-title .ic { color: var(--muted); }
.card-sub { color: var(--muted); font-size: 13px; }
.card-head .count { color: var(--muted); font-weight: 500; font-size: 13px; }
.card + .card { margin-top: 0; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 12px; line-height: 1.5; }
.divider { height: 1px; background: var(--border); margin: 18px 0; border: 0; }
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }

/* ---- stat tiles ------------------------------------------------------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { position: relative; display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 14px; box-shadow: var(--shadow); font: inherit; color: inherit; overflow: hidden; }
button.kpi { cursor: pointer; transition: transform .14s ease, border-color .14s, background .14s; }
button.kpi:hover { transform: translateY(-2px); border-color: var(--border-2); background: var(--surface-2); }
.kpi .top { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .bubble { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.kpi.ok .bubble { background: var(--ok-soft); color: var(--ok); } .kpi.warn .bubble { background: var(--warn-soft); color: var(--warn); } .kpi.bad .bubble { background: var(--bad-soft); color: var(--bad); } .kpi.info .bubble { background: var(--info-soft); color: var(--info); }
.kpi .val { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 12px; font-variant-numeric: tabular-nums; }
.kpi .foot { color: var(--muted); font-size: 12.5px; margin-top: 4px; min-height: 18px; display: flex; align-items: center; gap: 6px; }
.kpi .spark { position: absolute; right: 12px; top: 50px; width: 44%; height: 38px; opacity: .95; pointer-events: none; }
.up { color: var(--ok); } .down { color: var(--bad); }

/* ---- buttons --------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 550; white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s, transform .08s, box-shadow .12s; }
.btn:hover { background: var(--surface-3); border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn.primary { border-color: transparent; color: var(--accent-fg); background: linear-gradient(180deg, var(--accent-2), var(--accent) 70%); box-shadow: 0 6px 18px -8px var(--accent), 0 1px 0 rgba(255, 255, 255, .25) inset; }
.btn.primary:hover { filter: brightness(1.08); box-shadow: 0 8px 22px -8px var(--accent), 0 1px 0 rgba(255, 255, 255, .3) inset; }
.btn.soft { border-color: transparent; background: var(--accent-soft); color: var(--text); } .btn.soft:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); } .btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 34%, var(--border-2)); background: transparent; } .btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.danger.fill { background: var(--bad); color: #fff; border-color: transparent; } .btn.danger.fill:hover { filter: brightness(1.1); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn.icon { width: 38px; padding: 0; } .btn.icon.sm { width: 30px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .ic { width: 16px; height: 16px; } .btn.sm .ic { width: 14px; height: 14px; }
.btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; margin-left: -1px; } .btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); margin-left: 0; } .btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.link { background: none; border: 0; padding: 0; color: var(--accent-2); font: inherit; cursor: pointer; } .link:hover { text-decoration: underline; }

/* ---- forms ----------------------------------------------------------------------------------------- */
input, select, textarea { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--bg-2); color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s, background .12s; }
:root[data-theme="light"] input, :root[data-theme="light"] select, :root[data-theme="light"] textarea { background: var(--surface-2); }
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
select[multiple] { height: auto; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: color-mix(in srgb, var(--accent) 38%, var(--text-2)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 11%, transparent); }
input[type=checkbox], input[type=radio] { appearance: none; width: 18px; height: 18px; padding: 0; flex: none; border-radius: 6px; border: 1.5px solid var(--border-2); background: var(--bg-2); display: inline-grid; place-items: center; cursor: pointer; transition: all .12s; vertical-align: middle; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--accent-fg); border-bottom: 2px solid var(--accent-fg); transform: rotate(-45deg) translate(1px, -1px); }
input[type=radio]:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-fg); }
input[type=checkbox]:indeterminate { background: var(--accent); border-color: var(--accent); } input[type=checkbox]:indeterminate::after { content: ""; width: 8px; height: 2px; background: var(--accent-fg); }
input[type=file] { height: auto; padding: 8px 10px; }
input[type=datetime-local] { color-scheme: inherit; }
.field > label, .lbl { display: block; font-size: 12.5px; font-weight: 550; color: var(--text-2); margin-bottom: 6px; }
.field .hint { margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; margin: 0 !important; }
.input-icon { position: relative; } .input-icon > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; } .input-icon input { padding-left: 38px; }
.switch { appearance: none; width: 38px !important; height: 22px !important; border-radius: 99px !important; border: 0 !important; background: var(--border-2) !important; position: relative; transition: background .15s; }
.switch::after { content: "" !important; position: absolute; width: 16px !important; height: 16px !important; border: 0 !important; border-radius: 50%; background: #fff !important; top: 3px; left: 3px; transform: none !important; transition: transform .15s; }
.switch:checked { background: var(--accent) !important; } .switch:checked::after { transform: translateX(16px) !important; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-sm); background: var(--bg-2); border: 1px solid var(--border); }
:root[data-theme="light"] .seg { background: var(--surface-3); }
.seg button { height: 30px; padding: 0 13px; border-radius: 8px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.seg button:hover { color: var(--text); } .seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
:root[data-theme="light"] .seg button.on { background: var(--surface); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; transition: all .12s; white-space: nowrap; }
.chip:hover { border-color: var(--faint); color: var(--text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.chip .n { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.chip.on .n { background: var(--accent); color: var(--accent-fg); }
.chip.warn .n { background: var(--warn-soft); color: var(--warn); } .chip.bad .n { background: var(--bad-soft); color: var(--bad); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); } .tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tabs .n { padding: 0 7px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; line-height: 19px; }

/* ---- pills, dots, progress -------------------------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.plain::before { display: none; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); } .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); } .pill.accent { background: var(--accent-soft); color: var(--accent-2); } .pill.neutral { background: var(--surface-3); color: var(--muted); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s ease; }
.progress.ok > i { background: var(--ok); } .progress.warn > i { background: var(--warn); } .progress.bad > i { background: var(--bad); }

/* ---- tables ------------------------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; }
.t th { position: sticky; top: 0; z-index: 1; text-align: left; padding: 11px 14px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: color-mix(in srgb, var(--surface) 92%, var(--surface-3)); border-bottom: 1px solid var(--border); white-space: nowrap; }
.t td { padding: var(--row-pad) 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; transition: background .08s; } .t tbody tr.click:hover { background: var(--hover); }
.t tbody tr.sel { background: var(--accent-soft); }
.t th.sort { cursor: pointer; user-select: none; } .t th.sort:hover { color: var(--text); } .t th.sort.on { color: var(--text); }
.t th.sort.on::after { content: "↓"; margin-left: 6px; color: var(--accent-2); } .t th.sort.on.asc::after { content: "↑"; }
.t td.sm, .t th.sm { width: 1%; white-space: nowrap; }
.t .cellmain { font-weight: 600; } .t .cellsub { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .12s; } .t tr:hover .row-actions, .t tr:focus-within .row-actions, .row-actions.show { opacity: 1; }
@media (hover: none) { .row-actions { opacity: 1; } }
.dev-ic { width: 36px; height: 36px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.dev-ic.tv { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-2); } .dev-ic.phone { background: var(--info-soft); color: var(--info); } .dev-ic.pc { background: var(--ok-soft); color: var(--ok); }
.devcell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.copyw { display: inline-flex; align-items: center; gap: 4px; } .copy { display: inline-grid; place-items: center; background: none; border: 0; padding: 3px; border-radius: 6px; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .1s; } .copy .ic { width: 13px; height: 13px; } .copy:hover { background: var(--hover); color: var(--text); } .copyw:hover .copy, tr:hover .copy, .copy:focus-visible { opacity: 1; } @media (hover: none) { .copy { opacity: .7; } }
.tagrow { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 550; white-space: nowrap; }
.more { display: flex; justify-content: center; padding: 14px; }

/* ---- bulk bar ------------------------------------------------------------------------------------------- */
.bulkbar { position: sticky; bottom: 16px; z-index: 15; margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--surface-3) 94%, transparent); backdrop-filter: blur(12px); border: 1px solid var(--accent-line); box-shadow: var(--shadow-pop); }
.bulkbar .count { font-weight: 700; padding: 0 8px; } .bulkbar select, .bulkbar input { width: auto; height: 32px; }
.bulkbar .sep { width: 1px; height: 22px; background: var(--border-2); margin: 0 4px; }

/* ---- list items, empty, skeleton -------------------------------------------------------------------------- */
.item { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.item + .item { margin-top: 10px; } .item .main { flex: 1 1 240px; min-width: 0; } .item .sub { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; margin-top: 2px; }
.item.unread { border-color: var(--accent-line); box-shadow: inset 3px 0 0 var(--accent); }
.item.click { cursor: pointer; transition: background .1s, border-color .1s; } .item.click:hover { background: var(--surface-3); border-color: var(--border-2); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 34px 20px; color: var(--muted); }
.empty .bub { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--faint); margin-bottom: 6px; } .empty .bub .ic { width: 24px; height: 24px; }
.empty b { color: var(--text); font-size: 15px; } .empty p { max-width: 46ch; }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 11px 18px; } .kv > :nth-child(odd) { color: var(--muted); } .kv > :nth-child(even) { overflow-wrap: anywhere; }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv > :nth-child(even) { margin-bottom: 10px; } }
.banner { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--border)); background: linear-gradient(90deg, var(--warn-soft), transparent 70%), var(--surface); }
.banner .ic { color: var(--warn); margin-top: 2px; } .banner b { display: block; margin-bottom: 2px; }
.banner.ok { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: linear-gradient(90deg, var(--ok-soft), transparent 70%), var(--surface); } .banner.ok .ic { color: var(--ok); }
.banner.bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); background: linear-gradient(90deg, var(--bad-soft), transparent 70%), var(--surface); } .banner.bad .ic { color: var(--bad); }
.banner > .btn { align-self: center; flex: none; } .banner > .btn .ic { color: inherit; margin-top: 0; }

/* ---- charts ------------------------------------------------------------------------------------------------ */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .axis-t { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .hit { fill: transparent; } .chart .hit:hover + .bar, .chart .bar:hover { opacity: 1; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 8px; background: var(--surface-3); border: 1px solid var(--border-2); box-shadow: var(--shadow-pop); font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .1s; }
.chart-tip b { display: block; font-size: 13px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 10px; } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }
.hbars { display: grid; grid-template-columns: minmax(80px, max-content) minmax(0, 1fr) 46px; gap: 9px 12px; align-items: center; font-size: 13px; }
.hbars .track { height: 9px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .hbars .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.hbars .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; } .donut-wrap svg { width: 150px; height: 150px; flex: none; }
.donut-legend { display: grid; gap: 9px; flex: 1 1 140px; font-size: 13px; } .donut-legend div { display: flex; align-items: center; gap: 9px; } .donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; } .donut-legend span.n { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- feed / activity ---------------------------------------------------------------------------------------- */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); align-items: flex-start; } .feed-item:last-child { border-bottom: 0; padding-bottom: 0; } .feed-item:first-child { padding-top: 0; }
.ficon { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); }
.ficon.ok { background: var(--ok-soft); color: var(--ok); } .ficon.warn { background: var(--warn-soft); color: var(--warn); } .ficon.bad { background: var(--bad-soft); color: var(--bad); } .ficon.info { background: var(--info-soft); color: var(--info); } .ficon.accent { background: var(--accent-soft); color: var(--accent-2); }
.feed-item .fmain { flex: 1; min-width: 0; } .feed-item .fsub { color: var(--muted); font-size: 12.5px; }
.feed-item .fwhen { color: var(--faint); font-size: 12px; white-space: nowrap; }
.attn { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--border); } .attn:last-child { border-bottom: 0; }
.attn .ficon { width: 38px; height: 38px; border-radius: 11px; }
.attn .amain { flex: 1; min-width: 0; } .attn .amain b { display: block; } .attn .amain span { color: var(--muted); font-size: 13px; }

/* ---- inbox ------------------------------------------------------------------------------------------------------ */
.split { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; min-height: 640px; height: calc(100vh - 230px); }
.split > .pane-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.split > .pane-detail { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-list .list-top { padding: 14px; border-bottom: 1px solid var(--border); display: grid; gap: 10px; }
.pane-list .list-body { overflow-y: auto; flex: 1; }
.tk { display: block; width: 100%; text-align: left; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; background: none; color: inherit; font: inherit; cursor: pointer; }
.tk:hover { background: var(--hover); } .tk.on { background: var(--accent-soft); border-left-color: var(--accent); } .tk.unread b.subj::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; }
.tk .l1 { display: flex; gap: 8px; align-items: center; } .tk .l1 b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tk .l1 span { color: var(--faint); font-size: 12px; white-space: nowrap; }
.tk .l2 { color: var(--muted); font-size: 12.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tk .l3 { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.detail-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.thread { flex: 1; overflow-y: auto; padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 78%; padding: 11px 15px; border-radius: 16px 16px 16px 5px; background: var(--surface-3); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.msg.staff { align-self: flex-end; border-radius: 16px 16px 5px 16px; background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); border: 1px solid var(--accent-line); }
.msg .meta { color: var(--muted); font-size: 12px; margin-bottom: 4px; white-space: normal; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.composer { border-top: 1px solid var(--border); padding: 14px 20px 16px; display: grid; gap: 10px; background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.composer textarea { min-height: 84px; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; height: auto; } .split > .pane-list { border-right: 0; max-height: 420px; } .split.reading > .pane-list { display: none; } .split:not(.reading) > .pane-detail { display: none; } }

/* ---- overlays: modal, drawer, menu, toast, command palette ---------------------------------------------------------- */
.scrim { position: fixed; inset: 0; z-index: 90; background: rgba(4, 6, 10, .62); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; animation: fade .15s ease both; overflow-y: auto; }
:root[data-theme="light"] .scrim { background: rgba(15, 23, 42, .4); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: min(560px, 100%); border-radius: 18px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow-pop); animation: pop .18s ease both; display: flex; flex-direction: column; max-height: 84vh; }
.modal.wide { width: min(1000px, 100%); } .modal.tall { height: 84vh; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; } .modal-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -.015em; flex: 1; }
.modal-body { padding: 14px 22px 20px; overflow-y: auto; flex: 1; min-height: 0; } .modal-body p { color: var(--text-2); line-height: 1.55; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--border); }
.modal pre { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-2); font: 12px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; flex: 1; min-height: 0; }
.modal pre .warn { color: var(--warn); } .modal pre .bad { color: var(--bad); }
.drawer-scrim { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer { width: min(520px, 100%); background: var(--surface); border-left: 1px solid var(--border-2); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slide .22s ease both; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu { position: fixed; z-index: 95; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: var(--shadow-pop); animation: pop .12s ease both; }
.menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; } .menu button:hover, .menu button.hl { background: var(--hover); }
.menu button.danger { color: var(--bad); } .menu button .ic { color: var(--muted); } .menu hr { border: 0; height: 1px; background: var(--border); margin: 5px 4px; } .menu .mlabel { padding: 8px 11px 4px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.swatches { display: flex; gap: 8px; padding: 4px 8px 8px; } .swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: 0 0 0 1px var(--border-2) inset; } .swatch.on { border-color: var(--text); }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 11px; max-width: min(420px, calc(100vw - 40px)); padding: 12px 15px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border-2); box-shadow: var(--shadow-pop); animation: pop .2s ease both; cursor: pointer; }
.toast .ic { color: var(--ok); } .toast.err .ic { color: var(--bad); } .toast.err { border-color: color-mix(in srgb, var(--bad) 45%, var(--border-2)); } .toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }
.cmdk { width: min(640px, 100%); border-radius: 18px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: var(--shadow-pop); overflow: hidden; animation: pop .15s ease both; }
.cmdk-in { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); } .cmdk-in input { border: 0; background: none; height: 56px; padding: 0; font-size: 16px; box-shadow: none !important; } .cmdk-in .ic { color: var(--muted); }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.cmdk-group { padding: 10px 12px 5px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.cmdk-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; } .cmdk-row.hl { background: var(--accent-soft); }
.cmdk-row .ci { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex: none; } .cmdk-row.hl .ci { background: var(--accent); color: var(--accent-fg); }
.cmdk-row .cm { flex: 1; min-width: 0; } .cmdk-row .cm b { font-weight: 600; } .cmdk-row .cm span { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cmdk-row .ch { color: var(--faint); font-size: 12px; }
.cmdk-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; background: var(--surface-2); }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px; } .shortcuts div { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--border); } .shortcuts .keys { display: flex; gap: 4px; }

/* ---- sign in -------------------------------------------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr); position: relative; z-index: 1; }
.login-art { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--border); background: radial-gradient(700px 500px at 20% 10%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 70%), radial-gradient(600px 400px at 90% 100%, color-mix(in srgb, var(--info) 14%, transparent), transparent 70%), var(--bg-2); }
.login-art h2 { font-size: 38px; line-height: 1.12; letter-spacing: -.035em; max-width: 14ch; font-weight: 750; } .login-art p { color: var(--muted); max-width: 44ch; margin-top: 14px; font-size: 15px; }
.login-art .feats { display: grid; gap: 14px; margin-top: 36px; } .login-art .feats div { display: flex; gap: 14px; align-items: center; color: var(--text-2); } .login-art .feats .bub { width: 38px; height: 38px; border-radius: 11px; background: var(--surface); border: 1px solid var(--border-2); display: grid; place-items: center; color: var(--accent-2); }
.login-form { display: grid; place-items: center; padding: 40px 24px; }
.login-card { width: min(400px, 100%); } .login-card h1 { font-size: 26px; letter-spacing: -.025em; } .login-card .sub { color: var(--muted); margin: 6px 0 24px; }
.login-card .field + .field { margin-top: 16px; } .login-card .btn.primary { width: 100%; height: 44px; margin-top: 22px; font-size: 15px; }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-art { display: none; } }

/* ---- responsive shell ------------------------------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-pop); }
  .app.open .side { transform: none; } .app.open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  .menu-btn { display: inline-grid; } .topbar { padding: 0 14px; } .content { padding: 20px 14px 80px; }
  .app.collapsed { --side-w: 248px; } .app.collapsed .brand .name, .app.collapsed .nav-label, .app.collapsed .nav-item span.t { display: revert; } .app.collapsed .nav-item { justify-content: flex-start; padding: 9px 10px; } .app.collapsed .side-foot { flex-direction: row; } .app.collapsed .side-foot .who-t { display: revert; } .app.collapsed .who { padding: 4px 8px 4px 4px; margin: -4px; }
  .hide-md { display: none !important; }
}
@media (max-width: 640px) { .hide-sm { display: none !important; } .page-title { font-size: 22px; } .live .lt { display: none; } .search-trigger .kbd { display: none; } .kpis { grid-template-columns: repeat(2, 1fr); } .kpi .val { font-size: 25px; } }
@media print { .side, .topbar, .toasts { display: none !important; } .app { display: block; } body::before { display: none; } }

/* ---- forms boxes, message preview, upload drop zone ------------------------------------------------------------------------ */
.formbox { margin-top: 16px; padding: 18px; border: 1px dashed var(--border-2); border-radius: var(--radius-sm); background: var(--surface-2); }
.span2 { grid-column: span 2; } @media (max-width: 1100px) { .span2 { grid-column: auto; } }
.msg-compose { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; } @media (max-width: 1000px) { .msg-compose { grid-template-columns: 1fr; } }
.pv-wrap { position: sticky; top: 84px; }
.preview { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); padding: 14px; }
.pv-label { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-weight: 550; }
.pv-screen { position: relative; height: 240px; border-radius: 12px; overflow: hidden; background: #0b0d12; border: 1px solid var(--border-2); display: flex; flex-direction: column; }
.pv-banner { background: var(--warn); color: #1a1203; padding: 9px 12px; font-size: 12.5px; line-height: 1.35; }
.pv-body { padding: 14px; display: grid; gap: 10px; } .pv-body i { display: block; height: 44px; border-radius: 8px; background: rgba(255, 255, 255, .07); } .pv-body.dim { opacity: .5; }
.pv-popup { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 84%; border-radius: 14px; background: #1b2030; border: 1px solid #323a52; padding: 14px 16px; color: #eef0f6; box-shadow: 0 14px 40px rgba(0, 0, 0, .6); }
.pv-popup b { display: block; margin-bottom: 4px; } .pv-popup p { color: #b4bbcd; font-size: 12.5px; margin: 0 0 12px; line-height: 1.4; }
.pv-ok { display: inline-block; padding: 4px 18px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); font-size: 12px; font-weight: 600; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 26px 20px; min-height: 150px; border: 2px dashed var(--border-2); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; color: var(--muted); transition: all .15s; text-align: left; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); } .dropzone.has { border-style: solid; border-color: var(--accent-line); }
.dropzone .drop-t { display: flex; flex-direction: column; gap: 2px; } .dropzone b { color: var(--text); overflow-wrap: anywhere; }
@media (min-width: 981px) { .hide-lg { display: none !important; } }

/* ---- staff, customers, security and deeper analytics ---------------------------------------------------------------------------------------- */
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.tag.link { text-decoration: none; cursor: pointer; } .tag.link:hover { background: var(--accent-soft); color: var(--accent-2); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
button.pill.link { border: 0; cursor: pointer; font-family: inherit; } button.pill.link:hover { filter: brightness(1.18); }
.attn .amain > span { display: block; } .attn.done { opacity: .62; } .attn.done .ficon { filter: grayscale(1); }
#who-sub.lowc { color: var(--warn); }
.reasons { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; line-height: 1.5; } .reasons.tight { margin: 0; font-size: 12.5px; } .reasons li + li { margin-top: 3px; }
.check.opt { align-items: flex-start; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); gap: 12px; }
.check.opt > div b { font-weight: 600; } .check.opt > div .muted { font-size: 12.5px; margin-top: 2px; line-height: 1.45; } .check.opt input { margin-top: 3px; }
.optbox { display: grid; gap: 8px; }
.seen { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; } .seen > div { display: flex; align-items: center; gap: 8px; }
.picklist { display: grid; gap: 8px; max-height: 340px; overflow: auto; margin-top: 12px; padding-right: 2px; }
.note-box { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.item.link-row { text-decoration: none; color: inherit; } .item.link-row:hover { background: var(--surface-3); }

/* find a customer as you type */
.pick { position: relative; }
.pick-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); max-height: 260px; overflow: auto; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); box-shadow: 0 14px 40px rgba(0, 0, 0, .35); padding: 5px; }
.pick-opt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px; border: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.pick-opt:hover { background: var(--hover); } .pick-opt .muted { font-size: 12.5px; } .pick-opt.new { color: var(--accent-2); align-items: center; }
.pick-chip { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px 4px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface-2); }
.pick-chip .muted { font-size: 12.5px; }

/* busy hours */
.heat { display: grid; grid-template-columns: 36px repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; }
.heat .hl { font-size: 10.5px; color: var(--faint); white-space: nowrap; } .heat .hd { font-size: 12px; color: var(--muted); }
.heat .hc { display: block; aspect-ratio: 1; min-height: 14px; border-radius: 4px; background: var(--surface-3); } .heat .hc:hover { outline: 2px solid var(--text-2); outline-offset: 1px; }

/* install -> paid funnel */
.funnel { display: grid; gap: 14px; }
.fstep { display: grid; grid-template-columns: minmax(120px, 190px) 1fr minmax(90px, 140px); align-items: center; gap: 14px; }
.fstep .fl b { display: block; } .fstep .fl .muted { font-size: 12px; }
.fbar { position: relative; height: 32px; border-radius: 9px; background: var(--surface-3); overflow: hidden; }
.fbar > i { position: absolute; inset: 0 auto 0 0; border-radius: 9px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); opacity: .88; }
.fbar .fn { position: absolute; left: 12px; top: 0; bottom: 0; display: flex; align-items: center; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.fp { font-size: 12px; color: var(--muted); }
@media (max-width: 720px) { .fstep { grid-template-columns: 1fr; gap: 6px; } }

/* staff roles */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } @media (max-width: 720px) { .roles { grid-template-columns: 1fr; } }
.rolecard { text-align: left; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; display: grid; gap: 6px; align-content: start; }
.rolecard .muted { font-size: 12.5px; line-height: 1.45; } .rolecard:hover { border-color: var(--accent-line); } .rolecard.on { border-color: var(--accent); background: var(--accent-soft); }
.matrix .mc { text-align: center; width: 92px; } .matrix .mgroup td { background: var(--surface-2); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.matrix .yes { color: var(--ok); } .matrix .no { color: var(--faint); }

/* monthly statement */
.stmt-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stmt-sum > div { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 2px; }
.stmt-sum span { color: var(--muted); font-size: 12px; } .stmt-sum b { font-size: 22px; letter-spacing: -.02em; } .stmt-sum .last { border-color: var(--accent-line); }
@media (max-width: 720px) { .stmt-sum { grid-template-columns: repeat(2, 1fr); } }
/* Print only the statement, on white, however the panel is themed. */
@media print {
  html.printing-statement { --surface: #fff; --surface-2: #f6f8fb; --surface-3: #eceff5; --text: #111; --text-2: #333; --muted: #555; --faint: #888; --border: #ddd; --border-2: #ccc; --accent: #c0243a; color-scheme: light; }
  html.printing-statement body { background: #fff; }
  html.printing-statement body * { visibility: hidden; }
  html.printing-statement .statement, html.printing-statement .statement * { visibility: visible; }
  html.printing-statement .statement { position: absolute; left: 0; top: 0; width: 100%; }
  html.printing-statement .statement .btn { display: none; }
}

/* App logo preview (Rules, My account) */
.logo-prev { min-height: 96px; display: grid; place-items: center; padding: 14px; border: 1px dashed var(--border); border-radius: 12px; background: repeating-conic-gradient(#8881 0% 25%, transparent 0% 50%) 50% / 16px 16px; }
.logo-prev img { max-width: 100%; max-height: 120px; object-fit: contain; }
.logo-thumb { max-width: 220px; max-height: 90px; object-fit: contain; padding: 8px; border: 1px dashed var(--border); border-radius: 10px; background: repeating-conic-gradient(#8881 0% 25%, transparent 0% 50%) 50% / 16px 16px; }

/* ---- invoices (invoices.js) ---------------------------------------------------------------------------------------- */
.inv-view { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
@media (max-width: 900px) { .inv-view { grid-template-columns: 1fr; } }
.inv-paper-wrap { overflow-x: auto; padding: 2px 2px 10px; }
/* The invoice is a sheet of white paper whatever the panel's theme is — what you see is what prints. */
.inv-paper { --ink: #1b1d22; --ink-2: #4b5160; --ink-3: #8a90a0; --line: #e3e5ea; --brand: var(--accent); background: #fff; color: var(--ink); border-top: 6px solid var(--brand); border-radius: 10px; padding: 34px 38px 30px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 14px 38px -18px rgba(0, 0, 0, .55); font: 13px/1.5 var(--font); min-width: 560px; max-width: 840px; margin: 0 auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.inv-paper .ip-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.inv-paper .ip-biz { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.inv-paper .ip-small { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; } .inv-paper .ip-pre { white-space: pre-line; }
.inv-paper .ip-right { text-align: right; } .inv-paper .ip-word { font-size: 12px; font-weight: 700; letter-spacing: .24em; color: var(--ink-3); } .inv-paper .ip-num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.inv-paper .ip-stamp { display: inline-block; margin-top: 8px; padding: 1px 12px; border: 2px solid currentColor; border-radius: 6px; font-size: 13px; font-weight: 800; letter-spacing: .14em; transform: rotate(-3deg); opacity: .9; }
.inv-paper .ip-stamp.ok { color: #16a34a; } .inv-paper .ip-stamp.bad { color: #dc2626; } .inv-paper .ip-stamp.void, .inv-paper .ip-stamp.draft { color: #8a90a0; }
.inv-paper .ip-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 26px 0 22px; }
.inv-paper .ip-h { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
.inv-paper .ip-strong { font-size: 15px; font-weight: 650; }
.inv-paper .ip-dates { display: grid; grid-template-columns: auto 1fr; gap: 5px 18px; align-content: start; justify-items: end; } .inv-paper .ip-dates span { color: var(--ink-2); justify-self: start; }
.inv-paper .ip-items { width: 100%; border-collapse: collapse; }
.inv-paper .ip-items th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 8px 8px; border-bottom: 2px solid var(--ink); }
.inv-paper .ip-items td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.inv-paper .ip-items .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-paper .ip-totals { width: 290px; max-width: 100%; margin: 16px 0 0 auto; display: grid; gap: 6px; }
.inv-paper .ip-row { display: flex; justify-content: space-between; gap: 18px; color: var(--ink-2); } .inv-paper .ip-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.inv-paper .ip-row.strong { padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 650; }
.inv-paper .ip-due { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding: 11px 14px; border-radius: 8px; background: var(--ink); color: #fff; font-weight: 600; } .inv-paper .ip-due b { font-size: 18px; font-variant-numeric: tabular-nums; }
.inv-paper .ip-block { margin-top: 20px; } .inv-paper .ip-block .ip-pre { color: var(--ink-2); }
.inv-paper .ip-foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; color: var(--ink-3); font-size: 12px; }
.inv-side { display: grid; gap: 20px; }
.inv-sum { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 4px; }
.inv-bal { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 6px; }
.inv-actions { display: grid; gap: 8px; } .inv-actions .btn { width: 100%; }
.inv-note { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--info-soft); color: var(--text-2); font-size: 13px; line-height: 1.45; } .inv-note .ic { margin-top: 2px; color: var(--info); }
.inv-list > div { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); } .inv-list > div:last-child { border-bottom: 0; } .inv-list .muted { font-size: 12.5px; }
.inv-hist > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
/* the editor */
.inv-lines-wrap { overflow-x: auto; } .inv-lines { min-width: 620px; }
.il { display: grid; grid-template-columns: minmax(200px, 1fr) 84px 118px 118px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.il-head { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; } .il-head .r { text-align: right; }
.il-amt { text-align: right; font-weight: 600; }
.inv-totals { display: grid; gap: 4px; min-width: 240px; margin-left: auto; } .inv-totals > div { display: flex; justify-content: space-between; gap: 28px; color: var(--muted); } .inv-totals b { color: var(--text); font-variant-numeric: tabular-nums; } .inv-totals .big { font-size: 17px; color: var(--text); padding-top: 4px; border-top: 1px solid var(--border); }

/* Printing an invoice: only the sheet, from a copy appended to the page (print-root). */
#print-root { display: none; }
@media print {
  @page { margin: 14mm; }
  html.printing-invoice #root, html.printing-invoice #overlays, html.printing-invoice .toasts, html.printing-invoice .menu { display: none !important; }
  html.printing-invoice #print-root { display: block; }
  html.printing-invoice, html.printing-invoice body { background: #fff !important; }
  html.printing-invoice body::before { display: none; }
  #print-root .inv-paper { box-shadow: none; border-radius: 0; padding: 0 4mm; min-width: 0; max-width: none; margin: 0; }
}

/* the product's icon in place of the lettered tile (shell and sign-in page) */
.brand .mark-img { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; background: #000; box-shadow: 0 6px 18px -6px var(--accent-line), 0 0 0 1px rgba(255, 255, 255, .1); }
.login-logo { display: block; width: min(300px, 70%); aspect-ratio: 1; object-fit: cover; border-radius: 22px; margin: 4px 0 26px; box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .08); }

/* white-label / About cards (Rules, My account) */
.wl-state { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
