:root {
  /* ─── RotaCheck Pro Design System — Navy + Amber ─── */
  --bg: #f4f2ee;
  --bg-2: #ffffff;
  --panel: rgba(255,255,255,.98);
  --panel-soft: rgba(255,255,255,.88);
  --surface: #ffffff;
  --surface-2: #ebe8e3;
  --text: #1a2540;
  --text-secondary: #5a6480;
  --muted: #6b7592;
  --muted-2: #4a5568;
  --line: rgba(0,0,0,.07);
  --line-strong: rgba(0,0,0,.13);
  --accent: #1e3a5f;
  --accent-2: #15294a;
  --accent-light: rgba(30,58,95,.09);
  --accent-hover: rgba(30,58,95,.14);
  --cta: #e07118;
  --cta-hover: #c25e0c;
  --cta-light: rgba(224,113,24,.10);
  --success: #059669;
  --success-light: rgba(5,150,105,.08);
  --warning: #d97706;
  --warning-light: rgba(217,119,6,.08);
  --danger: #dc2626;
  --danger-light: rgba(220,38,38,.06);
  --info: #2563eb;
  --info-light: rgba(37,99,235,.06);

  /* Auxiliary semantic tokens (Track 3 — was inline hex in account.html). */
  --info-sky: #0ea5e9;
  --info-sky-light: rgba(14,165,233,.10);
  --purple: #8b5cf6;
  --purple-light: rgba(139,92,246,.10);
  --amber: #f59e0b;
  --amber-light: rgba(245,158,11,.10);
  --whatsapp: #25d366;
  --whatsapp-light: rgba(37,211,102,.10);

  --shadow: 0 1px 3px rgba(0,0,0,.07), 0 8px 28px rgba(0,0,0,.06);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.05);
  --shadow-lg: 0 4px 16px rgba(0,0,0,.10), 0 24px 48px rgba(0,0,0,.06);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --transition: .15s ease;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* ─── Sidebar tokens ─── */
  --sidebar-bg: #14253d;
  --sidebar-text: rgba(255,255,255,.75);
  --sidebar-text-active: #ffffff;
  --sidebar-active: rgba(255,255,255,.10);
  --sidebar-hover: rgba(255,255,255,.06);
  --sidebar-border: rgba(255,255,255,.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
body.app-body, body.dashboard-body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; display: block; }
.hidden { display: none !important; }
.top-space { margin-top: 24px; }
.wrap { flex-wrap: wrap; }
.gap-lg { gap: 14px; }

.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.stack-sm, .content-stack, .stack-md { display: flex; flex-direction: column; }
.stack-sm { gap: 10px; }
.stack-md, .content-stack { gap: 14px; }

.app-shell {
  width: min(1440px, calc(100% - 20px));
  margin: 10px auto 20px;
}

.glass {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  transition: box-shadow var(--transition);
}
/* Auth main split card overrides glass defaults */
.auth-card-split.glass {
  background: transparent;
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.08), 0 24px 64px rgba(30,58,95,.14);
  border-radius: var(--radius);
  overflow: hidden;
}

.auth-screen {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 0;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at 15% 40%, rgba(30,58,95,.10) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 10%, rgba(224,113,24,.07) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 90%, rgba(30,58,95,.05) 0%, transparent 50%),
    var(--bg);
}
.auth-page {
  width: 100%;
  max-width: 1140px;
  padding: 40px 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-screen {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 15% 40%, rgba(30,58,95,.10) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 10%, rgba(224,113,24,.07) 0%, transparent 45%),
    radial-gradient(ellipse at 60% 90%, rgba(30,58,95,.05) 0%, transparent 50%),
    var(--bg);
}
.auth-card {
  width: 100%;
  padding: 36px;
}
.auth-card-split { padding: 0; }
.auth-card.compact { width: min(520px, 100%); }

.auth-card-split {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 24px 64px rgba(30,58,95,.12);
  border: 1px solid var(--line);
}
.auth-split-left {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: linear-gradient(160deg, #15294a 0%, #1e3a5f 60%, #24476e 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-split-left::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(224,113,24,.18) 0%, transparent 70%);
  pointer-events: none;
}
.auth-split-left::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -40px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.04) 0%, transparent 70%);
  pointer-events: none;
}
.auth-split-right {
  padding: 40px 36px;
  border-radius: 0;
  border: none;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.brand-block {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}
.brand-block-hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 0;
  align-items: flex-start;
}

/* Hero left panel — novo layout */
.hero-brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.hero-copy {
  flex: 1;
}
.hero-copy h1 {
  margin: 8px 0 10px;
  font-size: clamp(28px, 3.8vw, 42px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: #fff;
}
.hero-copy p {
  color: rgba(255,255,255,.65);
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}
.center-block {
  grid-template-columns: 1fr;
  text-align: center;
  justify-items: center;
}

.brand-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  overflow: hidden;
}
.brand-logo-sm {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
.brand-logo-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.15);
  border-radius: 20px;
}
.brand-logo-hero.brand-logo-svg {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35), 0 4px 12px rgba(0,0,0,.2);
}
.brand-logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.brand-logo-sm.brand-logo-svg {
  width: 44px;
  height: 44px;
  box-shadow: 0 4px 12px rgba(30,58,95,.18);
}
.brand-logo-svg svg { display: block; border-radius: 20px; }

.eyebrow {
  color: rgba(255,255,255,.55);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
}
.auth-split-right .eyebrow { color: var(--accent-2); }

.auth-card h1, .view-head h2 {
  margin: 4px 0 10px;
  font-size: clamp(26px, 3.5vw, 38px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: #fff;
}
.auth-split-right h2,
.auth-split-right h3 { color: var(--text); }

.auth-split-left .auth-card p,
.auth-split-left p {
  color: rgba(255,255,255,.65);
  margin: 0;
  line-height: 1.65;
  max-width: 52ch;
  font-size: 15px;
}
.auth-split-right .auth-card p,
.auth-split-right p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}
.brand-copy-center p { margin-inline: auto; }

.hero-points {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}
.hero-point {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.hero-point strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}
.hero-point span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Auth Features (novo layout — dark left panel) */
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-feature {
  display: flex;
  gap: 12px;
  align-items: center !important;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  transition: background .15s, border-color .15s;
}
.auth-feature:hover {
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.16);
}
.auth-feature-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(224,113,24,.18);
  border: 1px solid rgba(224,113,24,.25);
  border-radius: 9px;
}
.auth-feature-icon svg { display: block; }
.auth-feature strong { display: block; font-size: 12.5px; color: rgba(255,255,255,.92); margin-bottom: 3px; font-weight: 700; }
.auth-feature span { display: block; font-size: 11px; color: rgba(255,255,255,.50); line-height: 1.45; }

/* Auth Plans Section */
.auth-plans-section {
  padding: 28px 32px;
}
.auth-plans-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.auth-plans-title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text);
}
.auth-plans-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .86rem;
}
.auth-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.auth-plan-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.auth-footer {
  text-align: center;
  padding: 8px 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-tabs,
.actions-inline,
.topbar-actions,
.brand-inline,
.route-metrics,
.delivery-head,
.delivery-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-tabs { margin: 0 0 24px; flex-wrap: wrap; }
.auth-tabs-modern {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px;
  gap: 3px;
  border: 1px solid var(--line);
}
.auth-tabs-modern .chip {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  font-size: .82rem;
  padding: 8px 14px;
}
.auth-tabs-modern .chip.active {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.auth-tabs-modern .chip:hover:not(.active) {
  background: var(--line);
  color: var(--text);
}
.actions-inline-tight { gap: 10px; }

.chip, .btn {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  transition: background .15s, border-color .15s, transform .12s;
}
.chip {
  background: var(--surface-2);
  color: var(--muted-2);
  border-color: var(--line);
  font-weight: 700;
  font-size: .875rem;
}
.chip.active,
.chip:hover {
  border-color: rgba(30,58,95,.2);
  background: var(--accent-light);
  color: var(--accent-2);
}

.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-form .grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.auth-form label, .card label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
}
.auth-form-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.025em;
  margin: 0 0 4px;
}
.auth-form-subtitle {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 20px;
}
input, textarea, select {
  width: 100%;
  border-radius: var(--radius-xs);
  border: 1.5px solid rgba(0,0,0,.10);
  background: var(--bg);
  color: var(--text);
  padding: 11px 14px;
  outline: none;
  font-size: .9rem;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input::placeholder, textarea::placeholder { color: #aab0c0; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(30,58,95,.10);
}
textarea { resize: vertical; }

.btn {
  font-weight: 700;
  font-size: .8125rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  letter-spacing: .01em;
  transition: all var(--transition);
  border-radius: var(--radius-xs);
  padding: 9px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,.10); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent-2);
  box-shadow: 0 1px 3px rgba(30,58,95,.20), 0 4px 14px rgba(30,58,95,.12);
}
.btn-primary:hover {
  background: var(--accent-2);
  box-shadow: 0 5px 18px rgba(30,58,95,.26), 0 1px 4px rgba(30,58,95,.16);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(30,58,95,.20); }
.btn-cta {
  color: #fff;
  background: linear-gradient(135deg, #f08030 0%, #d46010 100%);
  border-color: var(--cta-hover);
  box-shadow: 0 2px 10px rgba(224,113,24,.32), 0 1px 3px rgba(224,113,24,.20);
  font-weight: 800;
  letter-spacing: .02em;
}
.btn-cta:hover {
  background: linear-gradient(135deg, #e87025 0%, #c45608 100%);
  box-shadow: 0 6px 22px rgba(224,113,24,.42), 0 2px 8px rgba(224,113,24,.26);
  transform: translateY(-2px);
}
.btn-cta:active { transform: translateY(0); box-shadow: 0 2px 10px rgba(224,113,24,.32); }
.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-outline {
  color: var(--accent);
  background: transparent;
  border: 1.5px solid rgba(30,58,95,.28);
  box-shadow: none;
  font-weight: 700;
}
.btn-outline:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-2);
  transform: translateY(-1px);
}
.btn-sm { padding: 5px 11px; font-size: .75rem; }
.btn-block {
  width: 100%;
  display: flex;
  justify-content: center;
  text-align: center;
}
button:disabled, .btn:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.message-box, .message {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .875rem;
  line-height: 1.5;
}
.message { margin-top: 0; }
.muted { color: var(--muted); }
.text-caption {
  font-size: .8rem;
  margin-bottom: .75rem;
}
.text-caption-sm {
  font-size: .85rem;
  margin-bottom: 1rem;
}
.text-caption-xs {
  font-size: .85rem;
  margin-bottom: .5rem;
}
.position-relative { position: relative; }
.top-margin-lg { margin-top: 1.5rem; }

.topbar {
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.brand-inline small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 12px;
}

.main-grid {
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 20px;
  margin-top: 18px;
}
/* ─── SIDEBAR redesign: dark brand panel ─── */
.sidebar {
  padding: 0;
  position: sticky;
  top: 16px;
  align-self: start;
  background: var(--sidebar-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,.12), 0 12px 32px rgba(14,25,40,.20);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.sidebar-brand-name {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
}
.sidebar-brand-tag {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.4);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.sidebar-nav {
  padding: 10px 8px;
}
.sidebar-section-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: 10px 10px 4px;
}
.sidebar h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: -.01em;
  color: rgba(255,255,255,.9);
  padding: 12px 14px 0;
}
.nav-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sidebar-text);
  font-weight: 600;
  font-size: .865rem;
  transition: background .15s, color .15s, border-color .15s;
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
}
.nav-btn:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}
.nav-btn.active {
  background: var(--sidebar-active);
  border-color: rgba(255,255,255,.12);
  color: var(--sidebar-text-active);
  font-weight: 700;
}
.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--cta);
}
.nav-btn-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .7;
}
.nav-btn-icon svg { display: block; }
.nav-btn.active .nav-btn-icon { opacity: 1; }
/* Sidebar user area at bottom */
.sidebar-footer {
  padding: 10px 8px;
  border-top: 1px solid var(--sidebar-border);
  margin-top: 6px;
}

/* ─── BOTTOM NAV (mobile-first) ─────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.bottom-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: .65rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  transition: color .15s, background .15s;
  min-width: 56px;
}
.bottom-nav-btn .bottom-nav-icon {
  font-size: 1.25rem;
  line-height: 1;
}
.bottom-nav-btn.active {
  color: var(--accent);
  background: var(--accent-light);
}
.bottom-nav-btn:hover { color: var(--accent); }

/* ─── MORE MENU (mobile gestor popover) ──────────────── */
.more-menu {
  position: fixed;
  bottom: 68px;
  right: 8px;
  z-index: 910;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 -4px 20px rgba(0,0,0,.12);
  padding: 6px;
  min-width: 160px;
}
.more-menu.hidden { display: none; }
.more-menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  text-align: left;
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.more-menu-item:hover,
.more-menu-item:active { background: var(--accent-light); color: var(--accent); }

@media (max-width: 980px) {
  .bottom-nav { display: flex; }
  .sidebar { display: none; }
  .main-grid { grid-template-columns: 1fr; }
  .content-stack { padding-bottom: 72px; }
  /* Larger touch targets for truck drivers */
  input, textarea, select { padding: 14px 14px; font-size: 1rem; }
  .btn { min-height: 48px; font-size: .95rem; }
  .bottom-nav-btn { min-height: 52px; padding: 8px 10px; }
  .delivery-actions .btn { min-height: 44px; padding: 10px 14px; }
  .actions-inline, .delivery-actions { flex-wrap: wrap; }
  .actions-inline.wrap { gap: 8px; }
}

/* ─── SUB-TABS (within views) ─────────────────────────── */
.sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  width: fit-content;
}
.sub-tab {
  padding: 8px 18px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: .85rem;
  border-radius: var(--radius-xs);
  transition: background .15s, color .15s;
  cursor: pointer;
}
.sub-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.sub-tab:hover:not(.active) { color: var(--text); }
.sub-tab-content.hidden { display: none; }

/* ─── ROLE-BASED NAV VISIBILITY ─────────────────────── */
.nav-gestor { display: none; }
.role-gestor .nav-gestor,
.role-admin .nav-gestor { display: flex; }
.nav-admin { display: none; }
.role-admin .nav-admin,
.role-owner .nav-admin { display: flex; }

