:root {
  /* ABJP — azul claro */
  --brand-blue: #4a9fe0;
  --brand-blue-deep: #2f7ec4;
  --brand-blue-soft: #8ec8f0;

  --background: #ffffff;
  --background-subtle: #f5f9fd;
  --background-muted: #eef5fb;

  --foreground: #1a1f28;
  --foreground-secondary: #2e3744;
  --foreground-muted: #6b7585;
  --foreground-subtle: #939ba8;

  --border: #d5e2ef;
  --border-subtle: #e4edf5;
  --border-strong: #b8cadc;

  --hover: #e8f2fb;
  --active: #d7e9f7;

  --accent: var(--brand-blue);
  --accent-hover: var(--brand-blue-deep);

  --danger: #eb5757;
  --success: #448361;
  --warning: #d9730d;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  --font:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;

  --ease: background-color 120ms ease, border-color 120ms ease, color 120ms ease, opacity 120ms ease;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--foreground);
  background:
    radial-gradient(1100px 560px at 8% -8%, rgba(74, 159, 224, 0.28), transparent 55%),
    radial-gradient(900px 480px at 100% 0%, rgba(47, 126, 196, 0.16), transparent 52%),
    radial-gradient(720px 420px at 85% 100%, rgba(142, 200, 240, 0.22), transparent 48%),
    linear-gradient(180deg, #f3f8fd 0%, #eef5fb 45%, #f7fbfe 100%);
  background-attachment: fixed;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

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

h1 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 0 var(--space-6);
  color: var(--foreground);
}
h2 {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
  color: var(--foreground);
}
h3 {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  margin: 0 0 var(--space-2);
}

.page-lead {
  margin: -20px 0 32px;
  max-width: 520px;
}
.crumb-link {
  margin: 0 0 var(--space-3);
}
.crumb-link a,
a.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.88);
  color: var(--foreground-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: var(--ease);
}
.crumb-link a:hover,
a.back-btn:hover {
  text-decoration: none;
  color: var(--foreground);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
  background: #fff;
}

.row button { flex: 0 0 auto; width: auto; }

.eyebrow {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--foreground-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 var(--space-4);
}

