/* =========================================================================
   DGCI PERSONAL AI — MASTER DESIGN SYSTEM
   Every page in this application loads this single stylesheet.
   Do not create page-specific stylesheets — extend this one instead.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. FONTS
   Fraunces — display serif, used only for brand moments and headlines.
   Inter — body, UI, labels and data (tabular figures for scores/numbers).
   ------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Inter:wght@400;500;600;700&display=swap');

/* -------------------------------------------------------------------------
   2. DESIGN TOKENS
   ------------------------------------------------------------------------- */
:root {
  /* --- Color: base surfaces (deep violet-black, not pure black) --- */
  --bg: #0D0B14;
  --bg-elevated: #14111C;
  --surface: #1A1626;
  --surface-hover: #221C30;
  --surface-raised: #241E33;
  --border: #2B2438;
  --border-strong: #3D3450;

  /* --- Color: violet (primary interactive) --- */
  --violet-300: #A99CFF;
  --violet-500: #7C5CFF;
  --violet-600: #6446E0;
  --violet-900: #241B4A;

  /* --- Color: gold (accent — used sparingly, for emphasis & data) --- */
  --gold-300: #E2C46B;
  --gold-500: #C9A227;
  --gold-700: #8F7218;

  /* --- Color: text --- */
  --text-primary: #F3F1F7;
  --text-secondary: #B3A9C2;
  --text-tertiary: #7A7089;
  --text-on-gold: #241B0A;

  /* --- Color: semantic --- */
  --success: #57B889;
  --success-dim: #1E3A2C;
  --warning: #D9A544;
  --warning-dim: #3A2E14;
  --danger: #E2677E;
  --danger-dim: #3A1B22;

  /* --- Typography --- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --text-display: 600 clamp(2rem, 1.4rem + 2.6vw, 3.4rem)/1.08 var(--font-display);
  --text-h1: 600 clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem)/1.18 var(--font-display);
  --text-h2: 600 1.5rem/1.25 var(--font-display);
  --text-h3: 600 1.15rem/1.35 var(--font-body);
  --text-body: 400 0.9375rem/1.6 var(--font-body);
  --text-body-sm: 400 0.8125rem/1.55 var(--font-body);
  --text-caption: 500 0.75rem/1.4 var(--font-body);
  --text-data: 600 1.75rem/1.1 var(--font-body);
  --text-label: 500 0.6875rem/1 var(--font-body);

  /* --- Spacing scale --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* --- Radius --- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* --- Shadow (used sparingly — flat design otherwise) --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(5, 3, 12, 0.45);
  --shadow-gold: 0 0 0 1px rgba(201, 162, 39, 0.35);

  /* --- Motion --- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --dur-slow: 420ms;

  /* --- Layout --- */
  --nav-width: 240px;
  --header-height: 64px;
  --bottom-nav-height: 64px;
  --max-content: 1180px;
}

/* -------------------------------------------------------------------------
   3. RESET
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font: var(--text-body);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--violet-900); color: var(--text-primary); }

/* Faint noise/vignette on the base background — the one signature texture
   used across the whole app, not repeated as decoration elsewhere. */
body {
  background-image:
    radial-gradient(ellipse at 15% -10%, rgba(124, 92, 255, 0.10), transparent 45%),
    radial-gradient(ellipse at 100% 0%, rgba(201, 162, 39, 0.06), transparent 40%);
  background-attachment: fixed;
}

/* -------------------------------------------------------------------------
   4. TYPOGRAPHY UTILITIES
   ------------------------------------------------------------------------- */