.view-card, .card { padding: 16px 18px; }
.card.soft {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.card-elevated { box-shadow: var(--shadow-soft); }

.view-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.view-head h2 { font-size: clamp(20px, 2.5vw, 28px); font-weight: 700; }
.view-head-section {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.view-card h3, .card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.stats-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0,1fr));
}
.stats-grid-dashboard {
  /* 8 cards = 2 rows × 4 = grid perfeito sem espaço sobrando */
  grid-template-columns: repeat(4, minmax(0,1fr));
}
@media (max-width: 1023px) and (min-width: 768px) {
  .stats-grid-dashboard { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
/* === V3 Cluely-restraint stat-card === */
.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--t-05);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  display: flex; flex-direction: column; gap: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 0 color-mix(in oklab, var(--text) 3%, transparent);
  transition: transform .22s var(--roi-ease), border-color .22s var(--roi-ease), box-shadow .22s var(--roi-ease);
}
/* Left-border accent removed (impeccable anti-pattern "side-tab thick-border cards") */
.stat-card::after { display: none; }
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--t-15);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -10px color-mix(in oklab, var(--text) 18%, transparent);
}

/* Icon-chips removed — tone is signaled by the NUMBER color, not a colored chip */
.stat-card-icon { display: none; }

.stat-card span,
.stat-card .stat-card-label {
  color: var(--t-55);
  display: block;
  font: 500 11.5px/1.3 Manrope, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.stat-card strong,
.stat-card .stat-card-value {
  display: block;
  font: 800 32px/1 Manrope, sans-serif;
  margin-top: 4px;
  letter-spacing: -.028em;
  color: var(--t-95);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
/* Tone-colored numbers (replaces left-border accent + icon-chip) */
.stat-card--success .stat-card-value,
.stat-card-success .stat-card-value { color: var(--success); }
.stat-card--warning .stat-card-value,
.stat-card-warning .stat-card-value { color: var(--warning); }
.stat-card--danger .stat-card-value,
.stat-card-danger .stat-card-value  { color: var(--danger); }
.stat-card--info .stat-card-value,
.stat-card-info .stat-card-value    { color: var(--accent); }
.stat-card--teal .stat-card-value,
.stat-card-teal .stat-card-value    { color: var(--accent); }
.stat-card--cta .stat-card-value,
.stat-card-cta .stat-card-value     { color: var(--cta); }

.stat-card small {
  display: block;
  margin-top: 6px;
  color: var(--t-55);
  font: 500 11.5px/1.4 Manrope, sans-serif;
}

/* data-flash removed em V3 polish — pulse era visualmente staccato.
   Freshness pill ("● há 12s") já sinaliza atualização suficientemente. */

.empty-state {
  color: var(--muted);
  padding: 24px 16px;
  line-height: 1.6;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state::before {
  content: attr(data-icon);
  font-size: 32px;
  opacity: .5;
  display: block;
}
.empty-state-action {
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted-2);
  white-space: nowrap;
}
.status-gps { background: rgba(5,150,105,.15); color: #0d5a2e; border-color: rgba(5,150,105,.25); font-weight: 800; animation: gps-pulse 2s ease-in-out infinite; }
@keyframes gps-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
.status-sync { background: rgba(37,99,235,.12); color: #1e3fa8; border-color: rgba(37,99,235,.22); font-weight: 800; }
.status-sync.status-error { background: rgba(220,38,38,.12); color: #991b1b; border-color: rgba(220,38,38,.22); }
.status-sync.status-warning { background: rgba(217,119,6,.12); color: #92400e; border-color: rgba(217,119,6,.22); }
.status-entregue { background: rgba(5,150,105,.15); color: #0d5a2e; border-color: rgba(5,150,105,.28); font-weight: 800; }
.status-parcial { background: rgba(217,119,6,.15); color: #6b3200; border-color: rgba(217,119,6,.28); font-weight: 800; }
.status-ausente, .status-pendente { background: rgba(220,38,38,.10); color: #8b1a1a; border-color: rgba(220,38,38,.22); font-weight: 800; }

.route-card {
  background: var(--surface);
  border: 1px solid rgba(30,58,95,.14);
  border-left: 3px solid var(--accent);
}
.route-metrics { flex-wrap: wrap; margin-bottom: 16px; }
.route-metric {
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.route-order { display: grid; gap: 10px; }
.route-item, .list-row, .insight-row {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}
.list-row strong, .insight-row strong {
  display: block;
  margin-bottom: 4px;
}
.insight-row .meta {
  color: var(--muted);
  font-size: 13px;
}

.delivery-card { gap: 12px; }
.delivery-head { justify-content: space-between; align-items: start; }
.delivery-head h3 {
  margin: 6px 0;
  font-size: 19px;
}
.delivery-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.delivery-meta {
  color: var(--muted);
  font-size: 14px;
  display: grid;
  gap: 6px;
}
.inline-file { display: grid; gap: 8px; }

.check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}
.check-grid label {
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.check-grid input {
  width: auto;
  margin-right: 8px;
}

.dashboard-stack { margin-top: 20px; }

/* === V3 Dashboard density: container constrained Linear/Vercel-style ===
   App-shell era 1440px (largo demais em monitor 4K/ultrawide).
   Linear usa ~1200, Vercel ~1280, Cluely ~1024. Apertando aqui. */
body.dashboard-body .app-shell-dashboard {
  width: min(1280px, calc(100% - 32px));
  margin-inline: auto;
}
@media (max-width: 767px) {
  body.dashboard-body .app-shell-dashboard {
    width: calc(100% - 16px);
  }
}
.table-like { display: grid; gap: 10px; }
.csv-note {
  color: var(--muted);
  font-size: 13px;
}

.alert-card {
  border-left: 3px solid var(--warning);
}
.alert-card.danger { border-left-color: var(--danger); }
.alert-card.success { border-left-color: var(--success); }

.timeline {
  display: grid;
  gap: 10px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 12px;
  align-items: start;
}
.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  margin-top: 6px;
}
.timeline-content {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.timeline-content strong { display: block; margin-bottom: 4px; }
.timeline-content small { color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--accent-light);
  color: var(--accent-2);
  border: 1px solid rgba(30,58,95,.14);
}
.kpi-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

@media (max-width: 1180px) {
  .auth-card-split {
    grid-template-columns: 1fr;
  }
  .auth-split-left {
    padding: 32px 28px 24px;
    border-radius: 0;
  }
  .auth-split-left::before, .auth-split-left::after { display: none; }
  .auth-split-right {
    border-left: none;
    border-top: 1px solid var(--line);
    padding: 28px;
  }
  .stats-grid-dashboard {
    grid-template-columns: repeat(3, 1fr);
  }
  .auth-features { grid-template-columns: 1fr 1fr; }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 980px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .auth-form .grid-2 { grid-template-columns: 1fr; }
  .topbar, .view-head { flex-direction: column; align-items: flex-start; }
  .brand-block { grid-template-columns: 1fr; }
  .auth-card { padding: 22px; }
  .auth-card-split { padding: 0; }
  .auth-split-right { padding: 22px; }
}

@media (max-width: 640px) {
  .main-grid, .stats-grid, .check-grid { grid-template-columns: 1fr; }
  .app-shell { width: calc(100% - 16px); }
  .topbar { padding: 14px; }
  .view-card, .card, .auth-card { padding: 16px; }
  .auth-card-split { padding: 0; }
  .auth-split-left { padding: 24px 18px 20px; }
  .auth-split-right { padding: 22px 18px; }
  .auth-features { grid-template-columns: 1fr; }
  .auth-plans-grid { grid-template-columns: 1fr; }
  .auth-plans-section { padding: 20px 16px; }
  .auth-page { padding: 16px 10px 28px; }
}

/* ─── DASHBOARD TABS ─────────────────────────────────────── */
.dashboard-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 5px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.tab-btn {
  padding: 7px 16px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  transition: background .15s, color .15s;
  letter-spacing: .01em;
}
.tab-btn:hover { background: var(--accent-light); color: var(--accent-2); }
.tab-btn.tab-active { background: var(--accent); color: #fff; }
.tab-panel { display: flex; flex-direction: column; gap: 18px; }
.tab-panel.hidden { display: none !important; }

/* ─── FINANCIAL / LOGISTICS STATS ───────────────────────── */
.stats-grid-financial,
.stats-grid-logistics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}

/* ─── LIST ROW DETAILED ──────────────────────────────────── */
.list-row-detailed { flex-direction: column; align-items: flex-start; gap: 6px; }
.list-row-detailed .list-row-title { display: flex; align-items: center; gap: 10px; width: 100%; }
.cost-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: .8rem;
  color: var(--muted);
}
.cost-breakdown span { white-space: nowrap; }
.text-accent { color: var(--accent); }

/* ─── DAY BAR CHART ──────────────────────────────────────── */
.day-bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 130px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: .82rem;
}
.day-bar-row:last-child { border-bottom: none; }
.day-bar-label { color: var(--muted); font-weight: 600; }
.day-bar-track {
  height: 8px;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
}
.day-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  transition: width .3s;
}
.day-bar-value { color: var(--text); font-weight: 600; text-align: right; }

/* ─── RESPONSIVE TABS ────────────────────────────────────── */
@media (max-width: 980px) {
  .stats-grid-financial,
  .stats-grid-logistics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .stats-grid-financial,
  .stats-grid-logistics { grid-template-columns: 1fr; }
  .day-bar-row { grid-template-columns: 90px 1fr 90px; }
}

/* ─── LIST ROW EXTRAS ────────────────────────────────────── */
.list-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.list-row-sub {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 2px;
}
.list-row-meta {
  font-size: .78rem;
  color: var(--muted);
}
.list-row-danger {
  border-left: 3px solid var(--danger);
}
.list-row-warning {
  border-left: 3px solid var(--warning);
}
.d-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─── BADGE VARIANTS ─────────────────────────────────────── */
.badge-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--accent-light);
  color: var(--accent-2);
  border: 1px solid rgba(30,58,95,.14);
}
.badge-danger {
  background: rgba(192,57,43,.08);
  color: #922b1e;
  border-color: rgba(192,57,43,.14);
}
.badge-warning {
  background: rgba(180,83,9,.09);
  color: #7c3a04;
  border-color: rgba(180,83,9,.15);
}
.badge-success {
  background: var(--accent-light);
  color: var(--accent-2);
  border-color: rgba(30,58,95,.16);
}

/* ─── VEHICLE HISTORY CARD ───────────────────────────────── */
.vehicle-history-card {
  margin-bottom: 12px;
}
.vehicle-history-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.vehicle-history-header .muted {
  color: var(--muted);
  font-size: .875rem;
}
.vehicle-history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.vstat {
  flex: 1 1 80px;
  min-width: 80px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  text-align: center;
}
.vstat span {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.vstat small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 600;
}
.vstat-danger {
  background: rgba(220,38,38,.08);
  border-color: rgba(220,38,38,.14);
}
.vstat-danger span { color: var(--danger); }
.vstat-warning {
  background: rgba(217,119,6,.08);
  border-color: rgba(217,119,6,.14);
}
.vstat-warning span { color: var(--warning); }

@media (max-width: 640px) {
  .vehicle-history-stats { gap: 8px; }
  .vstat { min-width: 68px; padding: 8px 10px; }
}

/* ─── Alerts Dropdown ────────────────────────────── */
.alerts-badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px; display: flex;
  align-items: center; justify-content: center;
  padding: 0 4px; line-height: 1;
}
.alerts-dropdown {
  position: absolute; top: 56px; right: 12px;
  width: 360px; max-height: 420px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 1000; overflow: hidden;
  display: flex; flex-direction: column;
}
.alerts-dropdown-header {
  display: flex; justify-content: space-between;
  align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.alerts-list {
  overflow-y: auto; flex: 1; padding: 8px;
  max-height: 360px;
}
.alert-item {
  padding: 10px 12px; border-radius: var(--radius-xs);
  margin-bottom: 4px; cursor: pointer;
  transition: background .15s;
  border-left: 3px solid var(--info);
}
.alert-item:hover { background: var(--accent-light); }
.alert-item.severity-warning { border-left-color: var(--warning); }
.alert-item.severity-critical { border-left-color: var(--danger); }
.alert-item-title { font-weight: 600; font-size: 13px; }
.alert-item-message { font-size: 12px; color: var(--muted); margin-top: 2px; }
.alert-item-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.alert-item.read { opacity: .6; }
body.dashboard-body .alerts-dropdown {
  background: rgba(16,16,32,.95);
  border-color: rgba(255,255,255,.1);
}
body.dashboard-body .alerts-dropdown-header {
  border-bottom-color: rgba(255,255,255,.1);
  color: #fff;
}
body.dashboard-body .alert-item:hover { background: rgba(255,255,255,.05); }
body.dashboard-body .alert-item-message { color: rgba(255,255,255,.5); }
body.dashboard-body .alert-item-time { color: rgba(255,255,255,.4); }

/* ─── Dark Mode ──────────────────────────────────── */
[data-theme="dark"] {
  --bg: #12161e;
  --bg-2: #1a2030;
  --panel: rgba(26,32,48,.98);
  --panel-soft: rgba(26,32,48,.88);
  --surface: #1a2030;
  --surface-2: #222838;
  --text: #e8eaed;
  --text-secondary: #9aa0b0;
  --muted: #7a8194;
  --muted-2: #9aa0b0;
  --line: rgba(255,255,255,.06);
  --line-strong: rgba(255,255,255,.12);
  --accent: #5b8abf;
  --accent-2: #7aa3d4;
  --accent-light: rgba(91,138,191,.1);
  --accent-hover: rgba(91,138,191,.15);
  --cta: #f39c12;
  --cta-hover: #e67e22;
  --cta-light: rgba(243,156,18,.1);
  --success: #34d399;
  --success-light: rgba(52,211,153,.1);
  --warning: #fbbf24;
  --warning-light: rgba(251,191,36,.1);
  --danger: #f87171;
  --danger-light: rgba(248,113,113,.08);
  --info: #60a5fa;
  --info-light: rgba(96,165,250,.08);
  --shadow: 0 1px 3px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.15);
  --shadow-soft: 0 1px 2px rgba(0,0,0,.15);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.25), 0 20px 40px rgba(0,0,0,.2);
  color-scheme: dark;
}
[data-theme="dark"] body,
[data-theme="dark"] { background: var(--bg); color: var(--text); }
[data-theme="dark"] .glass { background: var(--surface); }
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--surface-2);
  border-color: var(--line-strong);
  color: var(--text);
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: var(--muted); }
[data-theme="dark"] .btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
[data-theme="dark"] .btn-ghost:hover { background: var(--surface-2); color: var(--text); }
[data-theme="dark"] .btn-secondary { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
[data-theme="dark"] .btn-secondary:hover { background: rgba(255,255,255,.08); }
[data-theme="dark"] .stat-card { background: var(--surface); }
[data-theme="dark"] .message-box { background: var(--surface-2); }
[data-theme="dark"] .view-card { background: var(--surface); }
[data-theme="dark"] .card { background: var(--surface); }
[data-theme="dark"] .card.soft { background: var(--surface-2); }
[data-theme="dark"] .topbar { background: var(--surface); }
[data-theme="dark"] .auth-card { background: var(--surface); }
[data-theme="dark"] .auth-split-right { background: var(--surface-2); }
[data-theme="dark"] .empty-state { color: var(--muted); }
[data-theme="dark"] .eyebrow { color: var(--accent); }
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3 { color: var(--text); }
[data-theme="dark"] .list-row { border-color: var(--line); }
[data-theme="dark"] .list-row:hover { background: var(--surface-2); }
[data-theme="dark"] .tab-btn { color: var(--muted); background: transparent; }
[data-theme="dark"] .tab-btn.tab-active { color: var(--accent); border-color: var(--accent); }
[data-theme="dark"] .alerts-dropdown { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .alerts-dropdown-header { border-color: var(--line); color: var(--text); }
[data-theme="dark"] .alert-item:hover { background: var(--surface-2); }

/* Dark mode toggle button */
.theme-toggle {
  background: transparent; border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 6px 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.theme-toggle svg { display: block; }
.theme-toggle:hover { background: var(--surface-2); }

/* ─── Micro-interactions & Feedback ──────────────── */

/* Loading spinner */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.spinner-center {
  display: flex; justify-content: center; align-items: center;
  padding: 24px; width: 100%;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
  min-height: 16px;
}
.skeleton-text { height: 14px; margin-bottom: 8px; width: 80%; }
.skeleton-title { height: 20px; margin-bottom: 10px; width: 60%; }
.skeleton-card { height: 80px; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Toast notifications */
.toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 10000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  animation: toastIn .3s ease;
  max-width: 380px;
  transition: all .3s ease;
}
.toast.toast-out { animation: toastOut .3s ease forwards; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--info); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* Button loading state */
.btn.loading { position: relative; color: transparent; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute;
  left: 50%; top: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.btn-secondary.loading::after,
.btn-ghost.loading::after {
  border-color: var(--line-strong);
  border-top-color: var(--accent);
}

/* Success checkmark animation */
.success-check {
  display: inline-flex; width: 24px; height: 24px;
  align-items: center; justify-content: center;
  background: var(--success); color: #fff;
  border-radius: 50%; font-size: 14px;
  animation: popIn .3s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes popIn { 0% { transform: scale(0); } 100% { transform: scale(1); } }

/* Fade transitions */
.fade-in { animation: fadeIn .2s ease; }
.fade-out { animation: fadeOut .2s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* Slide transitions */
.slide-up { animation: slideUp .25s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* List row hover effect */
.list-row {
  transition: background var(--transition), transform var(--transition);
  border-radius: var(--radius-xs);
}
.list-row:hover {
  background: var(--accent-light);
}

/* Card hover lift */
.card-elevated:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  transition: all var(--transition);
}

/* Input focus glow */
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* Status pill animations */
.status-pill {
  transition: all var(--transition);
}

/* Progress bar */
.progress-bar {
  height: 6px; border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 3px;
  background: var(--accent);
  transition: width .5s ease;
}

/* Pulse for attention */
.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

/* Auth Pricing Section */
.auth-pricing { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.auth-pricing-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.auth-pricing-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; }
.auth-trial-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(30,58,95,.1);
  color: var(--accent);
  border: 1px solid rgba(30,58,95,.18);
}
.auth-plans-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.auth-plan-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 12px;
  position: relative;
  transition: border-color .2s, box-shadow .2s;
}
.auth-plan-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(30,58,95,.1);
}
.auth-plan-card.auth-plan-highlight {
  border-color: var(--accent);
  background: rgba(30,58,95,.04);
  box-shadow: 0 2px 12px rgba(30,58,95,.1);
}
.auth-plan-badge {
  position: absolute;
  top: -8px;
  right: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}
.auth-plan-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-plan-price { font-size: 18px; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.auth-plan-price span { font-size: 11px; font-weight: 400; color: var(--muted); }
.auth-plan-card ul { list-style: none; padding: 0; margin: 0; }
.auth-plan-card li {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 2px 0;
}
.auth-plan-card li::before { content: '\2713  '; color: var(--accent); font-weight: 700; }
.auth-pricing-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.auth-pricing-link:hover { text-decoration: underline; }

/* Accessibility */
:focus-visible {
  outline: 3px solid rgba(30,58,95,.3);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(30,58,95,.3);
  outline-offset: 2px;
}

/* PWA splash and onboarding */
@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #15294a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .5s;
}

.splash-logo {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  margin-bottom: 20px;
  animation: splashPulse 1.5s infinite;
}

.splash-title {
  color: #fff;
  font-family: Manrope, sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.splash-subtitle {
  color: rgba(255,255,255,.5);
  font-size: 13px;
  margin-top: 6px;
}

.onboarding-screen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: #15294a;
  overflow-y: auto;
}
.onboarding-screen.hidden {
  pointer-events: none;
}

.onboarding-shell {
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: Manrope, sans-serif;
  color: #fff;
}

.onboarding-logo {
  width: 80px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.onboarding-title {
  margin: 0 0 8px;
}

.onboarding-copy {
  color: rgba(255,255,255,.6);
  margin-bottom: 24px;
}

.onboarding-copy-compact {
  margin-bottom: 16px;
}

.onboarding-permissions-card {
  background: rgba(255,255,255,.05);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.onboarding-permission-item {
  margin-bottom: 12px;
}

.onboarding-permission-copy {
  color: rgba(255,255,255,.5);
}

.onboarding-skip-btn {
  margin-top: 8px;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
}

.onboarding-dot.active {
  background: #e67e22;
}

/* Romaneio view: nunca usa display:none para que o Leaflet consiga medir o container.
   position:fixed + left:-9999px mantém o elemento no fluxo de renderização do browser
   (clientWidth/clientHeight são calculados) mas invisível ao usuário. */
#view-romaneio.hidden {
  display: block !important;
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  width: 100vw !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* App inline-style replacements */
.route-map-panel {
  height: 420px;
  border-radius: 12px;
  background: #15294a;
}

.map-actions-hidden,
.history-replay-hidden,
.delivery-card-message-hidden {
  display: none;
}

.history-replay-map {
  height: 380px;
  border-radius: 12px;
  background: #15294a;
}

.maintenance-filters,
.maintenance-stats-bar {
  margin-bottom: 16px;
}

.maintenance-modal-card {
  max-width: 520px;
}

/* ─── Landing page link-as-button ─── */
a.btn-cta, a.btn-outline, a.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: var(--radius-xs);
  padding: 11px 22px;
  font-weight: 800;
  font-size: .875rem;
  letter-spacing: .015em;
  transition: all .15s;
}
a.btn-cta {
  color: #fff;
  background: linear-gradient(135deg, #f08030 0%, #d46010 100%);
  border: 1px solid var(--cta-hover);
  box-shadow: 0 2px 10px rgba(224,113,24,.30), 0 1px 3px rgba(224,113,24,.18);
}
a.btn-cta:hover {
  background: linear-gradient(135deg, #e87025 0%, #c45608 100%);
  box-shadow: 0 5px 20px rgba(224,113,24,.40), 0 2px 6px rgba(224,113,24,.22);
  transform: translateY(-2px);
  color: #fff;
}
a.btn-outline {
  color: var(--accent);
  background: transparent;
  border: 1.5px solid rgba(30,58,95,.28);
}
a.btn-outline:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-2);
  transform: translateY(-1px);
}

/* Landing page */
.landing-page {
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.landing-page .nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  box-shadow: 0 1px 8px rgba(0,0,0,.04);
}

.landing-page .nav-inner,
.landing-page .hero,
.landing-page .section,
.landing-page .footer {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.landing-page .nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-page .nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
}

.landing-page .nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.landing-page .nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.landing-page .nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color .15s;
}

.landing-page .nav-links a:hover {
  color: var(--text);
}

.landing-page .hero {
  padding-top: 96px;
  padding-bottom: 72px;
  text-align: center;
  background:
    radial-gradient(ellipse at 20% 40%, rgba(30,58,95,.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 10%, rgba(224,113,24,.06) 0%, transparent 45%);
}

.landing-page .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(30,58,95,.08);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  border-radius: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(30,58,95,.14);
  letter-spacing: .02em;
}
.landing-page .hero-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cta);
  animation: hero-badge-pulse 2s ease-in-out infinite;
}
@keyframes hero-badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(1.4); }
}
@media (prefers-reduced-motion: reduce) {
  .landing-page .hero-badge::before { animation: none; }
}