.app {
  display: flex;
  min-height: calc(100dvh - 56px);
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--foreground);
  text-decoration: none;
  padding: 0;
  margin-right: 0;
  min-width: 0;
}
.topbar .brand:hover {
  background: transparent;
  color: var(--foreground);
}
.topbar .brand-logo {
  display: block;
  height: 30px;
  width: auto;
  max-width: min(168px, 48vw);
  object-fit: contain;
}
.topbar .brand-franchise,
.topbar .brand span {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground-muted);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.notif-wrap {
  position: relative;
}
.notif-btn {
  position: relative;
}
.notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: min(420px, 70dvh);
  display: flex;
  flex-direction: column;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(15, 15, 15, 0.14);
  z-index: 40;
  overflow: hidden;
}
.notif-panel[hidden] {
  display: none !important;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.notif-head strong {
  font-size: 13px;
  font-weight: 600;
}
.notif-actions {
  display: flex;
  gap: 4px;
}
.notif-action {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  width: auto;
}
.notif-action.bad-text {
  color: var(--danger, #b42318);
}
.notif-list {
  overflow-y: auto;
  max-height: calc(10 * 64px);
  overscroll-behavior: contain;
}
.notif-empty {
  margin: 0;
  padding: 20px 14px;
  text-align: center;
  font-size: 13px;
}
.notif-item {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: inherit;
  text-decoration: none;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover {
  background: var(--hover);
  color: inherit;
  text-decoration: none;
}
.notif-item.is-unread {
  background: rgba(74, 159, 224, 0.08);
}
.notif-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}
.notif-body {
  margin-top: 2px;
  font-size: 12px;
  color: var(--foreground-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--foreground-muted);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 8px 14px;
  margin-bottom: 4px;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
}
.sidebar-brand img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.sidebar-brand span {
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground-muted);
}
html.nav-collapsed .sidebar-brand,
body.nav-collapsed .sidebar-brand {
  display: none;
}

button.icon-btn,
button.avatar-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--foreground-secondary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
button.icon-btn:hover,
button.avatar-btn:hover {
  background: var(--hover);
  border-color: transparent;
  color: var(--foreground);
}
.nav-toggle .i-open { display: none; }
.nav-toggle .i-close { display: block; }
html.nav-collapsed .nav-toggle .i-open,
body.nav-collapsed .nav-toggle .i-open { display: block; }
html.nav-collapsed .nav-toggle .i-close,
body.nav-collapsed .nav-toggle .i-close { display: none; }

.avatar-btn {
  overflow: hidden;
  border-radius: 50% !important;
  border: 1px solid var(--border) !important;
  background: var(--background-muted) !important;
  font-size: 11px;
  font-weight: 600;
  color: var(--foreground-secondary) !important;
}
.avatar-btn img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  display: block;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: rgba(238, 245, 251, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-right: 1px solid var(--border-subtle);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
html.nav-ready .sidebar {
  transition: width 160ms ease, padding 160ms ease, border-color 160ms ease;
}
html.nav-collapsed .sidebar,
body.nav-collapsed .sidebar {
  width: 0;
  padding: 0;
  overflow: hidden;
  border-right-color: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  height: 32px;
  padding: 0 var(--space-2);
  border-radius: 5px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 450;
  color: var(--foreground-secondary);
  white-space: nowrap;
}
.nav-item:hover {
  background: var(--active);
  color: var(--foreground);
  text-decoration: none;
}
.nav-item.is-active {
  background: #e9e9e6;
  color: var(--foreground);
  font-weight: 500;
}

.nav-scrim {
  display: none;
}

.shell { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.account-modal {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 420px;
  width: calc(100% - 32px);
}
.account-modal::backdrop {
  background: rgba(15, 15, 15, 0.35);
}
.account-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: var(--space-5);
  box-shadow: 0 16px 48px rgba(15, 15, 15, 0.14);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.account-hero {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.account-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--background-muted);
}
.account-photo.initials {
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 600;
}
.account-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.account-email {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--foreground-muted);
}
.account-card .btn,
.account-card button {
  width: 100%;
}

.wrap {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
}

.toast-host {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 80;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.auth-body .toast-host {
  top: 20px;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--background);
  box-shadow:
    0 4px 16px rgba(15, 15, 15, 0.08),
    0 1px 3px rgba(15, 15, 15, 0.06);
  font-size: 14px;
  line-height: 1.45;
  animation: toast-in 180ms ease;
}
.toast.ok {
  border-color: #dbe8d8;
  background: #edf3ec;
  color: var(--success);
}
.toast.err {
  border-color: #f6d4d4;
  background: #fdebec;
  color: #d44c47;
}
.toast-text { flex: 1; }
.toast-close {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.7;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.toast-close:hover {
  opacity: 1;
  background: transparent;
  border-color: transparent;
  color: inherit;
}
.toast-host.is-hiding .toast {
  animation: toast-out 180ms ease forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}

body.is-navigating::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}
@media (max-width: 768px) {
  .toast-host { top: 64px; right: 12px; left: 12px; width: auto; }
}

.flash {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin: 0 0 var(--space-5);
  font-size: 14px;
  border: 1px solid transparent;
}
.flash.ok {
  background: #edf3ec;
  color: var(--success);
  border-color: #dbe8d8;
}
.flash.err {
  background: #fdebec;
  color: #d44c47;
  border-color: #f6d4d4;
}

.card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  box-shadow: 0 1px 0 rgba(74, 159, 224, 0.06);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.card-head h2 { margin: 0; }

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: #f1f1ef;
  color: #5f5e5b;
  letter-spacing: 0;
  vertical-align: middle;
}