.type-display { font: var(--text-display); font-family: var(--font-display); letter-spacing: -0.01em; }
.type-h1 { font: var(--text-h1); font-family: var(--font-display); letter-spacing: -0.01em; }
.type-h2 { font: var(--text-h2); font-family: var(--font-display); }
.type-h3 { font: var(--text-h3); }
.type-body { font: var(--text-body); }
.type-body-sm { font: var(--text-body-sm); color: var(--text-secondary); }
.type-caption { font: var(--text-caption); color: var(--text-tertiary); }
.type-data { font: var(--text-data); font-variant-numeric: tabular-nums; }
.type-label {
  font: var(--text-label);
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}
.text-muted { color: var(--text-secondary); }
.text-faint { color: var(--text-tertiary); }
.text-gold { color: var(--gold-300); }
.text-violet { color: var(--violet-300); }
.italic-accent { font-family: var(--font-display); font-style: italic; font-weight: 500; }

/* -------------------------------------------------------------------------
   5. LAYOUT SHELL
   Every unlocked page shares this shell: sidebar (desktop) + header +
   content + mobile bottom nav. navigation.js injects the sidebar/header/
   bottom-nav markup into these containers.
   ------------------------------------------------------------------------- */
.app-shell {
  min-height: 100%;
  display: flex;
}

#app-sidebar { flex-shrink: 0; }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#app-header { flex-shrink: 0; }

.app-content {
  flex: 1;
  width: 100%;
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-6) var(--sp-16);
}

@media (max-width: 880px) {
  .app-content { padding: var(--sp-6) var(--sp-4) calc(var(--bottom-nav-height) + var(--sp-10)); }
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}
.page-head__title { display: flex; flex-direction: column; gap: var(--sp-2); }
.page-head__eyebrow { color: var(--gold-300); }

/* -------------------------------------------------------------------------
   6. SIDEBAR (desktop navigation)
   ------------------------------------------------------------------------- */
.sidebar {
  width: var(--nav-width);
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) var(--sp-4);
}
@media (max-width: 880px) { .sidebar { display: none; } }

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-2) var(--sp-6);
  margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.sidebar__brand img { width: 28px; height: 28px; }
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar__brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.sidebar__brand-sub { font-size: 0.6875rem; color: var(--text-tertiary); }

.sidebar__section-label {
  padding: var(--sp-4) var(--sp-2) var(--sp-2);
  font: var(--text-label);
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
}

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  position: relative;
}
.nav-link:hover { background: var(--surface-hover); color: var(--text-primary); }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.nav-link.is-active {
  background: var(--violet-900);
  color: var(--text-primary);
}
.nav-link.is-active::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: var(--r-pill);
  background: var(--gold-500);
}

.sidebar__archive {
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}
.nav-link--archive { color: var(--gold-300); }
.nav-link--archive:hover { background: rgba(201, 162, 39, 0.08); }

