* {
  box-sizing: border-box;
}

:root,
[data-theme="dark"],
[data-theme="light"] {
  /* ── Surfaces (new deep-ink palette) ── */
  --bg-primary:   oklch(17% 0.012 252);
  --bg-secondary: oklch(20% 0.014 252);
  --bg-tertiary:  oklch(24% 0.016 252);
  --bg-card:      oklch(20% 0.014 252);
  --bg-4:         oklch(28% 0.018 252);

  /* ── Borders ── */
  --border-color: oklch(32% 0.020 252);
  --border-hover: oklch(42% 0.025 252);

  /* ── Text ── */
  --text-primary:   oklch(96% 0.005 252);
  --text-secondary: oklch(78% 0.012 252);
  --text-muted:     oklch(58% 0.015 252);
  --text-faint:     oklch(42% 0.015 252);

  /* ── Accent: electric blue ── */
  --accent:        oklch(70% 0.18 250);
  --accent-hover:  oklch(80% 0.16 250);
  --accent-subtle: oklch(70% 0.18 250 / 0.14);
  --accent-line:   oklch(70% 0.18 250 / 0.32);

  /* ── AI / magenta ── */
  --ai:       oklch(70% 0.22 320);
  --ai-2:     oklch(80% 0.20 320);
  --ai-soft:  oklch(70% 0.22 320 / 0.14);
  --ai-line:  oklch(70% 0.22 320 / 0.34);

  /* ── Signals ── */
  --green:    oklch(74% 0.17 152);
  --green-bg: oklch(74% 0.17 152 / 0.14);
  --red:      oklch(68% 0.20 22);
  --red-bg:   oklch(68% 0.20 22 / 0.14);
  --orange:   oklch(78% 0.15 75);
  --orange-bg:oklch(78% 0.15 75 / 0.14);

  /* ── mm-token aliases ── */
  --bg:   var(--bg-primary);
  --bg-2: var(--bg-secondary);
  --bg-3: var(--bg-tertiary);
  --line: var(--border-color);
  --line-strong: var(--border-hover);
  --fg:   var(--text-primary);
  --fg-2: var(--text-secondary);
  --fg-3: var(--text-muted);
  --fg-4: var(--text-faint);
  --blue:      var(--accent);
  --blue-2:    var(--accent-hover);
  --blue-soft: var(--accent-subtle);
  --blue-line: var(--accent-line);
  --amber:     var(--orange);
  --amber-soft:var(--orange-bg);
  --green-soft:var(--green-bg);
  --red-soft:  var(--red-bg);

  /* ── Glass (kept for backward compat) ── */
  --glass-bg:     oklch(20% 0.014 252 / 0.7);
  --glass-border: oklch(32% 0.020 252);
  --glass-shadow: 0 8px 32px oklch(0% 0 0 / 0.45), 0 1px 0 oklch(100% 0 0 / 0.04) inset;

  /* ── Typography ── */
  --font-display: 'Oxanium', system-ui, sans-serif;
  --font-body:    'Inter', 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --font-sans:    var(--font-body);

  /* ── Radii ── */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --radius:    var(--r);
  --radius-lg: var(--r-lg);
  --radius-xl: var(--r-xl);

  /* ── Shadows ── */
  --shadow:    0 2px 8px oklch(0% 0 0 / 0.4), 0 1px 2px oklch(0% 0 0 / 0.3);
  --shadow-lg: 0 16px 48px oklch(0% 0 0 / 0.5);
  --shadow-1:  0 1px 0 oklch(100% 0 0 / 0.04) inset, 0 1px 2px oklch(0% 0 0 / 0.4);
  --shadow-2:  0 1px 0 oklch(100% 0 0 / 0.04) inset, 0 8px 24px oklch(0% 0 0 / 0.4);
  --glow-blue: 0 0 0 1px var(--blue-line), 0 12px 40px oklch(70% 0.18 250 / 0.18);
  --glow-ai:   0 0 0 1px var(--ai-line), 0 12px 40px oklch(70% 0.22 320 / 0.18);

  /* ── Transition ── */
  --transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);

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

  /* ── Typography scale ── */
  --text-xs: 11px; --text-sm: 12px; --text-base: 14px;
  --text-lg: 16px; --text-xl: 20px; --text-2xl: 24px; --text-3xl: 32px;

  /* ── Animation ── */
  --ease-out: cubic-bezier(0.0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 100ms; --duration-normal: 200ms; --duration-slow: 350ms;

  /* ── Layout ── */
  --topbar-height: 56px;
  --sidebar-width: 200px;
  --bottom-bar-height: 56px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 14px;
  letter-spacing: -0.005em;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Gradient mesh background */
.app-layout {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, oklch(70% 0.18 250 / 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, oklch(70% 0.22 320 / 0.05) 0%, transparent 60%),
    var(--bg-primary);
  min-height: 100vh;
}

#root {
  min-height: 100vh;
}

img,
svg {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ========== Layout ========== */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  min-width: 0;
}
/* (gradient mesh defined above in body section) */

/* ---------- Top Bar ---------- */
.topbar {
  height: var(--topbar-height);
  background: oklch(17% 0.012 252 / 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.topbar-brand:hover { text-decoration: none; color: var(--fg); }

/* Brand mark — replaces old SVG logo */
.topbar-brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--blue) 0%, oklch(60% 0.20 280) 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.1) inset, 0 4px 12px oklch(70% 0.18 250 / 0.4);
}
.topbar-brand-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px solid oklch(100% 0 0 / 0.85);
  border-bottom-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-45deg);
}

.topbar-logo { display: none; }

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}

.topbar-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-tabs::-webkit-scrollbar {
  display: none;
}

.topbar-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}

.topbar-tab:hover {
  color: var(--fg);
  background: var(--bg-3);
  text-decoration: none;
}

.topbar-tab.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.topbar-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex-shrink: 0;
}

.topbar-notification-btn {
  position: relative;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--space-2);
  transition: all var(--transition);
  font-family: inherit;
}

.topbar-notification-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.topbar-notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- Content wrapper ---------- */
.content-wrapper {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  z-index: 100;
}

.sidebar-nav {
  padding: var(--space-2) 0;
  flex: 1;
}