.landing-page .hero h1 {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.035em;
  margin-bottom: 24px;
  color: var(--text);
}

.landing-page .hero h1 span {
  color: var(--cta);
  background: linear-gradient(135deg, var(--cta) 0%, var(--cta-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-page .hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.landing-page .hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-page .section {
  padding-top: 60px;
  padding-bottom: 60px;
}

.landing-page .section-header {
  text-align: center;
  margin-bottom: 48px;
}

.landing-page .section-header h2 {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.landing-page .section-header p {
  color: var(--muted);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto;
}

.landing-page .features-grid,
.landing-page .pricing-grid,
.landing-page .testimonials-grid {
  display: grid;
  gap: 20px;
}

.landing-page .features-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.landing-page .pricing-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.landing-page .testimonials-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.landing-page .feature-card,
.landing-page .price-card,
.landing-page .testimonial-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.landing-page .feature-card {
  padding: 28px 24px;
  transition: transform .2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow .2s cubic-bezier(0.4, 0, 0.2, 1), border-color .2s ease;
  position: relative;
}
.landing-page .feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  border-color: rgba(30,58,95,.18);
}
@media (prefers-reduced-motion: reduce) {
  .landing-page .feature-card { transition: none; }
  .landing-page .feature-card:hover { transform: none; }
}

.landing-page .feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(30,58,95,.12) 0%, rgba(30,58,95,.06) 100%);
  border: 1px solid rgba(30,58,95,.14);
  color: var(--accent);
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(30,58,95,.08);
}

/* Variant tints for category-coded cards. Breaks the "all icons identical"
   AI-generated look while keeping coherence with the brand palette. */
.landing-page .feature-card:nth-child(2) .feature-icon {
  background: linear-gradient(135deg, rgba(224,113,24,.14) 0%, rgba(224,113,24,.06) 100%);
  border-color: rgba(224,113,24,.18);
  color: var(--cta);
}
.landing-page .feature-card:nth-child(5) .feature-icon {
  background: linear-gradient(135deg, rgba(5,150,105,.14) 0%, rgba(5,150,105,.06) 100%);
  border-color: rgba(5,150,105,.18);
  color: var(--success);
}
.landing-page .feature-card:nth-child(8) .feature-icon {
  background: linear-gradient(135deg, rgba(217,119,6,.14) 0%, rgba(217,119,6,.06) 100%);
  border-color: rgba(217,119,6,.18);
  color: var(--warning);
}

.landing-page .feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -.01em;
  line-height: 1.3;
}

.landing-page .feature-card p {
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
}

.landing-page .stats-row {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  text-align: center;
  padding: 40px 0;
}

