:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8ef;
  --text: #16202e;
  --muted: #64748b;
  --primary: #1f5eff;
  --primary-hover: #1649cc;
  --primary-soft: #e8efff;
  --success: #0f9d58;
  --success-soft: #e3f5ec;
  --danger: #d93025;
  --danger-soft: #fdecec;
  --bar: #1f5eff;
  --highlight: #fff6d6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --radius: 12px;
  color-scheme: light;
}
/* dark: the system setting (auto), unless the viewer picked light; or picked dark explicitly */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b;
    --surface: #161d27;
    --surface-2: #1b2430;
    --border: #273241;
    --text: #e6ebf2;
    --muted: #8a97a8;
    --primary: #5b8cff;
    --primary-hover: #7aa2ff;
    --primary-soft: #1d2a45;
    --success: #34c77b;
    --success-soft: #16301f;
    --danger-soft: #3a1d1d;
    --bar: #5b8cff;
    --highlight: #3a3314;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b;
  --surface: #161d27;
  --surface-2: #1b2430;
  --border: #273241;
  --text: #e6ebf2;
  --muted: #8a97a8;
  --primary: #5b8cff;
  --primary-hover: #7aa2ff;
  --primary-soft: #1d2a45;
  --success: #34c77b;
  --success-soft: #16301f;
  --danger-soft: #3a1d1d;
  --bar: #5b8cff;
  --highlight: #3a3314;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; }
.logo {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .5px;
}
.top-right { display: flex; align-items: center; gap: 16px; }
.live { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 var(--success); animation: pulse 2s infinite; }
.dot.off { background: var(--danger); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 157, 88, .45); }
  70% { box-shadow: 0 0 0 7px rgba(15, 157, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 157, 88, 0); }
}
.link { color: var(--muted); text-decoration: none; font-size: 13px; }
.link:hover { color: var(--text); }