.sidebar-section-label {
  padding: var(--space-4) var(--space-4) var(--space-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px var(--space-4);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}

.nav-link-label {
  display: block;
  line-height: 1.2;
}

.nav-link-hint {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  opacity: 0.8;
}

.nav-link:hover .nav-link-hint,
.nav-link.active .nav-link-hint {
  opacity: 1;
}

.nav-link.active .nav-link-hint {
  color: var(--accent);
  opacity: 0.7;
}

.sidebar-group-label {
  padding: var(--space-3) var(--space-4) var(--space-1);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: var(--space-1);
  border-top: 1px solid var(--border-color);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
  text-decoration: none;
}
.nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-subtle);
  font-weight: 600;
}

.nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-section-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sidebar-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.sidebar-bottom {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Bottom Tab Bar (Mobile) ---------- */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-bar-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  z-index: 200;
  padding: 0;
}

.bottom-tabs-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
  text-decoration: none;
  font-family: inherit;
  padding: var(--space-1);
}

.bottom-tab:hover {
  text-decoration: none;
}

.bottom-tab.active {
  color: var(--accent);
}

.bottom-tab svg {
  width: 22px;
  height: 22px;
}

/* Notification panel (dropdown from topbar) */

.notification-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  max-height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: slideUp var(--duration-normal) var(--ease-out);
}

.notification-panel-head {
  padding: 8px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notification-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.notification-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notification-item {
  text-align: left;
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 10px;
  cursor: pointer;
  color: var(--text-primary);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--bg-tertiary);
}

.notification-item-unread {
  background: rgba(88, 166, 255, 0.08);
}

.notification-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 3px;
}

.notification-message {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.notification-time {
  font-size: 11px;
  color: var(--text-muted);
}


.main-content {
  flex: 1;
  padding: clamp(20px, 1.8vw, 32px);
  min-width: 0;
}

.page-shell {
  --page-shell-max: 1680px;
  width: min(100%, var(--page-shell-max));
  margin: 0 auto;
  min-width: 0;
}

.page-shell-dashboard {
  --page-shell-max: 100%;
}

.page-shell.page-shell-dashboard {
  width: 100%;
  max-width: none;
}

.page-shell-with-sidebar {
  --page-shell-max: 1560px;
}

.page-shell-without-sidebar {
  --page-shell-max: 1760px;
}

/* Mobile hamburger (for sidebar on mobile) */
.mobile-header {
  display: none;
}

.mobile-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-header-logo {
  width: 22px;
  height: 22px;
  display: block;
}

.mobile-header-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.hamburger-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 20px;
  padding: 6px 10px;
  cursor: pointer;
  line-height: 1;
}
.hamburger-btn:hover {
  background: var(--bg-tertiary);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
}
.sidebar-overlay.open {
  display: block;
}

/* ========== Page header ========== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 22px;
  font-weight: 600;
}

/* ========== Cards ========== */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--glass-shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card-highlight {
  border-left: 3px solid var(--accent);
}
.card-highlight-green {
  border-left: 3px solid var(--green);
}
.card-highlight-orange {
  border-left: 3px solid var(--orange);
}
.card-highlight-red {
  border-left: 3px solid var(--red);
}
.card-interactive {
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.card-interactive:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-flush {
  padding: 0;
}

/* ========== Form section & hint ========== */
.form-section {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
}
.form-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-3);
}
.form-hint {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ========== Breadcrumb ========== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}
.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--accent);
}
.breadcrumb-separator {
  font-size: 10px;
  color: var(--text-muted);
}

/* ========== Collapsible Section ========== */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
  padding: var(--space-3) 0;
}
.collapsible-header:hover {
  color: var(--accent);
}
.collapsible-chevron {
  transition: transform var(--duration-normal) var(--ease-out);
  font-size: 12px;
  color: var(--text-muted);
}
.collapsible-chevron.open {
  transform: rotate(180deg);
}
.collapsible-body {
  overflow: hidden;
  transition: max-height var(--duration-slow) var(--ease-out), opacity var(--duration-normal) var(--ease-out);
}
.collapsible-body.collapsed {
  max-height: 0;
  opacity: 0;
}
.collapsible-body.expanded {
  max-height: 3000px;
  opacity: 1;
}

/* ========== Info Tooltip ========== */
.info-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
  position: relative;
}
.info-tooltip-trigger:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.info-tooltip-content {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  padding: var(--space-3);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1.5;
  z-index: 500;
  animation: fadeIn var(--duration-fast) var(--ease-out);
  text-transform: none;
  letter-spacing: normal;
}

/* ========== Price Gauge ========== */
.price-gauge {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) 0%, var(--orange) 50%, var(--red) 100%);
  margin: var(--space-4) 0;
}
.price-gauge-marker {
  position: absolute;
  top: -6px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--text-primary);
  border: 3px solid var(--bg-secondary);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}
.price-gauge-labels {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-2);
}

/* ========== Action Cards (Valuation) ========== */
.action-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0;
}
.action-card {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  text-align: center;
}
.action-card-label {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: var(--space-2);
}
.action-card-price {
  font-size: var(--text-xl);
  font-weight: 800;
  font-family: var(--font-mono);
  margin-bottom: var(--space-1);
}
.action-card-hint {
  font-size: var(--text-xs);
  opacity: 0.8;
}
.action-card-buy {
  background: var(--green-bg);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--green);
}
.action-card-market {
  background: var(--accent-subtle);
  border: 1px solid rgba(88, 166, 255, 0.3);
  color: var(--accent);
}
.action-card-sell {
  background: var(--orange-bg);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: var(--orange);
}

/* ========== Confidence Shield ========== */
.confidence-shield {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
}
.confidence-high {
  background: var(--green-bg);
  color: var(--green);
}
.confidence-medium {
  background: var(--orange-bg);
  color: var(--orange);
}
.confidence-low {
  background: var(--red-bg);
  color: var(--red);
}

/* ========== Dashboard v2 ========== */

/* Header */
.dash { display: grid; gap: 20px; min-width: 0; }

.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}
.dash-refreshing-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: dash-pulse 1.2s ease-in-out infinite;
}
@keyframes dash-pulse {
  0%, 100% { opacity: .3; }
  50% { opacity: 1; }
}

/* Action pills */
.dash-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  text-decoration: none;
  transition: all var(--transition);
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}
.dash-action-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.dash-action-pill-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.dash-action-pill--accent .dash-action-pill-icon { background: var(--accent-subtle); color: var(--accent); }
.dash-action-pill--green .dash-action-pill-icon { background: var(--green-bg); color: var(--green); }
.dash-action-pill--orange .dash-action-pill-icon { background: var(--orange-bg); color: var(--orange); }
.dash-action-pill--accent:hover { border-color: var(--accent); }
.dash-action-pill--green:hover { border-color: var(--green); }
.dash-action-pill--orange:hover { border-color: var(--orange); }

