/* ============================================================
   ShiftCo Pipeline — design tokens (light + dark)
   ============================================================ */
:root {
  color-scheme: light;
  /* Brand Vision Board 2026 — primary #000/#2ae0db/#fff,
     secondary #0B2E3D #4F7C8C #85A0BA #C7D4DE #565F66, accent #145369 */
  --page: #f4f7f9;
  --surface: #ffffff;
  --ink: #0b2e3d;
  --ink-2: #565f66;
  --muted: #85a0ba;
  --grid: #c7d4de;
  --axis: #85a0ba;
  --border: rgba(11, 46, 61, 0.14);
  /* accent — brand teal fill, deep-blue ink, #145369 for accent text */
  --accent: #2ae0db;
  --accent-strong: #145369;
  --accent-wash: rgba(42, 224, 219, 0.16);
  --accent-ink: #0b2e3d;
  /* ordinal ramp for the 5 stages — the brand's secondary blues, light→deep */
  --stage-1: #c7d4de;
  --stage-2: #85a0ba;
  --stage-3: #4f7c8c;
  --stage-4: #145369;
  --stage-5: #0b2e3d;
  /* status */
  --good: #0ca30c;
  --good-text: #006300;
  --critical: #d03b3b;
  /* chrome */
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(11,11,11,0.04), 0 4px 16px rgba(11,11,11,0.05);
  --shadow-lift: 0 2px 6px rgba(11,11,11,0.08), 0 10px 28px rgba(11,11,11,0.10);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  /* dark mode built on the brand's deep blue #0B2E3D */
  --page: #071f2a;
  --surface: #0b2e3d;
  --ink: #ffffff;
  --ink-2: #c7d4de;
  --muted: #85a0ba;
  --grid: #1c4356;
  --axis: #4f7c8c;
  --border: rgba(199, 212, 222, 0.16);
  --accent: #2ae0db;
  --accent-strong: #63e6e0;
  --accent-wash: rgba(42, 224, 219, 0.14);
  --accent-ink: #0b2e3d;
  /* ordinal ramp for the 5 stages (brand blues on dark, won pops in teal) */
  --stage-1: #c7d4de;
  --stage-2: #85a0ba;
  --stage-3: #4f7c8c;
  --stage-4: #35b8b2;
  --stage-5: #2ae0db;
  --good: #0ca30c;
  --good-text: #0ca30c;
  --critical: #d03b3b;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.25);
  --shadow-lift: 0 2px 6px rgba(0,0,0,0.4), 0 10px 28px rgba(0,0,0,0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #071f2a;
    --surface: #0b2e3d;
    --ink: #ffffff;
    --ink-2: #c7d4de;
    --muted: #85a0ba;
    --grid: #1c4356;
    --axis: #4f7c8c;
    --border: rgba(199, 212, 222, 0.16);
    --accent: #2ae0db;
    --accent-strong: #63e6e0;
    --accent-wash: rgba(42, 224, 219, 0.14);
    --accent-ink: #0b2e3d;
    --stage-1: #c7d4de;
    --stage-2: #85a0ba;
    --stage-3: #4f7c8c;
    --stage-4: #35b8b2;
    --stage-5: #2ae0db;
    --good: #0ca30c;
    --good-text: #0ca30c;
    --critical: #d03b3b;
    --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.25);
    --shadow-lift: 0 2px 6px rgba(0,0,0,0.4), 0 10px 28px rgba(0,0,0,0.35);
  }
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  /* Brand type: Calibri for text, Georgia for headers (Rozanova lives in the logo) */
  font-family: Calibri, Carlito, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }

.app { display: flex; min-height: 100vh; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  width: 216px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--grid);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 18px;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
  color: var(--accent-ink); font-weight: 700; font-size: 14px;
  letter-spacing: -0.5px;
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -0.2px; }
.brand-logo { height: 40px; width: auto; display: block; }
.brand-logo.lg { height: 54px; }
/* The brand book ships a white lockup for dark backgrounds; swap to it rather
   than inverting the black one, so the artwork stays exactly as drawn. */
:root[data-theme="dark"] .brand-logo { content: url('../img/shiftco-logo-white.png'); }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: -2px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 480;
  border: none; background: none; width: 100%; text-align: left;
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-link:hover { background: var(--accent-wash); color: var(--ink); }
.nav-link.active { background: var(--accent-wash); color: var(--accent-strong); font-weight: 600; }
:root[data-theme="dark"] .nav-link.active { color: var(--accent-strong); }

.sidebar-foot { margin-top: auto; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; }
.theme-toggle {
  border: 1px solid var(--grid); background: var(--surface);
  border-radius: 999px; padding: 5px 10px;
  color: var(--ink-2); font-size: 12px;
  display: flex; align-items: center; gap: 6px;
}
.theme-toggle:hover { border-color: var(--axis); }