.sidebar__footer {
  padding-top: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.btn-logout {
  font: var(--text-caption);
  color: var(--text-tertiary);
  background: none;
  border: none;
  padding: var(--sp-2);
}
.btn-logout:hover { color: var(--danger); }

/* -------------------------------------------------------------------------
   7. MOBILE BOTTOM NAV
   ------------------------------------------------------------------------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  z-index: 40;
  padding: 0 var(--sp-2);
  align-items: center;
  justify-content: space-around;
}
@media (max-width: 880px) { .bottom-nav { display: flex; } }

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-tertiary);
  font-size: 0.625rem;
  font-weight: 500;
  padding: var(--sp-2);
  flex: 1;
  border-radius: var(--r-md);
}
.bottom-nav__item svg { width: 20px; height: 20px; }
.bottom-nav__item.is-active { color: var(--gold-300); }

.bottom-nav__fab {
  width: 46px; height: 46px;
  border-radius: var(--r-pill);
  background: var(--violet-500);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -22px;
  box-shadow: var(--shadow-md);
  border: 3px solid var(--bg-elevated);
}
.bottom-nav__fab svg { width: 22px; height: 22px; }

/* -------------------------------------------------------------------------
   8. HEADER
   ------------------------------------------------------------------------- */
.header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 0 var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: rgba(13, 11, 20, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
}
@media (max-width: 880px) { .header { padding: 0 var(--sp-4); } }

.header__search {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
}
.header__search input {
  background: none;
  border: none;
  outline: none;
  flex: 1;
  font-size: 0.8125rem;
}
.header__search svg { width: 16px; height: 16px; color: var(--text-tertiary); flex-shrink: 0; }
@media (max-width: 640px) { .header__search { display: none; } }

.header__actions { display: flex; align-items: center; gap: var(--sp-3); }
.header__avatar {
  width: 34px; height: 34px;
  border-radius: var(--r-pill);
  background: var(--violet-900);
  color: var(--violet-300);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
  border: 1px solid var(--border-strong);
}

/* -------------------------------------------------------------------------
   9. BUTTONS
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 16px; height: 16px; }

.btn--primary { background: var(--violet-500); color: #fff; }
.btn--primary:hover { background: var(--violet-600); }

.btn--gold { background: var(--gold-500); color: var(--text-on-gold); }
.btn--gold:hover { background: var(--gold-300); }

.btn--secondary { background: var(--surface); color: var(--text-primary); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-hover); }

.btn--ghost { background: none; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--surface); color: var(--text-primary); }

.btn--danger { background: var(--danger-dim); color: var(--danger); }
.btn--danger:hover { background: rgba(226, 103, 126, 0.25); }

.btn--sm { padding: var(--sp-2) var(--sp-3); font-size: 0.8125rem; }
.btn--lg { padding: var(--sp-4) var(--sp-6); font-size: 0.9375rem; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn:focus-visible, .nav-link:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--violet-300);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   10. CARDS & SURFACES
   ------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
}
.card--flush { padding: 0; overflow: hidden; }
.card--interactive { transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease); }
.card--interactive:hover { border-color: var(--border-strong); background: var(--surface-raised); }

.glass {
  background: rgba(26, 22, 38, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.grid {
  display: grid;
  gap: var(--sp-5);
}
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); }

.divider { height: 1px; background: var(--border); border: none; margin: var(--sp-5) 0; }

/* -------------------------------------------------------------------------
   11. BADGES / TAGS / PRIORITY
   ------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-2);
  border-radius: var(--r-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}
.badge--high { background: var(--danger-dim); color: var(--danger); border-color: transparent; }
.badge--medium { background: var(--warning-dim); color: var(--warning); border-color: transparent; }
.badge--low { background: var(--success-dim); color: var(--success); border-color: transparent; }
.badge--gold { background: rgba(201, 162, 39, 0.12); color: var(--gold-300); border-color: transparent; }
.badge--violet { background: var(--violet-900); color: var(--violet-300); border-color: transparent; }

/* -------------------------------------------------------------------------
   12. FORMS
   ------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.field__label { font: var(--text-caption); color: var(--text-secondary); font-weight: 600; }
.input, .textarea, select.input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease);
  width: 100%;
}
.input:focus, .textarea:focus { border-color: var(--violet-500); }
.textarea { resize: vertical; min-height: 120px; font-family: var(--font-body); }
.field__hint { font-size: 0.75rem; color: var(--text-tertiary); }
.field__error { font-size: 0.75rem; color: var(--danger); }

/* -------------------------------------------------------------------------
   13. LOCK SCREEN
   ------------------------------------------------------------------------- */
.lock-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  position: relative;
}
.lock-screen__mark {
  position: absolute;
  top: var(--sp-8);
  left: var(--sp-8);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-tertiary);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.lock-screen__mark img { width: 18px; height: 18px; opacity: 0.8; }
@media (max-width: 640px) { .lock-screen__mark { position: static; margin-bottom: var(--sp-10); } }

.lock-card {
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.lock-card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
  margin-bottom: var(--sp-2);
}
.lock-card__rule {
  width: 40px;
  height: 2px;
  background: var(--gold-500);
  margin: var(--sp-4) auto;
  border-radius: var(--r-pill);
}
.lock-card__sub {
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  margin-bottom: var(--sp-10);
}
.lock-card form { text-align: left; }
.lock-card .field { margin-bottom: var(--sp-4); }
.lock-card__error {
  display: none;
  align-items: center;
  gap: var(--sp-2);
  color: var(--danger);
  font-size: 0.8125rem;
  margin-bottom: var(--sp-4);
  padding: var(--sp-3);
  background: var(--danger-dim);
  border-radius: var(--r-md);
}
.lock-card__error.is-visible { display: flex; }
.lock-card__error svg { width: 16px; height: 16px; flex-shrink: 0; }