/* Filter bar */
.dash-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.dash-filter-select,
.dash-filter-input {
  padding: 6px 10px;
  font-size: 13px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  min-width: 0;
  max-width: 160px;
}
.dash-filter-select { width: 150px; }
.dash-filter-input { width: 100px; }
.dash-filter-select:focus,
.dash-filter-input:focus {
  outline: none;
  border-color: var(--accent);
}
.dash-filter-clear {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.dash-filter-clear:hover { color: var(--red); border-color: var(--red); }

/* KPI cards */
.dash-kpi {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.dash-kpi-card {
  --kpi-accent: var(--line);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}
.dash-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--kpi-accent);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.dash-kpi-card:hover {
  border-color: var(--kpi-accent);
  box-shadow: var(--shadow);
}
.dash-kpi--green  { --kpi-accent: var(--green); }
.dash-kpi--orange { --kpi-accent: var(--orange); }
.dash-kpi--accent { --kpi-accent: var(--blue); }
.dash-kpi--purple { --kpi-accent: var(--ai); }
.dash-kpi-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 4px;
}
.dash-kpi-val {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-kpi-unit {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.6;
  font-family: var(--font-body);
}
.dash-kpi-sub {
  font-size: 11px;
  color: var(--fg-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}

/* Bento grid */
.dash-bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.dash-bento-cell {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-width: 0;
  overflow: hidden;
}
.dash-bento-half { grid-column: span 2; }
.dash-bento-full { grid-column: 1 / -1; }

.dash-cell-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-cell-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.dash-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.dash-cell-head .dash-cell-title { margin-bottom: 0; }
.dash-cell-link {
  font-size: 12px;
  font-weight: 500;
}
.dash-cell-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Recent offers table */
.dash-recent-table {
  display: grid;
  gap: 0;
}
.dash-recent-row {
  display: grid;
  grid-template-columns: 2fr 0.7fr 1.2fr 1fr 0.8fr 0.6fr;
  gap: 8px;
  align-items: center;
  padding: 8px 4px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
}
.dash-recent-row:last-child { border-bottom: none; }
.dash-recent-row--header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding-bottom: 6px;
}
.dash-recent-vehicle { font-weight: 600; }
.dash-recent-price {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
}
.dash-recent-date { color: var(--text-secondary); font-size: 12px; }
.dash-recent-link { font-size: 12px; }

/* ========== Profitability Steps ========== */
.profit-steps {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.profit-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
}
.profit-step.active {
  color: var(--accent);
}
.profit-step.completed {
  color: var(--green);
}
.profit-step-number {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 700;
}
.profit-step-connector {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  min-width: 24px;
}

/* ========== Profitability Spectrum ========== */
.profit-spectrum {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--red) 0%, var(--orange) 40%, var(--green) 70%, #2ea043 100%);
  position: relative;
  margin: var(--space-4) 0;
}
.profit-spectrum-marker {
  position: absolute;
  top: -7px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--text-primary);
  border: 3px solid var(--bg-secondary);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

/* ========== Drawer ========== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 900;
  animation: fadeIn var(--duration-fast) var(--ease-out);
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 560px;
  max-width: 100vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: 901;
  display: flex;
  flex-direction: column;
  animation: drawerSlideIn var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}
@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ========== Filter Chips ========== */
.active-filters-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-3) 0;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--accent-subtle);
  border: 1px solid rgba(88, 166, 255, 0.25);
  border-radius: 999px;
  font-size: var(--text-sm);
  color: var(--accent);
}
.filter-chip-remove {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}
.filter-chip-remove:hover {
  opacity: 1;
}

/* ========== Offer Mobile Card ========== */
.offer-mobile-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.offer-mobile-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
}
.offer-mobile-card-title {
  font-weight: 600;
  font-size: var(--text-base);
}
.offer-mobile-card-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: var(--text-lg);
  white-space: nowrap;
}
.offer-mobile-card-meta {
  display: flex;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.offer-mobile-card-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* Desktop table / Mobile cards toggle */
.offers-desktop-table { display: block; }
.offers-mobile-cards { display: none; }

@media (max-width: 768px) {
  .offers-desktop-table { display: none !important; }
  .offers-mobile-cards { display: grid; gap: var(--space-2); }
}

/* ========== Utility classes ========== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.font-mono { font-family: var(--font-mono); }

.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-actions-between {
  justify-content: space-between;
}

.inline-actions-end {
  justify-content: flex-end;
}

.input-inline {
  width: min(260px, 100%);
}

.meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-size: 13px;
}

.meta-bar-link {
  margin-left: auto;
  font-size: 12px;
}

/* ========== Table ========== */
.table-wrapper {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(88, 166, 255, 0.02);
}

.offer-thumb {
  width: 72px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  display: block;
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  min-height: 38px;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  background: var(--border-color);
  border-color: var(--border-hover);
}
.btn:active:not(:disabled) {
  transform: scale(0.96);
  transition: transform 60ms ease;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-primary:active:not(:disabled) {
  background: #4393e6;
  transform: scale(0.96);
}

.btn-danger {
  color: var(--red);
  border-color: rgba(248, 81, 73, 0.3);
}
.btn-danger:hover {
  background: var(--red-bg);
  border-color: var(--red);
}
.btn-danger:active:not(:disabled) {
  background: rgba(248, 81, 73, 0.2);
  transform: scale(0.96);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  min-height: 30px;
}

.btn-icon {
  padding: 6px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  transition: transform 80ms ease, background var(--transition), color var(--transition), filter 80ms ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.btn-icon:active:not(:disabled) {
  transform: scale(0.94);
}

.nav-link,
.pagination-btn,
.hamburger-btn {
  -webkit-tap-highlight-color: transparent;
}

.tap-feedback {
  transform: scale(0.97) translateY(1px) !important;
  filter: brightness(1.08);
}

/* ========== Forms ========== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  cursor: pointer;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.form-group-span-full {
  grid-column: 1 / -1;
}

.form-group-max-md {
  max-width: 500px;
}

.country-section-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 14px;
}

.country-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.country-flag-preview {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  white-space: nowrap;
}

.country-field-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.country-section-separator {
  height: 1px;
  background: var(--border-color);
  margin: 14px 0;
}

.offer-country-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.offer-country-detail-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  padding: 12px;
}

.offer-country-detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.offer-country-detail-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.offer-country-detail-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.offer-alert-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  padding: 10px 12px;
}

/* Offers page tabs */
.offers-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.offers-tab:hover {
  color: var(--text-primary);
}
.offers-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Segment tabs (chart-tab) — used in MarketOffers, MyGarage ── */
.chart-tab {
  padding: 8px 18px;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  white-space: nowrap;
  position: relative;
  top: 2px; /* align bottom border with container border */
}
.chart-tab:hover {
  color: var(--text-primary);
  background: var(--accent-subtle);
  border-radius: var(--radius) var(--radius) 0 0;
}
.chart-tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.chart-tab.tap-feedback {
  background: var(--accent-subtle);
}

/* Column dropdown */
.column-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  margin-top: 6px;
  min-width: 320px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.offer-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.offer-gallery-item {
  margin: 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.offer-gallery-item img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.offer-gallery-item figcaption {
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-word;
}

.offer-price-history-list {
  display: grid;
  gap: 8px;
}

.offer-price-history-row {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  padding: 8px 10px;
}

.offer-scan-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(88, 166, 255, 0.08), rgba(210, 153, 34, 0.05));
  padding: 14px;
}

.offer-scan-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(248, 81, 73, 0.45);
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
}

.offer-scan-preview {
  margin-top: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 12px;
}

.offer-scan-preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.offer-scan-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.offer-scan-preview-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  padding: 8px;
}