.landing-page .stat-block strong {
  display: block;
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.landing-page .stat-block span,
.landing-page .testimonial-role,
.landing-page .footer {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Keyboard focus indicators — WCAG 2.2 AA: 3:1 contrast vs adjacent + ≥2px outline */
.landing-page a:focus-visible,
.landing-page .feature-card:focus-visible,
.landing-page .price-card:focus-visible {
  outline: 2px solid var(--cta);
  outline-offset: 3px;
  border-radius: 8px;
}
.landing-page .btn-cta:focus-visible,
.landing-page .btn-outline:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.landing-page .price-card {
  padding: 32px;
  position: relative;
}

.landing-page .price-card.featured {
  border-color: var(--accent);
  background: linear-gradient(160deg, rgba(30,58,95,.03) 0%, rgba(30,58,95,.01) 100%);
  box-shadow: 0 0 0 1.5px var(--accent), 0 8px 32px rgba(30,58,95,.12);
}

.landing-page .price-card.featured::before {
  content: 'MAIS POPULAR';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 12px;
  letter-spacing: .05em;
}

.landing-page .price-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.landing-page .price {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 4px;
}

.landing-page .price small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.landing-page .price-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

.landing-page .price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.landing-page .price-features li {
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.landing-page .price-features li::before {
  content: '\2713';
  color: var(--accent);
  font-weight: 700;
}

.landing-page .testimonial-card {
  padding: 24px;
}

.landing-page .testimonial-card blockquote {
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 16px;
  font-style: italic;
  color: var(--muted);
}

.landing-page .testimonial-author {
  font-size: 13px;
  font-weight: 700;
}

.landing-page .cta-section {
  text-align: center;
  padding: 60px 24px;
  background: linear-gradient(135deg, rgba(30,58,95,.06), rgba(30,58,95,.02));
  border-radius: 12px;
  margin: 40px auto;
  max-width: 1120px;
}

.landing-page .cta-section h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 12px;
}

.landing-page .cta-section p {
  color: var(--muted);
  margin-bottom: 24px;
}

.landing-page .footer {
  padding-top: 40px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}

.landing-btn-block {
  width: 100%;
  display: block;
  text-align: center;
}

/* Print */
@media print {
  .admin-topbar,
  .admin-sidebar,
  .actions-inline,
  .btn,
  .btn-ghost,
  .btn-icon,
  .detail-overlay,
  .loading-overlay,
  .toast-stack {
    display: none !important;
  }

  body,
  .app-shell,
  .dashboard-shell,
  .admin-shell {
    background: #fff !important;
    box-shadow: none !important;
  }
}

/* Z-index hierarchy */
.modal-overlay { z-index: 1200; }
.modal-card { z-index: 1210; }
.detail-overlay { z-index: 1300; }
.detail-panel { z-index: 1310; }
.loading-overlay { z-index: 1400; }
.toast-stack { z-index: 1500; }

@media (max-width: 768px) {
  .landing-page .nav-links { display: none; }
  .landing-page .hero h1 { font-size: 28px; }
  .landing-page .features-grid,
  .landing-page .pricing-grid,
  .landing-page .testimonials-grid { grid-template-columns: 1fr; }
  .landing-page .stats-row { grid-template-columns: repeat(2, 1fr); }

  /* ─── App tablet rules ─────────────────────── */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-dashboard { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-financial,
  .stats-grid-logistics { grid-template-columns: repeat(2, 1fr); }
  .route-metrics { gap: 8px; }
  .route-metric { flex: 1 1 calc(50% - 8px); min-width: 120px; }
  .delivery-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .delivery-meta { font-size: 13px; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ── D4: Micro-interações em inputs ─────────────── */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea, select {
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,58,95,.10);
}

/* ── D9: Topbar compacta no mobile ──────────────── */
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .topbar .brand-inline small { display: none; }
}

/* ── Offline Banner ─────────────────────────────── */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9500;
  background: #7c3a04; color: #fff;
  padding: 9px 16px;
  text-align: center;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  animation: slideDown .25s ease;
  letter-spacing: .01em;
}
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* Trial Banner */
.trial-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: linear-gradient(90deg, rgba(230,126,34,.15), rgba(230,126,34,.08));
  border: 1px solid rgba(230,126,34,.3);
  border-radius: 10px; padding: 10px 16px; margin-bottom: 12px;
  font-size: 13px; color: #e67e22;
}
.trial-banner-cta {
  background: #e67e22; color: #fff; border-radius: 6px; padding: 5px 14px;
  font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background .15s;
}
.trial-banner-cta:hover { background: #cf6d17; }
.trial-banner.trial-urgent { border-color: rgba(255,107,129,.4); background: linear-gradient(90deg, rgba(255,107,129,.15), rgba(255,107,129,.08)); color: #ff6b81; }
.trial-banner.trial-urgent .trial-banner-cta { background: #ff6b81; }

/* Trial Expired Modal */
.trial-expired-modal {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(0,0,0,.65); display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.trial-expired-modal.hidden { display: none; }
.trial-expired-card {
  max-width: 400px; width: 100%; padding: 32px; border-radius: 16px;
  text-align: center; background: var(--bg-card, #1a2d4a);
}
.trial-expired-card h2 { margin: 0 0 12px; font-size: 20px; }
.trial-expired-card p { color: rgba(255,255,255,.6); margin: 0 0 24px; font-size: 14px; }

/* ── Driver Mode ─────────────────────────────────── */
.role-motorista .nav-gestor,
.role-motorista .nav-admin,
.role-motorista .sidebar-section-label:nth-of-type(n+2) { display: none; }
.role-motorista .sidebar { max-width: 0; padding: 0; overflow: hidden; border: none; }
.role-motorista .content-stack { margin-left: 0; }

/* Driver Hero Card */
.driver-hero {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(30,58,95,.6) 100%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-bottom: 16px;
}
.driver-hero-greeting { font-size: 14px; color: var(--muted); margin: 0 0 4px; }
.driver-hero-count { font-size: 28px; font-weight: 800; margin: 0 0 16px; letter-spacing: -.025em; }
.driver-hero-count strong { color: var(--cta); }
.driver-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Driver delivery cards (Track 1 redesign) ───────────────────────────
   Variants by status: pending (default, neutral), active (em rota, accent),
   at-risk (não entregue / parcial / devolvido, danger). Pill in the head row
   labels the state in plain words. Touch-friendly 44px button targets.
   ───────────────────────────────────────────────────────────────────── */

.driver-delivery-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong, var(--line));
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.driver-delivery-card:hover {
  border-color: rgba(72, 194, 255, .35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .04);
}
.driver-delivery-card:active {
  transform: scale(.985);
}
.driver-delivery-card:focus-visible {
  outline: 2px solid var(--accent, #1e3a5f);
  outline-offset: 2px;
}

/* Status accent on the left rail — quick-glance signal even before reading. */
.driver-delivery-card--pending  { border-left-color: rgba(148, 163, 184, .55); }
.driver-delivery-card--active   { border-left-color: #2563eb; }
.driver-delivery-card--at-risk  { border-left-color: #dc2626; }

.driver-delivery-card--at-risk {
  background: linear-gradient(90deg, rgba(220,38,38,.04) 0%, var(--surface) 30%);
}

.driver-delivery-seq {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(72, 194, 255, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent, #1e3a5f);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.driver-delivery-card--at-risk .driver-delivery-seq {
  background: rgba(220, 38, 38, .12);
  color: #b91c1c;
}
.driver-delivery-card--active .driver-delivery-seq {
  background: rgba(37, 99, 235, .14);
  color: #1d4ed8;
}

.driver-delivery-info { flex: 1; min-width: 0; }

.driver-delivery-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.driver-delivery-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.driver-delivery-addr {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.driver-delivery-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  flex-shrink: 0;
  white-space: nowrap;
}
.driver-delivery-pill--pending {
  background: rgba(148, 163, 184, .18);
  color: #475569;
}
.driver-delivery-pill--active {
  background: rgba(37, 99, 235, .15);
  color: #1d4ed8;
  position: relative;
  padding-left: 16px;
}
.driver-delivery-pill--active::before {
  content: '';
  position: absolute;
  left: 7px; top: 50%;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #1d4ed8;
  transform: translateY(-50%);
  animation: driver-pill-pulse 1.6s ease-in-out infinite;
}
.driver-delivery-pill--at-risk {
  background: rgba(220, 38, 38, .14);
  color: #b91c1c;
}

@keyframes driver-pill-pulse {
  0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
  50%      { opacity: .55; transform: translateY(-50%) scale(1.4); }
}

.driver-delivery-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.driver-delivery-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  font-size: 12.5px;
  min-height: 36px;
  font-weight: 600;
}

/* Dark-mode tone overrides — make accents readable on the darker surface. */
@media (prefers-color-scheme: dark) {
  .driver-delivery-card:hover {
    border-color: rgba(122, 174, 207, .35);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .25);
  }
  .driver-delivery-card--at-risk {
    background: linear-gradient(90deg, rgba(248,113,113,.08) 0%, var(--surface) 30%);
  }
  .driver-delivery-card--at-risk .driver-delivery-seq {
    background: rgba(248, 113, 113, .18);
    color: #fca5a5;
  }
  .driver-delivery-card--active .driver-delivery-seq {
    background: rgba(96, 165, 250, .18);
    color: #93c5fd;
  }
  .driver-delivery-pill--pending {
    background: rgba(148, 163, 184, .18);
    color: #cbd5e1;
  }
  .driver-delivery-pill--active {
    background: rgba(96, 165, 250, .2);
    color: #93c5fd;
  }
  .driver-delivery-pill--active::before { background: #93c5fd; }
  .driver-delivery-pill--at-risk {
    background: rgba(248, 113, 113, .18);
    color: #fca5a5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .driver-delivery-card { transition: none; }
  .driver-delivery-card:active { transform: none; }
  .driver-delivery-pill--active::before { animation: none; }
}

/* ── Driver empty state (illustrated) ─────────────────────────────── */
.driver-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 16px 24px;
  color: var(--muted, #64748b);
}
.driver-empty-art {
  color: var(--accent, #1e3a5f);
  opacity: .65;
  margin-bottom: 12px;
}
.driver-empty-art .driver-empty-spark { opacity: .8; }
.driver-empty-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #1a2540);
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.driver-empty-sub {
  font-size: 13px;
  margin: 0 0 18px;
  max-width: 28ch;
  line-height: 1.5;
}
.driver-empty-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
@media (prefers-color-scheme: dark) {
  .driver-empty-art { color: #7aaecf; opacity: .7; }
}

/* Mobile bottom nav — driver gets 3 tabs only */
.role-motorista .bottom-nav .nav-gestor { display: none; }

@media (max-width: 768px) {
  .role-motorista .sidebar { display: none; }
}

/* ── Driver-to-auth-user binding badges (drivers list) ── */
.driver-bind-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.driver-bind-badge.bound {
  background: rgba(5, 150, 105, .12);
  color: #047857;
  border-color: rgba(5, 150, 105, .3);
}
.driver-bind-badge.unbound {
  background: transparent;
  color: var(--muted, #6b7280);
  border-color: var(--line, rgba(0,0,0,.12));
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.driver-bind-badge.unbound:hover {
  background: rgba(30, 58, 95, .06);
  color: var(--primary, #1e3a5f);
  border-color: rgba(30, 58, 95, .3);
}
.driver-bind-badge svg { flex-shrink: 0; }
.driver-bind-action {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0 0 0 4px;
  margin-left: 2px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
  opacity: .6;
  transition: opacity .12s ease;
}
.driver-bind-action:hover { opacity: 1; }

@media (prefers-color-scheme: dark) {
  .driver-bind-badge.bound {
    background: rgba(16, 185, 129, .15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, .35);
  }
}

/* ── Dashboard executive painel: stat-card variants + skeletons + freshness pill ── */
/* Track 2 — substitui o `style="color:#xxxxxx"` inline pelas tonalidades semânticas. */

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  min-width: 0;
}
.stat-card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

/* Tone variants — color the value, keep the rest neutral. */
.stat-card--info    .stat-card-value { color: #1d4ed8; }
.stat-card--success .stat-card-value { color: #059669; }
.stat-card--warning .stat-card-value { color: #d97706; }
.stat-card--danger  .stat-card-value { color: #dc2626; }
.stat-card--teal    .stat-card-value { color: #0f766e; }

@media (prefers-color-scheme: dark) {
  .stat-card--info    .stat-card-value { color: #93c5fd; }
  .stat-card--success .stat-card-value { color: #6ee7b7; }
  .stat-card--warning .stat-card-value { color: #fcd34d; }
  .stat-card--danger  .stat-card-value { color: #fca5a5; }
  .stat-card--teal    .stat-card-value { color: #5eead4; }
}

/* Skeleton placeholder for the stat-card grid during the first fetch. */
.stat-card--skeleton { pointer-events: none; }
.stat-skeleton-line {
  display: block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(0,0,0,.06) 0%,
    rgba(0,0,0,.12) 50%,
    rgba(0,0,0,.06) 100%
  );
  background-size: 200% 100%;
  animation: stat-skeleton-shimmer 1.4s ease-in-out infinite;
}
.stat-skeleton-line--label { width: 60%; height: 12px; }
.stat-skeleton-line--value { width: 40%; height: 22px; }
@media (prefers-color-scheme: dark) {
  .stat-skeleton-line {
    background: linear-gradient(
      90deg,
      rgba(255,255,255,.06) 0%,
      rgba(255,255,255,.12) 50%,
      rgba(255,255,255,.06) 100%
    );
    background-size: 200% 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .stat-skeleton-line { animation: none; }
}
@keyframes stat-skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Freshness pill — Linear-style "live" dot + relative time. */
.freshness-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(5, 150, 105, .1);
  color: #047857;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(5, 150, 105, .2);
  white-space: nowrap;
  letter-spacing: .01em;
  transition: background .2s, color .2s, border-color .2s;
}
.freshness-pill .freshness-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  animation: freshness-pulse 2s ease-in-out infinite;
}
.freshness-pill--refreshing {
  background: rgba(29, 78, 216, .1);
  color: #1d4ed8;
  border-color: rgba(29, 78, 216, .25);
}
.freshness-pill--refreshing .freshness-dot { background: #1d4ed8; }
.freshness-pill--error {
  background: rgba(220, 38, 38, .1);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, .25);
}
.freshness-pill--error .freshness-dot { background: #dc2626; animation: none; }
.freshness-pill--stale {
  background: rgba(217, 119, 6, .1);
  color: #a16207;
  border-color: rgba(217, 119, 6, .25);
}
.freshness-pill--stale .freshness-dot { background: #d97706; }

@media (prefers-color-scheme: dark) {
  .freshness-pill {
    background: rgba(16, 185, 129, .15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, .3);
  }
  .freshness-pill--refreshing {
    background: rgba(96, 165, 250, .15);
    color: #93c5fd;
    border-color: rgba(96, 165, 250, .3);
  }
  .freshness-pill--refreshing .freshness-dot { background: #60a5fa; }
  .freshness-pill--error {
    background: rgba(248, 113, 113, .15);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, .3);
  }
  .freshness-pill--error .freshness-dot { background: #f87171; }
  .freshness-pill--stale {
    background: rgba(251, 191, 36, .15);
    color: #fcd34d;
    border-color: rgba(251, 191, 36, .3);
  }
  .freshness-pill--stale .freshness-dot { background: #fbbf24; }
}

@media (prefers-reduced-motion: reduce) {
  .freshness-pill .freshness-dot { animation: none; }
}

@keyframes freshness-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .55; transform: scale(1.18); }
}

/* ── Section icon variants (Track 3 — replaces inline `style="background:rgba(...);color:#..."` in account.html) ── */
.section-icon--brand    { background: var(--accent-light);     color: var(--accent); }
.section-icon--info     { background: var(--info-sky-light);   color: var(--info-sky); }
.section-icon--purple   { background: var(--purple-light);     color: var(--purple); }
.section-icon--warning  { background: var(--amber-light);      color: var(--amber); }
.section-icon--whatsapp { background: var(--whatsapp-light);   color: var(--whatsapp); }

/* Danger outline button — for destructive secondary actions (e.g. "Cancelar assinatura"). */
.btn--danger-outline {
  color: var(--danger);
  border-color: rgba(220, 38, 38, .3);
}
.btn--danger-outline:hover {
  background: var(--danger-light);
  border-color: rgba(220, 38, 38, .5);
}

/* ── Fleet Live (gestor) — mapa em tempo real + lista lateral de motoristas ── */
.view-card-fleet-live {
  padding: 16px 18px;
}
.fleet-live-head {
  margin-bottom: 14px;
  align-items: flex-start;
}
.fleet-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  margin-left: 8px;
  border-radius: 999px;
  background: rgba(5, 150, 105, .12);
  color: #047857;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
  border: 1px solid rgba(5, 150, 105, .25);
}
.fleet-live-pill .fleet-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  animation: fleet-pulse 1.6s ease-in-out infinite;
}
.fleet-live-pill.is-error {
  background: rgba(220, 38, 38, .12);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, .25);
}
.fleet-live-pill.is-error .fleet-live-dot { background: #dc2626; animation: none; }
.fleet-live-pill.is-stale {
  background: rgba(217, 119, 6, .12);
  color: #a16207;
  border-color: rgba(217, 119, 6, .25);
}
.fleet-live-pill.is-stale .fleet-live-dot { background: #d97706; }
.fleet-live-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@keyframes fleet-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .55; transform: scale(1.35); }
}

.fleet-live-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 14px;
  height: calc(100vh - 220px);
  min-height: 480px;
}
.fleet-live-map-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.fleet-live-map {
  height: 100%;
  width: 100%;
  background: var(--surface-2);
}
.fleet-live-map .leaflet-container {
  height: 100%;
  width: 100%;
  background: var(--surface-2);
  font-family: inherit;
}

.fleet-live-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fleet-live-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.fleet-live-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s ease, transform .12s ease;
  margin-bottom: 4px;
  border: 1px solid transparent;
}
.fleet-live-row:hover { background: var(--accent-light); }
.fleet-live-row:active { transform: scale(.985); }
.fleet-live-row.is-active {
  background: var(--accent-light);
  border-color: rgba(30, 58, 95, .25);
}

.fleet-live-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  position: relative;
}
.fleet-live-avatar::after {
  content: "";
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid var(--surface);
}
.fleet-live-row.is-stale .fleet-live-avatar::after { background: #d97706; }
.fleet-live-row.is-offline .fleet-live-avatar::after { background: #94a3b8; }

.fleet-live-info {
  flex: 1;
  min-width: 0;
}
.fleet-live-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fleet-live-meta {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fleet-live-empty {
  text-align: center;
  padding: 32px 12px;
  color: var(--muted);
}
.fleet-live-empty-art {
  color: var(--accent);
  opacity: .55;
  margin-bottom: 12px;
}
.fleet-live-empty-text {
  font-size: 13px;
  margin: 0;
}

/* Custom Leaflet pin (fleet-specific — same family as the /t/<TOKEN> driver pin
   but smaller and with the initials inside instead of a generic truck icon). */
.fleet-pin {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  background: var(--accent, #1e3a5f);
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
  border: 3px solid #fff;
  position: relative;
}
.fleet-pin-text {
  transform: rotate(45deg);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.01em;
  font-family: inherit;
}
.fleet-pin.is-stale { background: #d97706; }
.fleet-pin.is-offline { background: #64748b; }

@media (prefers-color-scheme: dark) {
  .fleet-live-pill {
    background: rgba(16, 185, 129, .15);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, .3);
  }
  .fleet-live-row:hover,
  .fleet-live-row.is-active {
    background: rgba(122, 174, 207, .08);
    border-color: rgba(122, 174, 207, .25);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fleet-live-pill .fleet-live-dot { animation: none; }
}

@media (max-width: 880px) {
  .fleet-live-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .fleet-live-map-wrap { height: 380px; }
  .fleet-live-sidebar { max-height: 360px; }
}

/* ── W2.B: empty state diferenciado + mobile scroll hint ── */

/* Empty state with title + hint + optional CTA (renderFleetLiveList branches). */
.fleet-live-empty-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.fleet-live-empty-text {
  font-size: 12.5px;
  margin: 0 0 12px;
  line-height: 1.4;
  max-width: 24ch;
}
.fleet-live-empty-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}

/* Subtle gradient at the bottom of the sidebar list to hint there's more
   content below the fold (only when content actually overflows). Uses
   `position: sticky` on a pseudo so it follows the scroll container. */
.fleet-live-sidebar {
  position: relative;
}
.fleet-live-sidebar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 28px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, var(--surface) 90%);
  opacity: 0;
  transition: opacity .2s ease;
}
.fleet-live-sidebar.has-overflow::after {
  opacity: 1;
}

/* =========================================================================
   LANDING REDESIGN V2 — Direção A "Operação Concreta"
   Refs: Stripe (asymmetric hero + product preview), Linear (one-metric proof,
   pricing scale), Vercel (bento grid w/ phase narrative).
   ========================================================================= */

/* ── HERO 60/40 ASYMÉTRICO ── */

.landing-page .hero-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}

.landing-page .hero {
  text-align: left;
  padding-top: 80px;
  padding-bottom: 96px;
  overflow: hidden;
}

.landing-page .hero-copy {
  max-width: 540px;
}

.landing-page .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  margin-bottom: 28px;
  border: 1px solid var(--line-strong);
  letter-spacing: .01em;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.landing-page .hero-badge .hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 0 0 3px rgba(224,113,24,.18);
  animation: hero-badge-pulse 2.4s ease-in-out infinite;
}
.landing-page .hero-badge::before { display: none; } /* override pass 1 */
@keyframes hero-badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(1.4); }
}
@media (prefers-reduced-motion: reduce) {
  .landing-page .hero-badge .hero-badge-dot { animation: none; }
}

.landing-page .hero h1 {
  font-size: clamp(34px, 4.4vw, 60px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.038em;
  margin-bottom: 20px;
  color: var(--text);
}
.landing-page .hero h1 .hero-h1-em {
  display: block;
  color: var(--muted-2);
  font-weight: 600;
  letter-spacing: -.025em;
  margin-top: 4px;
}

.landing-page .hero p {
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted-2);
  margin: 0 0 32px;
  max-width: 520px;
}

.landing-page .hero-actions {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Secondary CTA agora é link sublinhado, não botão concorrente. */
.landing-page .hero-link-secondary {
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-bottom: 1.5px solid var(--line-strong);
  padding-bottom: 2px;
  transition: border-color .15s ease, color .15s ease;
}
.landing-page .hero-link-secondary:hover {
  color: var(--cta);
  border-bottom-color: var(--cta);
}

.landing-page .hero-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}
.landing-page .hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}
.landing-page .hero-trust-item svg {
  color: var(--success);
  flex-shrink: 0;
}

/* ── HERO MOCKUP — produto à direita ── */

.landing-page .hero-mockup {
  position: relative;
  perspective: 2000px;
}
.landing-page .hero-mockup-frame {
  background: linear-gradient(180deg, #fefefe 0%, #f4f5f9 100%);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow:
    0 1px 0 rgba(255,255,255,.5) inset,
    0 1px 2px rgba(15,30,60,.06),
    0 8px 16px rgba(15,30,60,.08),
    0 32px 64px -16px rgba(15,30,60,.18);
  overflow: hidden;
  transform: rotateY(-2deg) rotateX(2deg);
  transition: transform .4s cubic-bezier(0.4, 0, 0.2, 1);
}
.landing-page .hero-mockup-frame:hover {
  transform: rotateY(0) rotateX(0);
}
@media (prefers-reduced-motion: reduce) {
  .landing-page .hero-mockup-frame {
    transform: none;
    transition: none;
  }
}

.landing-page .hero-mockup-topbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(245,246,250,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.landing-page .hero-mockup-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #d1d5db;
}
.landing-page .hero-mockup-dot:nth-child(1) { background: #ef4444; }
.landing-page .hero-mockup-dot:nth-child(2) { background: #f59e0b; }
.landing-page .hero-mockup-dot:nth-child(3) { background: #10b981; }
.landing-page .hero-mockup-url {
  margin-left: 8px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11.5px;
  color: var(--muted);
}

.landing-page .hero-mockup-body {
  padding: 16px;
  display: grid;
  gap: 14px;
}

.landing-page .hero-mockup-stats {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
}
.landing-page .hero-mockup-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.landing-page .hero-mockup-stat--accent {
  background: linear-gradient(135deg, rgba(5,150,105,.10) 0%, rgba(5,150,105,.02) 100%);
  border-color: rgba(5,150,105,.25);
}
.landing-page .hero-mockup-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}
.landing-page .hero-mockup-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}
.landing-page .hero-mockup-stat-value small {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 2px;
}
.landing-page .hero-mockup-stat-trend {
  font-size: 11px;
  font-weight: 700;
  color: var(--success);
}

.landing-page .hero-mockup-map {
  position: relative;
  height: 200px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8f9fc 0%, #eef0f6 100%);
  border: 1px solid var(--line);
  overflow: hidden;
}
.landing-page .hero-mockup-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.landing-page .hero-mockup-route {
  animation: hero-route-draw 2.6s ease-out .4s forwards;
}
@keyframes hero-route-draw {
  to { stroke-dashoffset: 0; }
}
.landing-page .hero-mockup-truck {
  animation: hero-truck-ride 2.6s ease-out .4s forwards;
  transform-origin: center;
}
@keyframes hero-truck-ride {
  0% { opacity: 0; transform: translate(50px, 145px) scale(.5); }
  60% { opacity: 0; }
  100% { opacity: 1; transform: translate(185px, 75px) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .landing-page .hero-mockup-route { animation: none; stroke-dashoffset: 0; }
  .landing-page .hero-mockup-truck { animation: none; opacity: 1; }
}

.landing-page .hero-mockup-map-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(15,30,60,.08);
}
.landing-page .hero-mockup-map-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cta);
  box-shadow: 0 0 0 3px rgba(224,113,24,.20);
  animation: hero-badge-pulse 1.6s ease-in-out infinite;
}

.landing-page .hero-mockup-glow {
  position: absolute;
  inset: -10% -10% -20% -10%;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(224,113,24,.18) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 60%, rgba(30,58,95,.16) 0%, transparent 55%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

@media (max-width: 960px) {
  .landing-page .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .landing-page .hero { text-align: left; padding-top: 64px; padding-bottom: 72px; }
  .landing-page .hero-mockup-frame { transform: none; }
  .landing-page .hero-mockup-body { padding: 12px; }
}

/* ── PROOF STRIP — única, em vez de stats-row 4 col ── */

.landing-page .proof-strip {
  background: var(--accent);
  color: #fff;
  padding: 28px 24px;
  margin-top: 0;
  border-top: 1px solid rgba(255,255,255,.08);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.landing-page .proof-strip-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.landing-page .proof-headline {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.landing-page .proof-headline strong {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,.92);
  letter-spacing: -.005em;
}
.landing-page .proof-headline span {
  font-size: 14px;
  color: rgba(255,255,255,.72);
}
.landing-page .proof-headline em {
  color: var(--cta);
  font-style: normal;
  font-weight: 700;
}
.landing-page .proof-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.landing-page .proof-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.10);
  letter-spacing: .01em;
}

/* ── FEATURES BENTO — 3 fases narrativas ── */

.landing-page .features-bento {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 960px) {
  .landing-page .features-bento { grid-template-columns: 1fr; gap: 40px; }
}

.landing-page .features-phase {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.landing-page .features-phase-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.landing-page .features-phase-num {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 10px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.landing-page .features-phase-num--cta { color: var(--cta); background: rgba(224,113,24,.12); }
.landing-page .features-phase-num--success { color: var(--success); background: rgba(5,150,105,.12); }
.landing-page .features-phase-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--text);
  margin: 0;
}

.landing-page .feature-card--anchor {
  padding: 28px 24px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.landing-page .feature-card--anchor h4 {
  font-size: 18px;
  font-weight: 800;
  margin: 16px 0 8px;
  letter-spacing: -.015em;
  color: var(--text);
}
.landing-page .feature-card--anchor p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted-2);
  margin: 0;
}
.landing-page .feature-card--anchor .feature-icon {
  width: 44px;
  height: 44px;
  margin: 0;
}

.landing-page .feature-card--brand .feature-icon {
  background: linear-gradient(135deg, rgba(30,58,95,.14) 0%, rgba(30,58,95,.06) 100%);
  border-color: rgba(30,58,95,.18);
  color: var(--accent);
}
.landing-page .feature-card--cta {
  border-color: rgba(224,113,24,.25);
  background: linear-gradient(180deg, rgba(224,113,24,.04) 0%, var(--surface) 80%);
}
.landing-page .feature-card--cta .feature-icon {
  background: linear-gradient(135deg, rgba(224,113,24,.16) 0%, rgba(224,113,24,.06) 100%);
  border-color: rgba(224,113,24,.22);
  color: var(--cta);
}
.landing-page .feature-card--success .feature-icon {
  background: linear-gradient(135deg, rgba(5,150,105,.14) 0%, rgba(5,150,105,.06) 100%);
  border-color: rgba(5,150,105,.18);
  color: var(--success);
}

.landing-page .feature-card--mini {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .2s cubic-bezier(0.4, 0, 0.2, 1);
}
.landing-page .feature-card--mini:hover {
  border-color: var(--line-strong);
}
.landing-page .feature-card--mini .feature-card-eyebrow {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.landing-page .feature-card--mini h4 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.005em;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.3;
}
.landing-page .feature-card--mini p {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted-2);
  margin: 0;
}


/* =========================================================================
   LANDING V3 — Trust BR + Eyebrows + Stats counter + Calc + Pricing toggle
   + Dark Mode (View Transitions API)
   Refs: Linear (eyebrow numerado, toggle), Stripe (stats density),
   Vercel (radial section dividers), Sascar/TruckPad (trust bar BR).
   ========================================================================= */

/* ── Eyebrow numerado (Linear/Stripe/Vercel pattern) ── */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 700 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--cta);
  margin-bottom: 16px;
}
.eyebrow-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(224,113,24,.12);
  color: var(--cta);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.eyebrow--inline { margin-bottom: 24px; }

/* Section radial divider (Vercel-style) */
.landing-page .section { position: relative; }
.landing-page .section + .section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(60%, 600px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(30,58,95,.18), transparent);
}

/* ── Theme toggle button no nav ── */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s cubic-bezier(.4,0,.2,1), border-color .15s, background .15s;
}
.theme-toggle:hover { border-color: var(--cta); transform: rotate(15deg); }
.theme-toggle:focus-visible { outline: 2px solid var(--cta); outline-offset: 3px; }
.theme-toggle .theme-toggle-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-toggle-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-toggle-moon { display: inline-block; }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle:hover { transform: none; }
}

/* ── Hero calc (Onda 2) ── */
.landing-page .hero-calc {
  margin-top: 28px;
  background:
    linear-gradient(135deg, rgba(30,58,95,.05) 0%, rgba(224,113,24,.04) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 18px 20px;
  max-width: 540px;
  box-shadow: 0 1px 2px rgba(0,0,0,.02), 0 4px 16px rgba(15,30,60,.04);
}
.hero-calc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.hero-calc-eyebrow {
  font: 700 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-calc-disclaimer {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.hero-calc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 540px) {
  .hero-calc-row { grid-template-columns: 1fr; }
}
.hero-calc-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hcc-label {
  font: 600 12px/1 Manrope, sans-serif;
  color: var(--muted-2);
  text-transform: none;
  letter-spacing: .01em;
}
.hcc-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hcc-input-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--cta);
  height: 4px;
}
.hcc-value {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--accent);
  min-width: 3ch;
  font-size: 16px;
  text-align: right;
}
.hero-calc-out {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}
.hco-main {
  font-size: 15px;
  color: var(--muted-2);
  font-weight: 500;
}
.hco-main strong {
  font-size: 26px;
  color: var(--accent);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  transition: color .2s ease;
  margin: 0 4px;
}
.hco-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.hco-sub em {
  color: var(--cta);
  font-style: normal;
  font-weight: 700;
}

/* ── Stats counter scroll-trigger (Onda 4) ── */
.proof-stats {
  padding: 64px 24px;
  background: var(--surface-2);
  position: relative;
}
.proof-stats-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.proof-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line-strong);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
}
.ps-cell {
  background: var(--surface);
  padding: 28px 20px;
  text-align: center;
}
.ps-num {
  display: block;
  font: 800 36px/1 Manrope, sans-serif;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  margin-bottom: 8px;
}
.ps-label {
  font: 600 12px/1.3 Manrope, sans-serif;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  display: block;
}
@media (max-width: 720px) {
  .proof-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .ps-num { font-size: 30px; }
}

/* ── Testimonial metrics (Onda 4 — métrica embutida) ── */
.testimonial-metrics {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(5,150,105,.08) 0%, rgba(5,150,105,.02) 100%);
  border: 1px solid rgba(5,150,105,.20);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted-2);
}
.testimonial-metrics .tm-num {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--success);
  font-size: 15px;
  letter-spacing: -.005em;
}
.testimonial-metrics .tm-label {
  font-weight: 500;
  margin-right: 4px;
}
.testimonial-metrics .tm-sep {
  color: var(--line-strong);
  margin: 0 2px;
}

/* ── Pricing toggle anual/mensal (Onda 5) ── */
.pricing-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin-top: 24px;
  position: relative;
}
.pt-btn {
  border: 0;
  background: transparent;
  padding: 9px 18px;
  border-radius: 999px;
  font: 700 13.5px Manrope, sans-serif;
  color: var(--muted-2);
  cursor: pointer;
  transition: all .25s cubic-bezier(.4,0,.2,1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pt-btn.is-active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(30,58,95,.10);
  transform: scale(1.02);
}
.pt-save {
  background: rgba(5,150,105,.14);
  color: var(--success);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 800;
  letter-spacing: .02em;
}

/* Badge "Mais escolhido" pulsando no plano featured */
.landing-page .price-card.featured { position: relative; }
.badge-popular {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cta);
  color: #fff;
  font: 800 11px/1 Manrope, sans-serif;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: .07em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: badge-popular-pulse 2.6s ease-in-out infinite;
  box-shadow: 0 4px 12px rgba(224,113,24,.25);
}
@keyframes badge-popular-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(224,113,24,.25), 0 0 0 0 rgba(224,113,24,.5); }
  50% { box-shadow: 0 4px 12px rgba(224,113,24,.25), 0 0 0 12px rgba(224,113,24,0); }
}
@media (prefers-reduced-motion: reduce) {
  .badge-popular { animation: none; }
  .pt-btn.is-active { transform: none; }
}