.lock-card__biometric {
  margin-top: var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  color: var(--text-tertiary);
  font-size: 0.8125rem;
}
.lock-card__biometric button {
  background: none;
  border: 1px dashed var(--border-strong);
  color: var(--text-tertiary);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.lock-card__biometric button svg { width: 15px; height: 15px; }
.lock-card__biometric button:disabled { cursor: not-allowed; opacity: 0.6; }

.lock-screen__footnote {
  position: absolute;
  bottom: var(--sp-6);
  color: var(--text-tertiary);
  font-size: 0.6875rem;
}

/* Lock shake animation for wrong-password state */
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}
.is-shaking { animation: shake 420ms var(--ease); }

/* Lock icon idle animation (subtle, on load only) */
.lock-icon-wrap {
  width: 56px; height: 56px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-6);
}
.lock-icon-wrap svg { width: 22px; height: 22px; color: var(--gold-300); }

/* -------------------------------------------------------------------------
   14. TOAST
   ------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 340px;
}
@media (max-width: 640px) {
  #toast-container { left: var(--sp-4); right: var(--sp-4); max-width: none; bottom: calc(var(--bottom-nav-height) + var(--sp-4)); }
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  animation: toast-in var(--dur-slow) var(--ease) forwards;
}
.toast.is-leaving { animation: toast-out var(--dur-base) var(--ease) forwards; }
@keyframes toast-in { to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }
.toast__icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast--success .toast__icon { color: var(--success); }
.toast--error .toast__icon { color: var(--danger); }
.toast--info .toast__icon { color: var(--violet-300); }
.toast__body { flex: 1; }
.toast__title { font-size: 0.8125rem; font-weight: 600; }
.toast__msg { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.toast__close { background: none; border: none; color: var(--text-tertiary); padding: 2px; }

/* -------------------------------------------------------------------------
   15. MODAL
   ------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 5, 10, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  z-index: 90;
  opacity: 0;
  animation: overlay-in var(--dur-base) var(--ease) forwards;
}
@keyframes overlay-in { to { opacity: 1; } }
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  animation: modal-in var(--dur-slow) var(--ease) forwards;
}
@keyframes modal-in { to { transform: translateY(0) scale(1); opacity: 1; } }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: var(--sp-4); }
.modal__title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.modal__close { background: none; border: none; color: var(--text-tertiary); }
.modal__body { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: var(--sp-6); }
.modal__actions { display: flex; justify-content: flex-end; gap: var(--sp-3); }

/* -------------------------------------------------------------------------
   16. EMPTY & ERROR STATES
   ------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  color: var(--text-secondary);
}
.empty-state__icon {
  width: 44px; height: 44px;
  margin: 0 auto var(--sp-5);
  color: var(--text-tertiary);
}
.empty-state__title { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: var(--sp-2); color: var(--text-primary); }
.empty-state__msg { font-size: 0.875rem; max-width: 340px; margin: 0 auto var(--sp-6); }

.inline-error {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--danger-dim);
  border: 1px solid rgba(226, 103, 126, 0.3);
  color: var(--danger);
  padding: var(--sp-4);
  border-radius: var(--r-md);
  font-size: 0.8125rem;
}
.inline-error svg { width: 18px; height: 18px; flex-shrink: 0; }

/* -------------------------------------------------------------------------
   17. LOADING / SKELETON / SPINNER
   ------------------------------------------------------------------------- */
.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--violet-300);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-raised) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-sweep 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton-sweep { to { background-position: -200% 0; } }