.offer-scan-preview-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.offer-scan-preview-value {
  font-size: 13px;
  color: var(--text-primary);
  word-break: break-word;
}

.offer-scan-spinner {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: offerScanSpin 0.8s linear infinite;
}

@keyframes offerScanSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.form-error {
  color: var(--red);
  font-size: 12px;
  margin-top: 4px;
}

.spec-suggestion-bar {
  margin: 8px 0 14px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(46, 160, 67, 0.08), rgba(88, 166, 255, 0.06));
  animation: specSuggestionSlide 0.22s ease-out;
}

.spec-suggestion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.spec-suggestion-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.spec-suggestion-loading {
  font-size: 13px;
  color: var(--text-secondary);
}

.spec-suggestion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.spec-chip {
  text-align: left;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 8px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), background var(--transition);
}

.spec-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.spec-chip-top {
  border-color: rgba(46, 160, 67, 0.6);
  background: rgba(46, 160, 67, 0.12);
}

.spec-chip-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.spec-chip-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.field-inline-actions {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.field-suggest-list {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.field-suggest-chip {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
}

.info-inline {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-primary);
}

.info-inline.muted {
  color: var(--text-secondary);
}

@keyframes specSuggestionSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Input with unit suffix */
.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-unit .form-input {
  padding-right: 48px;
}
.input-unit {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  pointer-events: none;
  user-select: none;
}

/* Searchable select */
.searchable-select {
  position: relative;
}
.searchable-select-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.searchable-select-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}
.searchable-select-input::placeholder {
  color: var(--text-muted);
}
.searchable-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 200;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
}
.searchable-select-option {
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-primary);
  transition: background var(--transition);
}
.searchable-select-option:hover,
.searchable-select-option.highlighted {
  background: var(--bg-tertiary);
  color: var(--accent);
}
.searchable-select-empty {
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 150ms ease;
  padding: 16px;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 200ms ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
}

.import-page-card .modal-header {
  padding-left: 0;
  padding-right: 0;
}

.import-page-card .modal-body {
  padding-left: 0;
  padding-right: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== Comparison indicators ========== */
.indicator-up {
  color: var(--red);
}
.indicator-neutral {
  color: var(--orange);
}
.indicator-down {
  color: var(--green);
}

.price-up {
  color: var(--red);
}
.price-neutral {
  color: var(--orange);
}
.price-down {
  color: var(--green);
}

.compare-best {
  background: rgba(63, 185, 80, 0.12);
  color: var(--green);
  font-weight: 700;
}

.compare-worst {
  background: rgba(248, 81, 73, 0.12);
  color: var(--red);
  font-weight: 700;
}

/* ========== Badges ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
}
.badge-green {
  background: var(--green-bg);
  color: var(--green);
}
.badge-red {
  background: var(--red-bg);
  color: var(--red);
}
.badge-orange {
  background: var(--orange-bg);
  color: var(--orange);
}

/* ========== Toolbar ========== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input {
  padding: 8px 12px;
  font-size: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  width: 260px;
  max-width: 100%;
  font-family: inherit;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.sort-select {
  padding: 8px 12px;
  font-size: 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
}

/* ========== Pagination ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  gap: 8px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  padding: 4px 10px;
  font-size: 13px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  font-family: inherit;
  min-height: 30px;
}
.pagination-btn:hover:not(:disabled) {
  background: var(--border-color);
}
.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pagination-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.per-page-select {
  padding: 4px 8px;
  font-size: 13px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
}

/* ========== Inline edit panel ========== */
.inline-edit-panel {
  background: var(--bg-card);
  border-top: 1px solid var(--accent);
  animation: slideDown 200ms ease;
}

.inline-edit-panel td {
  padding: 20px 16px;
}

@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 1000px; }
}

