/* =============================================================================
   SEVRIC — portal design system
   Brand: tinted cobalt on dark ink. Wide-tracked wordmark, hex-aperture mark.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Caveat:wght@500;600;700&display=swap');

:root {
  /* ---------- SEVRIC brand tokens ---------- */
  --brand-cobalt-deep:  #4A7BC8;  /* deep tinted cobalt — light substrates */
  --brand-cobalt:       #7AA7E6;  /* tinted cobalt       — dark substrates */
  --brand-cobalt-soft:  #9FC0EB;
  --brand-ink:          #0E1320;  /* near-black anchor */

  /* Surface — dark theme, anchored to brand ink */
  --bg:           #0A0E1A;
  --bg-elev:      #0E1320;
  --panel:        rgba(255, 255, 255, 0.024);
  --panel-hover:  rgba(255, 255, 255, 0.045);
  --panel-active: rgba(255, 255, 255, 0.065);
  --line:         rgba(255, 255, 255, 0.08);
  --line-strong:  rgba(255, 255, 255, 0.14);

  /* Text */
  --text:        rgba(255, 255, 255, 0.96);
  --text-muted:  rgba(255, 255, 255, 0.62);
  --text-dim:    rgba(255, 255, 255, 0.42);
  --text-faint:  rgba(255, 255, 255, 0.28);

  /* Accent — mapped to tinted cobalt on dark */
  --accent:      #7AA7E6;
  --accent-soft: rgba(122, 167, 230, 0.18);
  --accent-line: rgba(122, 167, 230, 0.35);
  --accent-glow: rgba(122, 167, 230, 0.28);

  /* Semantic */
  --ok:       #4ade80;
  --warn:     #fbbf24;
  --danger:   #fb7185;
  --info:     #60a5fa;

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* Shadows */
  --sh-sm: 0 1px 2px rgba(0,0,0,0.4);
  --sh-md: 0 4px 24px rgba(0,0,0,0.35);
  --sh-lg: 0 24px 60px rgba(0,0,0,0.5);
  --ring:  0 0 0 1px var(--line-strong), 0 16px 48px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; min-height: 100vh; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  font-variation-settings: 'opsz' 32;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* =============================================================================
   Hard anchor reset
   -----------------------------------------------------------------------------
   Without this, browser-default blue underlines bleed through every <a> on
   the page — card-style links (.spot, .tile, .nav-link, .brief-row .cta)
   AND inline links inside dynamic content rendered by dashboard-wire.js.
   Every clickable card in the SEVRIC chrome uses an <a> tag for
   accessibility; the visual treatment lives on the container's
   background/border/etc, not on browser-default link styling.

   We use !important here intentionally. Inline hover-state styling, user
   stylesheets, and old cached style fragments have all been seen leaking
   browser blue through this layer — !important locks the surface so a
   stray rule in a partial (or in third-party widget HTML) can't reintroduce
   underlines. If you legitimately want an underline somewhere, set it on
   a more-specific selector and override `text-decoration` with !important
   too — and consider whether you actually want the underline at all in
   this design system (.widget .hint a:hover and .toggle-mode a:hover are
   the only two places we currently do).
   ========================================================================== */
a,
a:link,
a:visited,
a:hover,
a:active,
a:focus,
a:focus-within,
a:focus-visible {
  color: inherit !important;
  text-decoration: none !important;
  text-decoration-line: none !important;
  text-decoration-color: transparent !important;
  text-decoration-style: solid !important;
  text-underline-offset: 0 !important;
  -webkit-text-decoration: none !important;
}
/* Belt-and-suspenders: kill underlines on anything an anchor can wrap.
   <a><strong>...</strong> · costing ...</a> patterns rendered by
   dashboard-wire.js were inheriting underline from the parent in some
   browsers even with the global reset, because the underline computed
   on the parent paints across descendants. */
