/**
 * ClubVault Administrator — CONSOLE
 * Patterns borrowed from Linear / Stripe / Vercel / Cloudflare / fleet ops UIs:
 * - fixed ~248px sidebar, grouped nav
 * - monochrome base + one gold accent (brand)
 * - 4–6 KPI north stars, exception-first home
 * - dense tables/rows, quiet chrome, sharp type
 */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --bg: #0a0a0b;
  --bg-soft: #111113;
  --bg-elev: #141416;
  --surface: #141416;
  --surface-2: #1c1c1f;
  --surface-3: #232326;
  --border: #2a2a2e;
  --border-strong: #3a3a40;
  --text: #ededef;
  --muted: #8b8b93;
  --chrome: #a1a1aa;
  --accent: #d4af5a;
  --accent-soft: #e4c878;
  --accent-hover: #efd48a;
  --accent-dim: color-mix(in srgb, var(--accent) 14%, transparent);
  --gold-hi: #efd48a;
  --good: #34d399;
  --good-dim: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-dim: rgba(251, 191, 36, 0.12);
  --bad: #f87171;
  --bad-dim: rgba(248, 113, 113, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --display: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --sidebar: 15.5rem;
  --topbar: 3.25rem;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --panel: var(--surface);
  --panel2: var(--surface-2);
  --max: 72rem;
}

/* Theme variants */
body.fleet-theme-minxvip,
body.fleet-theme-clubvault {
  --bg: #0a0a0b;
  --bg-soft: #111113;
  --surface: #141416;
  --surface-2: #1c1c1f;
  --border: #2a2a2e;
  --text: #ededef;
  --muted: #8b8b93;
  --accent: #d4af5a;
  --accent-soft: #e4c878;
  --accent-hover: #efd48a;
  --gold-hi: #efd48a;
}

body.fleet-theme-default {
  --bg: #000;
  --surface: #0c0c0c;
  --surface-2: #151515;
  --border: #262626;
  --text: #fafafa;
  --muted: #737373;
  --accent: #d4af5a;
}

body.fleet-theme-clubvault-pink {
  --bg: #0c0a0d;
  --surface: #161218;
  --surface-2: #1f1a22;
  --border: #3a2a36;
  --text: #faf5f8;
  --muted: #b0a0ab;
  --accent: #ff6fb0;
  --accent-soft: #ff9bcb;
  --accent-hover: #ffb4d8;
  --gold-hi: #ffb4d8;
}

body.theme-light {
  --bg: #f4f4f5;
  --bg-soft: #ececee;
  --bg-elev: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #eaeaec;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --muted: #71717a;
  --chrome: #52525b;
  --accent: #a16207;
  --accent-soft: #b45309;
  --accent-hover: #ca8a04;
  --gold-hi: #854d0e;
  --good: #16a34a;
  --warn: #ca8a04;
  --bad: #dc2626;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body.fleet-theme-ocean {
  --bg: #020617;
  --surface: #0f172a;
  --surface-2: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --gold-hi: #7dd3fc;
}

body.fleet-theme-forest {
  --bg: #052e16;
  --surface: #064e3b;
  --surface-2: #065f46;
  --border: #166534;
  --text: #ecfdf5;
  --muted: #86efac;
  --accent: #4ade80;
  --gold-hi: #86efac;
}

body.fleet-theme-sunset {
  --bg: #1c0a0a;
  --surface: #2a1212;
  --surface-2: #3b1717;
  --border: #7f1d1d;
  --text: #fff7ed;
  --muted: #fdba74;
  --accent: #fb923c;
  --gold-hi: #fdba74;
}

body.fleet-theme-slate {
  --bg: #0c0c10;
  --surface: #14141a;
  --surface-2: #1c1c24;
  --border: #2e2e3a;
  --text: #ececf1;
  --muted: #9b9baf;
  --accent: #a1a1aa;
  --gold-hi: #d4d4d8;
}

body.fleet-theme-nord {
  --bg: #2e3440;
  --surface: #3b4252;
  --surface-2: #434c5e;
  --border: #4c566a;
  --text: #eceff4;
  --muted: #aeb3bb;
  --accent: #88c0d0;
  --gold-hi: #8fbcbb;
}

