/* Aita Donostia — sistema de diseño interno
   Panel de automatización de facturas y pedidos. Estética enterprise / back-office. */

:root {
  --bg: oklch(96% 0.006 240);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(97.5% 0.004 240);
  --fg: oklch(22% 0.02 250);
  --fg-secondary: oklch(40% 0.02 250);
  --muted: oklch(53% 0.015 250);
  --border: oklch(89% 0.006 240);
  --border-strong: oklch(80% 0.008 240);

  --accent: oklch(53% 0.17 258);
  --accent-hover: oklch(47% 0.17 258);
  --accent-fg: oklch(99% 0 0);
  --accent-soft: oklch(94% 0.03 258);
  --accent-soft-fg: oklch(40% 0.14 258);

  --success: oklch(56% 0.13 152);
  --success-soft: oklch(94% 0.045 152);
  --success-fg: oklch(30% 0.09 152);

  --warning: oklch(62% 0.15 65);
  --warning-soft: oklch(94% 0.05 75);
  --warning-fg: oklch(38% 0.10 65);

  --danger: oklch(53% 0.19 25);
  --danger-soft: oklch(94% 0.045 25);
  --danger-fg: oklch(40% 0.16 25);

  --neutral-soft: oklch(93% 0.006 240);
  --neutral-fg: oklch(40% 0.01 240);

  --purple: oklch(50% 0.14 300);
  --purple-soft: oklch(94% 0.03 300);
  --purple-fg: oklch(38% 0.12 300);

  --sidebar-bg: oklch(21% 0.035 258);
  --sidebar-bg-2: oklch(25% 0.04 258);
  --sidebar-fg: oklch(92% 0.01 258);
  --sidebar-muted: oklch(63% 0.03 258);
  --sidebar-border: oklch(30% 0.04 258);
  --sidebar-active: oklch(32% 0.07 258);
  --sidebar-active-accent: oklch(70% 0.14 230);

  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 2px oklch(20% 0.02 250 / 0.07);
  --shadow-md: 0 6px 20px oklch(20% 0.02 250 / 0.10);
  --shadow-drawer: 2px 0 24px oklch(20% 0.02 250 / 0.18);

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --topbar-h: 60px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; color: var(--fg); font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
table { border-collapse: collapse; }
::selection { background: var(--accent-soft); color: var(--accent-soft-fg); }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--sidebar-border);
  z-index: 40;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--sidebar-border);
  min-height: var(--topbar-h);
}
.sidebar-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--sidebar-active-accent);
  color: oklch(18% 0.03 258);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  flex: none;
  overflow: hidden;
}
.sidebar-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-brand .sidebar-brand-mark { width: 44px; height: 44px; border-radius: var(--radius-md); }
.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; }
.sidebar-brand-text strong { font-family: var(--font-display); font-size: 14.5px; font-weight: 700; color: oklch(97% 0.01 258); white-space: nowrap; }
.sidebar-brand-text span { font-size: 11px; color: var(--sidebar-muted); white-space: nowrap; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sidebar-muted);
  padding: 14px 10px 6px;
  font-weight: 650;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  color: var(--sidebar-fg);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s ease;
}
.sidebar-link svg { width: 17px; height: 17px; flex: none; opacity: 0.85; }
.sidebar-link:hover { background: var(--sidebar-bg-2); }
.sidebar-link.active { background: var(--sidebar-active); color: oklch(98% 0.01 258); position: relative; }
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: var(--sidebar-active-accent);
}
.sidebar-link-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--danger);
  color: white;
  border-radius: 999px;
  padding: 1px 6px;
  font-family: var(--font-mono);
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding: 12px;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
}
.sidebar-user:hover { background: var(--sidebar-bg-2); }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sidebar-active-accent);
  color: oklch(18% 0.03 258);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  flex: none;
}
.sidebar-user-meta { line-height: 1.25; overflow: hidden; }
.sidebar-user-meta strong { display: block; font-size: 13px; color: oklch(97% 0.01 258); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-meta span { font-size: 11.5px; color: var(--sidebar-muted); }

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-title { display: flex; flex-direction: column; gap: 1px; }
.topbar-crumb { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.topbar-heading { font-size: 15.5px; font-weight: 700; font-family: var(--font-display); }
.topbar-spacer { flex: 1; }
.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 7px 11px;
  color: var(--muted);
  font-size: 13px;
  width: 260px;
}
.topbar-search svg { width: 15px; height: 15px; flex: none; }
.topbar-search input { border: none; background: none; outline: none; width: 100%; font-size: 13px; color: var(--fg); }
.topbar-icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  color: var(--fg-secondary);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.topbar-icon-btn svg { width: 18px; height: 18px; }
.topbar-icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 1.5px solid var(--surface); }
.hamburger { display: none; }
.role-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---------- Content ---------- */
.content { padding: 24px 28px 80px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-subtitle { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--fg-secondary); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: oklch(80% 0.08 25); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-danger-solid { background: var(--danger); color: white; }
.btn-danger-solid:hover { filter: brightness(1.08); }
.btn-success-solid { background: var(--success); color: white; }
.btn-success-solid:hover { filter: brightness(1.08); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 14px; }
.card-head-meta { font-size: 12px; color: var(--muted); }

/* ---------- Stat / status cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 22px; }
.stat-grid-6 .stat-card { padding: 13px 14px; gap: 4px; }
.stat-grid-6 .stat-card .stat-card-label { font-size: 10.5px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stat-card.tone-warning { border-left-color: var(--warning); }
.stat-card.tone-danger { border-left-color: var(--danger); }
.stat-card.tone-success { border-left-color: var(--success); }
.stat-card.tone-neutral { border-left-color: var(--border-strong); }
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-card-label { font-size: 12px; font-weight: 650; color: var(--fg-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
.stat-icon { width: 30px; height: 30px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; flex: none; }
.stat-icon svg { width: 16px; height: 16px; }
.stat-icon.tone-warning { background: var(--warning-soft); color: var(--warning-fg); }
.stat-icon.tone-danger { background: var(--danger-soft); color: var(--danger-fg); }
.stat-icon.tone-success { background: var(--success-soft); color: var(--success-fg); }
.stat-icon.tone-neutral { background: var(--neutral-soft); color: var(--neutral-fg); }
.stat-value { font-family: var(--font-mono); font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.stat-caption { font-size: 12px; color: var(--muted); }
.stat-card-action {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-card-action svg { width: 13px; height: 13px; }

/* ---------- Badges / status pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 650;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.6;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-neutral { background: var(--neutral-soft); color: var(--neutral-fg); }
.badge-accent { background: var(--accent-soft); color: var(--accent-soft-fg); }
.badge-success { background: var(--success-soft); color: var(--success-fg); }
.badge-warning { background: var(--warning-soft); color: var(--warning-fg); }
.badge-danger { background: var(--danger-soft); color: var(--danger-fg); }
.badge-purple { background: var(--purple-soft); color: var(--purple-fg); }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
table.table { width: 100%; font-size: 13px; }
.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 650;
  color: var(--muted);
  background: var(--surface-2);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr.row-link { cursor: pointer; }
.table tbody tr.row-flagged { background: var(--danger-soft); }
.table tbody tr.row-flagged:hover { background: oklch(91% 0.06 25); }
.table .cell-muted { color: var(--muted); }
.table .cell-num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
th.cell-num { text-align: right; }

/* ---------- Filters bar ---------- */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.select, .input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--fg);
}
.select { padding-right: 6px; }
.search-input { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); padding: 7px 10px; min-width: 220px; }
.search-input svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.search-input input { border: none; outline: none; font-size: 13px; width: 100%; }
.filters-spacer { flex: 1; }
.filter-count { font-size: 12.5px; color: var(--muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 650; color: var(--fg-secondary); }
.field-hint { font-size: 11.5px; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="search"], .field select, .field textarea {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 9px 11px;
  font-size: 13.5px;
  background: var(--surface);
  color: var(--fg);
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* ---------- Confidence indicator ---------- */
.confidence { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 650; }
.confidence-bar { width: 44px; height: 5px; border-radius: 3px; background: var(--neutral-soft); overflow: hidden; }
.confidence-bar span { display: block; height: 100%; border-radius: 3px; }
.confidence.high { color: var(--success-fg); }
.confidence.high .confidence-bar span { background: var(--success); }
.confidence.medium { color: var(--warning-fg); }
.confidence.medium .confidence-bar span { background: var(--warning); }
.confidence.low { color: var(--danger-fg); }
.confidence.low .confidence-bar span { background: var(--danger); }

/* ---------- Alert / banner ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: var(--radius-md); border: 1px solid; font-size: 13px; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert-danger { background: var(--danger-soft); border-color: oklch(85% 0.07 25); color: var(--danger-fg); }
.alert-warning { background: var(--warning-soft); border-color: oklch(87% 0.07 75); color: var(--warning-fg); }
.alert-accent { background: var(--accent-soft); border-color: oklch(85% 0.06 258); color: var(--accent-soft-fg); }
.alert strong { font-weight: 700; }

/* ---------- Utility layout ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.hr { height: 1px; background: var(--border); border: none; margin: 16px 0; }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.kbd { font-family: var(--font-mono); font-size: 11px; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 4px; padding: 1px 6px; }

/* ---------- Mobile drawer / overlay ---------- */
.sidebar-overlay { display: none; }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { display: none; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: 268px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-drawer);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: oklch(15% 0.02 250 / 0.45);
    z-index: 39;
  }
  .sidebar-overlay.open { display: block; }
  .hamburger {
    display: flex;
    width: 34px; height: 34px;
    align-items: center; justify-content: center;
    border-radius: var(--radius-md);
    color: var(--fg-secondary);
    flex: none;
  }
  .hamburger:hover { background: var(--surface-2); }
  .hamburger svg { width: 20px; height: 20px; }
  .topbar-search { display: none; }
  .content { padding: 18px 16px 92px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-grid-6 { grid-template-columns: 1fr 1fr; }
  .grid-2, .split { grid-template-columns: 1fr; }
  .review-shell { grid-template-columns: 1fr; }
  .preview-pane { position: static; }
  .preview-body { min-height: 380px; padding: 16px; }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--sidebar-bg);
    border-top: 1px solid var(--sidebar-border);
    z-index: 41;
    padding: 0 4px;
  }
  .bottom-nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--sidebar-muted);
    font-size: 10.5px;
    font-weight: 600;
  }
  .bottom-nav-link svg { width: 19px; height: 19px; }
  .bottom-nav-link.active { color: var(--sidebar-active-accent); }
}