a *,
a *:hover,
a *:focus,
a *:active {
  text-decoration: none !important;
  -webkit-text-decoration: none !important;
}
a:focus-visible {
  outline: 2px solid var(--brand-cobalt, #7AA7E6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Backdrop: deep ink with a soft cobalt aurora */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 20% 0%,  rgba(122, 167, 230, 0.22), transparent 60%),
    radial-gradient(50% 40% at 85% 10%, rgba(74, 123, 200, 0.16),  transparent 60%),
    radial-gradient(70% 50% at 50% 110%, rgba(122, 167, 230, 0.08), transparent 60%),
    radial-gradient(100% 100% at 50% 50%, #0E1320 0%, #06080E 100%);
  filter: saturate(108%);
}

/* Subtle film grain for tactile feel */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* =============================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; font-weight: 600; }
h1 { font-size: 40px; line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 15px; line-height: 1.3; font-weight: 600; }
p  { margin: 0; color: var(--text-muted); line-height: 1.5; }

/* Restrained cursive — Caveat is the SEVRIC brand cursive. Reads as a
   marker-pen note rather than wedding-invitation flourish. Reserved for
   personalization moments only (the signed-in user's first name on the
   dashboard, the verb in a hero callout). Do NOT apply to headings,
   buttons, or labels. */
.serif  { font-family: 'Caveat', 'Apple Chancery', cursive; font-style: normal; font-weight: 700; }
.mono   { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }

.display-title {
  font-size: 44px;
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.display-title .serif {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: var(--line-strong);
}

/* =============================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0; z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(8, 9, 12, 0.65);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

/* -----------------------------------------------------------------------------
   SEVRIC brand lockup
   .brand        — link/container for the header wordmark-with-mark
   .brand-mark   — hex-aperture mark (loads the cobalt SVG)
   .brand > span — "SEVRIC" wordmark text, wide-tracked thin
   -------------------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 17px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--brand-cobalt);
  text-decoration: none;
  padding-left: 2px;
}
.brand:hover { color: var(--text); }
.brand > span { padding-right: 0.3em; /* optical balance for trailing tracking */ }

.brand-mark {
  position: relative;
  width: 40px; height: 40px;
  background-image: url("/brand/sevric-mark-color-light-transparent.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 6px 18px rgba(122, 167, 230, 0.4));
  flex-shrink: 0;
}
/* Mark used in auth (login/mfa) headers — sized down so the heading leads. */
.auth-card .brand { margin-bottom: 28px; }
.auth-card .brand-mark { width: 32px; height: 32px; }
.auth-card .brand { font-size: 14px; letter-spacing: 0.28em; }

/* -----------------------------------------------------------------------------
   Tenant chip — sits next to the brand in the topbar. Tells a group admin
   which dealership group they're acting in. Low-contrast, informational
   only; hidden for single-tenant platform-admin views.
   -------------------------------------------------------------------------- */
.topbar-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.tenant-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
  max-width: 260px;
  min-width: 0;
}
.tenant-chip .tenant-divider {
  color: var(--text-faint);
  font-weight: 300;
  font-size: 14px;
  line-height: 1;
}
.tenant-chip .tenant-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -----------------------------------------------------------------------------
   Store picker — only shown when the user has >1 accessible store. Renders
   in the hero below the display title so the active-store context is the
   first thing the user sees after their name.
   -------------------------------------------------------------------------- */
.store-picker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 640px;
}
.store-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.store-picker-label svg {
  width: 14px; height: 14px;
  stroke: var(--brand-cobalt);
  stroke-width: 2;
  fill: none;
}
.store-select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 28px 6px 10px;
  font: 500 13.5px 'Inter', sans-serif;
  cursor: pointer;
  min-width: 220px;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237AA7E6' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.store-select:hover { border-color: var(--brand-cobalt-soft); }
.store-select:focus {
  outline: none;
  border-color: var(--brand-cobalt);
  box-shadow: 0 0 0 3px rgba(122,167,230,0.22);
}
.store-select option {
  background: var(--bg-elev);
  color: var(--text);
}
.store-picker-hint {
  font-size: 12px;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .store-picker { flex-wrap: wrap; }
  .store-picker-hint { display: none; }
}

/* Single-store read-only badge */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 6px 12px;
  background: rgba(122,167,230,0.08);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--brand-cobalt-soft);
}
.store-badge svg {
  width: 14px; height: 14px;
  stroke: var(--brand-cobalt);
  stroke-width: 2;
  fill: none;
}

.top-right {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  position: relative;
  padding: 8px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-link:hover { color: var(--text); background: var(--panel); }
.nav-link.active { color: var(--text); background: var(--panel); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  margin-left: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.user-chip:hover { background: var(--panel-hover); }

.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--brand-cobalt) 0%, var(--brand-cobalt-deep) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 2px 6px rgba(74, 123, 200, 0.35);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  margin-left: 6px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: 500 13px 'Inter', sans-serif;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  color: var(--text);
  background: var(--panel);
  border-color: var(--line);
}
.icon-btn svg { width: 14px; height: 14px; stroke-width: 2; }