/* ========== Stats cards ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ========== Empty state ========== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state p {
  margin: 8px 0 0;
  font-size: 14px;
}
.empty-state .btn {
  margin-top: 16px;
}

/* ========== Charts ========== */
.chart-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ========== Dashboard v2 responsive ========== */
@media (max-width: 1200px) {
  .dash-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-bento-half {
    grid-column: 1 / -1;
  }
  .dash-kpi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ========== Comparison ========== */
.comparison-selector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.comparison-selector-button {
  min-width: 140px;
}

.comparison-vehicle-list {
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.comparison-vehicle-option {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background var(--transition), border-color var(--transition), opacity var(--transition);
}

.comparison-vehicle-option:hover {
  background: rgba(88, 166, 255, 0.04);
  border-color: var(--border-color);
}

.comparison-vehicle-option-selected {
  background: rgba(88, 166, 255, 0.06);
  border-color: rgba(88, 166, 255, 0.28);
}

.comparison-vehicle-option-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.comparison-vehicle-title {
  font-weight: 600;
  font-size: var(--text-base);
}

.comparison-vehicle-meta {
  flex: 1 1 280px;
  min-width: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.comparison-table {
  --compare-columns: 2;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.comparison-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.comparison-cells {
  display: grid;
  grid-template-columns: repeat(var(--compare-columns), minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.comparison-cell {
  min-width: 0;
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
}

.comparison-cell-best {
  color: var(--accent);
  font-weight: 700;
  background: rgba(88, 166, 255, 0.06);
}

.comparison-equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.comparison-equipment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ========== Profitability panel ========== */
.profit-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.profit-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
.profit-row:last-child {
  border-bottom: none;
}
.profit-row .label {
  color: var(--text-secondary);
}
.profit-row .value {
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.profit-total {
  font-size: 18px;
  font-weight: 700;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 2px solid var(--border-color);
}

/* ========== My Garage ========== */
.garage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.garage-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.garage-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.garage-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.3);
}
.garage-card-sold {
  opacity: 0.86;
}

.garage-card-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  background: rgba(13, 17, 23, 0.92);
  border: 1px solid rgba(248, 81, 73, 0.45);
  color: var(--red);
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.garage-card-content {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.garage-card-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.garage-card-subtitle {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}

.garage-card-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(max-content, auto);
  gap: 8px 16px;
  font-size: var(--text-sm);
  align-items: start;
}

.garage-card-metric {
  min-width: 0;
}

.garage-card-metric-label {
  color: var(--text-muted);
}

.garage-card-metric-value {
  font-family: var(--font-mono);
  font-weight: 600;
}

.garage-card-metric-value-nowrap {
  white-space: nowrap;
}

.garage-card-metric-price {
  text-align: right;
}

.garage-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.garage-details-card {
  border-color: rgba(88, 166, 255, 0.25);
}

.garage-details-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.garage-market-message {
  margin-bottom: 12px;
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid rgba(88, 166, 255, 0.35);
  color: var(--accent);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}

.garage-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.garage-tab-btn {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.garage-tab-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.garage-tab-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(88, 166, 255, 0.08);
}

.garage-point-card {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-tertiary);
}

.garage-filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.garage-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
}

.garage-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.garage-timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.garage-timeline-item {
  position: relative;
  display: flex;
  gap: 10px;
  z-index: 1;
}

.garage-timeline-bullet {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 2px solid var(--timeline-color, var(--accent));
  background: var(--bg-secondary);
  color: var(--timeline-color, var(--accent));
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.garage-timeline-content {
  flex: 1;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--timeline-color, var(--accent));
  border-radius: var(--radius);
  background: var(--bg-secondary);
  padding: 12px;
}

.garage-timeline-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.garage-timeline-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.garage-timeline-meta {
  color: var(--text-secondary);
  font-size: 13px;
}

.garage-timeline-description {
  margin-top: 10px;
  color: var(--text-primary);
  white-space: pre-wrap;
  line-height: 1.45;
}

/* ========== Loading ========== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
}

/* ========== Recharts overrides ========== */
.recharts-cartesian-axis-tick-value {
  fill: var(--text-secondary) !important;
  font-size: 12px !important;
}
.recharts-text,
.recharts-layer text {
  font-family: var(--font-sans) !important;
}
.recharts-legend-wrapper,
.recharts-default-legend {
  font-family: var(--font-sans) !important;
}
.recharts-default-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.recharts-legend-item {
  display: inline-flex !important;
  align-items: center;
}
.recharts-legend-item-text {
  color: var(--text-secondary) !important;
  font-family: var(--font-sans) !important;
}

/* ========== Login screen ========== */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
.login-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
}

.login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 48px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
}

.login-brand-image {
  width: 52px;
  height: 52px;
  display: block;
}

.login-brand-name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
  color: var(--text-primary);
}

.login-brand-tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  text-align: center;
}

.login-error {
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  text-align: center;
}

.login-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  justify-content: center;
  text-align: center;
}
.login-btn:disabled {
  opacity: 0.7;
  background: var(--accent);
  border-color: var(--accent);
}

/* ========== Toast / Snackbar ========== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  animation: toastSlideIn 250ms ease;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.toast-success {
  border-color: var(--green);
  background: var(--green-bg);
}
.toast-success .toast-icon {
  color: var(--green);
}

.toast-error {
  border-color: var(--red);
  background: var(--red-bg);
}
.toast-error .toast-icon {
  color: var(--red);
}

.toast-info .toast-icon {
  color: var(--accent);
}

.toast-icon {
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.toast-message {
  flex: 1;
  min-width: 0;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.toast-close:hover {
  color: var(--text-primary);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ========== Theme toggle switch ========== */
.theme-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.theme-switch input {
  display: none;
}
.theme-switch-track {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  transition: background 0.3s;
}
.theme-switch-thumb {
  position: absolute;
  left: 3px;
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.theme-switch input:checked ~ .theme-switch-track .theme-switch-thumb {
  transform: translateX(24px);
}
.theme-switch-icon {
  font-size: 13px;
  line-height: 1;
  z-index: 1;
  pointer-events: none;
}
.theme-switch-moon {
  color: var(--text-muted);
}
.theme-switch-sun {
  color: var(--text-muted);
}

/* ========== Light theme scrollbar ========== */
[data-theme="light"] ::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #c1c8d1;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #afb8c1;
}

/* ========== Valuation ========== */
.valuation-form-card {
  border-color: color-mix(in srgb, var(--accent-color) 45%, var(--border-color));
}

.valuation-no-data {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
  margin-bottom: 16px;
}

.valuation-mileage-focus {
  border: 1px solid color-mix(in srgb, var(--accent-color) 40%, transparent);
  border-radius: var(--radius);
  padding: 10px;
  background: color-mix(in srgb, var(--accent-color) 10%, transparent);
}

.valuation-mileage-input {
  font-size: 18px;
  font-weight: 700;
}

.valuation-submit-btn {
  min-width: 140px;
}

.profitability-submit-btn {
  min-width: 180px;
}

.profitability-vehicle-meta {
  margin-bottom: 16px;
}

.profit-spectrum-labels {
  font-size: 11px;
  color: var(--text-muted);
}

.valuation-table-controls .form-select {
  min-width: 160px;
}

.valuation-result-card {
  border-color: color-mix(in srgb, var(--success-color) 35%, var(--border-color));
}

.valuation-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.valuation-main-price {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.valuation-range-label {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.valuation-range-track {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(88, 166, 255, 0.2), rgba(63, 185, 80, 0.25));
  border: 1px solid var(--border-color);
  position: relative;
  margin-bottom: 14px;
}

.valuation-range-marker {
  position: absolute;
  top: -4px;
  width: 10px;
  height: 20px;
  border-radius: 6px;
  background: #f85149;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px rgba(248, 81, 73, 0.25);
}

.valuation-confidence-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.valuation-confidence-bar {
  height: 10px;
  flex: 1;
  border-radius: 999px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.valuation-confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, #d29922 0%, #3fb950 100%);
}

.valuation-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(242, 201, 76, 0.35);
  background: rgba(242, 201, 76, 0.12);
  color: var(--text-primary);
}