/* ── DARK MODE (Onda 6) ── */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --bg-2: #0f1729;
  --panel: rgba(15,23,41,.96);
  --panel-soft: rgba(15,23,41,.85);
  --surface: #111a2c;
  --surface-2: #0d1424;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --muted-2: #b4bdcc;
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.14);
  --accent: #93c5fd;
  --accent-2: #60a5fa;
  --accent-light: rgba(147,197,253,.10);
  --accent-hover: rgba(147,197,253,.16);
  --cta: #ff8c3b;
  --cta-hover: #ff7a1f;
  --cta-light: rgba(255,140,59,.14);
  --success: #6ee7b7;
  --success-light: rgba(110,231,183,.12);
  --warning: #fcd34d;
  --warning-light: rgba(252,211,77,.12);
  --danger: #fca5a5;
  --danger-light: rgba(252,165,165,.12);
  --info: #93c5fd;
  --info-light: rgba(147,197,253,.10);
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 28px rgba(0,0,0,.5);
}

:root[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}
:root[data-theme="dark"] .landing-page .nav {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
:root[data-theme="dark"] .landing-page .feature-card,
:root[data-theme="dark"] .landing-page .price-card,
:root[data-theme="dark"] .landing-page .testimonial-card {
  background: var(--surface);
  border-color: var(--line);
}
:root[data-theme="dark"] .landing-page .hero-mockup-frame {
  background: linear-gradient(180deg, #1a2236 0%, #0f1729 100%);
  border-color: var(--line-strong);
}
:root[data-theme="dark"] .landing-page .hero-mockup-topbar {
  background: rgba(13,20,36,.92);
  border-bottom-color: var(--line);
}
:root[data-theme="dark"] .landing-page .hero-mockup-stat,
:root[data-theme="dark"] .landing-page .hero-mockup-map {
  background: var(--surface-2);
  border-color: var(--line);
}
:root[data-theme="dark"] .landing-page .hero-mockup-map-pill {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line-strong);
}
:root[data-theme="dark"] .landing-page .hero-mockup-route { stroke: url(#route-grad); }
:root[data-theme="dark"] .landing-page .hero-mockup-stat--accent {
  background: linear-gradient(135deg, rgba(110,231,183,.12) 0%, rgba(110,231,183,.04) 100%);
  border-color: rgba(110,231,183,.25);
}

/* View Transitions API — root crossfade smooth */
@supports (view-transition-name: root) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 360ms;
    animation-timing-function: cubic-bezier(.4,0,.2,1);
  }
  ::view-transition-old(root) { animation-name: vt-fade-out; }
  ::view-transition-new(root) { animation-name: vt-fade-in; }
  @keyframes vt-fade-out { to { opacity: 0; } }
  @keyframes vt-fade-in { from { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}


/* =========================================================================
   ROI tab — Stripe/Linear-grade redesign
   Refs: design-critique-case-studies (Stripe Reports composition),
   ui-visual-design-system (typography stack Linear), interaction-motion-design
   (cubic-ease counter), performance-states-patterns (skeleton + drawer).
   ========================================================================= */
:root {
  --roi-radius: 14px;
  --roi-radius-sm: 8px;
  --roi-ease: cubic-bezier(.4,0,.2,1);
  --roi-ease-out: cubic-bezier(.16,1,.3,1);
  --roi-line-soft: color-mix(in oklab, var(--text) 7%, transparent);
  --roi-line-hard: color-mix(in oklab, var(--text) 13%, transparent);
  --roi-surface-raise: color-mix(in oklab, var(--surface) 96%, var(--text) 4%);
  --roi-success-soft: color-mix(in oklab, var(--success) 12%, transparent);

  /* === V3 alpha hierarchy (Cluely-inspired) — adaptive light/dark === */
  --t-95: color-mix(in oklab, var(--text) 95%, transparent);
  --t-76: color-mix(in oklab, var(--text) 76%, transparent);
  --t-55: color-mix(in oklab, var(--text) 55%, transparent);
  --t-37: color-mix(in oklab, var(--text) 37%, transparent);
  --t-15: color-mix(in oklab, var(--text) 15%, transparent);
  --t-05: color-mix(in oklab, var(--text) 5%, transparent);
}

/* === V3 motion primitives — Cluely-inspired === */
@keyframes rt-stagger-in {
  from { opacity: 0; filter: blur(6px); translate: 0 14px; }
  to   { opacity: 1; filter: blur(0);   translate: 0 0;    }
}
[class*="rt-fade-"] {
  animation: rt-stagger-in .6s var(--roi-ease-out) both;
}
.rt-fade-1 { animation-delay: 0ms;   }
.rt-fade-2 { animation-delay: 160ms; }
.rt-fade-3 { animation-delay: 320ms; }
.rt-fade-4 { animation-delay: 480ms; }
.rt-fade-5 { animation-delay: 640ms; }

/* Triple-layered inset glow (Cluely's claude-pulse → success token) */
@keyframes rt-state-pulse {
  0%, 100% {
    box-shadow:
      color-mix(in oklab, var(--success) 50%, transparent) 0 0 10px inset,
      color-mix(in oklab, var(--success) 30%, transparent) 0 0 20px inset;
  }
  50% {
    box-shadow:
      color-mix(in oklab, var(--success) 70%, transparent) 0 0 15px inset,
      color-mix(in oklab, var(--success) 50%, transparent) 0 0 25px inset;
  }
}
.rt-pulse { animation: rt-state-pulse 2.4s ease-in-out infinite; }

/* New timeline row glow on realtime insert */
[data-is-new="true"] {
  animation: rt-state-pulse 1.5s ease-in-out 1;
}

@media (prefers-reduced-motion: reduce) {
  [class*="rt-fade-"] { animation: none; opacity: 1; filter: none; translate: 0; }
  .rt-pulse { animation: none; }
  [data-is-new="true"] { animation: none; }
  .stat-card[data-flash="true"] { animation: none; }
}

/* === V3 Overview (Visão Geral) — Cluely-inspired === */
.overview-hero {
  padding: 22px 0 4px;
  margin-bottom: 28px;
}
/* Ambient gradient removido — colorido (--accent) ficava como "blob bugado"
   atrás dos 8 cards. ROI hero mantém o gradient porque lá é 1 número grande
   verde + sparkline = glow faz sentido. Visão Geral é informação distribuída
   e o glow só atrapalhava. */
.overview-eyebrow {
  font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--t-55);
  display: inline-block; margin-bottom: 14px;
}

.overview-section { margin-bottom: 36px; }
.overview-section-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--t-05);
}
.overview-section-num {
  font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .12em; color: var(--t-37);
  font-feature-settings: 'tnum';
}
.overview-section-title {
  font: 500 15px/1.3 Manrope, sans-serif;
  letter-spacing: -.012em;
  color: var(--t-95); margin: 0; flex: 1;
}