/* =============================================================================
   Container
   ========================================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 100px;
}
.page-head {
  margin-bottom: 40px;
  max-width: 760px;
}
.page-head .eyebrow { margin-bottom: 16px; }
.page-head h1 { margin-bottom: 14px; }
.page-head .subtitle {
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.55;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 48px 0 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.section-head .hint {
  font-size: 12.5px;
  color: var(--text-dim);
}

/* =============================================================================
   Widgets — stat cards
   ========================================================================== */
.widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
@media (max-width: 860px) {
  .widgets { grid-template-columns: repeat(2, 1fr); }
}

.widget {
  position: relative;
  padding: 22px 22px 20px;
  background: var(--bg);
  transition: background 0.2s ease;
}
.widget:hover { background: var(--bg-elev); }

.widget .label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.widget .label svg {
  width: 14px; height: 14px;
  stroke-width: 2;
  color: var(--text-faint);
}
.widget .value {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1;
}
.widget .hint {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.widget .hint a { color: var(--accent); text-decoration: none; font-weight: 500; }
.widget .hint a:hover { text-decoration: underline; }

.widget .delta { color: var(--ok); font-weight: 600; }
.widget .delta.down { color: var(--danger); }

/* =============================================================================
   App tiles
   ========================================================================== */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 980px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr; } }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 24px;
  min-height: 196px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: inherit;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  padding: 1px;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.tile::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--r-lg);
  background: radial-gradient(500px 200px at var(--mx, 50%) var(--my, 0%), var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tile:hover {
  border-color: var(--line-strong);
  background: var(--panel-hover);
  transform: translateY(-1px);
}
.tile:hover::after { opacity: 1; }

.tile[disabled],
.tile.no-access {
  cursor: not-allowed;
  opacity: 0.45;
}
.tile[disabled]:hover, .tile.no-access:hover {
  transform: none;
  background: var(--panel);
  border-color: var(--line);
}
.tile[disabled]:hover::after, .tile.no-access:hover::after { opacity: 0; }

.tile .top-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.tile .app-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 18px;
  position: relative;
  z-index: 1;
}
.tile .app-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }

.tile .arrow {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: all 0.2s ease;
  position: relative;
  z-index: 1;
}
.tile:not([disabled]):hover .arrow {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--accent-line);
  transform: translate(2px, -2px);
}
.tile .arrow svg { width: 14px; height: 14px; stroke-width: 2; }