.valuation-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.valuation-outlier-row {
  opacity: 0.7;
}

.valuation-target-row {
  background: color-mix(in srgb, var(--accent-color) 14%, transparent);
}

/* ========== TABLET RESPONSIVE ========== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dash-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-bento-half { grid-column: 1 / -1; }
  .dash-kpi {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .main-content {
    padding: var(--space-6);
  }
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
  /* Top bar: hide tabs, show hamburger */
  .topbar-tabs {
    display: none;
  }
  .topbar .hamburger-btn {
    display: flex !important;
  }
  .topbar {
    padding: 0 var(--space-4);
  }

  /* Bottom tabs: show on mobile */
  .bottom-tabs {
    display: block;
  }

  /* Sidebar: slide-in from left */
  .sidebar {
    position: fixed;
    left: -260px;
    top: var(--topbar-height);
    height: calc(100vh - var(--topbar-height));
    width: 260px;
    transition: left 0.25s ease;
    z-index: 100;
  }
  .sidebar.open {
    left: 0;
  }

  .main-content {
    padding: var(--space-4);
    padding-bottom: calc(var(--bottom-bar-height) + var(--space-4));
  }

  .page-shell,
  .page-shell-dashboard,
  .page-shell-with-sidebar,
  .page-shell-without-sidebar {
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-title {
    font-size: 18px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-input {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .action-cards {
    grid-template-columns: 1fr;
  }

  /* Dashboard v2 mobile */
  .dash-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .dash-actions {
    width: 100%;
  }
  .dash-action-pill {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 6px 10px;
  }
  .dash-filters {
    flex-direction: column;
  }
  .dash-filter-select,
  .dash-filter-input {
    max-width: none;
    width: 100%;
  }
  .dash-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-bento {
    grid-template-columns: 1fr;
  }
  .dash-bento-half,
  .dash-bento-full {
    grid-column: auto;
  }
  .dash-recent-row {
    grid-template-columns: 1.5fr 0.5fr 1fr;
    font-size: 12px;
  }
  .dash-recent-row > :nth-child(4),
  .dash-recent-row > :nth-child(5),
  .dash-recent-row > :nth-child(6) {
    display: none;
  }

  .form-group-max-md {
    max-width: none;
  }

  .input-inline {
    width: 100%;
  }

  .meta-bar-link {
    margin-left: 0;
    flex-basis: 100%;
  }

  .inline-actions-mobile-stack {
    align-items: stretch;
  }

  .inline-actions-mobile-stack > * {
    width: 100%;
  }

  .inline-actions-mobile-stack .btn,
  .inline-actions-mobile-stack .form-select,
  .inline-actions-mobile-stack .form-input {
    width: 100%;
    justify-content: center;
  }

  .comparison-selector-head {
    flex-direction: column;
    align-items: stretch;
  }

  .comparison-selector-button {
    width: 100%;
    justify-content: center;
  }

  .comparison-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .comparison-cells {
    grid-template-columns: repeat(var(--compare-columns), minmax(220px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .comparison-equipment-grid {
    grid-template-columns: 1fr;
  }

  .valuation-table-controls {
    width: 100%;
  }

  .profit-spectrum-labels {
    font-size: 10px;
    width: 100%;
  }

  .garage-grid {
    grid-template-columns: 1fr;
  }

  .garage-card-metrics {
    grid-template-columns: 1fr;
  }

  .garage-card-metric-price {
    text-align: left;
  }

  .garage-card-actions {
    flex-direction: column;
  }

  .garage-card-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .garage-tabs {
    flex-direction: column;
  }

  .garage-tab-btn {
    width: 100%;
    text-align: left;
  }

  .garage-details-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .garage-filter-chips {
    flex-direction: column;
  }

  .garage-filter-chip {
    width: 100%;
    border-radius: var(--radius);
  }

  .offer-alert-item {
    flex-direction: column;
  }

  .offer-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .country-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .country-flag-preview {
    width: fit-content;
  }

  .modal {
    max-width: 100%;
    max-height: 95vh;
    margin: 8px;
    border-radius: var(--radius-lg);
  }
  .modal-overlay {
    padding: 8px;
  }

  .btn {
    min-height: 44px;
    padding: 10px 16px;
  }
  .btn-sm {
    min-height: 36px;
    padding: 6px 12px;
  }

  .pagination {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .login-card {
    margin: 16px;
    padding: 32px 24px;
    max-width: 100%;
  }

  .login-brand-image {
    width: 280px;
  }

  /* Table: horizontal scroll on mobile */
  table {
    min-width: 700px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: calc(var(--bottom-bar-height) + 16px);
    max-width: none;
  }

  .valuation-result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .notification-panel {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    width: auto;
    border-radius: 0;
    max-height: calc(100vh - var(--topbar-height) - var(--bottom-bar-height));
  }

  .drawer {
    width: 100vw;
  }

  .profit-steps {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .stat-value {
    font-size: 18px;
  }
  .page-title {
    font-size: 16px;
  }
}

/* ========== Collapsible filters ========== */
.filters-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.filters-toggle-btn .chevron {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 10px;
}
.filters-toggle-btn .chevron.open {
  transform: rotate(180deg);
}
.filter-active-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 5px;
}
.filters-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.filters-body.collapsed {
  max-height: 0;
}
.filters-body.expanded {
  max-height: 2000px;
}

/* ========== Column dropdown ========== */
.column-dropdown-wrapper {
  position: relative;
  display: inline-block;
}
.column-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 50;
  min-width: 240px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  padding: 8px;
  margin-top: 4px;
}
.column-dropdown label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
}
.column-dropdown label:hover {
  background: var(--bg-tertiary);
}

/* ========== Offer page tabs ========== */
.offer-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border-color);
}
.offer-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
}
.offer-tab:hover {
  color: var(--text-primary);
}
.offer-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.offer-tab .tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--bg-tertiary);
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  padding: 0 4px;
}

/* =========================================================
   mm-* Design System — Motometr Refresh
   ========================================================= */

/* Topbar avatar */
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(60% 0.18 30), oklch(50% 0.20 350));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: white;
  flex-shrink: 0;
}