/* Clean view-card variant (substitui .glass.card-elevated em overview) */
.view-card--clean {
  background: var(--surface);
  border: 1px solid var(--t-05);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex; flex-direction: column;
  box-shadow: inset 0 1px 0 0 color-mix(in oklab, var(--text) 3%, transparent);
  transition: border-color .22s var(--roi-ease);
}
.view-card--clean:hover { border-color: var(--t-15); }
.view-card-eyebrow {
  font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--t-55);
  display: block; margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--t-05);
}
.view-card--clean .list-row {
  border: 0;
  border-top: 1px solid var(--t-05);
  padding: 10px 0;
  background: transparent;
  border-radius: 0;
}
.view-card--clean .list-row:first-child { border-top: 0; padding-top: 0; }
.view-card--clean .list-row:last-child { padding-bottom: 0; }
.view-card--clean .list-row-title strong { color: var(--t-95); font-weight: 500; font-family: Manrope, ui-sans-serif, system-ui, sans-serif; }
.view-card--clean .list-row-sub { color: var(--t-55); font-weight: 500; font-family: Manrope, ui-sans-serif, system-ui, sans-serif; }
.view-card--clean .list-row-meta { color: var(--t-37); font-family: 'JetBrains Mono', ui-monospace, monospace; }
.view-card--clean .empty-state {
  color: var(--t-55); font-weight: 500;
  padding: 24px 0; text-align: center;
}

/* Status pill V3 override — no chunky border, no uppercase, alpha-tinted */
.view-card--clean .status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: color-mix(in oklab, currentColor 10%, transparent);
  border: 0;
  border-radius: 6px;
  padding: 3px 9px;
  font: 500 11.5px/1.3 Manrope, ui-sans-serif, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}
.view-card--clean .status-pill::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.view-card--clean .status-pendente { color: var(--warning); }
.view-card--clean .status-entregue { color: var(--success); }
.view-card--clean .status-parcial { color: var(--t-55); }
.view-card--clean .status-nao_entregue,
.view-card--clean .status-devolvido { color: var(--danger); }

/* List row V3 — flat hierarchy (anti-cardocalypse) */
.view-card-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--t-05);
  font-family: Manrope, ui-sans-serif, system-ui, sans-serif;
}
.view-card-row:first-child { border-top: 0; padding-top: 4px; }
.view-card-row:last-child { padding-bottom: 0; }
.view-card-row-main {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0; flex: 1;
}
.view-card-row-title {
  color: var(--t-95);
  font: 500 13.5px/1.3 Manrope, ui-sans-serif, sans-serif;
}
.view-card-row-sub {
  color: var(--t-55);
  font: 500 12.5px/1.4 Manrope, ui-sans-serif, sans-serif;
}
.view-card-row-sub strong {
  color: var(--t-95);
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.view-card-row-time {
  color: var(--t-37);
  font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .04em;
  flex-shrink: 0; margin-left: 12px;
  white-space: nowrap;
}
.view-card-row-value {
  color: var(--t-95);
  font: 600 14px/1 Manrope, ui-sans-serif, sans-serif;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0; margin-left: 12px;
}
.view-card-row-value--success { color: var(--success); }
.view-card-row-value--warning { color: var(--warning); }
.view-card-row-value--danger { color: var(--danger); }

/* Status row: pill na esquerda + value na direita, ambos width fit-content */
.view-card-row--status {
  align-items: center;
}
.view-card-row--status .status-pill {
  width: fit-content;
  flex: 0 0 auto;
}
.view-card-row--status .view-card-row-value {
  flex: 0 0 auto;
}

/* Filters collapsable */
.filters-collapsed {
  background: var(--surface);
  border: 1px solid var(--t-05);
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow: hidden;
}
.filters-summary {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; min-height: 48px;
  background: transparent; border: 0;
  font: 500 13px/1.3 Manrope, sans-serif;
  color: var(--t-76); cursor: pointer;
  transition: background .15s var(--roi-ease);
  text-align: left;
}
.filters-summary:hover { background: var(--t-05); }
.filters-summary-text {
  display: inline-flex; align-items: center; gap: 8px;
  flex-wrap: wrap; min-width: 0;
}
.filters-summary-period { color: var(--t-95); font-weight: 600; }
.filters-summary-divider { color: var(--t-37); }
/* Desktop: secondary wrapper é só inline group (vehicles + divider + drivers) */
.filters-summary-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--t-55);
}
.filters-summary-chevron {
  flex-shrink: 0; color: var(--t-37);
  transition: transform .2s var(--roi-ease);
}
.filters-summary[aria-expanded="true"] .filters-summary-chevron { transform: rotate(180deg); }
.filters-body {
  padding: 4px 18px 16px;
  border-top: 1px solid var(--t-05);
  animation: roi-collapse-in .24s var(--roi-ease-out);
}
.filters-body[hidden] { display: none; }