@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-grid-6 { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .search-input, .select { width: 100%; }
  .table-wrap { overflow-x: auto; }
  table.table { min-width: 720px; }
  .split { display: flex; flex-direction: column; }
}

/* ---------- Document review split view ---------- */
.review-shell { display: grid; grid-template-columns: 1fr 420px; gap: 20px; align-items: start; }
.preview-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); position: sticky; top: 84px; }
.preview-toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.preview-toolbar-spacer { flex: 1; }
.preview-zoom-label { font-size: 12px; color: var(--muted); font-family: var(--font-mono); padding: 0 4px; }
.preview-icon-btn { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); color: var(--fg-secondary); }
.preview-icon-btn:hover { background: var(--border); }
.preview-icon-btn svg { width: 15px; height: 15px; }
.preview-body { padding: 22px; background: var(--surface-2); display: flex; justify-content: center; min-height: 560px; }
.doc-paper { width: 100%; max-width: 420px; background: white; border: 1px solid var(--border); box-shadow: var(--shadow-md); padding: 26px 24px; color: oklch(30% 0.01 250); }
.doc-paper-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 14px; border-bottom: 2px solid oklch(20% 0.01 250); margin-bottom: 16px; }
.doc-paper-head strong { font-size: 13px; display: block; }
.doc-paper-head span { font-size: 10.5px; color: oklch(50% 0.01 250); }
.doc-paper-meta { font-size: 10px; text-align: right; line-height: 1.6; color: oklch(45% 0.01 250); }
.doc-line { height: 7px; background: oklch(88% 0.005 250); border-radius: 2px; margin-bottom: 7px; }
.doc-line.short { width: 55%; }
.doc-line.tiny { width: 30%; height: 6px; }
.doc-table-mock { margin: 16px 0; border-top: 1px solid oklch(85% 0.005 250); border-bottom: 1px solid oklch(85% 0.005 250); padding: 10px 0; }
.doc-table-mock .doc-row { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
.doc-table-mock .doc-row .doc-line { margin-bottom: 0; flex: 1; }
.doc-table-mock .doc-row .doc-line.w-num { flex: 0 0 34px; }
.doc-highlight { outline: 2px solid var(--accent); outline-offset: 2px; background: var(--accent-soft); border-radius: 2px; }

.review-field-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.review-field-row { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.review-field-row:last-child { border-bottom: none; }
.review-field-top { display: flex; align-items: center; justify-content: space-between; }
.review-field-label { font-size: 12px; font-weight: 650; color: var(--fg-secondary); }
.review-field-row input { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 9px; font-size: 13.5px; font-family: var(--font-mono); background: var(--surface); color: var(--fg); width: 100%; }
.review-field-row.flagged { background: var(--danger-soft); }
.review-field-row.flagged input { border-color: oklch(75% 0.10 25); }

/* ---------- Diff / comparison tables ---------- */
.diff-table th, .diff-table td { text-align: right; }
.diff-table th:first-child, .diff-table td:first-child { text-align: left; }
.diff-cell-bad { color: var(--danger-fg); font-weight: 700; background: var(--danger-soft); border-radius: 4px; }
.diff-cell-ok { color: var(--success-fg); }

/* ---------- Reconciliation rows ---------- */
.recon-status-icon { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.recon-status-icon svg { width: 15px; height: 15px; }
.recon-status-icon.success { background: var(--success-soft); color: var(--success-fg); }
.recon-status-icon.warning { background: var(--warning-soft); color: var(--warning-fg); }
.recon-status-icon.danger { background: var(--danger-soft); color: var(--danger-fg); }
.recon-status-icon.purple { background: var(--purple-soft); color: var(--purple-fg); }
.recon-status-icon.neutral { background: var(--neutral-soft); color: var(--neutral-fg); }
.recon-status-icon.accent { background: var(--accent-soft); color: var(--accent-soft-fg); }

/* ---------- Toggle switch (admin) ---------- */
.toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: background 0.15s; }
.toggle-track::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform 0.15s; box-shadow: var(--shadow-sm); }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::before { transform: translateX(16px); }

/* ---------- Progress bar (admin health) ---------- */
.health-row { display: flex; align-items: center; gap: 12px; }
.health-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--neutral-soft); overflow: hidden; }
.health-bar span { display: block; height: 100%; border-radius: 3px; background: var(--success); }

/* ---------- Auth screens (login) ---------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sidebar-bg);
  background-image:
    linear-gradient(180deg, var(--sidebar-bg) 0%, oklch(19% 0.03 258) 100%);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 32px 30px 28px;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.auth-brand .sidebar-brand-mark { background: var(--accent); color: white; }
.auth-brand strong { font-family: var(--font-display); font-size: 15.5px; font-weight: 700; }
.auth-brand span { display: block; font-size: 11.5px; color: var(--muted); }
.auth-title { font-size: 18px; margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.totp-inputs { display: flex; gap: 8px; margin-bottom: 6px; }
.totp-inputs input {
  width: 100%;
  aspect-ratio: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.totp-inputs input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); background: var(--surface); }
.auth-foot-link { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.auth-foot-link a { color: var(--accent); font-weight: 650; }
.auth-security-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--muted); }
.auth-security-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