.tile .title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}
.tile .desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}
.tile .meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
}
.role-pill::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}
.role-pill.viewer { color: #7dd3fc; border-color: rgba(125, 211, 252, 0.3); background: rgba(125, 211, 252, 0.08); }
.role-pill.editor { color: #fcd34d; border-color: rgba(252, 211, 77, 0.3);   background: rgba(252, 211, 77, 0.08); }
.role-pill.admin  { color: var(--brand-cobalt); border-color: rgba(122, 167, 230, 0.4); background: rgba(122, 167, 230, 0.12); }
.role-pill.none   { color: var(--text-faint); }
.role-pill.none::before { box-shadow: none; background: var(--text-faint); }

/* =============================================================================
   Auth pages
   ========================================================================== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 40px 36px 32px;
  background: rgba(13, 15, 20, 0.7);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  backdrop-filter: blur(32px) saturate(140%);
  -webkit-backdrop-filter: blur(32px) saturate(140%);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.auth-header { margin-bottom: 28px; }
.auth-header .brand { margin-bottom: 32px; }
.auth-header h1 {
  font-size: 26px;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  font-weight: 600;
}
.auth-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.form-row { margin-bottom: 12px; }
.form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.input, .form-row input, .form-row select {
  width: 100%;
  padding: 11px 13px;
  font: 500 14px 'Inter', sans-serif;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: all 0.15s ease;
}
.input::placeholder, .form-row input::placeholder {
  color: var(--text-faint);
  font-weight: 400;
}
.input:hover, .form-row input:hover, .form-row select:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
.input:focus, .form-row input:focus, .form-row select:focus {
  outline: none;
  border-color: var(--accent-line);
  background: rgba(122, 167, 230, 0.05);
  box-shadow: 0 0 0 3px rgba(122, 167, 230, 0.16);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font: 600 14px 'Inter', sans-serif;
  letter-spacing: -0.01em;
  transition: all 0.15s ease;
  user-select: none;
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  color: #ffffff;
  background: linear-gradient(180deg, var(--brand-cobalt) 0%, var(--brand-cobalt-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 4px 14px rgba(74, 123, 200, 0.45),
    0 0 0 1px rgba(14, 19, 32, 0.35);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--brand-cobalt-soft) 0%, var(--brand-cobalt) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 8px 24px rgba(122, 167, 230, 0.45),
    0 0 0 1px rgba(14, 19, 32, 0.45);
}

.btn-secondary, .btn-google {
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover, .btn-google:hover { background: var(--panel-hover); border-color: rgba(255,255,255,0.22); }
.btn-google svg { width: 16px; height: 16px; }

.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 14px rgba(220, 38, 38, 0.35);
}

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Banner messages */
.error-msg, .info-msg {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.error-msg {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.22);
}
.info-msg {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
}

.forgot-link {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 16px;
}
.forgot-link a {
  color: var(--text-dim);
  font-size: 12.5px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.forgot-link a:hover { color: var(--text); }

.toggle-mode {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-dim);
}
.toggle-mode a { color: var(--accent); text-decoration: none; font-weight: 600; cursor: pointer; }
.toggle-mode a:hover { color: var(--brand-cobalt-soft); text-decoration: underline; text-underline-offset: 3px; }

/* Password strength */
.strength-bar {
  display: flex; gap: 4px;
  margin-top: 10px;
}
.strength-bar div {
  flex: 1; height: 3px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease;
}
.strength-bar.s1 div:nth-child(1) { background: #fb7185; }
.strength-bar.s2 div:nth-child(-n+2) { background: #f59e0b; }
.strength-bar.s3 div:nth-child(-n+3) { background: var(--brand-cobalt); }
.strength-bar.s4 div:nth-child(-n+4) { background: #4ade80; }
.strength-label { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; font-weight: 500; }

.policy {
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  font-size: 12px;
  color: var(--text-dim);
  display: none;
}
.policy.open { display: block; }
.policy strong { color: var(--text-muted); font-weight: 500; display: block; margin-bottom: 6px; font-size: 11.5px; }
.policy ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.policy li { display: flex; align-items: center; gap: 6px; }
.policy li::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.policy li.ok { color: var(--ok); }
.policy li.ok::before {
  background: var(--ok);
  border-color: var(--ok);
  box-shadow: inset 0 0 0 2px var(--bg);
}

/* MFA input */
.mfa-digit-input {
  letter-spacing: 0.5em;
  text-align: center;
  font: 600 20px ui-monospace, 'SF Mono', monospace !important;
}

.security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-dim);
  font-weight: 500;
}
.security-badge svg { width: 12px; height: 12px; stroke-width: 2; color: var(--ok); }

/* =============================================================================
   Admin table
   ========================================================================== */
.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table thead { background: var(--bg-elev); }
.admin-table th,
.admin-table td {
  padding: 14px 18px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.admin-table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255, 255, 255, 0.015); }

.admin-table select {
  min-width: 100px;
  padding: 6px 28px 6px 10px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: 500 12.5px 'Inter', sans-serif;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%23ffffff80' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.admin-table select:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(122, 167, 230, 0.16);
}

.admin-toggle {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  width: 34px; height: 20px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-strong);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.admin-toggle::after {
  content: "";
  position: absolute;
  top: 1px; left: 1px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s cubic-bezier(0.3, 0, 0.3, 1);
}
.admin-toggle:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.admin-toggle:checked::after { transform: translateX(14px); }

.user-cell { display: flex; align-items: center; gap: 12px; }
.user-cell .avatar { width: 30px; height: 30px; font-size: 11px; }
.user-cell .name { font-weight: 500; color: var(--text); }
.user-cell .email { color: var(--text-dim); font-size: 11.5px; margin-top: 1px; }

.check { color: var(--ok); font-weight: 700; }
.dash  { color: var(--text-faint); }

/* =============================================================================
   Launch page
   ========================================================================== */
.launch-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 28px;
  padding: 40px;
  text-align: center;
}
.spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(122, 167, 230, 0.14);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.launch-title { font-size: 18px; font-weight: 600; color: var(--text); letter-spacing: -0.015em; }
.launch-sub   { font-size: 13.5px; color: var(--text-muted); }

/* =============================================================================
   Empty states
   ========================================================================== */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 13.5px;
}
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--panel);
}
.empty-state .icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  background: var(--panel-hover);
  border-radius: 14px;
  border: 1px solid var(--line);
}
.empty-state .icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.empty-state h3 { color: var(--text); font-size: 15px; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; max-width: 320px; margin: 0 auto; }

/* =============================================================================
   Utilities
   ========================================================================== */