/* -------------------------------------------------------------------------
   18. ACCESSIBILITY
   ------------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--sp-2);
  z-index: 200;
  background: var(--gold-500);
  color: var(--text-on-gold);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-weight: 600;
}
.skip-link:focus { left: var(--sp-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------------------------------------------------
   19b. DASHBOARD — stat cards, quick actions, recent activity row
   ------------------------------------------------------------------------- */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.stat-card__label { display: flex; align-items: center; justify-content: space-between; }
.stat-card__value { font: var(--text-data); }

.quick-actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-8);
}
.quick-action {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
}
.quick-action__icon {
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.quick-action__icon svg { width: 20px; height: 20px; }
.quick-action--primary .quick-action__icon { background: var(--violet-900); color: var(--violet-300); }
.quick-action--gold .quick-action__icon { background: rgba(201,162,39,0.12); color: var(--gold-300); }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.analysis-row { display: block; text-decoration: none; }
.analysis-row__icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--surface-raised);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.analysis-row__icon svg { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .analysis-row .type-caption { display: none; }
}

/* -------------------------------------------------------------------------
   19c. NEW ANALYSIS — unified input cards, dropzone, category chips
   ------------------------------------------------------------------------- */
.input-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
@media (max-width: 880px) { .input-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .input-grid { grid-template-columns: 1fr; } }

.input-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
  width: 100%;
}
.input-tile:hover, .input-tile.is-active { border-color: var(--violet-500); background: var(--surface-raised); }
.input-tile__icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: var(--violet-900);
  color: var(--violet-300);
  display: flex; align-items: center; justify-content: center;
}
.input-tile__icon svg { width: 18px; height: 18px; }
.input-tile__title { font-weight: 600; font-size: 0.9rem; }
.input-tile__sub { color: var(--text-tertiary); font-size: 0.75rem; }

.input-panel {
  margin-top: var(--sp-6);
  border-top: 1px solid var(--border);
  padding-top: var(--sp-6);
}

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--violet-500); background: rgba(124,92,255,0.05); }
.dropzone__icon { width: 34px; height: 34px; color: var(--text-tertiary); margin: 0 auto var(--sp-3); }
.dropzone__title { font-weight: 600; font-size: 0.9rem; margin-bottom: 2px; }
.dropzone__sub { color: var(--text-tertiary); font-size: 0.75rem; }

.file-preview {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  margin-top: var(--sp-4);
}
.file-preview__thumb {
  width: 52px; height: 52px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-raised);
  flex-shrink: 0;
}
.file-preview__meta { flex: 1; min-width: 0; }
.file-preview__name { font-size: 0.8125rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview__size { font-size: 0.75rem; color: var(--text-tertiary); }

.chip-group { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.chip.is-selected { background: var(--violet-500); border-color: var(--violet-500); color: #fff; }
.chip--auto.is-selected { background: var(--gold-500); border-color: var(--gold-500); color: var(--text-on-gold); }

.source-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.source-tab {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 600;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
}
.source-tab.is-active { background: var(--surface-raised); border-color: var(--border-strong); color: var(--text-primary); }

/* -------------------------------------------------------------------------
   19d. ANALYSIS LOADING — animated checklist
   ------------------------------------------------------------------------- */
.loading-screen {
  max-width: 460px;
  margin: var(--sp-16) auto;
  text-align: center;
}
.loading-screen__ring {
  width: 84px; height: 84px;
  margin: 0 auto var(--sp-8);
  position: relative;
}
.loading-screen__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.loading-screen__ring circle { fill: none; stroke-width: 4; }
.loading-screen__ring .track { stroke: var(--border); }
.loading-screen__ring .fill { stroke: var(--gold-500); stroke-linecap: round; transition: stroke-dashoffset 600ms var(--ease); }
.loading-screen__pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
}

.checklist { display: flex; flex-direction: column; gap: var(--sp-3); text-align: left; }
.checklist__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 0.875rem;
  transition: color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.checklist__item.is-active { color: var(--text-primary); border-color: var(--border-strong); }
.checklist__item.is-done { color: var(--text-secondary); }
.checklist__marker {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.checklist__item.is-done .checklist__marker { background: var(--success); border-color: var(--success); color: var(--bg); }
.checklist__item.is-active .checklist__marker { border-color: var(--gold-500); }
.checklist__item.is-active .checklist__marker::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-500);
  animation: pulse-dot 1s var(--ease) infinite;
}
@keyframes pulse-dot { 50% { opacity: 0.35; transform: scale(0.8); } }
.checklist__marker svg { width: 12px; height: 12px; }

/* -------------------------------------------------------------------------
   20. INTELLIGENCE REPORT
   ------------------------------------------------------------------------- */
.app-content--report { max-width: 980px; }

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  flex-wrap: wrap;
  margin-bottom: var(--sp-10);
}
.report-header__meta { flex: 1; min-width: 240px; }