body.fleet-theme-espresso {
  --bg: #1c1410;
  --surface: #2a1f18;
  --surface-2: #3d2e24;
  --border: #5c4636;
  --text: #faf5f0;
  --muted: #c4b5a8;
  --accent: #d4a574;
  --gold-hi: #e8c9a8;
}

/* —— Base —— */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.fleet-console {
  --radius: 8px;
}

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

body.is-signed-out .app-shell {
  display: block;
}

/* Sidebar — Linear/Cloudflare pattern */
.console-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  z-index: 30;
  overflow: hidden;
}

.console-side__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid var(--border);
  min-height: var(--topbar);
}

.console-side__logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.console-side__names {
  min-width: 0;
}

.console-side__title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.console-side__sub {
  margin: 0.05rem 0 0;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.console-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem 0.55rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  scrollbar-width: thin;
}

.console-nav__label {
  margin: 0.75rem 0.55rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
}

.console-nav__label:first-child {
  margin-top: 0.25rem;
}

#nav button,
.console-nav button[data-panel] {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.48rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

#nav button:hover {
  background: var(--surface-2);
  color: var(--text);
}

#nav button.active {
  background: var(--accent-dim);
  color: var(--gold-hi);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}

body.theme-light #nav button.active {
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  color: var(--gold-hi);
}

.console-side__foot {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.console-side__user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.console-side__user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

body.is-signed-in .console-side__user-dot {
  background: var(--good);
  box-shadow: 0 0 0 3px var(--good-dim);
}

/* Main column */
.shell-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.console-top {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--topbar);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.page-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
}

.console-top__titles {
  min-width: 0;
  flex: 1;
}

.page-bar__title,
#topbarTitle {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
}

.page-bar__sub {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.page-bar__sub:empty,
.page-bar__sub[hidden] {
  display: none;
}

.topbar__trail,
.topbar__eyebrow,
.page-guide {
  display: none !important;
}

.console-top__actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.console-chip {
  font-size: 0.72rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Page content */
.console-stage {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}

main {
  min-width: 0;
  width: 100%;
}

/* Hide chrome when signed out */
body.is-signed-out .console-side,
body.is-signed-out .console-top,
body.is-signed-out .mobile-dock {
  display: none !important;
}

body.is-signed-out .app-shell,
body.is-signed-out .shell-body,
body.is-signed-out .console-stage {
  max-width: none;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

body.is-signed-out .console-stage {
  display: block;
}

/* Panels */
.panel {
  display: none;
  opacity: 0;
}

.panel.visible {
  display: block;
  opacity: 1;
}

.panel.panel-enter.visible {
  animation: panelIn 0.28s var(--ease) both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— Login (Stripe/Linear calm) —— */
.console-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 55%),
    var(--bg);
}

.console-login__card {
  width: min(100%, 22.5rem);
  padding: 2rem 1.75rem 1.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.console-login__logo {
  display: block;
  width: min(100%, 200px);
  height: auto;
  margin: 0 auto 1.25rem;
}

.console-login__kicker {
  margin: 0 0 0.2rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.console-login__title {
  margin: 0 0 1.35rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.console-login label {
  display: block;
  margin: 0.75rem 0 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

.console-login input {
  width: 100%;
}

.console-login__actions {
  margin-top: 1.15rem;
}

.console-login__actions .btn {
  width: 100%;
}

.console-login__first {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--border);
}

/* —— Overview home —— */
.console-home {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.console-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.console-hero h2,
.vault-status,
.desk-status {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  max-width: none;
  text-transform: none;
  font-family: var(--font);
}

.console-hero p,
.vault-status-meta {
  margin: 0.35rem 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

/* KPI strip — Stripe pattern: 4–6 equal metrics */
.kpi-strip,
.desk-nums,
.vault-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.65rem;
  background: transparent;
  border: 0;
}

button.desk-num,
.kpi-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}

button.desk-num:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.desk-num__v {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.desk-num__k {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

button.desk-num--bad {
  border-color: color-mix(in srgb, var(--bad) 40%, var(--border));
  background: var(--bad-dim);
}

button.desk-num--bad .desk-num__v {
  color: var(--bad);
}

button.desk-num--warn {
  border-color: color-mix(in srgb, var(--warn) 40%, var(--border));
  background: var(--warn-dim);
}

button.desk-num--warn .desk-num__v {
  color: var(--warn);
}

/* Exception / focus blocks */
.console-section-label,
.vault-section__label,
.desk-section-title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.desk-focus,
.vault-focus,
.desk-issues,
.vault-issues {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.desk-focus button,
.vault-focus button,
.desk-issues button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.desk-focus button:last-child,
.vault-focus button:last-child,
.desk-issues button:last-child {
  border-bottom: 0;
}

.desk-focus button:hover,
.vault-focus button:hover,
.desk-issues button:hover {
  background: var(--surface-2);
}

.desk-focus button strong,
.vault-focus button strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font);
}

/* Quick links row */
.console-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.55rem;
}

.console-quick button,
.vault-lane {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.console-quick button:hover,
.vault-lane:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--surface-2);
}

.console-quick button strong,
.vault-lane strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.console-quick button span,
.vault-lane span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: none;
}

.vault-lane {
  grid-template-columns: none;
  padding-left: 0.9rem;
}

.vault-lane__n,
.vault-lane__go {
  display: none;
}

.vault-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.55rem;
  border: 0;
  margin: 0;
}

.vault-lane--priority {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-dim);
}

/* Surfaces */
.card,
.job-simple {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.15rem;
  margin: 0 0 0.85rem;
  box-shadow: none;
}

.card:first-child,
.job-simple:first-child {
  padding-top: 1rem;
}

.card h2,
.job-simple h2 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
  font-family: var(--font);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}