/* ============================================================
   Main column
   ============================================================ */
.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
/* Georgia Regular, as the brand book specifies for headers. */
.page-title { font-family: Georgia, Gelasio, "Times New Roman", serif; font-size: 24px; font-weight: 400; letter-spacing: -0.2px; margin: 0; }
.page-sub { color: var(--muted); font-size: 13px; margin: 3px 0 0; }

/* ============================================================
   Buttons
   ============================================================ */
/* Brand buttons are pills in uppercase bold — three variants in the brand book:
   solid dark, outlined light, and solid teal (our .primary). */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  color: var(--ink);
}
.btn:hover { background: var(--ink); color: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); filter: brightness(0.93); }
:root[data-theme="dark"] .btn.primary:hover { filter: brightness(1.1); }
.btn.danger-ghost { color: var(--critical); border-color: transparent; background: none; }
.btn.danger-ghost:hover { background: rgba(208, 59, 59, 0.08); color: var(--critical); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--accent-wash); color: var(--ink); }
.btn.sm { padding: 5px 12px; font-size: 11.5px; }
/* Buttons carrying a proper noun or a file name read better as written. */
.btn.verbatim { text-transform: none; letter-spacing: 0; font-weight: 600; }

/* ============================================================
   Cards & KPI tiles
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 0 0 2px; }
.card-sub { font-size: 12px; color: var(--muted); margin: 0 0 12px; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
/* The brand's impact-stat treatment: a small uppercase label over a large
   Georgia figure — the same pairing used for "468 / Members Joined". */