.flex { display: flex; }
.gap-sm { gap: 8px; }
.gap-md { gap: 14px; }

@media (max-width: 640px) {
  .topbar { padding: 14px 18px; }
  .container { padding: 36px 20px 70px; }
  h1, .display-title { font-size: 30px; }
  .user-chip .email { display: none; }
  .user-chip { padding: 4px; }
  .nav-link[data-hidden-mobile] { display: none; }
}

/* Track mouse for tile glow */
.tile { --mx: 50%; --my: 50%; }

/* =============================================================================
   SEVRIC gradient text — used on auth headings ("Welcome back", etc.)
   Tinted cobalt gradient, readable at any weight.
   ========================================================================== */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, var(--brand-cobalt-soft) 45%, var(--brand-cobalt) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}
/* Caveat runs noticeably smaller optically than Inter/Fraunces — bump size
   so the cursive accent sits at the same visual weight as the heading. */
.gradient-text .serif,
.display-title .serif {
  font-size: 1.25em;
  line-height: 1;
  letter-spacing: -0.01em;
  padding: 0 0.04em;
  display: inline-block;
  transform: translateY(0.06em);
}

/* Safety fallback — if a consumer stylesheet references the old --border or
   --surface / --success tokens inherited from an earlier draft, define them
   here as aliases so nothing shatters. */
:root {
  --border:        var(--line);
  --border-strong: var(--line-strong);
  --surface:       var(--bg-elev);
  --success:       var(--ok);
}

/* =============================================================================
   SEVRIC New Forms — schema-driven form renderer + catalog + builder chrome
   ========================================================================== */

/* ---- Catalog page ---- */
.nf-hero {
  position: relative; margin: 0 0 24px;
  padding: 30px 32px 26px;
  background:
    radial-gradient(80% 120% at 0% 0%,  rgba(122,167,230,0.10), transparent 55%),
    radial-gradient(60% 100% at 100% 0%, rgba(74,123,200,0.06),  transparent 60%),
    rgba(255,255,255,0.024);
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden;
}
.nf-hero::before {
  content: ""; position: absolute; top: 0; left: 28px; right: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(122,167,230,0.5), transparent);
}
.nf-hero .eyebrow { margin-bottom: 14px; }
.nf-hero h1 {
  font-family: 'Fraunces','Times New Roman',serif;
  font-optical-sizing: auto; font-weight: 500;
  font-size: 36px; line-height: 1.05; letter-spacing: -0.035em;
  margin: 0 0 8px;
}
.nf-hero h1 .serif {
  color: var(--brand-cobalt); font-size: 1.18em;
  padding: 0 0.04em; transform: translateY(0.04em); display: inline-block;
}
.nf-hero .sub {
  font-size: 14.5px; color: var(--text-muted); line-height: 1.55;
  margin: 0; max-width: 720px;
}

.nf-filters {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px;
}
.nf-chip {
  padding: 6px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text-muted); font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.01em; cursor: pointer; font-family: inherit;
  transition: all 0.15s ease;
}
.nf-chip.active {
  background: var(--accent-soft); border-color: var(--accent-line); color: var(--brand-cobalt);
}

.nf-tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.nf-tile {
  position: relative; display: block;
  padding: 18px 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.030), rgba(255,255,255,0.008));
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit; text-decoration: none;
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
}
.nf-tile:hover {
  border-color: var(--accent-line);
  background:
    linear-gradient(180deg, rgba(122,167,230,0.08), rgba(122,167,230,0.012));
  transform: translateY(-1px);
}
.nf-tile.full { grid-column: 1 / -1; }
.nf-tile .meta {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.10em;
  text-transform: uppercase; color: var(--text-dim); margin: 0 0 8px;
  display: inline-flex; align-items: center; gap: 8px;
}
.nf-tile .meta::before {
  content: ""; width: 18px; height: 1px; background: var(--line-strong);
}
.nf-tile .name {
  font-family: 'Fraunces','Times New Roman',serif;
  font-optical-sizing: auto; font-weight: 500;
  font-size: 18px; letter-spacing: -0.02em; margin: 0 0 4px;
}
.nf-tile .desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0;
}
.nf-tile.create {
  border-style: dashed; opacity: 0.85;
  display: flex; align-items: center; justify-content: center; min-height: 110px;
}
.nf-tile.create:hover { opacity: 1; }
.nf-tile.create .plus {
  font-family: 'Fraunces',serif; font-size: 22px; margin-right: 8px;
  color: var(--brand-cobalt);
}