.card-head h2 {
  margin: 0;
}

.help-strip,
.help-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.55rem 0.7rem;
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}

/* Entity list — exception-first rows */
.entity-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.entity-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.entity-card strong {
  font-size: 0.95rem;
  font-weight: 600;
}

.entity-card__meta {
  margin-top: 0.15rem;
  font-size: 0.8rem;
}

.entity-card__tip {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.entity-card--live {
  border-left: 3px solid var(--good);
}

.entity-card--stale {
  border-left: 3px solid var(--warn);
}

.entity-card--offline {
  border-left: 3px solid var(--bad);
  background: var(--bad-dim);
}

.ok-banner {
  padding: 0.85rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--good) 35%, var(--border));
  border-radius: var(--radius);
  background: var(--good-dim);
  color: var(--good);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-family: var(--font);
}

/* Feeds */
.feed,
.feed--dense {
  display: flex;
  flex-direction: column;
}

.feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.feed-row:last-child {
  border-bottom: 0;
}

/* Wizard */
.wizard-steps {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.wizard-steps > li {
  position: relative;
  padding: 0.85rem 0 0.85rem 2.75rem;
  border-bottom: 1px solid var(--border);
  counter-increment: step;
}

.wizard-steps > li:last-child {
  border-bottom: 0;
}

.wizard-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
}

.wizard-steps > li strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 0.9rem;
}

.wizard-steps > li p {
  margin: 0.2rem 0 0;
  font-size: 0.84rem;
}

.linkish {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-soft);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Forms */
label {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  transition: border-color 0.12s, box-shadow 0.12s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 0 0 3px var(--accent-dim);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  max-width: none;
  accent-color: var(--accent);
}

.mono,
code.mono,
pre.mono {
  font-family: var(--mono);
  font-size: 0.84em;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: #14110a;
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 80%, #000);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.85rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, filter 0.12s;
}

.btn:hover {
  background: var(--accent-hover);
  filter: none;
}

.btn:active {
  transform: translateY(0.5px);
}

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

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

.btn.small {
  font-size: 0.75rem;
  padding: 0.32rem 0.6rem;
}

.btn.danger,
.btn.bad {
  background: var(--bad);
  border-color: var(--bad);
  color: #1a0808;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
}

.row.cols-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0.45rem 0;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  margin: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.45rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Badges */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--bg-soft);
}

.badge.live {
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 35%, transparent);
  background: var(--good-dim);
}

.badge.stale {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  background: var(--warn-dim);
}

