:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f3f8ef;
  --text: #3f2d23;
  --muted: #7b6a5f;
  --line: #e6dacd;
  --primary: #70a943;
  --primary-dark: #3f6f22;
  --primary-soft: #eef7e8;
  --accent: #d98bad;
  --accent-dark: #9b4f73;
  --accent-soft: #fff0f6;
  --brown: #3f2d23;
  --success: #5f9735;
  --danger: #b42318;
  --warning: #a15c07;
  --shadow: 0 12px 30px rgba(63, 45, 35, 0.1);
}

.purchases-panel {
  min-height: calc(100vh - 190px);
}

.purchase-workspace { background: var(--surface); padding: 20px; min-width: 0; }
.purchase-workspace h3 { font-size: 17px; margin: 24px 0 12px; }
.purchase-workspace h4 { font-size: 14px; margin: 0; }
.purchase-catalog-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.purchase-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 20px; }
.purchase-tabs button { background: transparent; color: var(--text); border: 1px solid transparent; padding: 9px 12px; border-radius: 4px; }
.purchase-tabs button.active { background: var(--primary-soft); border-color: var(--primary); }
.purchase-operation-form { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.purchase-document-row { display: grid; grid-template-columns: minmax(180px,2fr) repeat(3,minmax(100px,1fr)) auto; gap: 10px; align-items: end; margin-bottom: 12px; }
.purchase-document-row:has(.purchase-cost-choice) { grid-template-columns: minmax(160px,2fr) repeat(3,minmax(90px,1fr)) minmax(160px,1.5fr) auto; }
.purchase-cost-choice { font-size: 12px; }
.purchase-cost-choice input { width: 18px; height: 18px; }
.purchase-cost-choice span { display: block; font-size: 11px; color: var(--muted); }
.purchase-icon { min-width: 36px; width: 36px; height: 36px; padding: 0; font-size: 20px; }
.purchase-table-scroll { width: 100%; overflow-x: auto; }
.purchase-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.purchase-table th, .purchase-table td { text-align: left; border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; }
.purchase-table th { background: var(--surface-soft); font-weight: 600; white-space: nowrap; }
.purchase-table td { min-width: 70px; overflow-wrap: anywhere; }
.purchase-table td.purchase-no-wrap { white-space: nowrap; }
#purchase-production-links .purchase-table { min-width: 1290px; }
#purchase-production-links td:first-child { min-width: 220px; }
#purchase-production-links td:nth-child(3) { min-width: 220px; }
#purchase-production-links td:last-child { min-width: 230px; }
#purchase-production-links td:last-child button { margin: 0 4px 4px 0; }
.purchase-table small { display: block; color: var(--muted); }
.purchase-table details { min-width: 100px; }
.purchase-table details[open] { min-width: 450px; }
.purchase-warning, .purchase-table small.purchase-warning { color: var(--danger); }
.purchase-report-filters { display: grid; grid-template-columns: repeat(4,minmax(140px,1fr)); gap: 12px; margin-bottom: 16px; }
.purchase-workspace [hidden] { display: none !important; }
.purchase-suggested-price { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.purchase-history { width: min(1000px,calc(100vw - 32px)); max-height: calc(100vh - 40px); border: 1px solid var(--line); border-radius: 6px; padding: 20px; color: var(--text); }
.purchase-history::backdrop { background: rgba(0,0,0,.4); }
.purchase-history .panel-heading h2 { font-size: 18px; overflow-wrap: anywhere; }
.purchase-history .panel-heading form { flex: 0 0 auto; }
.purchase-price-dialog { width: min(640px,calc(100vw - 32px)); }
.purchase-workspace .purchase-price-dialog .panel-heading { flex-direction: row; flex-wrap: nowrap; align-items: flex-start; }
.purchase-price-dialog .panel-heading h2 { flex: 1; min-width: 0; }
.purchase-price-dialog p small { display: block; margin-top: 6px; overflow-wrap: anywhere; }
.purchase-price-values { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.purchase-price-values dt { color: var(--muted); font-size: 13px; }
.purchase-price-values dd { margin: 6px 0 0; font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.purchase-price-values div:last-child dd { color: var(--primary-dark); }
.purchase-price-dialog .form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.production-model-price-action { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.production-model-price-action span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.production-materials { margin: 8px 0; font-size: 12px; }
.production-materials summary { cursor: pointer; overflow-wrap: anywhere; }
.production-materials ul { padding-left: 16px; margin: 8px 0; }
.production-materials li { margin-bottom: 5px; overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .purchase-document-row, .purchase-document-row:has(.purchase-cost-choice) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .purchase-report-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  .purchase-workspace { padding: 12px; }
  .purchase-document-row, .purchase-document-row:has(.purchase-cost-choice), .purchase-report-filters { grid-template-columns: minmax(0,1fr); }
  .purchase-tabs button { font-size: 12px; padding: 8px; }
  .purchase-workspace .panel-heading { flex-wrap: wrap; }
}

.purchases-panel .panel-heading {
  align-items: center;
}

.purchases-panel .panel-heading small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.purchases-frame {
  display: block;
  width: 100%;
  min-height: calc(100vh - 285px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.purchase-aux-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.purchase-formula-items {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.purchase-formula-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-bottom: 18px;
}

.purchase-formula-totals label { min-width: 0; }
.purchase-formula-totals output {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 20px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.purchase-formula-totals label:last-child output { color: var(--primary-dark); }

.purchase-formula-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) minmax(110px, .8fr) minmax(90px, .7fr) minmax(110px, .8fr) minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.muted-item {
  opacity: .62;
}

.empty {
  color: var(--muted);
  margin: 10px 0;
}

@media (max-width: 700px) {
  .purchases-panel .panel-heading {
    align-items: stretch;
  }

  .purchases-frame {
    min-height: 70vh;
  }

  .purchase-aux-grid,
  .purchase-formula-row {
    grid-template-columns: 1fr;
  }

  .purchase-formula-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .purchase-formula-totals label:last-child { grid-column: 1 / -1; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #fffafc 0%, var(--bg) 240px, #f8fbf4 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body.logged-out .app-header,
body.logged-out .tabbar,
body.logged-out main {
  display: none;
}

body.logged-in #login-screen {
  display: none;
}

.production-board { display:grid; grid-template-columns:repeat(6,minmax(240px,1fr)); gap:16px; margin-bottom:20px; overflow-x:auto; }
.production-column { min-width:0; padding:14px; border:1px solid #dcebd1; border-radius:8px; background:var(--surface-soft); }
.production-column h3 { margin:0 0 12px; color:var(--primary-dark); }
.production-card { display:grid; gap:8px; margin-bottom:10px; padding:14px; overflow:hidden; border-left:4px solid var(--primary); border-radius:8px; background:#fff; box-shadow:0 4px 14px rgba(63,45,35,.08); }
.production-card.urgent { border-left-color:var(--accent-dark); }
.production-card strong,.production-card small { display:block; }
.production-card > * { min-width:0; }
.production-card small { margin:0; color:var(--muted); line-height:1.4; overflow-wrap:anywhere; }
.production-card .badge { white-space:normal; overflow-wrap:anywhere; }
.production-card button { width:100%; margin-top:10px; }
.production-card select { width:100%; margin-top:10px; }
.production-timer { color:var(--primary-dark) !important; font-weight:800; }
.production-photo-button { display:block; margin-top:10px; padding:9px; border:1px solid #ead0dc; border-radius:8px; background:var(--accent-soft); text-align:center; cursor:pointer; font-weight:700; }
.production-photo-button input { display:none; }
.production-photo { display:block; width:100%; max-height:180px; margin:0; border-radius:8px; object-fit:cover; }
.production-photos { display:grid; grid-template-columns:repeat(auto-fit,minmax(90px,1fr)); gap:8px; margin-top:2px; }
.production-photos .production-photo { height:110px; max-height:none; }
.person-avatar { width:52px; height:52px; flex:0 0 52px; border:2px solid #fff; border-radius:50%; object-fit:cover; box-shadow:0 0 0 1px var(--line); }
.person-avatar.small { width:32px; height:32px; flex-basis:32px; font-size:11px; }
.person-avatar.large { width:68px; height:68px; flex-basis:68px; font-size:18px; }
.person-avatar-fallback { display:grid; place-items:center; background:var(--primary-dark); color:#fff; font-weight:800; }
.person-photo-preview { display:block; width:96px; height:96px; margin:0 0 12px; border:2px solid var(--line); border-radius:50%; object-fit:cover; }
.production-person { display:flex; align-items:flex-start; gap:9px; min-width:0; }
.production-person-details { display:flex; flex:1; flex-direction:column; align-items:flex-start; gap:3px; min-width:0; padding-top:3px; }
.production-person-details small { min-width:0; padding:0; }
.production-delivery-deadline { display:flex; flex-direction:column; align-items:flex-start; gap:1px; }
.production-delivery-deadline span { color:var(--muted); }
.production-delivery-deadline time { display:block; white-space:nowrap; font-variant-numeric:tabular-nums; }
.production-logistics { display:flex; flex-wrap:wrap; align-items:center; gap:6px; color:var(--muted); font-size:0.8rem; line-height:1.4; }
.production-logistics .badge { flex:0 0 auto; }
.production-logistics-event { display:grid; grid-template-columns:auto max-content max-content; align-items:baseline; gap:5px; min-width:0; }
.production-logistics-event span { color:var(--muted); }
.production-logistics-event time { display:block; white-space:nowrap; font-variant-numeric:tabular-nums; }
.production-logistics-distance { white-space:nowrap; }
@media (max-width:360px) { .production-logistics-event { grid-template-columns:auto max-content; } .production-logistics-event time:last-child { grid-column:2; } }
.production-person.prominent { margin-bottom:10px; }
.production-stock-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.production-stock-actions button { margin-top:0; }
.crown-stock-filters { margin-bottom:16px; }
.crown-stock-list { display:grid; gap:10px; }
.crown-stock-item { display:grid; grid-template-columns:96px minmax(0,1fr) auto; align-items:center; gap:14px; padding:12px 0; border-bottom:1px solid var(--line); }
.crown-stock-item:last-child { border-bottom:0; }
.crown-stock-item img,.crown-stock-placeholder { width:96px; height:72px; border-radius:6px; object-fit:cover; }
.crown-stock-placeholder { display:grid; place-items:center; background:var(--surface-soft); color:var(--muted); font-size:12px; }
.crown-stock-main { min-width:0; }
.crown-stock-main small { display:block; margin-top:5px; color:var(--muted); }
.crown-stock-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.crown-stock-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.production-monitor-view > .panel-heading { margin-bottom:16px; }
.production-monitor { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.production-monitor-worker { min-width:0; border-top:3px solid var(--primary); background:var(--surface); box-shadow:var(--shadow); }
.production-monitor-worker > header { display:flex; justify-content:space-between; gap:12px; padding:14px; border-bottom:1px solid var(--line); }
.production-monitor-worker > header strong,.production-monitor-worker > header small { display:block; }
.production-monitor-worker > header small { margin-top:4px; color:var(--muted); }
.production-monitor-job { padding:14px; border-bottom:1px solid var(--line); }
.production-monitor-job:last-child { border-bottom:0; }
.production-monitor-job.late { border-left:4px solid var(--danger); background:#fff5f4; }
.production-monitor-job-heading { display:flex; justify-content:space-between; gap:8px; }
.production-monitor-job > span,.production-monitor-job > small { display:block; margin-top:5px; color:var(--muted); }
.production-monitor-timer { display:block; margin-top:10px; color:var(--primary-dark); font-size:24px; }
.production-monitor-job.late .production-monitor-timer { color:var(--danger); }
.production-monitor-idle { padding:24px 14px; color:var(--muted); text-align:center; }
.florist-station-header { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:20px; }
.florist-station-header h2 { margin:0 0 4px; }
.florist-station-header small { color:var(--muted); }
.florist-station-header label { width:min(360px,100%); }
.florist-station-queue { display:grid; gap:16px; }
.florist-station-order { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,320px); gap:20px; padding:20px; border-left:5px solid var(--primary); background:var(--surface); box-shadow:var(--shadow); }
.florist-station-order.urgent { border-left-color:var(--danger); }
.florist-station-order.late { background:#fff5f4; }
.florist-station-order-main h3 { margin:10px 0 6px; font-size:22px; }
.florist-station-order-main > strong,.florist-station-order-main > small { display:block; margin-top:6px; }
.florist-station-order-main > small { color:var(--muted); }
.florist-station-actions button { width:100%; margin-top:10px; }
.florist-camera-dialog { width:min(640px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); margin:auto; padding:16px; border:1px solid var(--line); border-radius:8px; color:var(--text); background:var(--surface); overflow:auto; }
.florist-camera-dialog::backdrop { background:rgba(0,0,0,.5); }
.service-order-crowns-dialog { width:min(680px,calc(100vw - 24px)); max-height:calc(100dvh - 24px); border:1px solid var(--line); border-radius:8px; color:var(--text); background:var(--surface); overflow:auto; }
.service-order-crowns-dialog::backdrop { background:rgba(0,0,0,.5); }
.service-order-crowns-current { margin:12px 0; padding:10px; border-radius:8px; background:var(--surface-soft); }
.service-order-crowns-current small { display:block; margin-top:5px; color:var(--muted); }
.service-order-crowns-new-items { display:grid; gap:10px; margin:10px 0; }
.florist-camera-dialog [hidden] { display:none !important; }
.florist-camera-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.florist-camera-heading h2 { margin:0; font-size:20px; }
.florist-camera-heading button { width:40px; height:40px; flex:0 0 40px; padding:0; font-size:24px; }
#florist-camera-order { margin:8px 0 12px; overflow-wrap:anywhere; color:var(--muted); font-size:14px; }
#florist-camera-device-wrap { margin-bottom:12px; }
.florist-camera-media { display:grid; place-items:center; width:100%; height:min(380px,48dvh); background:#1b211b; overflow:hidden; border-radius:4px; }
.florist-camera-media video,.florist-camera-media img { display:block; width:100%; height:100%; min-height:0; object-fit:contain; }
#florist-camera-status { margin:12px 0; min-height:20px; overflow-wrap:anywhere; font-size:14px; }
#florist-camera-status.camera-error { color:var(--danger); }
.florist-camera-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
.florist-camera-actions button { min-height:44px; max-width:100%; }
@media(max-width:420px) { .florist-camera-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } .florist-camera-actions button { width:100%; padding:10px 6px; font-size:14px; } }
.production-dashboard { margin:22px 0 16px; padding-top:18px; border-top:1px solid var(--line); }
.production-dashboard > .panel-heading { margin-bottom:14px; }
.production-dashboard-charts { margin-top:16px; }
.production-team-summary { display:grid; grid-template-columns:1fr 1fr; gap:24px; }
.production-team-summary h3 { margin:0 0 10px; font-size:16px; }
.production-team-summary p { display:flex; justify-content:space-between; gap:12px; margin:0; padding:8px 0; border-bottom:1px solid var(--line); }
.production-strategic-view > .panel-heading { margin-bottom:16px; }
.production-strategic-charts { margin-top:18px; }
.production-ranking p { display:flex; justify-content:space-between; gap:12px; margin:0; padding:9px 0; border-bottom:1px solid var(--line); }
.production-ranking small { color:var(--muted); }
.production-registers { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.compact-form { align-items:end; }
.inline-form { display:flex; gap:10px; align-items:end; }
.inline-form label { flex:1; }
@media (max-width:900px){ .production-board,.production-registers{ grid-template-columns:1fr; } }
@media (max-width:900px){ .production-monitor{ grid-template-columns:1fr; } }
@media (max-width:700px){ .florist-station-header{ align-items:stretch; flex-direction:column; }.florist-station-order{ grid-template-columns:1fr; } }
@media (max-width:700px){ .production-team-summary{ grid-template-columns:1fr; } }
@media (max-width:700px){ .crown-stock-item{ grid-template-columns:72px minmax(0,1fr); } .crown-stock-item img,.crown-stock-placeholder{ width:72px;height:64px; } .crown-stock-actions{ grid-column:1/-1;justify-content:stretch; } .crown-stock-actions button{ flex:1; } }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--accent-soft) 100%);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card img {
  width: min(220px, 100%);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  justify-self: center;
}

.login-card h1 {
  margin: 0 0 4px;
  text-align: center;
  color: #3f2d23;
}

.login-card small {
  color: var(--muted);
  text-align: center;
}

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

button.primary {
  background: var(--primary);
  color: #fff;
}

button.primary:hover {
  background: var(--primary-dark);
}

button.ghost {
  border: 1px solid #ead0dc;
  background: var(--accent-soft);
  color: #000;
}

button.danger {
  background: #f6d6d2;
  color: var(--danger);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

input.identity-locked,
select.identity-locked {
  border-color: #d8c9bb;
  background: #f5efe8;
  color: var(--muted);
}

button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.86rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px clamp(16px, 4vw, 38px);
  border-bottom: 4px solid var(--accent);
  background: var(--primary-dark);
  color: #fff;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.app-header-logo {
  width: 118px;
  height: 118px;
  flex: 0 0 auto;
  object-fit: contain;
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.app-header p {
  margin: 4px 0 0;
  color: #f1e2d8;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.status-pill,
.badge,
.key-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill {
  background: var(--accent-dark);
  color: #fff;
}

.status-pill.ready,
.badge.success {
  background: #cbeebb;
  color: #2f681e;
}

.status-pill.loading {
  background: #fff4d6;
  color: var(--warning);
}

.status-pill.error,
.badge.danger {
  background: #fbe0dd;
  color: var(--danger);
}

.badge.warn {
  background: #fff0cf;
  color: var(--warning);
}

.badge.freelancer {
  border: 1px solid #2f7fb3;
  background: #9fd6f5;
  color: #000;
}

.badge.driver-away {
  border: 1px solid #8f68b5;
  background: #d7b9ef;
  color: #000;
}

.badge.muted,
.key-hint {
  background: #f2eadf;
  color: var(--muted);
}

.tabbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
  padding: 10px clamp(12px, 4vw, 38px);
  background: rgba(251, 250, 247, 0.96);
  border-bottom: 1px solid var(--line);
}

.tab {
  flex: 0 0 auto;
  min-width: 96px;
  background: transparent;
  color: #5f4a3e;
  border: 1px solid transparent;
}

.tab.active {
  background: var(--primary-soft);
  border-color: #cfe5bd;
  box-shadow: 0 4px 14px rgba(63, 45, 35, 0.08);
  color: var(--brown);
}

.tab-menu {
  position: relative;
  flex: 0 0 auto;
}

.nav-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.nav-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.nav-trigger[aria-expanded="true"] .nav-chevron {
  transform: rotate(225deg);
}

.nav-admin {
  margin-left: auto;
}

.nav-icon {
  width: 44px;
  min-width: 44px;
  height: 44px;
  justify-content: center;
  padding: 0;
  font-size: 24px;
}

.nav-section + .nav-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.nav-section-title {
  display: block;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tabbar button:focus-visible,
.tab-dropdown a:focus-visible {
  outline: 2px solid var(--primary-dark);
  outline-offset: 2px;
}

.tab-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  width: min(304px, calc(100vw - 24px));
  max-height: 560px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tab-dropdown button,
.tab-dropdown a {
  display: block;
  width: 100%;
  min-height: 38px;
  border-radius: 6px;
  background: transparent;
  color: var(--brown);
  text-align: left;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: break-word;
  text-decoration: none;
  padding: 9px 10px;
}

.tab-dropdown button:hover,
.tab-dropdown a:hover,
.tab-dropdown .active {
  background: var(--primary-soft);
}

@media (max-width: 720px) {
  .tabbar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 12px;
  }

  .tabbar > .tab,
  .tabbar .nav-trigger {
    min-width: 0;
    min-height: 44px;
    padding: 8px;
    font-size: 14px;
    gap: 6px;
  }

  .tabbar .nav-icon {
    width: 44px;
    font-size: 24px;
  }

  .nav-admin {
    margin-left: 0;
    justify-self: end;
  }
}

main {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 4vw, 38px) 44px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.two-columns,
.metric-grid {
  display: grid;
  gap: 16px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.wide-panel {
  grid-column: 1 / -1;
}

.registration-shell {
  position: relative;
  display: grid;
  gap: 16px;
  min-height: 640px;
  overflow: hidden;
}

.registration-shell::before {
  position: absolute;
  inset: 0;
  content: "";
  background-image: url("assets/logo-controle-operacional.png?v=20261008-logo");
  background-position: center 44px;
  background-repeat: no-repeat;
  background-size: min(520px, 78vw) auto;
  opacity: 0.08;
  pointer-events: none;
}

.registration-content {
  position: relative;
  z-index: 1;
}

.registration-content {
  display: grid;
  gap: 16px;
}

.registration-panel {
  width: 100%;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  margin-bottom: 16px;
}

.alerts {
  margin-bottom: 16px;
  border: 1px solid #efb4ad;
  border-radius: 8px;
  padding: 16px;
  background: #fff1f0;
  color: var(--danger);
  box-shadow: var(--shadow);
}

.alerts h2 {
  margin-bottom: 10px;
  color: var(--danger);
}

.alert-list {
  display: grid;
  gap: 10px;
}

.alert-card {
  display: grid;
  gap: 4px;
  border: 1px solid #efb4ad;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fffafa;
}

.alert-action {
  justify-self: start;
  margin-top: 6px;
}

.alert-card.blink {
  animation: alertBlink 0.65s ease-in-out 3;
}

.badge.blink {
  animation: alertBlink 0.65s ease-in-out 3;
}

@keyframes alertBlink {
  0%,
  100% {
    transform: scale(1);
    box-shadow: none;
  }

  50% {
    transform: scale(1.015);
    background: #ffe4e1;
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.18);
  }
}

.alert-card span,
.alert-card strong {
  overflow-wrap: anywhere;
}

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 16px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.metric strong {
  font-size: 2rem;
}

.metric.danger strong {
  color: var(--danger);
}

.dashboard-period-panel {
  margin-bottom: 16px;
  border: 1px solid #cfe5bd;
  border-radius: 8px;
  padding: 12px;
  background: var(--primary-soft);
  box-shadow: var(--shadow);
}

.dashboard-period-controls {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) repeat(2, minmax(150px, 0.45fr)) auto;
  gap: 10px;
  align-items: end;
}

.dashboard-period-controls label {
  color: var(--brown);
}

.dashboard-period-apply {
  min-width: 72px;
  align-self: end;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-chart-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dashboard-chart-card.compact-chart {
  display: grid;
  align-content: start;
}

.dashboard-chart-card.wide-chart {
  grid-column: span 2;
}

.dashboard-chart-heading {
  margin-bottom: 14px;
}

.dashboard-chart-heading h2 {
  color: var(--brown);
  font-size: 1.05rem;
}

.dashboard-chart {
  min-width: 0;
}

.dashboard-bar-chart {
  display: grid;
  gap: 11px;
}

.dashboard-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.6fr) minmax(76px, auto);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.dashboard-bar-label {
  color: var(--brown);
  font-size: 0.86rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.dashboard-bar-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #f2eadf;
}

.dashboard-bar-fill {
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
}

.dashboard-bar-fill.green {
  background: #5f9735;
}

.dashboard-bar-fill.blue {
  background: #2f7fb3;
}

.dashboard-bar-fill.pink {
  background: #d98bad;
}

.dashboard-bar-fill.yellow {
  background: #d9a62a;
}

.dashboard-bar-value {
  color: var(--brown);
  font-size: 0.88rem;
  text-align: right;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dashboard-bar-total {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.dashboard-bar-total .dashboard-bar-label,
.dashboard-bar-total .dashboard-bar-value {
  font-size: 0.92rem;
  font-weight: 900;
}

.dashboard-bar-total .dashboard-bar-track {
  background: #eadfce;
}

.vehicle-fuel-picker {
  position: relative;
}

.vehicle-fuel-toggle {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
  font-weight: 700;
}

.vehicle-fuel-toggle::after {
  float: right;
  color: var(--muted);
  content: "▾";
}

.vehicle-fuel-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.vehicle-fuel-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  color: var(--brown);
  font-size: 0.86rem;
  font-weight: 800;
}

.vehicle-fuel-options label:hover {
  background: var(--primary-soft);
}

.vehicle-fuel-options input {
  width: auto;
  min-height: auto;
}

.vehicle-fuel-efficiency-chart {
  display: grid;
  gap: 16px;
}

.vehicle-fuel-efficiency-group {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.vehicle-fuel-efficiency-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.vehicle-fuel-efficiency-group h3 {
  margin: 0;
  color: var(--brown);
  font-size: 0.94rem;
  overflow-wrap: anywhere;
}

.vehicle-fuel-efficiency-rows {
  display: grid;
  gap: 8px;
}

.vehicle-fuel-efficiency-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(120px, 1.5fr) minmax(82px, auto) minmax(86px, auto);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.vehicle-fuel-efficiency-fuel {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.vehicle-fuel-efficiency-value,
.vehicle-fuel-efficiency-cost {
  color: var(--brown);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}

.vehicle-fuel-efficiency-cost {
  color: var(--accent-dark);
}

.dashboard-bar-fill.fuel-gasolina_comum {
  background: #5f9735;
}

.dashboard-bar-fill.fuel-gasolina_aditivada {
  background: #3f6f22;
}

.dashboard-bar-fill.fuel-etanol_comum {
  background: #2f7fb3;
}

.dashboard-bar-fill.fuel-etanol_aditivado {
  background: #64a7c7;
}

.dashboard-bar-fill.fuel-diesel_comum {
  background: #d9a62a;
}

.dashboard-bar-fill.fuel-diesel_s10 {
  background: #9b4f73;
}

.driver-efficiency-layout {
  display: grid;
  gap: 14px;
}

.driver-efficiency-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  overflow-wrap: anywhere;
}

.driver-efficiency-ranking {
  display: grid;
  gap: 10px;
}

.driver-efficiency-ranking-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.driver-efficiency-ranking-heading h3 {
  color: var(--brown);
  font-size: 0.96rem;
}

.driver-efficiency-ranking-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.driver-efficiency-ranking-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
}

.driver-efficiency-ranking-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  border: 1px solid #e4eadf;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fffdfb;
}

.driver-efficiency-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e8f8df;
  color: #31591d;
  font-size: 0.82rem;
  font-weight: 900;
}

.driver-efficiency-ranking-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.driver-efficiency-ranking-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.driver-efficiency-ranking-label strong {
  color: var(--brown);
  overflow-wrap: anywhere;
}

.driver-efficiency-ranking-label span {
  color: var(--brown);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.driver-efficiency-ranking-main small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.driver-efficiency-gauge-wrap {
  display: grid;
  gap: 5px;
  justify-items: center;
  min-width: 0;
}

.driver-efficiency-gauge {
  --needle-angle: 0deg;
  --red-solid-angle: 72deg;
  --yellow-angle: 96deg;
  --green-angle: 120deg;
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 2 / 1;
  overflow: visible;
}

.driver-efficiency-gauge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px 999px 0 0;
  background: conic-gradient(
    from 270deg at 50% 100%,
    #c93f32 0deg,
    #c93f32 var(--red-solid-angle),
    #efc94a var(--yellow-angle),
    #5f9735 var(--green-angle),
    #1f5f2f 180deg,
    transparent 180deg 360deg
  );
}

.driver-efficiency-gauge::after {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 0;
  height: 70%;
  z-index: 1;
  border-radius: 999px 999px 0 0;
  background: #fffdfb;
}

.driver-efficiency-gauge-needle {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 2;
  width: 3px;
  height: 76%;
  border-radius: 999px;
  background: #3f2d23;
  box-shadow: 0 0 0 1px rgba(63, 45, 35, 0.08);
  transform: translateX(-50%) rotate(calc(var(--needle-angle) - 90deg));
  transform-origin: bottom center;
}

.driver-efficiency-gauge-hub {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 3;
  width: 16px;
  height: 16px;
  border: 3px solid #fffdfb;
  border-radius: 50%;
  background: #3f2d23;
  transform: translate(-50%, 50%);
}

.driver-efficiency-gauge-mark {
  position: absolute;
  z-index: 4;
  min-width: 24px;
  padding: 1px 2px;
  border-radius: 999px;
  background: rgba(255, 253, 251, 0.82);
  color: #3f2d23;
  font-size: clamp(0.5rem, 1vw, 0.58rem);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.driver-efficiency-gauge-tick {
  position: absolute;
  z-index: 3;
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: rgba(63, 45, 35, 0.74);
  transform: translate(-50%, -50%) rotate(var(--tick-rotate));
  pointer-events: none;
}

.dashboard-donut-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.dashboard-donut {
  position: relative;
  display: grid;
  place-items: center;
  width: min(178px, 42vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--danger) 0 var(--delay-deg), #5f9735 var(--delay-deg) 360deg);
}

.dashboard-donut::before {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.dashboard-donut-core {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2px;
  justify-items: center;
  color: var(--brown);
}

.dashboard-donut-core strong {
  font-size: 1.75rem;
}

.dashboard-donut-core span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.dashboard-donut-legend {
  display: grid;
  gap: 8px;
  color: var(--brown);
  font-weight: 800;
}

.dashboard-donut-legend span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dashboard-donut-legend i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.dashboard-donut-legend i.delay {
  background: var(--danger);
}

.dashboard-donut-legend i.ontime {
  background: #5f9735;
}

.dashboard-donut-legend small {
  color: var(--muted);
  font-weight: 800;
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-heading.compact {
  margin-bottom: 10px;
}

h2,
h3,
h4 {
  margin: 0;
  letter-spacing: 0;
}

h2 {
  font-size: 1.2rem;
}

h3 {
  font-size: 1rem;
}

h4 {
  color: #5f4a3e;
  font-size: 0.95rem;
}

form {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.travel-time-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.travel-time-title {
  flex: 0 0 100%;
  color: #5f4a3e;
  font-size: 0.92rem;
  font-weight: 700;
}

.travel-time-fields label {
  flex: 0 0 178px;
}

.travel-time-fields select {
  width: 100%;
  min-width: 96px;
}

.execution-picker {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
}

.arrival-delay-reason {
  grid-column: 1 / -1;
}

#arrival-form {
  scroll-margin-top: 96px;
}

#arrival-qr-panel {
  scroll-margin-top: 96px;
}

.odometer-order-details,
.qr-arrival-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--primary-soft);
  color: var(--text);
  font-weight: 700;
}

.odometer-order-details span,
.odometer-order-details small,
.qr-arrival-details span,
.qr-arrival-details small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.arrival-qr-camera {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.arrival-qr-camera video {
  width: min(520px, 100%);
  max-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  object-fit: cover;
}

.arrival-qr-camera small {
  color: var(--muted);
  font-weight: 700;
}

.arrival-qr-card {
  border-color: var(--primary);
  border-top-color: var(--primary-dark);
}

.arrival-qr-mark {
  background: var(--primary-dark);
  font-size: 1rem;
}

.arrival-qr-content span,
.arrival-qr-content h2 {
  color: var(--primary-dark);
}

.arrival-qr-km-fields {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.execution-combobox {
  display: grid;
  gap: 6px;
}

.combobox-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.combo-toggle {
  min-width: 82px;
}

.combo-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 25;
  display: grid;
  max-height: 260px;
  overflow: auto;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.combo-option {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 42px;
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--brown);
  text-align: left;
  font-weight: 800;
}

.combo-option:hover,
.combo-option:focus {
  background: var(--primary-soft);
}

.combo-option small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.combo-option.create {
  background: var(--accent-soft);
  color: #000;
}

.combo-empty {
  padding: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.inline-task-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdfb;
}

.inline-task-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inline-task-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 0.8fr) minmax(160px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
}

.inline-task-grid button {
  min-width: 140px;
}

label {
  display: grid;
  gap: 6px;
  color: #5f4a3e;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8c9bb;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(112, 169, 67, 0.22);
  border-color: var(--primary);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions > button {
  flex: 1 1 180px;
}

.form-grid-action {
  align-self: end;
  min-height: 42px;
}

.form-alert {
  margin: 12px 0;
  border: 1px solid #f1b8b2;
  border-left: 5px solid var(--danger);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff5f4;
  color: var(--danger);
  font-weight: 800;
}

.form-alert.success {
  border-color: #b8dc9f;
  border-left-color: var(--success);
  background: #f1faec;
  color: #2f681e;
}

.route-stops {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.route-stop-picker {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 10px;
  align-items: end;
}

.route-stop-picker button {
  min-width: 150px;
}

.route-stop-list {
  display: grid;
  gap: 8px;
}

.route-stop-total,
.route-stop-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffdfb;
}

.route-stop-total {
  background: var(--primary-soft);
}

.route-stop-total span,
.route-stop-main small {
  color: var(--muted);
  font-weight: 700;
}

.route-stop-time {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.route-stop-time label {
  width: auto;
}

.route-time-fields {
  display: flex;
  align-items: center;
  gap: 6px;
}

.route-time-fields select {
  width: 78px;
  min-height: 36px;
  padding: 7px 9px;
}

.route-stop-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.permission-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdfb;
}

.permission-editor-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.permission-editor-heading h3 {
  margin: 0;
}

.permission-editor-heading small {
  color: var(--muted);
  font-weight: 700;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.permission-card {
  display: grid;
  gap: 8px;
  border: 1px solid #dce8d6;
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
}

.permission-card strong {
  color: var(--brown);
}

.permission-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.permission-actions label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  font-size: 0.82rem;
}

.permission-actions input {
  width: 16px;
  min-height: 16px;
}

.report-actions {
  margin: 12px 0 16px;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
}

.list-item:has(> .person-avatar) { grid-template-columns:auto minmax(0,1fr) auto; }

.list-item.driver-active {
  border-color: #95d070;
  border-left: 6px solid #5f9735;
  background: #e8f8df;
}

.list-item.driver-freelancer {
  border-color: #6fb3dc;
  border-left: 6px solid #2f7fb3;
  background: #dff2ff;
}

.list-item.driver-away-status {
  border-color: #b995d8;
  border-left: 6px solid #7f52a7;
  background: #eee0f8;
}

.list-item.driver-disconnected {
  border-color: #d0d4d9;
  border-left: 6px solid #9aa3ad;
  background: #f1f2f4;
}

.list-item.driver-disconnected .item-main strong,
.list-item.driver-disconnected .item-main span,
.list-item.driver-disconnected .item-main small {
  color: #5d6670;
}

.list-item.checkout-late {
  border-color: #efb4ad;
  background: #fff1f0;
  animation: checkoutBlink 1s ease-in-out infinite;
}

.checkout-timer {
  font-weight: 800;
}

.checkout-timer.late {
  color: var(--danger);
}

.odometer-driver-departure { display:flex; flex-direction:column; align-items:flex-start; gap:3px; margin-top:4px; color:var(--muted); }
.odometer-driver-name { min-width:0; overflow-wrap:anywhere; }
.odometer-departure-value { display:flex; flex-direction:column; align-items:flex-start; gap:2px; min-width:0; }
.odometer-departure-value > span { color:var(--muted); }
.odometer-departure-value time { display:block; white-space:nowrap; font-variant-numeric:tabular-nums; }
.odometer-departure-pending { color:var(--muted); }

.checkout-alert {
  animation: checkoutBlink 1s ease-in-out infinite;
}

.late-reason-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  border: 1px solid #efb4ad;
  border-radius: 8px;
  padding: 10px;
  background: #fffafa;
}

.late-reason-form textarea {
  min-height: 74px;
}

.late-reason-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.late-reason-summary {
  color: var(--danger);
  font-weight: 800;
}

@keyframes checkoutBlink {
  0%,
  100% {
    box-shadow: none;
  }

  50% {
    box-shadow: 0 0 0 5px rgba(180, 35, 24, 0.2);
  }
}

.item-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.item-main strong,
.item-main span,
.item-main small {
  overflow-wrap: anywhere;
}

.item-main span,
.item-main small,
.empty {
  color: var(--muted);
}

.item-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.amount {
  font-weight: 800;
}

.checklist {
  display: grid;
  gap: 14px;
}

.check-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.check-group h3 {
  padding: 12px;
  background: var(--primary-soft);
  color: var(--brown);
}

.check-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(250px, 0.9fr) minmax(180px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.check-title {
  line-height: 1.35;
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.segmented label {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brown);
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
}

.segmented input {
  width: 16px;
  min-height: 16px;
}

.segmented label:has(input:checked) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.observation {
  min-height: 38px;
}

.signature-area {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdfb;
}

.checklist-evidence {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffdfb;
}

.checklist-evidence-preview,
.checklist-evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.checklist-evidence-preview:empty::before {
  content: "Nenhuma foto registrada.";
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.checklist-evidence-photo {
  display: grid;
  gap: 6px;
  align-content: start;
}

.checklist-evidence-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.checklist-evidence-photo small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.checklist-evidence-photo figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#signature-canvas {
  display: block;
  width: 100%;
  min-height: 220px;
  border: 1px dashed #aab7c4;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.detail {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin-bottom: 12px;
}

.detail-grid span,
.detail-row span,
.detail-row small {
  overflow-wrap: anywhere;
}

.detail-group {
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.detail-group h4 {
  padding: 9px 10px;
  background: var(--surface-soft);
}

.detail-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px minmax(120px, 0.8fr);
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

.signature-image {
  display: block;
  width: min(360px, 100%);
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-table {
  display: grid;
  gap: 8px;
}

.report-panel form {
  margin-bottom: 14px;
  border: 1px solid #dce8d6;
  border-radius: 8px;
  padding: 14px;
  background: #f7fbf5;
}

.report-document {
  overflow: hidden;
  border: 1px solid #d7e3d1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(63, 45, 35, 0.1);
}

.report-brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px clamp(16px, 3vw, 26px);
  border-bottom: 5px solid #70a943;
  background: linear-gradient(135deg, #ffffff 0%, #eef7ea 54%, #fdeaf2 100%);
}

.report-brand-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.report-logo-frame {
  display: block;
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  overflow: hidden;
  border: 1px solid #ead6df;
  border-radius: 8px;
  background: #fff;
}

.report-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.operational-report-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #406e23;
}

.operational-report-logo {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  object-fit: contain;
}

.operational-report-header > div { min-width: 0; }
.operational-report-header h1 { margin: 4px 0; font-size: 20px; overflow-wrap: anywhere; }
.operational-report-header small { display: block; }

@media (max-width: 480px) {
  .operational-report-header { align-items: flex-start; flex-direction: column; }
}

.report-kicker {
  display: block;
  margin-bottom: 4px;
  color: #000;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.report-title {
  color: #3f2d23;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.15;
}

.report-generated {
  display: block;
  margin-top: 5px;
  color: #5f6f63;
  font-weight: 700;
}

.report-brand-seal {
  min-width: 150px;
  border: 1px solid #e5c3d2;
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.78);
  text-align: right;
}

.report-brand-seal strong,
.report-brand-seal span {
  display: block;
}

.report-brand-seal strong {
  color: #3f2d23;
  font-size: 1rem;
}

.report-brand-seal span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.report-filter-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px clamp(14px, 3vw, 22px);
  border-bottom: 1px solid #ead6df;
  background: #fff7fb;
}

.report-filter-chip,
.report-summary-card {
  min-width: 0;
  border: 1px solid #e4eadf;
  border-left: 4px solid #70a943;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.report-filter-chip span,
.report-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.report-filter-chip strong,
.report-summary-card strong {
  display: block;
  margin-top: 4px;
  color: var(--brown);
  overflow-wrap: anywhere;
}

.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 16px clamp(14px, 3vw, 22px) 4px;
}

.report-summary-card {
  border-left-color: #d98bad;
  background: #fffafd;
}

.report-summary-card strong {
  color: #3f2d23;
  font-size: 1.15rem;
}

.report-data-panel {
  padding: 16px clamp(14px, 3vw, 22px) 22px;
}

.report-data-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #3f2d23;
}

.report-data-heading span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.report-data-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.report-data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.report-data-table th,
.report-data-table td {
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.report-data-table th {
  background: #3f2d23;
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.report-data-table td {
  border-top: 1px solid var(--line);
  color: var(--brown);
  font-size: 0.92rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.report-data-table tr:nth-child(even) td {
  background: #f7fbf5;
}

.report-action-cell {
  white-space: nowrap;
}

.report-empty-state {
  border: 1px dashed #d8c9bb;
  border-radius: 8px;
  padding: 22px;
  background: #fffdfb;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.report-row {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 0.8fr 0.8fr 0.8fr;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfb;
}

.report-row span,
.report-row strong {
  overflow-wrap: anywhere;
}

.report-total {
  background: var(--primary-soft);
  font-weight: 800;
}

.availability-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.availability-filter {
  max-width: 420px;
  margin-bottom: 14px;
  border: 1px solid #dce8d6;
  border-radius: 8px;
  padding: 12px;
  background: #f7fbf5;
}

.dashboard-availability-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.45fr);
  gap: 10px;
  max-width: 680px;
  align-items: end;
}

.metric.available strong {
  color: var(--success);
}

.metric.route strong {
  color: var(--warning);
}

.metric.unavailable strong {
  color: var(--danger);
}

.driver-availability-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.driver-availability-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.driver-availability-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 118px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 13px;
  background: #fffdfb;
}

.driver-availability-card.disponivel {
  border-color: #95d070;
  border-left-color: #5f9735;
  background: #e8f8df;
}

.driver-availability-card.disponivel.freelancer-available {
  border-color: #6fb3dc;
  border-left-color: #2f7fb3;
  background: #dff2ff;
}

.driver-availability-card.driver-away-status {
  border-color: #b995d8;
  border-left-color: #7f52a7;
  background: #eee0f8;
}

.driver-availability-card.em_rota {
  border-color: #f4d57a;
  border-left-color: #d9a62a;
  background: #fff5d1;
}

.driver-availability-card.em_rota .badge.warn {
  border: 1px solid #d9a62a;
  background: #f2d36b;
  color: #000;
}

.driver-availability-card.route-near-limit-alert {
  border-color: #f59e0b;
  border-left-color: #c86f00;
  background: #ffe6a3;
  animation: routeNearLimitBlink 0.9s ease-in-out infinite;
}

.driver-availability-card.route-near-limit-alert .driver-availability-main span,
.driver-availability-card.route-near-limit-alert .driver-availability-main small {
  color: #3f2a00;
  font-weight: 800;
}

.driver-availability-card.route-near-limit-alert .badge.warn,
.driver-availability-card.route-near-limit-alert .badge.route-soon {
  border: 1px solid #9a4f00;
  background: #c86f00;
  color: #fff;
}

.driver-availability-card.route-late-alert {
  border-color: #ff0000;
  border-left-color: #ff0000;
  background: #ff1f1f;
  color: #fff;
  animation: routeLateBlink 0.75s ease-in-out infinite;
}

.driver-availability-card.route-late-alert .driver-availability-main span,
.driver-availability-card.route-late-alert .driver-availability-main small {
  color: #fff;
  font-weight: 800;
}

.driver-availability-card.route-late-alert .badge.danger {
  background: #fff;
  color: #b00000;
}

.driver-availability-card.desabilitado,
.driver-availability-card.indisponivel {
  border-color: #efc4bf;
  border-left-color: var(--danger);
  background: #fff6f5;
}

.driver-availability-card.indisponivel.driver-away-status,
.driver-availability-card.desabilitado.driver-away-status {
  border-color: #b995d8;
  border-left-color: #7f52a7;
  background: #eee0f8;
}

@keyframes routeNearLimitBlink {
  0%,
  100% {
    background: #ffe6a3;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.24);
  }

  50% {
    background: #ffc857;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.28);
  }
}

@keyframes routeLateBlink {
  0%,
  100% {
    background: #ff1f1f;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.35);
  }

  50% {
    background: #b00000;
    box-shadow: 0 0 0 7px rgba(255, 0, 0, 0.35);
  }
}

.driver-availability-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.driver-availability-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.driver-availability-badges {
  display: inline-flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.driver-availability-title strong,
.driver-availability-main span,
.driver-availability-main small {
  overflow-wrap: anywhere;
}

.driver-availability-main span,
.driver-availability-main small {
  color: var(--muted);
}

.route-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 7px;
  margin-top: 4px;
}

.route-info-item {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(86, 115, 63, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
}

.route-info-item.route-info-wide {
  grid-column: 1 / -1;
}

.route-info-item span {
  display: block;
  margin-bottom: 2px;
  color: #5d6657;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.route-info-item strong {
  display: block;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.route-info-item.route-info-highlight {
  border-color: rgba(217, 166, 42, 0.42);
  background: rgba(255, 249, 222, 0.82);
}

.route-info-item.route-info-delay {
  border-color: rgba(176, 0, 0, 0.3);
  background: rgba(255, 233, 230, 0.86);
}

.route-info-item.route-info-delay span,
.route-info-item.route-info-delay strong {
  color: #8f130c;
}

.driver-availability-card.route-near-limit-alert .route-info-item {
  border-color: rgba(154, 79, 0, 0.28);
  background: rgba(255, 255, 255, 0.62);
}

.driver-availability-card.route-near-limit-alert .route-info-item span,
.driver-availability-card.route-near-limit-alert .route-info-item strong {
  color: #3f2a00;
}

.driver-availability-card.route-late-alert .route-info-item {
  border-color: rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.18);
}

.driver-availability-card.route-late-alert .route-info-item span,
.driver-availability-card.route-late-alert .route-info-item strong {
  color: #fff;
}

.availability-toggle {
  position: relative;
  width: 76px;
  min-width: 76px;
  min-height: 38px;
  border-radius: 999px;
  padding: 5px;
  background: #f2eadf;
  color: var(--muted);
  text-align: right;
}

.availability-toggle::before {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(63, 45, 35, 0.25);
  content: "";
  transition: transform 0.18s ease;
}

.availability-toggle span {
  position: relative;
  z-index: 1;
  display: block;
  padding: 4px 5px;
  font-size: 0.72rem;
  font-weight: 900;
}

.availability-toggle.on {
  background: var(--success);
  color: #fff;
}

.availability-toggle.on::before {
  transform: translateX(38px);
}

.availability-toggle.off {
  background: #f2eadf;
  color: var(--brown);
  text-align: left;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--brown);
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.toast.error {
  background: var(--danger);
}

.restriction-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(63, 45, 35, 0.58);
}

.restriction-card {
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  border: 2px solid var(--danger);
  border-top: 8px solid var(--danger);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(63, 45, 35, 0.28);
}

.restriction-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 1.55rem;
  font-weight: 900;
}

.confirmation-card {
  border-color: var(--primary);
  border-top-color: var(--accent);
}

.confirmation-mark {
  background: var(--primary-dark);
}

.restriction-content {
  display: grid;
  gap: 6px;
}

.restriction-content span {
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.restriction-content h2 {
  margin: 0;
  color: var(--danger);
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.confirmation-content span,
.confirmation-content h2 {
  color: var(--brown);
}

.success-card {
  border-color: var(--success);
  border-top-color: var(--success);
}

.success-mark {
  background: var(--success);
}

.success-content span,
.success-content h2 {
  color: var(--success);
}

.restriction-content p {
  margin: 0;
  color: var(--brown);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.restriction-ok {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 116px;
  background: var(--danger);
  color: #fff;
}

.restriction-ok:hover {
  background: #8f1d14;
}

.success-ok {
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 116px;
  background: var(--success);
  color: #fff;
}

.success-ok:hover {
  background: var(--primary-dark);
}

.confirmation-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.confirmation-actions button {
  min-width: 112px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1050px) {
  .two-columns,
  .metric-grid,
  .dashboard-period-controls,
  .dashboard-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .availability-summary {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .check-row,
  .report-row {
    grid-template-columns: 1fr;
  }

  .item-side {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-brand {
    align-items: center;
  }

  .app-header-logo {
    width: 88px;
    height: 88px;
  }

  .two-columns,
  .metric-grid,
  .dashboard-period-controls,
  .dashboard-charts,
  .form-grid,
  .inline-task-grid,
  .route-stop-picker,
  .route-stop-total,
  .route-stop-item,
  .detail-grid,
  .report-filter-strip,
  .report-summary-grid,
  .availability-summary {
    grid-template-columns: 1fr;
  }

  .combo-toggle,
  .inline-task-grid button {
    width: 100%;
    min-width: 0;
  }

  .panel {
    padding: 14px;
  }

  .dashboard-chart-card {
    padding: 14px;
  }

  .dashboard-chart-card.wide-chart {
    grid-column: auto;
  }

  .dashboard-bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dashboard-bar-value {
    text-align: left;
  }

  .vehicle-fuel-efficiency-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .vehicle-fuel-efficiency-value,
  .vehicle-fuel-efficiency-cost {
    text-align: left;
  }

  .driver-efficiency-ranking-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .dashboard-donut-layout {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-brand-header,
  .report-brand-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-logo-frame {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }

  .report-brand-seal {
    width: 100%;
    text-align: left;
  }

  .list-item {
    grid-template-columns: 1fr;
  }

  .list-item:has(> .person-avatar), .driver-availability-card { grid-template-columns:auto minmax(0,1fr); }
  .list-item:has(> .person-avatar) .item-side, .driver-availability-card .availability-toggle { grid-column:1/-1; }

  .driver-availability-card {
    grid-template-columns: 1fr;
  }

  .dashboard-availability-controls {
    grid-template-columns: 1fr;
  }

  .availability-toggle {
    justify-self: start;
  }

  .segmented {
    grid-template-columns: repeat(3, minmax(78px, 1fr));
    overflow-x: auto;
  }

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