.topbar-icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg-2);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}
.topbar-icon-btn:hover {
  background: var(--bg-3);
  color: var(--fg);
}

/* Utility font helpers */
.display  { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
.mono     { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num      { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Screen wrapper */
.mm-screen {
  background: var(--bg);
  color: var(--fg);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.mm-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 0%, oklch(70% 0.18 250 / 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 10% 100%, oklch(70% 0.22 320 / 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.mm-screen > * { position: relative; z-index: 1; }

/* Pills */
.mm-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg-2);
  font-family: var(--font-mono);
}
.mm-pill.blue   { color: var(--blue);   background: var(--blue-soft);  border-color: var(--blue-line); }
.mm-pill.green  { color: var(--green);  background: var(--green-soft); border-color: oklch(74% 0.17 152 / 0.32); }
.mm-pill.amber  { color: var(--amber);  background: var(--amber-soft); border-color: oklch(78% 0.15 75 / 0.32); }
.mm-pill.red    { color: var(--red);    background: var(--red-soft);   border-color: oklch(68% 0.20 22 / 0.32); }
.mm-pill.ai     { color: var(--ai);     background: var(--ai-soft);    border-color: var(--ai-line); }
.mm-pill.dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: mm-pulse 1.6s ease-in-out infinite;
}
@keyframes mm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Buttons */
.mm-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg);
  cursor: pointer;
  transition: background var(--transition);
}
.mm-btn:hover { background: var(--bg-3); }
.mm-btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: oklch(15% 0.012 252);
  box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.15) inset, 0 8px 20px oklch(70% 0.18 250 / 0.3);
}
.mm-btn.primary:hover { background: var(--blue-2); }
.mm-btn.ai {
  background: var(--ai);
  border-color: var(--ai);
  color: oklch(15% 0.012 320);
  box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.15) inset, 0 8px 20px oklch(70% 0.22 320 / 0.3);
}
.mm-btn.ghost { background: transparent; border-color: transparent; }
.mm-btn.ghost:hover { background: var(--bg-3); }
.mm-btn.lg { height: 44px; padding: 0 20px; font-size: 14px; }

/* Card */
.mm-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.mm-card.flush { padding: 0; }

/* Section header */
.mm-section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.mm-section-h h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* KPI */
.mm-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  color: var(--fg-3);
  font-weight: 500;
}
.mm-kpi-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Table */
.mm-table { width: 100%; border-collapse: collapse; }
.mm-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.mm-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}
.mm-table tr:hover td { background: var(--bg-3); }

/* Inputs */
.mm-input {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
}
.mm-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.mm-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  color: var(--fg-3);
  font-weight: 500;
  margin-bottom: 6px;
}

/* Sparkline */
.mm-spark { display: block; overflow: visible; }

/* License plate */
.mm-plate {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border-radius: 5px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  background: oklch(96% 0.005 252);
  color: oklch(15% 0.012 252);
  border: 1.5px solid oklch(70% 0.005 252);
  overflow: hidden;
  height: 26px;
  line-height: 1;
}
.mm-plate-eu {
  background: var(--blue);
  color: white;
  padding: 0 4px;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 10px;
  letter-spacing: 0;
  font-weight: 800;
}
.mm-plate-num { padding: 0 8px; }

/* Image placeholder */
.mm-img {
  background: repeating-linear-gradient(
    135deg,
    var(--bg-3) 0 8px,
    var(--bg-2) 8px 16px
  );
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: grid;
  place-items: center;
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
}
.mm-img::after { content: attr(data-label); }

/* Login screen */
.login-overlay {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bg);
  animation: fadeIn var(--duration-normal) var(--ease-out);
}
.login-overlay.fade-out { opacity: 0; transition: opacity 0.4s; }

.login-panel-brand {
  flex: 1.1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
}
.login-panel-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 40%, oklch(70% 0.18 250 / 0.18) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 90%, oklch(70% 0.22 320 / 0.10) 0%, transparent 70%);
  pointer-events: none;
}
.login-panel-brand > * { position: relative; }

.login-panel-form {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-2);
}

@media (max-width: 720px) {
  .login-panel-brand { display: none; }
  .login-panel-form { padding: 32px 24px; }
}

/* Tap feedback (mobile) */
.tap-feedback {
  opacity: 0.7;
  transform: scale(0.97);
  transition: opacity 80ms, transform 80ms;
}
/* ===================================================================
   MOTOMETR — Design Refresh Tokens
   Dark, deeper, warmer than current. Electric blue accent.
   =================================================================== */

:root {
  /* === Surfaces === */
  --bg: oklch(17% 0.012 252);          /* deep ink, slight blue */
  --bg-2: oklch(20% 0.014 252);        /* card */
  --bg-3: oklch(24% 0.016 252);        /* hover / nested */
  --bg-4: oklch(28% 0.018 252);        /* input / chip */
  --line: oklch(32% 0.020 252);        /* hairline */
  --line-strong: oklch(42% 0.025 252);

  /* === Text === */
  --fg: oklch(96% 0.005 252);
  --fg-2: oklch(78% 0.012 252);        /* secondary */
  --fg-3: oklch(58% 0.015 252);        /* muted */
  --fg-4: oklch(42% 0.015 252);        /* faint */

  /* === Accent: electric blue === */
  --blue: oklch(70% 0.18 250);
  --blue-2: oklch(80% 0.16 250);       /* hover */
  --blue-soft: oklch(70% 0.18 250 / 0.14);
  --blue-line: oklch(70% 0.18 250 / 0.32);

  /* === Signals === */
  --green: oklch(74% 0.17 152);
  --green-soft: oklch(74% 0.17 152 / 0.14);
  --amber: oklch(78% 0.15 75);
  --amber-soft: oklch(78% 0.15 75 / 0.14);
  --red: oklch(68% 0.20 22);
  --red-soft: oklch(68% 0.20 22 / 0.14);

  /* === Magenta — reserved for AI/insight surfaces === */
  --ai: oklch(70% 0.22 320);
  --ai-2: oklch(80% 0.20 320);
  --ai-soft: oklch(70% 0.22 320 / 0.14);
  --ai-line: oklch(70% 0.22 320 / 0.34);

  /* === Type === */
  --font-display: 'Oxanium', system-ui, sans-serif;
  --font-body: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Geist Mono', ui-monospace, monospace;

  /* === Radii === */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* === Shadows === */
  --shadow-1: 0 1px 0 oklch(100% 0 0 / 0.04) inset, 0 1px 2px oklch(0% 0 0 / 0.4);
  --shadow-2: 0 1px 0 oklch(100% 0 0 / 0.04) inset, 0 8px 24px oklch(0% 0 0 / 0.4);
  --glow-blue: 0 0 0 1px var(--blue-line), 0 12px 40px oklch(70% 0.18 250 / 0.18);
  --glow-ai: 0 0 0 1px var(--ai-line), 0 12px 40px oklch(70% 0.22 320 / 0.18);
}