/* Tab badge $ no nav */
.tab-btn--accent { position: relative; font-weight: 800; }
.tab-btn--accent .tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 6px;
  background: linear-gradient(135deg, var(--cta) 0%, var(--cta-hover) 100%);
  color: #fff; font-size: 10px; font-weight: 800;
  margin-right: 6px; letter-spacing: -.02em; vertical-align: middle;
}

/* Header */
.roi-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 22px; margin-bottom: 36px; flex-wrap: wrap;
}
.roi-header-text { min-width: 0; flex: 1 1 320px; }
.roi-eyebrow {
  font: 600 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted-2); display: inline-block; margin-bottom: 10px;
}
.roi-eyebrow::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--success);
  margin-right: 8px; vertical-align: 1px;
}
.roi-title {
  font-size: clamp(22px, 2.3vw, 28px);
  font-weight: 700; letter-spacing: -.022em;
  margin: 0 0 6px; color: var(--text);
}
.roi-subtitle {
  font-size: 13.5px; font-weight: 500;
  color: var(--muted-2); max-width: 56ch;
  line-height: 1.5; margin: 0;
}
.roi-period-toggle {
  display: inline-flex; background: var(--roi-surface-raise);
  border: 1px solid var(--roi-line-soft); border-radius: 999px; padding: 3px;
}
.roi-pt-btn {
  border: 0; background: transparent; padding: 7px 13px; border-radius: 999px;
  font: 600 12.5px/1 Manrope, sans-serif; color: var(--muted-2);
  cursor: pointer; transition: color .18s var(--roi-ease), background .18s var(--roi-ease);
}
.roi-pt-btn:hover { color: var(--text); }
.roi-pt-btn.is-active {
  background: var(--surface); color: var(--text); font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 0 0 1px var(--roi-line-hard);
}

/* Hero unificado — V3 com ambient gradient Cluely-inspired */
.roi-hero {
  display: grid; grid-template-columns: 1fr auto;
  align-items: stretch; gap: 14px;
  background: var(--surface); border: 1px solid var(--t-05);
  border-radius: 18px; padding: 32px 28px 26px;
  margin-bottom: 22px; position: relative; overflow: hidden;
  isolation: isolate;
}
.roi-hero::before {
  content: ''; position: absolute;
  inset: -40px -20px auto -20px; height: 280px;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 80% at 50% 20%,
    color-mix(in oklab, var(--success) 14%, transparent) 0%,
    transparent 70%);
  z-index: -1;
}
.roi-hero-primary { display: flex; flex-direction: column; gap: 14px; min-width: 0; position: relative; }
.roi-hero-label {
  font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .14em; text-transform: uppercase; color: var(--t-55);
}
.roi-hero-row { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; }
.roi-hero-value {
  font-size: clamp(40px, 5.6vw, 64px); font-weight: 800;
  color: var(--success); font-variant-numeric: tabular-nums;
  letter-spacing: -.035em; line-height: .95;
}
.roi-hero-spark {
  flex: 1 1 180px; height: 56px; max-width: 280px; min-width: 140px;
  align-self: flex-end; margin-bottom: 6px;
  color: var(--success); opacity: .9;
}
.roi-hero-spark .spark-area { fill: color-mix(in oklab, currentColor 14%, transparent); stroke: none; }
.roi-hero-spark .spark-line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.roi-hero-spark .spark-dot { fill: var(--surface); stroke: currentColor; stroke-width: 1.5; }
.roi-hero-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--t-05);
}
.roi-hero-foot-item { display: inline-flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--t-55); }
.roi-hero-foot-label { font-weight: 500; color: var(--t-55); }
.roi-hero-foot-value { font-weight: 700; color: var(--t-95); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.roi-hero-foot-divider { width: 3px; height: 3px; border-radius: 50%; background: var(--t-15); }
.roi-hero-foot-item--muted { color: var(--t-37); font-weight: 500; }
.roi-hero-settings {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--t-05); border-radius: 9999px;
  padding: 8px 14px; font: 500 12px/1 Manrope, sans-serif; color: var(--t-55);
  cursor: pointer; transition: color .18s var(--roi-ease), border-color .18s var(--roi-ease), transform .18s var(--roi-ease), background .18s var(--roi-ease);
  box-shadow: inset 0 1px 0 0 color-mix(in oklab, var(--text) 4%, transparent);
}
.roi-hero-settings:hover { color: var(--t-95); border-color: var(--t-15); transform: translateY(-1px); }
.roi-hero-settings[aria-expanded="true"] {
  color: var(--accent); border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, transparent);
}
@media (max-width: 720px) {
  .roi-hero { grid-template-columns: 1fr; padding: 22px 20px 20px; }
  .roi-hero-settings { justify-self: flex-start; }
}

/* Settings panel collapsable */
.roi-settings-panel {
  background: var(--roi-surface-raise);
  border: 1px solid var(--roi-line-soft);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 28px;
  animation: roi-collapse-in .24s var(--roi-ease-out); transform-origin: top;
}
.roi-settings-panel[hidden] { display: none; }
@keyframes roi-collapse-in { from { opacity: 0; transform: scaleY(.96) translateY(-4px); } to { opacity: 1; transform: scaleY(1) translateY(0); } }
.roi-settings-form {
  display: grid; grid-template-columns: repeat(3, 1fr) auto auto;
  gap: 10px 12px; align-items: end;
}
@media (max-width: 880px) {
  .roi-settings-form { grid-template-columns: 1fr 1fr; }
  .roi-settings-form .roi-save { grid-column: 1 / -1; }
}
.roi-setting {
  display: flex; flex-direction: column; gap: 5px;
  font: 600 11px/1.2 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted-2); min-width: 0;
}
.roi-setting input {
  background: var(--surface); border: 1px solid var(--roi-line-hard);
  border-radius: 8px; padding: 9px 11px;
  font: 600 14px Manrope, sans-serif; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  transition: border-color .18s var(--roi-ease), box-shadow .18s var(--roi-ease);
  width: 100%;
}
.roi-setting input:focus {
  outline: 0; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.roi-save {
  border: 0; background: var(--text); color: var(--bg-2);
  border-radius: 8px; padding: 10px 16px;
  font: 700 12.5px/1 Manrope, sans-serif; letter-spacing: .01em; cursor: pointer;
  transition: background .18s var(--roi-ease), transform .18s var(--roi-ease);
}
.roi-save:hover { background: var(--accent); transform: translateY(-1px); }
.roi-save-feedback {
  font: 700 12px 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .04em; color: var(--success); align-self: center;
  opacity: 0; transition: opacity .2s var(--roi-ease);
}
.roi-save-feedback:not(:empty) { opacity: 1; }

/* Sections — V3 Cluely-restraint */
.roi-section { margin-bottom: 36px; }
.roi-section-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--t-05);
}
.roi-section-num {
  font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .12em; color: var(--t-37);
  font-feature-settings: 'tnum';
}
.roi-section-title {
  font: 500 15px/1.3 Manrope, sans-serif; letter-spacing: -.012em;
  color: var(--t-95); margin: 0; flex: 1;
}
.roi-section-tag {
  font: 500 10.5px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--success); background: var(--roi-success-soft);
  padding: 4px 8px; border-radius: 4px;
}
.roi-section-tag--muted { color: var(--t-37); background: var(--t-05); }
.roi-section-tag--live {
  color: var(--success); background: var(--roi-success-soft);
  display: inline-flex; align-items: center; gap: 6px;
  position: relative;
}
.roi-pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--success) 60%, transparent);
  animation: roi-pulse 1.8s var(--roi-ease) infinite;
}
@keyframes roi-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--success) 60%, transparent); }
  70% { box-shadow: 0 0 0 6px color-mix(in oklab, var(--success) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--success) 0%, transparent); }
}
.roi-section-note {
  font-size: 13px; font-weight: 500; color: var(--t-55);
  line-height: 1.55; margin: 0 0 14px; max-width: 68ch;
}
.roi-section-note em { font-style: italic; color: var(--t-95); font-weight: 500; }

/* Cards section 01 — V3 alpha + subtle borders */
.roi-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .roi-cards { grid-template-columns: 1fr; } }
.roi-card {
  background: var(--surface); border: 1px solid var(--t-05);
  border-radius: var(--roi-radius); padding: 18px 20px 16px;
  display: flex; flex-direction: column; gap: 10px; position: relative;
  transition: transform .22s var(--roi-ease), box-shadow .22s var(--roi-ease), border-color .22s var(--roi-ease);
  box-shadow: inset 0 1px 0 0 color-mix(in oklab, var(--text) 3%, transparent);
}
.roi-card:hover {
  transform: translateY(-2px); border-color: var(--t-15);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -10px color-mix(in oklab, var(--text) 18%, transparent);
}
.roi-card-head { display: flex; align-items: center; gap: 8px; color: var(--t-55); }
.roi-card-glyph { width: 16px; height: 16px; flex-shrink: 0; color: var(--t-55); }
.roi-card[data-kind="fuel"] .roi-card-glyph { color: var(--accent); }
.roi-card[data-kind="maint"] .roi-card-glyph { color: var(--success); }
.roi-card-label {
  font: 500 12px/1.2 Manrope, sans-serif; letter-spacing: .01em;
  color: var(--t-55);
}
.roi-card-value {
  font-size: 32px; font-weight: 800; color: var(--t-95);
  font-variant-numeric: tabular-nums; letter-spacing: -.028em; line-height: 1;
}
.roi-card-meta { font-size: 12.5px; font-weight: 500; color: var(--t-55); line-height: 1.45; margin: 0; }
.roi-card-formula {
  background: transparent; border: 0; padding: 0; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 4px;
  font: 500 12px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .04em; color: var(--t-55);
  cursor: pointer; align-self: flex-start;
  transition: color .15s var(--roi-ease), gap .15s var(--roi-ease);
}
.roi-card-formula:hover { color: var(--t-95); gap: 6px; }
.roi-card-formula svg { transform: rotate(-90deg); transition: transform .15s var(--roi-ease); }
.roi-card-formula:hover svg { transform: rotate(0); }

/* Counts section 02 — V3 alpha */
.roi-counts {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface); border: 1px solid var(--t-05);
  border-radius: var(--roi-radius); overflow: hidden;
}
.roi-count {
  display: grid; grid-template-columns: 96px 1fr; gap: 18px;
  padding: 18px 22px; border-top: 1px solid var(--t-05);
  align-items: baseline;
}
.roi-count:first-child { border-top: 0; }
.roi-count-num {
  font-size: 28px; font-weight: 700; color: var(--t-95);
  font-variant-numeric: tabular-nums; letter-spacing: -.022em;
  line-height: 1; text-align: right;
}
.roi-count-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.roi-count-label { font: 500 13.5px/1.35 Manrope, sans-serif; color: var(--t-95); }
.roi-count-help { font-size: 12.5px; font-weight: 500; color: var(--t-55); line-height: 1.5; }
.roi-count-help em { font-style: italic; color: var(--t-37); }
.roi-count-help code {
  font: 500 11.5px 'JetBrains Mono', ui-monospace, monospace;
  background: var(--t-05); padding: 1px 5px;
  border-radius: 4px; color: var(--t-55);
}
@media (max-width: 540px) {
  .roi-count { grid-template-columns: 1fr; gap: 6px; }
  .roi-count-num { text-align: left; }
}