/* ---- Form (rendered output) ---- */
.nf-form-shell {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.030), rgba(255,255,255,0.008));
  border: 1px solid var(--line); border-radius: 22px;
  overflow: hidden;
}
.nf-form-header {
  padding: 26px 32px 20px;
  border-bottom: 1px solid var(--line);
}
.nf-form-header-row {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 24px;
}
@media (max-width: 720px) {
  .nf-form-header-row { grid-template-columns: 1fr; text-align: center; }
}
.nf-sevric { height: 44px; width: auto; color: var(--text); display: block; }
.nf-form-eyebrow {
  font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 6px;
  display: inline-flex; align-items: center; gap: 10px;
}
.nf-form-eyebrow::before {
  content: ""; width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line));
}
.nf-form-title {
  font-family: 'Fraunces','Times New Roman',serif;
  font-optical-sizing: auto; font-weight: 500;
  font-size: 28px; line-height: 1.1; letter-spacing: -0.025em;
  margin: 0 0 4px;
}
.nf-form-desc {
  font-size: 13px; color: var(--text-muted); margin: 0;
  line-height: 1.5; max-width: 520px;
}
.nf-form-header-right { text-align: right; min-width: 100px; }
.nf-dealer-logo {
  max-height: 60px; max-width: 180px; object-fit: contain;
  display: block; margin-left: auto;
}
.nf-store-block {
  margin-top: 6px;
  font-size: 12px; color: var(--text-muted); text-align: right;
}
.nf-store-name { font-weight: 600; color: var(--text); }

.nf-form-body { padding: 28px 32px; }
.nf-form-section {
  margin-bottom: 28px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.nf-form-section:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.nf-form-section-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 16px;
}
.nf-form-section-num {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 12px; letter-spacing: 0.08em;
  color: var(--text-dim);
  flex-shrink: 0; min-width: 24px;
}
.nf-form-section-title {
  font-family: 'Fraunces','Times New Roman',serif;
  font-optical-sizing: auto; font-weight: 500;
  font-size: 17px; letter-spacing: -0.01em;
}
.nf-form-section-hint {
  font-size: 12.5px; color: var(--text-muted); margin-top: 2px;
}
.nf-form-section-grid {
  display: grid; gap: 14px;
}
.nf-form-section-grid[data-cols="1"] { grid-template-columns: 1fr; }
.nf-form-section-grid[data-cols="2"] { grid-template-columns: 1fr 1fr; }
.nf-form-section-grid[data-cols="3"] { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) {
  .nf-form-section-grid[data-cols="2"],
  .nf-form-section-grid[data-cols="3"] { grid-template-columns: 1fr; }
}

.nf-field { min-width: 0; }
.nf-field-label {
  display: block; margin-bottom: 6px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  color: var(--text-muted);
}
.nf-field-label .nf-req {
  font-size: 10.5px; font-weight: 400; letter-spacing: 0;
  text-transform: lowercase; color: var(--text-dim); margin-left: 8px;
}
.nf-field-help {
  font-size: 11.5px; color: var(--text-dim); margin-top: 6px; line-height: 1.45;
}

.nf-input {
  width: 100%; box-sizing: border-box;
  padding: 11px 13px;
  font: 500 14px 'Inter', sans-serif;
  color: var(--text);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  transition: all 0.15s ease;
  font-family: inherit;
}
.nf-input:hover:not(:disabled) { border-color: rgba(255,255,255,0.22); }
.nf-input:focus {
  outline: none; border-color: var(--accent-line);
  background: rgba(122,167,230,0.05);
  box-shadow: 0 0 0 3px rgba(122,167,230,0.16);
}
.nf-input:disabled { opacity: 0.7; cursor: not-allowed; }
.nf-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.nf-currency {
  display: flex; align-items: stretch;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: rgba(255,255,255,0.02);
  overflow: hidden;
}
.nf-currency:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px rgba(122,167,230,0.16);
}
.nf-currency-prefix {
  display: inline-flex; align-items: center; padding: 0 12px;
  color: var(--text-dim); font-size: 14px;
  border-right: 1px solid var(--line);
  background: var(--bg-elev);
}
.nf-currency-input {
  border: 0 !important; background: transparent !important;
  box-shadow: none !important; flex: 1;
}

.nf-select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237AA7E6' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.nf-radios {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 0;
}
.nf-radio {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text); cursor: pointer;
}
.nf-radio input[type="radio"] {
  accent-color: var(--brand-cobalt);
  width: 16px; height: 16px;
}