.report-section { margin-bottom: var(--sp-10); }
.report-section__title { margin-bottom: var(--sp-5); }

/* Hero score (circular) */
.hero-score { position: relative; width: 120px; height: 120px; flex-shrink: 0; }
.hero-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hero-score circle { fill: none; stroke-width: 7; }
.hero-score .track { stroke: var(--border); }
.hero-score .fill { stroke-linecap: round; transition: stroke-dashoffset 900ms var(--ease); }
.hero-score__value {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero-score__num { font: var(--text-data); font-size: 2rem; font-variant-numeric: tabular-nums; }
.hero-score__of { font-size: 0.6875rem; color: var(--text-tertiary); }

/* Score bars */
.score-bar { display: flex; flex-direction: column; gap: var(--sp-2); }
.score-bar__head { display: flex; align-items: center; justify-content: space-between; }
.score-bar__value { font-weight: 700; font-variant-numeric: tabular-nums; }
.score-bar__track { height: 8px; border-radius: var(--r-pill); background: var(--surface-raised); overflow: hidden; }
.score-bar__fill { height: 100%; width: 0; border-radius: var(--r-pill); transition: width 900ms var(--ease); }

/* Key findings list items */
.finding-item { display: flex; align-items: flex-start; gap: var(--sp-3); }
.finding-item__dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.finding-item--low .finding-item__dot { background: var(--success); }
.finding-item--high .finding-item__dot { background: var(--danger); }
.finding-item--medium .finding-item__dot { background: var(--gold-500); }

/* Compare blocks (design/branding current vs recommended) */
.compare-col { padding: var(--sp-4); border-radius: var(--r-md); background: var(--bg-elevated); }
.compare-col--current { border-left: 2px solid var(--border-strong); }
.compare-col--recommended { border-left: 2px solid var(--gold-500); }
.compare-col span.type-label { display: block; margin-bottom: var(--sp-2); }

.swatch-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-2); }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.swatch__chip { width: 36px; height: 36px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); }

/* Problem -> Why -> What -> How chain card */
.chain-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.chain-card__row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.chain-card__row:last-child { border-bottom: none; }
.chain-card__row--problem { background: var(--danger-dim); }
.chain-card__row--impact { background: rgba(201,162,39,0.08); }
.chain-card__tag { font: var(--text-label); color: var(--text-tertiary); letter-spacing: 0.05em; padding-top: 2px; }
@media (max-width: 640px) {
  .chain-card__row { grid-template-columns: 1fr; gap: var(--sp-1); }
}

.opportunity-card, .idea-card { height: 100%; }