.stat-label {
  font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.stat-value {
  font-family: Georgia, Gelasio, "Times New Roman", serif;
  font-size: 30px; font-weight: 400; letter-spacing: -0.2px; margin-top: 4px;
  color: var(--accent-strong);
}
:root[data-theme="dark"] .stat-value { color: var(--accent); }
.stat-note { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.stat-note .delta-good { color: var(--good-text); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============================================================
   Charts
   ============================================================ */
.chart-wrap { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-svg text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
.tick-label { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.bar-label { font-size: 11px; fill: var(--ink-2); font-weight: 600; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: var(--axis); stroke-width: 1; }
.bar { fill: var(--accent); }
.bar-hit { fill: transparent; }
.bar-hit:hover + .bar, .bar.hover { filter: brightness(1.12); }

.tooltip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  padding: 8px 11px;
  font-size: 12px;
  min-width: 120px;
  opacity: 0;
  transition: opacity 80ms ease;
}
.tooltip.show { opacity: 1; }
.tooltip .tt-title { color: var(--muted); margin-bottom: 3px; }
.tooltip .tt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.tooltip .tt-key { display: inline-block; width: 12px; height: 0; border-top: 3px solid var(--accent); border-radius: 2px; margin-right: 6px; }
.tooltip .tt-label { color: var(--ink-2); }
.tooltip .tt-value { font-weight: 650; font-variant-numeric: tabular-nums; }

/* stage breakdown (horizontal bars) */
.stage-rows { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.stage-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: baseline; }
.stage-row-name { font-size: 12.5px; color: var(--ink-2); font-weight: 550; display: flex; align-items: center; gap: 7px; }
.stage-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.stage-row-val { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.stage-row-val small { color: var(--muted); font-weight: 480; }
.stage-track { grid-column: 1 / -1; height: 10px; background: var(--page); border-radius: 4px; overflow: hidden; position: relative; }
.stage-fill { height: 100%; border-radius: 0 4px 4px 0; border-left: 2px solid var(--surface); position: absolute; top: 0; left: 0; min-width: 2px; }
.stage-fill:first-child { border-left: none; border-radius: 4px; }

/* ============================================================
   Table view
   ============================================================ */
.table-scroll { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}
table.data td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--grid);
  white-space: nowrap;
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 80ms; }
table.data tbody tr:hover { background: var(--accent-wash); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th.num { text-align: right; }
table.data .computed { color: var(--ink-2); background: color-mix(in srgb, var(--page) 55%, transparent); }
table.data tfoot td { font-weight: 650; border-top: 1px solid var(--axis); border-bottom: none; background: color-mix(in srgb, var(--page) 55%, transparent); }
.row-actions { opacity: 0; transition: opacity 100ms; display: flex; gap: 2px; }
tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; }
.icon-btn {
  border: none; background: none; padding: 5px; border-radius: 6px;
  /* --muted is the palette's lightest grey and reads too faint for a control. */
  color: var(--ink-2); display: grid; place-items: center;
}
.icon-btn:hover { background: var(--accent-wash); color: var(--ink); }
.icon-btn.danger:hover { background: rgba(208,59,59,0.1); color: var(--critical); }
.icon-btn svg { width: 15px; height: 15px; }

.cell-select {
  border: 1px solid transparent; background: none;
  border-radius: 6px; padding: 4px 6px; max-width: 220px;
  color: var(--ink);
}
.cell-select:hover, .cell-select:focus { border-color: var(--grid); background: var(--surface); }

.stage-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 550;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  background: var(--page); border: 1px solid var(--grid);
  color: var(--ink-2);
}

/* monthly grid (spreadsheet-style) */
.month-grid td.hot { background: var(--accent-wash); color: var(--ink); font-weight: 600; }
.month-grid td.zero { color: var(--grid); }
.month-grid tfoot td.zero { color: var(--muted); font-weight: 480; }

/* ============================================================
   Kanban
   ============================================================ */
.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 10px;
}
@media (max-width: 1100px) { .board { grid-template-columns: repeat(5, 230px); } }
.col {
  background: color-mix(in srgb, var(--surface) 62%, var(--page));
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  padding: 10px;
  min-height: 160px;
  display: flex; flex-direction: column; gap: 8px;
}
.col.drag-over { border-color: var(--accent); background: var(--accent-wash); }
.col-head { padding: 4px 6px 6px; border-bottom: 2px solid var(--col-color, var(--axis)); margin-bottom: 2px; }
.col-title { font-size: 12.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.col-count {
  margin-left: auto;
  font-size: 11px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--grid);
  padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.col-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.knb-card {
  touch-action: none;
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 10px 12px;
  cursor: grab;
}
.knb-card:hover { box-shadow: var(--shadow-lift); border-color: var(--axis); }
.knb-card.dragging { opacity: 0.45; }
.knb-name { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
.knb-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.knb-rev { font-variant-numeric: tabular-nums; font-size: 12.5px; color: var(--ink-2); }
.knb-fact { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 650; }
.knb-tags { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.knb-tag {
  font-size: 10.5px; color: var(--muted);
  background: var(--page); border: 1px solid var(--grid);
  border-radius: 999px; padding: 1px 7px;
}
.col-empty {
  color: var(--muted); font-size: 12px; text-align: center;
  padding: 14px 6px; border: 1px dashed var(--grid); border-radius: var(--radius-sm);
}

/* ============================================================
   Settings
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.inline-input {
  border: 1px solid var(--grid); border-radius: var(--radius-sm);
  background: var(--surface); padding: 6px 9px; width: 100%;
}
.inline-input:focus { outline: 2px solid var(--accent-wash); border-color: var(--accent); }
.inline-input.num { text-align: right; font-variant-numeric: tabular-nums; width: 72px; }
.source-list { display: flex; flex-direction: column; }
.source-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 2px; border-bottom: 1px solid var(--grid); }
.source-item:last-child { border-bottom: none; }
.add-row { display: flex; gap: 8px; margin-top: 12px; }

/* ============================================================
   Modal
   ============================================================ */
.modal-back {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(11,11,11,0.32);
  display: grid; place-items: center;
  padding: 20px;
}
:root[data-theme="dark"] .modal-back { background: rgba(0,0,0,0.55); }
.modal {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  width: 100%; max-width: 480px;
  padding: 22px 24px;
}
/* ---------- sortable + filterable tables ---------- */
.table-tools {
  display: flex; align-items: center; gap: 10px;
  padding: 0 2px 10px; flex-wrap: wrap;
}
.filter-input {
  flex: 1 1 260px; max-width: 360px;
  padding: 6px 10px;
  font: inherit; font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius-sm);
}
.filter-input:focus { outline: 2px solid var(--accent-wash); border-color: var(--accent); }
.filter-input::placeholder { color: var(--muted); }

/* ---------- typeahead (single-select member picker) ---------- */
.typeahead { position: relative; display: inline-block; }
.typeahead-input {
  min-width: 210px;
  padding: 5px 10px;
  font: inherit; font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius-sm);
}
.typeahead-input:focus { outline: 2px solid var(--accent-wash); border-color: var(--accent); }
.typeahead-input::placeholder { color: var(--ink-2); }
.typeahead-list {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0;
  min-width: 100%; max-height: 260px; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  padding: 4px;
}
.typeahead-option {
  padding: 6px 10px; font-size: 13px; white-space: nowrap;
  border-radius: 5px; cursor: pointer;
}
.typeahead-option:hover, .typeahead-option.active { background: var(--accent-wash); color: var(--accent-strong); }

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--ink); }
th.sortable:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sort-arrow { margin-left: 5px; font-size: 9px; opacity: 0.35; }
th.sorted .sort-arrow { opacity: 1; color: var(--accent-strong); }
th.sorted { color: var(--ink); }