.nf-checkbox-row {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text); cursor: pointer;
  padding: 6px 0;
}
.nf-checkbox {
  width: 18px; height: 18px;
  accent-color: var(--brand-cobalt);
  cursor: pointer;
}

.nf-readonly {
  padding: 11px 13px;
  font: 500 14px 'Inter', sans-serif;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* Signature pad */
.nf-sig-wrap { width: 100%; }
.nf-sig-pad-frame {
  position: relative;
  background: rgba(255,255,255,0.025);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 600 / 180;
}
.nf-sig-pad {
  display: block; width: 100%; height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.nf-sig-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 13px;
  font-family: 'Fraunces', serif; font-style: italic;
  pointer-events: none;
}
.nf-sig-actions {
  display: flex; justify-content: flex-end; margin-top: 8px;
}
.nf-btn-tiny {
  background: transparent; border: 0; cursor: pointer;
  color: var(--text-dim); font-size: 12px;
  padding: 4px 10px; border-radius: 6px;
  font-family: inherit;
}
.nf-btn-tiny:hover { color: var(--text); background: var(--panel); }

/* Form submit row */
.nf-form-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 18px 32px 24px;
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.10);
}
.nf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px;
  font: 600 13.5px 'Inter', sans-serif;
  border-radius: 10px;
  cursor: pointer; border: 1px solid transparent;
  transition: all 0.15s ease; font-family: inherit;
}
.nf-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.nf-btn.primary {
  color: #fff;
  background: linear-gradient(180deg, var(--brand-cobalt) 0%, var(--brand-cobalt-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.12),
    0 4px 14px rgba(74,123,200,0.45);
}
.nf-btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--brand-cobalt-soft) 0%, var(--brand-cobalt) 100%);
}
.nf-btn.secondary {
  color: var(--text);
  background: var(--panel); border-color: var(--line-strong);
}
.nf-btn.secondary:hover:not(:disabled) {
  background: var(--panel-hover); border-color: rgba(255,255,255,0.22);
}
.nf-btn.danger {
  color: var(--danger);
  background: rgba(251,113,133,0.06); border-color: rgba(251,113,133,0.30);
}

/* Submission list rows */
.nf-recent {
  margin-top: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.030), rgba(255,255,255,0.008));
  border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 22px;
}
.nf-recent-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.nf-recent-head .label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim);
}
.nf-row {
  display: grid; grid-template-columns: 90px 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.nf-row:first-of-type { border-top: 0; }
.nf-row .id {
  font-family: ui-monospace, monospace; font-size: 11.5px;
  color: var(--text-dim);
}
.nf-row .when {
  font-size: 11.5px; color: var(--text-dim); white-space: nowrap;
}
.nf-pill {
  font-size: 11px; padding: 3px 10px; border-radius: 999px;
  font-weight: 600; letter-spacing: 0.04em;
  border: 1px solid var(--line);
}
.nf-pill.pending  { color: var(--warn);  background: rgba(251,191,36,0.10); border-color: rgba(251,191,36,0.30); }
.nf-pill.approved { color: var(--ok);    background: rgba(74,222,128,0.10); border-color: rgba(74,222,128,0.30); }
.nf-pill.completed{ color: var(--ok);    background: rgba(74,222,128,0.10); border-color: rgba(74,222,128,0.30); }
.nf-pill.rejected { color: var(--danger);background: rgba(251,113,133,0.10);border-color: rgba(251,113,133,0.32); }
.nf-pill.draft    { color: var(--text-dim); }

/* Builder split-screen */
.nf-builder {
  display: grid; grid-template-columns: 380px 1fr; gap: 18px;
}
@media (max-width: 980px) { .nf-builder { grid-template-columns: 1fr; } }
.nf-builder-side {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.030), rgba(255,255,255,0.008));
  border: 1px solid var(--line); border-radius: 18px;
  padding: 18px 20px;
  max-height: calc(100vh - 200px); overflow-y: auto;
  position: sticky; top: 16px;
}
.nf-builder-side h3 {
  font-family: 'Fraunces',serif; font-weight: 500;
  font-size: 15px; letter-spacing: -0.01em;
  margin: 14px 0 8px;
}
.nf-builder-side .section-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
}
.nf-builder-side .field-card {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 6px;
}
.nf-builder-side .field-card .row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px;
}
.nf-builder-side .ghost {
  width: 100%; padding: 9px;
  background: transparent; color: var(--brand-cobalt);
  border: 1px dashed var(--accent-line); border-radius: 10px;
  cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600;
  letter-spacing: 0.02em; margin-top: 6px;
}
.nf-builder-side .ghost:hover { background: var(--accent-soft); }
.nf-builder-preview {
  /* preview just hosts a .nf-form-shell — no extra chrome needed */
}