/* Priority matrix */
.priority-matrix { display: grid; grid-template-columns: 24px 1fr; grid-template-rows: 1fr 24px; gap: var(--sp-3); }
.priority-matrix__grid { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: var(--sp-3); }
.priority-matrix__axis { display: flex; align-items: center; justify-content: center; font: var(--text-label); color: var(--text-tertiary); letter-spacing: 0.06em; }
.priority-matrix__axis--y { grid-column: 1; grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); }
.priority-matrix__axis--x { grid-column: 2; grid-row: 2; }
.matrix-cell { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); min-height: 120px; }
.matrix-cell__label { display: block; font: var(--text-label); color: var(--gold-300); letter-spacing: 0.04em; margin-bottom: var(--sp-3); }
@media (max-width: 640px) {
  .priority-matrix { grid-template-columns: 1fr; }
  .priority-matrix__axis--y { display: none; }
  .priority-matrix__grid { grid-column: 1; grid-template-columns: 1fr; }
}

/* Roadmap */
.roadmap {
  display: flex;
  align-items: stretch;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.roadmap__step {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
}
.roadmap__label { font: var(--text-label); color: var(--gold-300); letter-spacing: 0.06em; display: block; margin-bottom: var(--sp-2); }
.roadmap__arrow { display: flex; align-items: center; color: var(--text-tertiary); font-size: 1.2rem; }
@media (max-width: 640px) { .roadmap__arrow { display: none; } }

/* Final recommendation banner */
.final-recommendation {
  background: linear-gradient(135deg, var(--violet-900), var(--bg-elevated));
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
}

/* Save actions bar */
.save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
}

/* -------------------------------------------------------------------------
   21. COMPANIES & COMPANY DETAIL
   ------------------------------------------------------------------------- */
.company-card__avatar {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  border: 1px solid;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  flex-shrink: 0;
}