.pill.on,
.badge.active { background: #edf3ec; color: var(--success); }
.pill.off,
.badge.blocked { background: #fdebec; color: #d44c47; }
.pill.wait,
.badge.pending { background: #fbecdd; color: var(--warning); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
}
.stat {
  padding: var(--space-4) var(--space-5);
  color: inherit;
  border-right: 1px solid var(--border-subtle);
  min-width: 0;
  text-align: left;
}
.stat:last-child { border-right: 0; }
.stat:hover {
  background: var(--hover);
  color: inherit;
  text-decoration: none;
}
.stat span {
  display: block;
  color: var(--foreground-muted);
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat b {
  display: block;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--foreground);
  line-height: 1.2;
}
.stat b.stat-bump {
  animation: stat-bump 420ms ease;
}
@keyframes stat-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.12); color: var(--brand-blue-deep); }
  100% { transform: scale(1); }
}

.stats-log {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stats-log .stat { cursor: default; }
.stats-log .stat:hover { background: transparent; }

.log-day-form {
  margin-bottom: var(--space-6);
  max-width: 420px;
}
.log-day-form .row {
  align-items: center;
}
.log-day-form .row > input[type="date"] {
  flex: 1 1 160px;
}
.log-day-form .row > button,
.log-day-form .row > .btn {
  flex: 0 0 auto;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--space-5);
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  color: var(--foreground-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.chip:hover {
  background: var(--hover);
  color: inherit;
  text-decoration: none;
}
.chip.is-on {
  border-color: var(--brand-blue, #4a9fe0);
  background: #e8f3fb;
  color: var(--brand-blue-deep, #1f6ea8);
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.activity-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item time {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--foreground-muted);
  padding-top: 3px;
}
.activity-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.activity-kind {
  font-size: 12px;
  font-weight: 600;
  color: var(--foreground-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.activity-name {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}
.activity-name:hover { text-decoration: underline; }
.activity-meta {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.35;
}
.activity-empty {
  padding: 16px 0;
  list-style: none;
}

@media (max-width: 900px) {
  .stats-log {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .activity-item {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
  }
}

.row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: stretch;
}
.row > * { flex: 1 1 140px; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground-muted);
  margin: 0 0 var(--space-1);
}

input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--foreground-secondary);
  background: var(--background);
  border: 1px solid #dededb;
  border-radius: var(--radius-md);
  height: 38px;
  padding: 0 12px;
  width: 100%;
  transition: var(--ease);
}
textarea {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: var(--foreground-subtle); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.otp {
  font-size: 22px;
  letter-spacing: 0.28em;
  text-align: center;
  font-weight: 600;
}

button, .btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--brand-blue);
  background: var(--brand-blue);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: auto;
  min-width: 0;
  transition: var(--ease);
}
button:hover, .btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

button.ghost, .btn.ghost {
  background: var(--background);
  color: var(--foreground-secondary);
  border-color: #dededb;
}
button.ghost:hover, .btn.ghost:hover {
  background: var(--background-muted);
  color: var(--foreground);
  border-color: var(--border-strong);
}

button.ok {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #fff;
}
button.ok:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button.bad {
  background: var(--background);
  color: #d44c47;
  border-color: #f0c7c7;
}
button.bad:hover { background: #fdebec; color: #d44c47; }

button.warn {
  background: var(--background);
  color: var(--warning);
  border-color: #f3d5b3;
}

form.card button[type="submit"]:not(.ghost):not(.bad):not(.ok) {
  width: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.actions form { margin: 0; }
.actions button { width: auto; }

.list {
  display: flex;
  flex-direction: column;
}
.item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  color: inherit;
  border-radius: 0;
}
.item:first-child { padding-top: 0; }
.item:hover {
  text-decoration: none;
  color: inherit;
  background: var(--hover);
  margin: 0 calc(-1 * var(--space-3));
  padding-left: var(--space-3);
  padding-right: var(--space-3);
}
.item .name {
  font-weight: 500;
  font-size: 15px;
}
.item .meta {
  color: var(--foreground-muted);
  font-size: 13px;
  margin-top: 2px;
}

.driver-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}
.driver-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  transition: var(--ease);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.driver-card:hover {
  text-decoration: none;
  color: inherit;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
.driver-card-photo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--background-muted);
  border: 1px solid var(--border-subtle);
}
.driver-card-photo.initials {
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, #fff);
}
.driver-card-body {
  min-width: 0;
}
.driver-card-body .name {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.driver-card-body .meta {
  color: var(--foreground-muted);
  font-size: 13px;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.driver-hero {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 0 0 var(--space-4);
}
.driver-hero .driver-card-photo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
}
.driver-hero h1 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.driver-hero .muted {
  margin: 6px 0 0;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-2);
  flex-wrap: wrap;
}
.pager-info {
  font-size: 13px;
  color: var(--foreground-muted);
}
.pager .ghost {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.85);
  color: var(--foreground-secondary);
  text-decoration: none;
  font-size: 13px;
}
.pager .ghost:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border-subtle));
}
.pager .ghost.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 16px;
  font-size: 14px;
}
.dl dt { color: var(--foreground-muted); font-weight: 500; }
.dl dd { margin: 0; overflow-wrap: anywhere; color: var(--foreground-secondary); }

.photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.photos img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--background-muted);
}
.photos figcaption {
  margin-top: 4px;
}

.step {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-top: var(--space-4);
  background: var(--background-subtle);
}

details.more {
  margin-top: var(--space-4);
  color: var(--foreground-muted);
  font-size: 13px;
}
details.more summary {
  cursor: pointer;
  color: var(--foreground-secondary);
  font-weight: 500;
}
details.more summary:hover { color: var(--foreground); }

.sub-list {
  min-height: 72px;
  margin: var(--space-3) 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background-subtle);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-content: flex-start;
}
.sub-empty { font-size: 13px; }
.sub-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--background);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--foreground-secondary);
}
.sub-tag-remove {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--foreground-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.sub-tag-remove:hover {
  background: var(--hover);
  color: var(--foreground);
  border-color: transparent;
}
.sub-picker select { flex: 1 1 180px; }
.sub-picker button { flex: 0 0 auto; width: auto; }

.auth-body {
  background: var(--background-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-4);
}
.auth-wrap {
  width: min(420px, 100%);
}
.auth-brand {
  display: inline-flex;
  margin: 0 0 var(--space-4);
  text-decoration: none;
}
.auth-brand img {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
}
.auth-wrap h1 {
  font-size: 32px;
  margin-bottom: var(--space-2);
}
.auth-wrap .muted { margin: 0 0 var(--space-6); max-width: 360px; }
.auth-wrap .card { padding: var(--space-6); }
.auth-wrap button { width: 100%; }

@media (max-width: 768px) {
  .app { display: block; min-height: calc(100dvh - 56px); }
  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: min(240px, 86vw);
    z-index: 25;
    transform: translateX(0);
  }
  html.nav-ready .sidebar {
    transition: transform 160ms ease;
  }
  html.nav-collapsed .sidebar,
  body.nav-collapsed .sidebar {
    width: min(240px, 86vw);
    padding: var(--space-3);
    transform: translateX(-105%);
    border-right: 1px solid var(--border-subtle);
  }
  .nav-scrim {
    display: block;
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(15, 15, 15, 0.18);
    z-index: 20;
  }
  .nav-scrim[hidden] { display: none; }
  .wrap { padding: var(--space-6) var(--space-4) var(--space-12); }
  h1 { font-size: 26px; }
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat {
    padding: var(--space-3) var(--space-2);
    border-right: 1px solid var(--border-subtle);
    border-bottom: 0;
    text-align: center;
  }
  .stat:last-child { border-right: 0; border-bottom: 0; }
  .stat span { font-size: 11px; }
  .stat b { font-size: 18px; }
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .actions button { width: 100%; }
}

@media (min-width: 640px) {
  .photos { grid-template-columns: repeat(4, 1fr); }
}