.badge.offline {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
  background: var(--bad-dim);
}

.dot-live,
.dot-stale,
.dot-offline {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.15rem;
}

.dot-live {
  background: var(--good);
}
.dot-stale {
  background: var(--warn);
}
.dot-offline {
  background: var(--bad);
}

/* Flash toasts */
#flash {
  position: fixed;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: min(22rem, calc(100vw - 1.5rem));
  pointer-events: none;
}

#flash .flash,
#flash > div {
  pointer-events: auto;
  padding: 0.65rem 0.85rem;
  font-size: 0.84rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

#flash .ok,
.ok {
  color: var(--good);
}
#flash .err,
.err {
  color: var(--bad);
}

/* Detail / KV */
.detail-stack {
  display: flex;
  flex-direction: column;
}

.detail-stack .kv,
.kv {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
}

.desk-block--split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .desk-block--split {
    grid-template-columns: 1fr 1fr;
  }
}

.desk-mini {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.callout {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0.65rem 0;
  background: var(--bg-soft);
}

.job-advanced,
.vault-advanced {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 0.85rem;
}

.job-advanced > summary,
.vault-advanced > summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.7rem 0;
  list-style: none;
  letter-spacing: 0;
  text-transform: none;
}

.job-advanced > summary::-webkit-details-marker,
.vault-advanced > summary::-webkit-details-marker {
  display: none;
}

.job-advanced > summary:hover {
  color: var(--text);
}

/* Theme / access / modules */
.fleet-theme-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.fleet-theme-opt.active {
  border-color: var(--accent) !important;
  color: var(--gold-hi) !important;
}

.access-check-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 0.65rem 0;
}

.access-check-label {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0;
}

.access-check-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.35rem;
  margin: 0.45rem 0;
}

.module-grid label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin: 0;
  text-transform: none;
}

.module-cb {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.86rem;
}

.module-cb label {
  display: inline;
  font-size: inherit;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  cursor: pointer;
  text-transform: none;
}

.module-cb .d {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: 0.08rem;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.input {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
}

/* Tabs (merchant workspace) */
.tabs,
.mw-tabs,
.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.9rem;
}

.tabs button,
.mw-tabs button,
.tab-row button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  letter-spacing: 0;
  text-transform: none;
}

.tabs button.active,
.mw-tabs button.active,
.tab-row button.active,
.tabs button[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Modals */
#modalOverlay,
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#modalOverlay.open,
.modal-overlay.open {
  display: flex !important;
}

.modal {
  width: min(100%, 28rem);
  max-height: min(88vh, 42rem);
  overflow: auto;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.modal--wide,
#merchantWorkspaceInner {
  width: min(100%, 52rem);
}

.modal h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-transform: none;
  font-family: var(--font);
}

/* Mobile dock */
.mobile-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(12px);
  padding: 0.3rem 0.2rem calc(0.3rem + env(safe-area-inset-bottom));
}

.mobile-dock button {
  flex: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.5rem 0.15rem;
  cursor: pointer;
}

.mobile-dock button.active {
  color: var(--gold-hi);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .console-side {
    display: none;
  }

  body.is-signed-in .mobile-dock {
    display: flex;
  }

  body.is-signed-in .console-stage {
    padding-bottom: 5rem;
  }
}

/* Tools */
.tools-out,
pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--chrome);
  max-height: 28rem;
  overflow: auto;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
  margin-right: 0.3rem;
}

.sidebar,
.app-fx,
.vault-mast,
.vault-rail {
  /* legacy hide if any */
}

body.fleet-theme-minxvip .btn:not(.secondary),
body.fleet-theme-clubvault .btn:not(.secondary) {
  color: #14110a;
}

body.fleet-theme-clubvault-pink .btn:not(.secondary) {
  color: #1c0413;
}

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

@media (max-width: 520px) {
  .entity-card {
    flex-direction: column;
    align-items: stretch;
  }
  .entity-card .btn {
    width: 100%;
  }
}

/* Page bar is inside top */
.page-bar {
  /* flex above */
}

.topbar__home {
  flex-shrink: 0;
}

.topbar__menu {
  display: none !important;
}