/* === Base === */
.mm {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  font-feature-settings: "ss01", "cv11";
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.mm * { box-sizing: border-box; }
.mm h1, .mm h2, .mm h3, .mm h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
.mm .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
.mm .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.mm .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* === Bezel container — every artboard wraps in this === */
.mm-screen {
  background: var(--bg);
  color: var(--fg);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  isolation: isolate;
}
.mm-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 0%, oklch(70% 0.18 250 / 0.10) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 10% 100%, oklch(70% 0.22 320 / 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.mm-screen > * { position: relative; z-index: 1; }

/* === Topbar reused across screens === */
.mm-topbar {
  height: 56px;
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: oklch(17% 0.012 252 / 0.7);
  backdrop-filter: blur(12px);
}
.mm-brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 16px;
}
.mm-brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, var(--blue) 0%, oklch(60% 0.20 280) 100%);
  display: grid; place-items: center;
  position: relative;
  box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.1) inset, 0 4px 12px oklch(70% 0.18 250 / 0.4);
}
.mm-brand-mark::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px solid oklch(100% 0 0 / 0.85);
  border-bottom-color: transparent;
  border-right-color: transparent;
  border-radius: 50%;
  transform: rotate(-45deg);
}
.mm-tabs {
  display: flex; gap: 2px;
  flex: 1;
}
.mm-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.mm-tab.active {
  color: var(--blue);
  background: var(--blue-soft);
}
.mm-topbar-right {
  display: flex; align-items: center; gap: 8px;
  color: var(--fg-3);
}
.mm-icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg-2);
  cursor: pointer;
  position: relative;
}
.mm-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(60% 0.18 30), oklch(50% 0.20 350));
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: white;
}
.mm-avatar-link {
  text-decoration: none;
  cursor: pointer;
}
.mm-topbar-popover-wrap {
  position: relative;
}
.mm-topbar-popover {
  position: absolute;
  top: 38px;
  right: 0;
  width: 320px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  box-shadow: var(--shadow-2);
  z-index: 80;
}
.mm-topbar-search-popover .mm-input {
  height: 34px;
}
.mm-topbar-popover-title {
  font-size: 10px;
  color: var(--fg-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.mm-topbar-popover-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.mm-topbar-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mm-topbar-notifications-list {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.mm-topbar-notification-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--bg);
  text-decoration: none;
  color: inherit;
}
.mm-topbar-notification-item:hover {
  border-color: var(--blue-line);
  background: var(--blue-soft);
}
.mm-topbar-notification-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-1);
}
.mm-topbar-notification-detail {
  margin-top: 2px;
  font-size: 11px;
  color: var(--fg-3);
}

/* === Pills === */
.mm-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg-2);
  font-family: var(--font-mono);
}
.mm-pill.blue   { color: var(--blue);  background: var(--blue-soft);  border-color: var(--blue-line); }
.mm-pill.green  { color: var(--green); background: var(--green-soft); border-color: oklch(74% 0.17 152 / 0.32); }
.mm-pill.amber  { color: var(--amber); background: var(--amber-soft); border-color: oklch(78% 0.15 75 / 0.32); }
.mm-pill.red    { color: var(--red);   background: var(--red-soft);   border-color: oklch(68% 0.20 22 / 0.32); }
.mm-pill.ai     { color: var(--ai);    background: var(--ai-soft);    border-color: var(--ai-line); }
.mm-pill.dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: mm-pulse 1.6s ease-in-out infinite;
}
@keyframes mm-pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === Buttons === */
.mm-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg);
  cursor: pointer;
}
.mm-btn:hover { background: var(--bg-3); }
.mm-btn.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: oklch(15% 0.012 252);
  box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.15) inset, 0 8px 20px oklch(70% 0.18 250 / 0.3);
}
.mm-btn.primary:hover { background: var(--blue-2); }
.mm-btn.ai {
  background: var(--ai);
  border-color: var(--ai);
  color: oklch(15% 0.012 320);
  box-shadow: 0 0 0 1px oklch(100% 0 0 / 0.15) inset, 0 8px 20px oklch(70% 0.22 320 / 0.3);
}
.mm-btn.ghost { background: transparent; }
.mm-btn.lg { height: 44px; padding: 0 20px; font-size: 14px; }

/* === Card === */
.mm-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.mm-card.flush { padding: 0; }

/* === Section header === */
.mm-section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
}
.mm-section-h h3 {
  font-size: 14px; font-weight: 600;
  color: var(--fg-2);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

/* === KPI === */
.mm-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  color: var(--fg-3);
  font-weight: 500;
}
.mm-kpi-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* === Table === */
.mm-table { width: 100%; border-collapse: collapse; }
.mm-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-3);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.mm-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}
.mm-table tr:hover td { background: var(--bg-3); }

/* === Inputs === */
.mm-input {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  width: 100%;
}
.mm-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.mm-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
  color: var(--fg-3);
  font-weight: 500;
  margin-bottom: 6px;
}

/* === Sparkline === */
.mm-spark { display: block; overflow: visible; }

/* License plate motif */
.mm-plate {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border-radius: 5px;
  font-family: 'Oxanium', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  background: oklch(96% 0.005 252);
  color: oklch(15% 0.012 252);
  border: 1.5px solid oklch(70% 0.005 252);
  overflow: hidden;
  height: 26px;
  line-height: 1;
}
.mm-plate-eu {
  background: var(--blue);
  color: white;
  padding: 0 4px;
  height: 100%;
  display: grid; place-items: center;
  font-size: 10px;
  letter-spacing: 0;
  font-weight: 800;
}
.mm-plate-num { padding: 0 8px; }

/* Image placeholder — striped */
.mm-img {
  background:
    repeating-linear-gradient(135deg,
      var(--bg-3) 0 8px,
      var(--bg-2) 8px 16px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: grid; place-items: center;
  color: var(--fg-4);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  position: relative;
}
.mm-img::after {
  content: attr(data-label);
}