/* Timeline section 03 — V3 alpha */
.roi-timeline {
  background: var(--surface); border: 1px solid var(--t-05);
  border-radius: var(--roi-radius); overflow: hidden;
}
.roi-tl-group { border-top: 1px solid var(--t-05); }
.roi-tl-group:first-child { border-top: 0; }
.roi-tl-day-header {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: color-mix(in oklab, var(--surface) 92%, var(--text) 8%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--t-05);
  font: 500 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .14em; text-transform: uppercase; color: var(--t-37);
}
.roi-tl-day-header strong { color: var(--t-95); font-weight: 600; }
.roi-tl-day-count { margin-left: auto; color: var(--t-37); font-weight: 500; }
.roi-tl-row {
  display: grid; grid-template-columns: 16px 1fr auto 56px; gap: 14px;
  align-items: center; padding: 11px 18px 11px 22px;
  border-top: 1px solid var(--t-05);
  font-size: 13px; transition: background .15s var(--roi-ease);
}
.roi-tl-row:hover { background: var(--roi-surface-raise); }
.roi-tl-row[data-kind="delivery_documented"],
.roi-tl-row[data-kind="sla_kept"],
.roi-tl-row[data-kind="tracking_view"] { padding-left: 38px; }
.roi-tl-glyph { width: 14px; height: 14px; color: var(--t-37); }
.roi-tl-row[data-kind="fuel_saved_route"] .roi-tl-glyph { color: var(--accent); }
.roi-tl-row[data-kind="preventive_maintenance"] .roi-tl-glyph { color: var(--success); }
.roi-tl-label {
  color: var(--t-95); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.roi-tl-value {
  color: var(--success); font-weight: 700;
  font-variant-numeric: tabular-nums; font-size: 13.5px; letter-spacing: -.01em;
}
.roi-tl-value--muted { color: var(--t-55); font-weight: 500; }
.roi-tl-time {
  font-size: 11px; color: var(--t-37);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .04em; text-align: right;
  font-feature-settings: 'tnum';
}
.roi-timeline-empty {
  padding: 36px 24px; text-align: center;
  color: var(--t-55); font-size: 13px; font-weight: 500;
}

/* Drawer */
.roi-drawer {
  position: fixed; inset: 0; z-index: 80;
  display: flex; justify-content: flex-end;
}
.roi-drawer[hidden] { display: none; }
.roi-drawer-scrim {
  position: absolute; inset: 0;
  background: color-mix(in oklab, var(--text) 32%, transparent);
  animation: roi-fade-in .2s var(--roi-ease); cursor: pointer;
}
.roi-drawer-panel {
  position: relative; width: min(420px, 92vw); height: 100%;
  background: var(--surface); border-left: 1px solid var(--roi-line-hard);
  box-shadow: -16px 0 40px -16px rgba(0,0,0,.18);
  display: flex; flex-direction: column;
  animation: roi-slide-in .26s var(--roi-ease-out);
}
@keyframes roi-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes roi-slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.roi-drawer-head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--roi-line-soft);
  position: relative;
}
.roi-drawer-eyebrow {
  font: 600 11px/1 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted-2); display: block; margin-bottom: 8px;
}
.roi-drawer-title { font: 700 18px/1.3 Manrope, sans-serif; letter-spacing: -.018em; color: var(--text); margin: 0; }
.roi-drawer-close {
  position: absolute; top: 18px; right: 16px;
  width: 28px; height: 28px; border-radius: 6px;
  background: transparent; border: 0; color: var(--muted-2);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s var(--roi-ease), color .15s var(--roi-ease);
}
.roi-drawer-close:hover { background: var(--roi-surface-raise); color: var(--text); }
.roi-drawer-body {
  padding: 22px 24px 32px; overflow-y: auto;
  font-size: 13.5px; line-height: 1.6; color: var(--muted-2); font-weight: 500;
}
.roi-drawer-body p { margin: 0 0 14px; }
.roi-drawer-body strong { color: var(--text); font-weight: 700; }
.roi-drawer-body code {
  font: 600 12px 'JetBrains Mono', ui-monospace, monospace;
  background: var(--roi-surface-raise); padding: 2px 6px;
  border-radius: 4px; color: var(--text);
}
.roi-drawer-body .formula-block {
  background: var(--roi-surface-raise); border: 1px solid var(--roi-line-soft);
  border-radius: 8px; padding: 12px 14px; margin: 10px 0 16px;
  font: 600 12.5px/1.5 'JetBrains Mono', ui-monospace, monospace; color: var(--text);
}

/* Skeleton */
[data-loading="true"] [data-skeleton] {
  display: inline-block; color: transparent !important;
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--text) 6%, transparent) 0%,
    color-mix(in oklab, var(--text) 12%, transparent) 50%,
    color-mix(in oklab, var(--text) 6%, transparent) 100%);
  background-size: 200% 100%; border-radius: 4px;
  animation: roi-shimmer 1.4s var(--roi-ease) infinite;
  min-width: 80px;
}
[data-loading="true"] .roi-hero-value[data-skeleton] { min-width: 240px; height: 56px; }
[data-loading="true"] .roi-card-value[data-skeleton] { min-width: 140px; height: 32px; }
[data-loading="true"] .roi-count-num[data-skeleton] { min-width: 60px; height: 28px; }
[data-loading="true"] .roi-hero-foot-value[data-skeleton] { min-width: 38px; height: 13px; }
@keyframes roi-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .roi-pt-btn, .roi-card, .roi-tl-row, .roi-card-formula svg,
  .roi-hero-settings, .roi-save, .roi-drawer-close, .roi-setting input { transition: none; }
  .roi-pulse, [data-loading="true"] [data-skeleton] { animation: none; }
  .roi-drawer-panel, .roi-drawer-scrim, .roi-settings-panel { animation: none; }
  .roi-card:hover, .roi-hero-settings:hover, .roi-save:hover { transform: none; }
}

/* =========================================================================
   V3 Mobile breakpoints — Overview (Visão Geral)
   ========================================================================= */
@media (max-width: 767px) {
  /* === TOPBAR mobile: compact, single row, ícones-only === */
  .topbar-dashboard {
    padding: 10px 12px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .topbar-dashboard .brand-inline {
    flex: 1 1 auto; min-width: 0; gap: 8px;
  }
  .topbar-dashboard .brand-inline strong {
    font-size: 15px; line-height: 1.2; font-weight: 700;
    letter-spacing: -.015em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    display: block;
  }
  /* Drop "Dashboard " prefix em mobile, mostrar só "RotaCheck" */
  .topbar-dashboard .brand-inline strong { font-size: 0; }
  .topbar-dashboard .brand-inline strong::after {
    content: "RotaCheck";
    font-size: 15px;
    color: var(--text);
  }
  .topbar-dashboard .brand-inline small { display: none; }
  .topbar-dashboard .brand-logo-topbar { width: 30px; height: 30px; flex-shrink: 0; }
  .topbar-actions-app {
    flex: 0 0 auto;
    gap: 4px;
  }
  /* Override @media 980px que define min-height: 48px nos buttons */
  .topbar-dashboard .topbar-actions-app .btn,
  .topbar-dashboard .topbar-actions-app .theme-toggle {
    padding: 0;
    min-width: 34px; width: 34px;
    height: 34px; min-height: 34px;
    font-size: 0; /* hide text "Abrir app" / "Sair" — só ícone */
    font-weight: 500;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px;
  }
  .topbar-dashboard .topbar-actions-app .btn svg,
  .topbar-dashboard .topbar-actions-app .theme-toggle svg {
    width: 16px; height: 16px;
    flex-shrink: 0;
  }
  /* "Abrir app" e "Sair" não têm SVG no HTML — gerar via ::before */
  .topbar-dashboard .topbar-actions-app a[href="index.html"]::before {
    content: "";
    display: inline-block;
    width: 16px; height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/><polyline points='15 3 21 3 21 9'/><line x1='10' y1='14' x2='21' y2='3'/></svg>") center/contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/><polyline points='15 3 21 3 21 9'/><line x1='10' y1='14' x2='21' y2='3'/></svg>") center/contain no-repeat;
  }
  .topbar-dashboard .topbar-actions-app #btn-dashboard-logout::before {
    content: "";
    display: inline-block;
    width: 16px; height: 16px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><polyline points='16 17 21 12 16 7'/><line x1='21' y1='12' x2='9' y2='12'/></svg>") center/contain no-repeat;
    mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/><polyline points='16 17 21 12 16 7'/><line x1='21' y1='12' x2='9' y2='12'/></svg>") center/contain no-repeat;
  }

  /* === TABS row: scroll horizontal Linear/Vercel-style === */
  .dashboard-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px;
    gap: 2px;
    /* fade nos cantos pra sinalizar scroll disponível */
    mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 12px, black calc(100% - 12px), transparent 100%);
  }
  .dashboard-tabs::-webkit-scrollbar { display: none; }
  .dashboard-tabs .tab-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
  }

  /* === FILTERS summary mobile: grid 2-row Cluely-style ===
     Row 1: Período (esquerda) · ● há Xs (direita)
     Row 2: todos veículos · todos motoristas (full width, muted)
     Resultado: 2 linhas compactas ao invés de 4 linhas espalhadas. */
  .filters-summary { padding: 12px 14px; min-height: 40px; align-items: center; }
  .filters-summary-text {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    line-height: 1.3;
  }
  /* Dividers diretos do parent .filters-summary-text somem em mobile.
     O divider INTERNO (entre veículos+motoristas) permanece visível. */
  .filters-summary-text > .filters-summary-divider { display: none; }

  .filters-summary-period {
    grid-column: 1; grid-row: 1;
    font-size: 13.5px;
    color: var(--t-95);
    font-weight: 600;
    letter-spacing: -.005em;
  }
  .filters-summary-text .freshness-pill {
    grid-column: 2; grid-row: 1;
    font-size: 10.5px;
    padding: 2px 8px;
    justify-self: end;
  }
  .filters-summary-secondary {
    grid-column: 1 / -1; grid-row: 2;
    display: inline;
    font-size: 11.5px;
    color: var(--t-55);
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .filters-summary-divider--inner {
    display: inline;
    color: var(--t-37);
    margin: 0 6px;
  }
  .filters-summary-vehicles,
  .filters-summary-drivers {
    color: var(--t-55);
    display: inline;
  }

  /* Hero overview */
  .overview-hero { padding: 18px 0 2px; margin-bottom: 22px; }
  .overview-hero::before { inset: -16px -10px auto -10px; height: 180px; }
  .overview-eyebrow { font-size: 10.5px; margin-bottom: 12px; }

  /* Stats grid: 2-col em mobile (era 4) */
  .stats-grid-dashboard { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .stat-card { padding: 14px 14px 12px; gap: 4px; }
  .stat-card-label,
  .stat-card span { font-size: 11px; line-height: 1.25; }
  .stat-card-value,
  .stat-card strong { font-size: 26px; }

  /* Overview sections */
  .overview-section { margin-bottom: 26px; }
  .overview-section-title { font-size: 14px; }

  /* View cards — stack 1-col em mobile */
  .overview-section .grid-2 { grid-template-columns: 1fr; gap: 12px; }
  .view-card--clean { padding: 16px; }
  .view-card-eyebrow { font-size: 10.5px; }
}

/* =========================================================================
   V3 Mobile breakpoints — < 768px (ROI tab)
   Cluely-inspired bottom-sheet drawer + thumb-friendly touch targets
   ========================================================================= */
@media (max-width: 767px) {
  /* Header */
  .roi-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 24px;
  }
  .roi-header-text { flex: 1 1 auto; }
  .roi-title { font-size: 22px; }
  .roi-subtitle { font-size: 13px; }
  .roi-period-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
  }
  .roi-pt-btn {
    min-height: 44px;  /* WCAG touch target */
    font-size: 14px;
    padding: 0 8px;
  }

  /* Hero — stack everything vertical, full-width sparkline */
  .roi-hero {
    grid-template-columns: 1fr;
    padding: 26px 18px 22px;
    gap: 16px;
  }
  .roi-hero::before {
    inset: -30px -10px auto -10px;
    height: 220px;
  }
  .roi-hero-row {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .roi-hero-value {
    font-size: clamp(36px, 9vw, 48px);
  }
  .roi-hero-spark {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    height: 48px;
    align-self: stretch;
    margin-bottom: 0;
  }
  .roi-hero-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-top: 14px;
  }
  .roi-hero-foot-divider { display: none; }
  .roi-hero-settings {
    align-self: stretch;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
  }

  /* Settings panel — full width inputs, prevent iOS zoom */
  .roi-settings-form {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .roi-settings-form .roi-save { grid-column: 1; }
  .roi-setting input {
    font-size: 16px;  /* iOS won't zoom on focus if >= 16px */
    min-height: 44px;
    padding: 10px 14px;
  }
  .roi-save {
    min-height: 44px;
    font-size: 14px;
  }

  /* Section heads — compact */
  .roi-section { margin-bottom: 28px; }
  .roi-section-head {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }
  .roi-section-title { font-size: 15px; flex: 1 1 auto; }

  /* Cards (01·) — already stack from 720px, ensure padding */
  .roi-cards { gap: 12px; }
  .roi-card { padding: 18px 16px 16px; }
  .roi-card-value { font-size: 28px; }
  .roi-card-formula {
    min-height: 44px;
    align-self: stretch;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid var(--t-05);
    margin-top: 8px;
  }

  /* Counts (02·) — vertical stack with bigger touch */
  .roi-count {
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 16px;
    align-items: start;
  }
  .roi-count-num {
    text-align: left;
    font-size: 24px;
    min-width: 60px;
  }

  /* Timeline (03·) — 2-line stack: row 1 [glyph label time], row 2 [. value value] */
  .roi-tl-row {
    grid-template-columns: 16px 1fr auto;
    grid-template-areas:
      "glyph label time"
      ".     value value";
    gap: 4px 12px;
    padding: 12px 16px;
  }
  .roi-tl-row[data-kind="delivery_documented"],
  .roi-tl-row[data-kind="sla_kept"],
  .roi-tl-row[data-kind="tracking_view"] { padding-left: 16px; }
  .roi-tl-glyph { grid-area: glyph; align-self: start; margin-top: 4px; }
  .roi-tl-label {
    grid-area: label;
    white-space: normal;
    line-height: 1.35;
  }
  .roi-tl-value {
    grid-area: value;
    justify-self: end;
    font-size: 13px;
    margin-top: 2px;
  }
  .roi-tl-time {
    grid-area: time;
    align-self: start;
  }
  .roi-tl-day-header {
    padding: 10px 16px;
    font-size: 10.5px;
  }

  /* Drawer — bottom sheet style */
  .roi-drawer-panel {
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    height: 88vh;
    border-radius: 20px 20px 0 0;
    animation: rt-bottom-sheet-up .32s var(--roi-ease-out);
    padding-top: 28px;
  }
  .roi-drawer-panel::before {
    content: "";
    position: absolute;
    top: 10px; left: 50%;
    width: 40px; height: 4px;
    background: var(--t-15);
    border-radius: 2px;
    transform: translateX(-50%);
  }
  .roi-drawer-scrim { backdrop-filter: blur(4px); }
}
@keyframes rt-bottom-sheet-up {
  from { translate: 0 100%; opacity: .8; }
  to   { translate: 0 0;    opacity: 1;  }
}

/* === V3 Tablet — 768-1023px === */
@media (min-width: 768px) and (max-width: 1023px) {
  .roi-cards { grid-template-columns: 1fr 1fr; }
  .roi-counts { /* keep default */ }
  .roi-hero-row { flex-wrap: wrap; }
  .roi-hero-value { font-size: clamp(38px, 5vw, 52px); }
}

/* Reduced motion override pra V3 mobile */
@media (prefers-reduced-motion: reduce) {
  .roi-drawer-panel { animation: none; }
}
