/* =============================================================================
   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=Dancing+Script:wght@500;600&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;
}

/* 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 — Dancing Script is a connected handwriting script that
   reads as cursive without wedding-invitation flourish. Reserved for
   personalization moments only (the signed-in user's first name on the
   dashboard). Do NOT apply to headings, buttons, or labels. */
.serif  { font-family: 'Dancing Script', 'Apple Chancery', cursive; font-style: normal; font-weight: 600; }
.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: 400;
  letter-spacing: -0.02em;
}

.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;
}
/* Dancing Script runs a touch smaller optically than Inter — modest scale bump
   so the signature name sits at the same visual weight as the heading. */
.gradient-text .serif,
.display-title .serif {
  font-size: 1.15em;
  line-height: 1;
  letter-spacing: 0;
  padding: 0 0.04em;
  display: inline-block;
  transform: translateY(0.04em);
}

/* 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);
}