.filter-bar {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.filter-chip {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: none;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  font-weight: 600;
}
.filter-chip.is-active { background: var(--surface-raised); border-color: var(--border-strong); color: var(--text-primary); }

/* Company header */
.company-header {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}
.company-header__avatar {
  width: 64px; height: 64px;
  border-radius: var(--r-lg);
  border: 1px solid;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.3rem;
  flex-shrink: 0;
}

/* Tabs */
.tab-bar {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-8);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: var(--sp-3) var(--sp-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-tertiary);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.tab-btn.is-active { color: var(--text-primary); border-bottom-color: var(--gold-500); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* Timeline */
.timeline { position: relative; padding-left: var(--sp-8); }
.timeline::before {
  content: '';
  position: absolute; left: 15px; top: 4px; bottom: 4px;
  width: 1px; background: var(--border);
}
.timeline__item { position: relative; padding-bottom: var(--sp-6); display: flex; gap: var(--sp-4); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__icon {
  position: absolute; left: calc(-1 * var(--sp-8));
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
}
.timeline__icon svg { width: 14px; height: 14px; }
.timeline__item--insight .timeline__icon { color: var(--gold-300); }
.timeline__item--report .timeline__icon { color: var(--violet-300); }
.timeline__body { flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }

/* File tiles */
.file-tile {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
}
.file-tile__icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--surface-raised);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.file-tile__icon svg { width: 18px; height: 18px; }

/* Chat */
.chat-panel { display: flex; flex-direction: column; height: 460px; }
.chat-panel__log {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-1);
}
.chat-panel__composer { display: flex; gap: var(--sp-3); margin-top: var(--sp-4); }
.chat-panel__composer .input { flex: 1; }

.chat-bubble {
  max-width: 78%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.chat-bubble--user { align-self: flex-end; background: var(--violet-900); border-color: transparent; }
.chat-bubble--dgci { align-self: flex-start; }
.chat-bubble--typing { display: flex; align-items: center; gap: var(--sp-2); }
.chat-bubble__sender { display: block; font: var(--text-label); color: var(--text-tertiary); margin-bottom: 4px; }

/* -------------------------------------------------------------------------
   22. KNOWLEDGE
   ------------------------------------------------------------------------- */
.knowledge-card { height: 100%; }
.knowledge-card__tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }

/* -------------------------------------------------------------------------
   23. INSIGHTS — frequency bars
   ------------------------------------------------------------------------- */
.freq-bars { display: flex; flex-direction: column; gap: var(--sp-4); }
.freq-bar__head { display: flex; justify-content: space-between; margin-bottom: var(--sp-2); }
.freq-bar__track { height: 8px; border-radius: var(--r-pill); background: var(--surface-raised); overflow: hidden; }
.freq-bar__fill { height: 100%; background: var(--gold-500); border-radius: var(--r-pill); transition: width 700ms var(--ease); }

/* -------------------------------------------------------------------------
   24. REPORTS CENTER
   ------------------------------------------------------------------------- */
.report-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  justify-content: space-between;
  flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   25. VOICE ASSISTANT
   ------------------------------------------------------------------------- */
.voice-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--sp-10) var(--sp-4);
}
.voice-mic {
  width: 96px; height: 96px;
  border-radius: var(--r-pill);
  background: var(--violet-500);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: none;
  position: relative;
  margin-bottom: var(--sp-6);
  transition: background var(--dur-base) var(--ease);
}
.voice-mic svg { width: 34px; height: 34px; }
.voice-mic.is-listening { background: var(--danger); }
.voice-mic::before, .voice-mic::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--violet-500);
  opacity: 0;
}
.voice-mic.is-listening::before, .voice-mic.is-listening::after {
  border-color: var(--danger);
  animation: mic-pulse 1.6s var(--ease) infinite;
}
.voice-mic.is-listening::after { animation-delay: 0.5s; }
@keyframes mic-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}
.voice-status { font-size: 0.8125rem; color: var(--text-tertiary); margin-bottom: var(--sp-8); min-height: 1.2em; }
.voice-examples { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-6); }
.voice-example-chip {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.voice-example-chip:hover { background: var(--surface-hover); }

/* -------------------------------------------------------------------------
   26. GLOBAL SEARCH RESULTS (inside a modal body)
   ------------------------------------------------------------------------- */
.search-results { display: flex; flex-direction: column; gap: var(--sp-5); max-height: 50vh; overflow-y: auto; }
.search-result {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.search-result:hover { background: var(--surface); color: var(--text-primary); }

/* -------------------------------------------------------------------------
   27. SETTINGS
   ------------------------------------------------------------------------- */
.settings-section { margin-bottom: var(--sp-8); }
.settings-section__title { margin-bottom: var(--sp-4); }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row__label { display: flex; flex-direction: column; gap: 2px; }

.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  transition: background var(--dur-base) var(--ease);
}
.switch__track::before {
  content: '';
  position: absolute;
  height: 16px; width: 16px;
  left: 3px; bottom: 3px;
  background: var(--text-tertiary);
  border-radius: 50%;
  transition: transform var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.switch input:checked + .switch__track { background: var(--violet-900); border-color: var(--violet-500); }
.switch input:checked + .switch__track::before { transform: translateX(18px); background: var(--violet-300); }

/* -------------------------------------------------------------------------
   28. QUICK MODE (Odoo event)
   ------------------------------------------------------------------------- */
.quick-result-card { border-left: 3px solid var(--gold-500); }
.quick-step-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font: var(--text-label);
  color: var(--gold-300);
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-3);
}

/* -------------------------------------------------------------------------
   29. INLINE ARCHIVE LOCK (within the app shell, not full-screen)
   ------------------------------------------------------------------------- */
.archive-lock {
  max-width: 380px;
  margin: var(--sp-16) auto;
  text-align: center;
}
.archive-lock .field { text-align: left; margin-top: var(--sp-6); }

/* -------------------------------------------------------------------------
   19. RESPONSIVE TABLE → CARD (used by comparison/old-new tables in reports)
   ------------------------------------------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; }
.data-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font: var(--text-label);
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-strong);
}
.data-table td {
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
@media (max-width: 640px) {
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: var(--sp-3); padding: var(--sp-2) 0; }
  .data-table td { border: none; padding: var(--sp-2) var(--sp-4); }
  .data-table td::before { content: attr(data-label); display: block; font: var(--text-label); color: var(--text-tertiary); margin-bottom: 2px; }
}