/* =============================================================================
 * Submissions list
 * ========================================================================= */
.nf-recent .nf-row {
  text-decoration: none; color: inherit; cursor: pointer;
  transition: background 0.12s ease;
}
.nf-recent .nf-row:hover {
  background: rgba(122,167,230,0.04);
}
.nf-row .title {
  font-weight: 500; font-size: 13.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nf-row .meta {
  font-size: 11.5px; color: var(--text-dim); white-space: nowrap;
}
.nf-row .status-cell { text-align: right; }

.nf-status {
  display: inline-block;
  font-size: 10.5px; padding: 3px 10px; border-radius: 999px;
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line);
}
.nf-status.pending  { color: var(--warn);  background: rgba(251,191,36,0.10);  border-color: rgba(251,191,36,0.30); }
.nf-status.approved { color: var(--ok);    background: rgba(74,222,128,0.10);  border-color: rgba(74,222,128,0.30); }
.nf-status.completed{ color: var(--ok);    background: rgba(74,222,128,0.10);  border-color: rgba(74,222,128,0.30); }
.nf-status.rejected { color: var(--danger);background: rgba(251,113,133,0.10); border-color: rgba(251,113,133,0.32); }

.nf-empty {
  padding: 28px 22px; text-align: center;
  font-size: 13px; color: var(--text-muted);
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 14px;
}

/* =============================================================================
 * Submission detail header
 * ========================================================================= */
.nf-sub-header {
  margin-bottom: 18px; padding: 22px 26px;
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(122,167,230,0.10), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,0.028), rgba(255,255,255,0.006));
  border: 1px solid var(--line); border-radius: 18px;
}
.nf-sub-eyebrow {
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim);
}
.nf-sub-title {
  font-family: 'Fraunces',serif; font-weight: 400;
  font-size: 30px; line-height: 1.1; letter-spacing: -0.025em;
  margin: 6px 0 8px;
}
.nf-sub-meta {
  font-size: 12.5px; color: var(--text-muted);
}
.nf-sub-status-row {
  display: flex; align-items: center; gap: 14px; margin-top: 12px;
  flex-wrap: wrap;
}
.nf-sub-actions {
  margin-top: 18px; padding: 18px 22px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 14px;
}
.nf-btn.danger {
  background: rgba(251,113,133,0.12); color: var(--danger);
  border: 1px solid rgba(251,113,133,0.35);
}
.nf-btn.danger:hover {
  background: rgba(251,113,133,0.20);
}
.nf-raw-dump {
  margin: 0 24px 24px; padding: 16px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 10px;
  font-family: ui-monospace, monospace; font-size: 12px;
  color: var(--text-muted); white-space: pre-wrap; word-break: break-word;
}

/* =============================================================================
 * Print — when an admin clicks "Print" on a submission detail view, the
 * SEVRIC chrome (topbar, hero header, action buttons) drops out. What remains:
 * the SEVRIC + dealer-logo form header, the section grid, and any signatures.
 * Goal: a clean printed page that mirrors the legacy PDF's information hierarchy.
 * ========================================================================= */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .topbar, .nf-sub-actions, .nf-filters, .nav-link, #sevric-splash,
  .top-right, .icon-btn, #errorBox { display: none !important; }

  main.container { padding: 0 !important; max-width: none !important; }
  .nf-sub-header {
    background: none !important; border: 0 !important; padding: 0 0 12px;
  }
  .nf-sub-title { color: #000 !important; }
  .nf-sub-meta, .nf-sub-eyebrow { color: #444 !important; }

  .nf-form-shell {
    background: #fff !important; border: 1px solid #000 !important;
    border-radius: 0 !important; box-shadow: none !important;
    color: #000 !important;
  }
  .nf-form-header { border-bottom: 1px solid #000 !important; }
  .nf-form-section { border-top: 1px solid #ccc !important; }
  .nf-form-section-title, .nf-form-title, .nf-form-section-num { color: #000 !important; }
  .nf-input, .nf-textarea, .nf-select, .nf-readonly {
    border: 1px solid #888 !important; background: #fff !important; color: #000 !important;
  }
  .nf-status { border-color: #000 !important; color: #000 !important; background: none !important; }
  .nf-sig-pad-frame { border: 1px solid #000 !important; background: #fff !important; }
}