main { max-width: 1320px; margin: 0 auto; padding: 20px 24px 48px; display: grid; gap: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
input, select {
  height: 36px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
select { min-width: 220px; }
select.narrow { min-width: 170px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; cursor: pointer;
}
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.spacer { flex: 1; }
.btn {
  height: 36px; padding: 0 16px; border-radius: 8px; border: 0;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn svg { width: 16px; height: 16px; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.kpi .value small { font-size: 14px; font-weight: 500; color: var(--muted); }
.kpi.main .value { color: var(--primary); }

/* ---------- sections ---------- */
.section-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.section-head h2 { margin: 0; font-size: 15px; font-weight: 650; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 16px; text-align: left; white-space: nowrap; }
th {
  font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
td { border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }

#summary tbody tr { cursor: pointer; }
#summary tbody tr:hover { background: var(--surface-2); }
#summary tbody tr.selected { background: var(--primary-soft); }
#summary tbody tr.zero td { color: var(--muted); }
#summary tbody tr.group td { background: var(--surface-2); font-weight: 650; cursor: pointer; }
#summary tbody tr.group:hover td { background: var(--primary-soft); }
.share { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.share .track { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.share .fill { height: 100%; background: var(--bar); border-radius: 4px; }
.share span { width: 44px; text-align: right; color: var(--muted); font-size: 12px; }

.search { width: 240px; }
.ids { color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; }
tr.new td { animation: flash 3s ease-out; }
@keyframes flash { from { background: var(--highlight); } to { background: transparent; } }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.pager .chip { height: 30px; }
.notice { padding: 8px 16px; background: var(--highlight); font-size: 13px; }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 20;
  padding: 12px 16px; border-radius: 10px;
  background: var(--success); color: #fff; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  transform: translateY(120%); opacity: 0; transition: .3s;
}
.toast.show { transform: none; opacity: 1; }

@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .topbar { padding: 10px 16px; }
  .live span.text { display: none; }
  main { padding: 16px 16px 40px; }
  .kpi .value { font-size: 20px; }
  select, .search { width: 100%; min-width: 0; }
  .field { flex: 1 1 140px; }
  .spacer { display: none; }
  .btn { width: 100%; justify-content: center; }
}

/* ---------- needs review ---------- */
.issues { border-color: #f0b429; }
.issues .section-head { background: var(--highlight); border-radius: var(--radius) var(--radius) 0 0; }
.issues td { white-space: normal; vertical-align: top; }
.issues td.nowrap { white-space: nowrap; }
.issues details summary { cursor: pointer; color: var(--primary); }
.issues pre { margin: 6px 0 0; padding: 8px; max-width: 360px; white-space: pre-wrap; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }
.issues .act { display: flex; gap: 6px; align-items: center; }
.issues .act select { min-width: 200px; height: 32px; }
.btn.sm { height: 32px; padding: 0 12px; }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--primary-soft); }

.badge.warn { background: var(--highlight); border-color: #f0b429; margin-left: 6px; }

/* ---------- roles, tabs, silence, staff ---------- */
[hidden] { display: none !important; }
.tabs { display: flex; gap: 4px; margin-right: auto; margin-left: 24px; }
.tab { padding: 6px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--primary); background: var(--primary-soft); }
.who { font-size: 13px; color: var(--muted); }
.fixed-branch { height: 36px; display: flex; align-items: center; padding: 0 12px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.silence { border-color: #e8a0a0; }
.silence .section-head { background: var(--danger-soft); border-radius: var(--radius) var(--radius) 0 0; }
.ago { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ago.late { color: var(--danger); font-weight: 600; }
#staffTable td { vertical-align: middle; }
#staffTable .act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#staffTable select { min-width: 220px; height: 32px; }
.status { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status.active { background: var(--success-soft); color: var(--success); }
.status.pending { background: var(--highlight); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.hint { padding: 0 16px 16px; margin: 0; font-size: 13px; }
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; margin: 4px 0 0; }
  .brand-text, .who { display: none; }
}

/* ---------- manual payments ---------- */
.manual { border-color: var(--primary); }
.field.grow { flex: 1 1 220px; }
.field.grow input { width: 100%; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.src { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.src.ok { background: var(--success-soft); color: var(--success); }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 15px; padding: 2px 6px; border-radius: 6px; }
.icon-btn:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- navigation: back button + path ---------- */
a.brand { color: var(--text); text-decoration: none; }
.crumbs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.path { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.path a { color: var(--primary); text-decoration: none; }
.path a:hover { text-decoration: underline; }
.path span { color: var(--muted); }
.who { text-decoration: none; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.who:hover { border-color: var(--primary); color: var(--text); }

/* ---------- KPI deltas vs previous period ---------- */
.kpi .value { font-variant-numeric: normal; }
.delta { margin-top: 6px; font-size: 12.5px; color: var(--muted); min-height: 17px; }
.delta .up { color: var(--success); font-weight: 600; }
.delta .down { color: var(--danger); font-weight: 600; }

/* ---------- company cards (home) ---------- */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.company-card { padding: 16px 18px; cursor: pointer; text-decoration: none; color: var(--text); display: grid; gap: 10px;
  transition: border-color .15s, transform .15s; }
.company-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.company-card .cc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.company-card .cc-name { font-weight: 700; font-size: 16px; }
.company-card .cc-go { color: var(--muted); font-size: 13px; }
.company-card .cc-amount { font-size: 24px; font-weight: 700; }
.company-card .cc-amount small { font-size: 13px; font-weight: 500; color: var(--muted); }
.company-card .cc-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); gap: 8px; flex-wrap: wrap; }
.company-card .track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.company-card .fill { height: 100%; border-radius: 3px; background: var(--bar); }

/* ---------- charts ---------- */
.charts { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.chart { padding: 8px 12px 12px; height: 230px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--bar); }
.chart .bar.dim { fill: var(--primary-soft); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart g.col:hover .bar { fill: var(--primary-hover); }
.chart .empty-msg { fill: var(--muted); font-size: 13px; }
.tooltip { position: fixed; z-index: 30; pointer-events: none; padding: 8px 10px; border-radius: 8px;
  background: var(--text); color: var(--surface); font-size: 12.5px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.tooltip b { font-size: 13.5px; }

/* ---------- admins / profile / modal ---------- */
.status.off { background: var(--surface-2); color: var(--muted); }
.status.temp { background: var(--highlight); }
.warn-box { border-radius: var(--radius); border: 1px solid #f0b429; }
.profile-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding: 20px; }
.profile-info { display: flex; gap: 14px; align-items: center; align-self: start; }
.avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 700;
  background: var(--primary-soft); color: var(--primary); }
.p-name { font-size: 18px; font-weight: 700; }
.pw-form { display: grid; gap: 12px; max-width: 360px; }
.pw-form h3 { margin: 0; font-size: 15px; }
.pw-form input { width: 100%; }
.hint-inline { margin: 0; font-size: 12.5px; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(15, 20, 27, .45); }
.modal-box { width: 100%; max-width: 420px; padding: 22px; display: grid; gap: 12px; }
.modal-box h3 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; }
.secret { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--surface-2);
  border: 1px dashed var(--border); font-family: ui-monospace, Consolas, monospace; font-size: 16px; justify-content: space-between; }

@media (max-width: 900px) {
  .charts, .profile-body { grid-template-columns: 1fr; }
}

.row-link { color: inherit; text-decoration: none; }
.row-link:hover { color: var(--primary); text-decoration: underline; }

/* grid children default to min-width:auto, so a wide table would stretch the whole page on phones;
   let them shrink and keep the horizontal scroll inside .table-wrap */
main > *, .charts > *, .kpis > *, .company-grid > * { min-width: 0; }
@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi .value { font-size: 18px; }
  .delta { font-size: 11.5px; }
  .filters .field { flex: 1 1 100%; }
  .filters input[type=date] { width: 100%; }
  .chart { height: 200px; }
  .crumbs { gap: 8px; }
}

/* ---------- theme switch ---------- */
.theme-btn { height: 32px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.theme-btn:hover { border-color: var(--primary); }
.theme-corner { position: fixed; top: 16px; right: 16px; }

/* ---------- activity log ---------- */
.role { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.role.super { background: var(--highlight); }
.role.admin { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
#auditTable td { white-space: normal; vertical-align: top; }
#auditTable td.nowrap { white-space: nowrap; }
.act-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); }
.act-tag.money { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.act-tag.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.act-tag.people { background: var(--success-soft); color: var(--success); border-color: transparent; }
.src-tag { font-size: 12px; color: var(--muted); white-space: nowrap; }

a.btn { text-decoration: none; }
a.btn.ghost { color: var(--text); }
.charts.single { grid-template-columns: minmax(0, 1fr); }

/* ---------- password fields: show/hide, live rules, inline errors ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 34px; height: 30px;
  display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--text); background: var(--surface-2); }
.pw-eye svg { width: 18px; height: 18px; }
input.invalid, input.invalid:focus { border-color: var(--danger); outline-color: var(--danger-soft); }
input.valid { border-color: var(--success); }
.pw-rules { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); }
.pw-rules li::before { content: "•"; display: inline-block; width: 16px; text-align: center; }
.pw-rules li.ok { color: var(--success); }
.pw-rules li.ok::before { content: "✓"; font-weight: 700; }
.pw-rules li.bad { color: var(--danger); }
.pw-rules li.bad::before { content: "✗"; font-weight: 700; }
.field-msg { margin: -6px 0 0; min-height: 0; font-size: 12.5px; }
.field-msg.bad { color: var(--danger); }
.field-msg.ok { color: var(--success); }
.form-error { margin: 0; color: var(--danger); font-size: 13px; font-weight: 600; }
.form-error:empty, .field-msg:empty { display: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
/* Edge draws its own reveal button; ours (pw.js) is the only one */
input::-ms-reveal, input::-ms-clear { display: none; }

/* ---------- layout with the live feed sidebar ---------- */
#scopeView { max-width: 1640px; }
.scope-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.scope-main { display: grid; gap: 16px; min-width: 0; }
.scope-main > * { min-width: 0; }

/* ---------- live feed ---------- */
.feed { position: sticky; top: 72px; max-height: calc(100vh - 88px); display: flex; flex-direction: column; overflow: hidden; }
.feed .section-head h2 { display: flex; align-items: center; gap: 8px; }
.feed-list { overflow-y: auto; padding: 6px 8px 8px; display: grid; gap: 2px; }
.feed-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; }
.feed-item:hover { background: var(--surface-2); }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bar); opacity: .35; }
.feed-item.fresh .feed-dot { opacity: 1; box-shadow: 0 0 0 3px var(--primary-soft); }
.feed-main { min-width: 0; display: grid; }
.feed-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-main span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-side { display: grid; justify-items: end; }
.feed-side b { font-variant-numeric: tabular-nums; }
.feed-side span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.feed-empty { padding: 24px 12px; text-align: center; color: var(--muted); }
.feed-item.enter { animation: feed-in .55s cubic-bezier(.2, .8, .2, 1), feed-glow 2.8s ease-out; }
@keyframes feed-in { from { opacity: 0; transform: translateY(-14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes feed-glow { from { background: var(--highlight); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .feed-item.enter { animation: feed-glow 2.8s ease-out; } }
@media (max-width: 1180px) {
  .scope-layout { grid-template-columns: minmax(0, 1fr); }
  .feed { order: -1; position: static; max-height: 340px; }
}

/* ---------- Ctrl+K quick search ---------- */
kbd { display: inline-block; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); border-bottom-width: 2px;
  background: var(--surface); color: var(--muted); font: 11px/1.4 ui-monospace, Consolas, monospace; }
.search-btn { height: 32px; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px 0 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.search-btn:hover { border-color: var(--primary); color: var(--text); }
.cmdk { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 16px 16px; background: rgba(15, 20, 27, .5); }
.cmdk-box { width: 100%; max-width: 640px; overflow: hidden; display: flex; flex-direction: column; max-height: 70vh;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3); animation: cmdk-in .14s ease-out; }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cmdk-input-row input { flex: 1; height: 54px; border: 0; outline: 0; padding: 0; background: transparent; font-size: 16px; }
.cmdk-list { overflow-y: auto; padding: 6px; }
.cmdk-group { padding: 10px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.cmdk-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.cmdk-item .ic { font-size: 16px; text-align: center; }
.cmdk-item .t { min-width: 0; display: grid; }
.cmdk-item .t b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item .t span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item .r { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmdk-item.active { background: var(--primary-soft); }
.cmdk-item.active .t b { color: var(--primary); }
.cmdk-item mark { background: none; color: var(--primary); font-weight: 700; }
.cmdk-empty { padding: 26px 12px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
tr.focus td { background: var(--highlight); }
tr.focus td:first-child { box-shadow: inset 3px 0 0 #f0b429; }
@media (max-width: 760px) {
  .search-btn kbd, .search-btn .search-label { display: none; }
  .cmdk { padding-top: 16px; }
}