/* Dialogs that carry a reference table need more room than a form does. */
.modal.wide {
  max-width: 760px;
  max-height: 90vh; overflow-y: auto;
}
.modal h3 { font-family: Georgia, Gelasio, "Times New Roman", serif; margin: 0 0 16px; font-size: 17px; letter-spacing: -0.2px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12px; font-weight: 550; color: var(--ink-2); }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--grid); border-radius: var(--radius-sm);
  background: var(--surface); padding: 8px 10px;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--accent-wash); border-color: var(--accent);
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.field-hint { font-size: 11.5px; color: var(--muted); }

/* ============================================================
   Toast & misc
   ============================================================ */
.toast-zone { position: fixed; bottom: 22px; right: 22px; z-index: 70; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--grid); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lift);
  padding: 10px 16px; font-size: 13px;
  animation: slide-in 160ms ease;
}
.toast.error { border-left-color: var(--critical); }
@keyframes slide-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty-state { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty-state .big { font-size: 15px; color: var(--ink-2); font-weight: 550; margin-bottom: 4px; }

.view { animation: fade 150ms ease; }
@keyframes fade { from { opacity: 0.4; } to { opacity: 1; } }

.section-gap { margin-top: 14px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   Login
   ============================================================ */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--page); }
.login-card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--grid);
  border-radius: 14px; box-shadow: var(--shadow-lift); padding: 28px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark.lg { width: 40px; height: 40px; border-radius: 11px; font-size: 19px; }
.login-title { font-family: Georgia, Gelasio, "Times New Roman", serif; font-size: 19px; font-weight: 400; letter-spacing: -0.2px; }
.login-sub { font-size: 12.5px; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form .form-field input {
  border: 1px solid var(--grid); border-radius: var(--radius-sm);
  background: var(--surface); padding: 9px 11px; width: 100%;
}
.login-form .form-field input:focus { outline: 2px solid var(--accent-wash); border-color: var(--accent); }
.btn.wide { width: 100%; justify-content: center; margin-top: 4px; }
.login-error { color: var(--critical); font-size: 12.5px; min-height: 16px; }
.login-demo {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--grid);
  font-size: 12px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px;
}
.login-demo-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); font-weight: 600; }
.login-demo code {
  background: var(--page); border: 1px solid var(--grid); border-radius: 4px;
  padding: 1px 5px; font-size: 11.5px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

/* ============================================================
   Identity: avatars, badges, user chip
   ============================================================ */
.avatar {
  display: inline-grid; place-items: center; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--accent-wash); color: var(--accent-strong);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.2px;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }

.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; text-transform: capitalize;
  padding: 2px 9px; border-radius: 999px;
  background: var(--page); border: 1px solid var(--grid); color: var(--ink-2);
}
/* Model ids and other verbatim strings must not be title-cased by the rule above. */
.badge.verbatim { text-transform: none; }
.badge.accent { background: var(--accent-wash); border-color: transparent; color: var(--accent-strong); }
.badge.good { color: var(--good-text); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.badge.muted { color: var(--muted); }

.user-chip {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: none; background: none; padding: 7px 8px; border-radius: var(--radius-sm);
  text-align: left; color: var(--ink); margin-bottom: 6px;
}
.user-chip:hover { background: var(--accent-wash); }
.user-chip-text { min-width: 0; display: flex; flex-direction: column; }
.user-chip-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot { flex-direction: column; align-items: stretch; gap: 6px; }
.foot-row { display: flex; gap: 6px; }
.foot-row .theme-toggle { flex: 1; justify-content: center; }

.cell-user { display: flex; align-items: center; gap: 8px; }
table.data tbody tr.clickable { cursor: pointer; }
.cell-select.bordered { border-color: var(--grid); background: var(--surface); }
.filter-bar { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   Profile
   ============================================================ */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-name { font-size: 17px; font-weight: 650; letter-spacing: -0.2px; }
.profile-business { font-size: 13px; color: var(--ink-2); }
.form-field input:disabled, .form-field select:disabled {
  background: var(--page); color: var(--muted); cursor: not-allowed;
}

.btn[disabled] { opacity: 0.55; cursor: default; }

.knb-tag.owner { background: var(--accent-wash); border-color: transparent; color: var(--accent-strong); }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px 12px; }
  .brand { padding: 0 8px 0 0; }
  .brand-sub { display: none; }
  .sidebar-foot { margin: 0 0 0 auto; padding: 0; flex-direction: row; align-items: center; }
  .user-chip { width: auto; margin: 0; padding: 4px; }
  .user-chip-text { display: none; }
  .nav-link span { display: none; }
  .main { padding: 18px 14px 50px; }
}
