:root {
  --bg: #efefeb;
  --surface: #ffffff;
  --surface-soft: #f6f6f2;
  --surface-warm: #fff7d6;
  --line: #deded8;
  --line-strong: #b8b8af;
  --text: #171717;
  --muted: #67675f;
  --brand: #fbb800;
  --brand-hover: #dfa300;
  --success: #087443;
  --success-soft: #e4f7ec;
  --warning: #995c00;
  --warning-soft: #fff0c2;
  --dark: #090909;
  --radius: 12px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
  --font: "Gotham", "Avenir Next", "Montserrat", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

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

button { cursor: pointer; }
[hidden] { display: none !important; }

.fleet-gate { max-width: 36rem; margin: 12vh auto; padding: 2rem; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.fleet-gate h1 { margin-top: 0; }
.fleet-gate p { color: var(--muted); line-height: 1.5; }
.app-shell.is-read-only #maintenance-plan-create,
.app-shell.is-read-only #reading-form,
.app-shell.is-read-only #vehicle-add,
.app-shell.is-read-only #profile-edit-vehicle,
.app-shell.is-read-only [data-update-vehicle],
.app-shell.is-read-only #vehicle-form-section,
.app-shell.is-read-only #service-order-form,
.app-shell.is-read-only #license-form,
.app-shell.is-read-only #tire-cost-form,
.app-shell.is-read-only #tire-dot-form,
.app-shell.is-read-only #tire-distance-form,
.app-shell.is-read-only #tire-movement-form,
.app-shell.is-read-only #fuel-form,
.app-shell.is-read-only .admin-form,
.app-shell.is-read-only #order-new,
.app-shell.is-read-only #profile-open-order,
.app-shell.is-read-only #cta-import-file,
.app-shell.is-read-only #cta-api-preview,
.app-shell.is-read-only #cta-import-commit,
.app-shell.is-read-only #import-fleet-preview,
.app-shell.is-read-only [data-map-add-cost],
.app-shell.is-read-only [data-map-add-km],
.app-shell.is-read-only [data-send-tire-stock] { display: none !important; }

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 20px;
  background: var(--dark);
  color: #f8faf7;
}

.brand {
  display: grid;
  gap: 8px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand img {
  width: min(100%, 210px);
  height: auto;
}

.brand h1,
.brand p { margin: 0; }

.brand h1 {
  font-size: 1.8rem;
  line-height: 1.05;
}

.brand p,
.sidebar-note p {
  color: rgba(248, 250, 247, 0.7);
  line-height: 1.5;
}

.brand-kicker,
.eyebrow,
.section-kicker,
.sidebar-note-label {
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.back-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible { color: var(--brand); }

.platform-nav { display: grid; gap: 6px; padding: 12px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--radius); background: rgba(255, 255, 255, 0.05); }
.platform-nav-label { margin-bottom: 3px; color: var(--brand); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.platform-nav-link { display: block; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius); color: #f8faf7; font-weight: 800; text-decoration: none; }
.platform-nav-link:hover, .platform-nav-link:focus-visible, .platform-nav-link.is-current { border-color: var(--brand); background: var(--brand); color: #000000; outline: none; }

.module-nav { display: grid; gap: 7px; }
.module-nav-hint { display: none; }

.module-nav-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 60px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #ffffff;
  text-align: left;
}

.module-nav a.module-nav-item { text-decoration: none; }
a.module-nav-item:hover, a.module-nav-item:focus-visible { border-color: var(--brand); background: var(--brand); color: #000; }
a.module-nav-item:hover small, a.module-nav-item:focus-visible small { color: rgba(0, 0, 0, .62); }

.module-nav-item span { font-weight: 850; }
.module-nav-item small { color: rgba(255, 255, 255, 0.58); }

button.module-nav-item:hover,
button.module-nav-item:focus-visible,
.module-nav-item.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #000000;
  outline: none;
}

button.module-nav-item:hover small,
button.module-nav-item:focus-visible small,
.module-nav-item.is-active small { color: rgba(0, 0, 0, 0.62); }

.module-nav-item.is-disabled {
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.48);
  cursor: not-allowed;
}

.sidebar-note {
  display: grid;
  gap: 7px;
  margin-top: auto;
  padding: 15px;
  border: 1px solid rgba(251, 184, 0, 0.4);
  border-radius: var(--radius);
  background: rgba(251, 184, 0, 0.08);
}

.sidebar-note strong,
.sidebar-note p { margin: 0; }

.main-content {
  min-width: 0;
  padding: 28px clamp(22px, 4vw, 54px) 48px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.topbar h2,
.topbar p { margin: 0; }

.topbar h2 {
  margin-top: 5px;
  font-size: clamp(2rem, 4vw, 3.15rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.topbar p {
  max-width: 650px;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.topbar-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mode-badge,
.date-badge,
.local-badge,
.counter {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.mode-badge { background: var(--dark); color: var(--brand); }
.date-badge,
.counter { border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.local-badge { background: var(--warning-soft); color: var(--warning); }

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

.back-button {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 850;
}

.back-button:hover,
.back-button:focus-visible {
  border-color: var(--brand-hover);
  background: var(--surface-warm);
  outline: 3px solid rgba(251, 184, 0, 0.18);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.035);
}

.metric-card span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.metric-card small { color: var(--muted); line-height: 1.35; }

.workspace-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.section-header.compact { align-items: center; }
.section-header h3 { margin: 4px 0 0; font-size: 1.4rem; }

.section-tools {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 9px;
}

.search-field,
.filter-field,
.field {
  display: grid;
  gap: 6px;
}

.search-field span,
.filter-field span,
.field > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

input,
select { min-height: 43px; padding: 9px 11px; }
textarea { padding: 11px; resize: vertical; }

input:focus,
select:focus,
textarea:focus {
  border-color: #967000;
  box-shadow: 0 0 0 3px rgba(251, 184, 0, 0.2);
}

.suggestion-menu {
  position: absolute;
  z-index: 1000;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
}
.suggestion-menu[hidden] { display: none; }
.suggestion-menu button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.suggestion-menu button:hover,
.suggestion-menu button.is-selected { background: #fff2c6; }

.search-field { width: min(280px, 35vw); }
.filter-field { width: 150px; }

.primary-button {
  min-height: 43px;
  padding: 9px 15px;
  border: 1px solid var(--brand-hover);
  border-radius: 9px;
  background: var(--brand);
  color: #000000;
  font-weight: 900;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--brand-hover);
  outline: 3px solid rgba(251, 184, 0, 0.22);
}

.fleet-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.fleet-table {
  width: 100%;
  min-width: 1380px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.preventive-table { min-width: 900px; }
.preventive-table td:nth-child(4) { min-width: 210px; }

.fleet-table th,
.fleet-table td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.fleet-table th {
  background: var(--dark);
  color: #ffffff;
  font-size: 0.69rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  white-space: nowrap;
}

.fleet-table tbody tr:nth-child(even) { background: var(--surface-soft); }
.fleet-table tbody tr:hover { background: var(--surface-warm); }
.fleet-table tbody tr:last-child td { border-bottom: 0; }

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: 900;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-button span {
  color: var(--brand);
  font-size: 0.84rem;
}

.sort-button:hover,
.sort-button:focus-visible {
  color: var(--brand);
  outline: none;
}

.action-heading { display: inline-block; padding: 4px 0; }
.fleet-id { font-size: 1rem; }
.model-cell { min-width: 180px; }
.numeric-cell { white-space: nowrap; }
.numeric-cell small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.66rem; }
.date-cell { min-width: 128px; color: var(--muted); font-size: 0.74rem; }
.muted-value { color: var(--muted); font-size: 0.75rem; }

.vehicle-type {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.fleet-data-note {
  margin: 0;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #6e5200;
  font-weight: 850;
}

.empty-state {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.reading-form { padding-bottom: 20px; }
.form-intro { margin: 20px 22px 0; color: var(--muted); line-height: 1.55; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 22px;
}

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

.input-suffix {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
}

.input-suffix input { border-radius: 9px 0 0 9px; }
.input-suffix strong {
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-left: 0;
  border-radius: 0 9px 9px 0;
  background: var(--surface-soft);
  color: var(--muted);
}

.form-feedback {
  margin: 0 22px 14px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--warning-soft);
  color: var(--warning);
  font-weight: 700;
}

.form-feedback.is-success { background: var(--success-soft); color: var(--success); }
.record-dialog { width: min(800px, calc(100vw - 24px)); max-height: 90dvh; padding: 0; border: 0; border-radius: 14px; overflow-y: auto; }
.record-dialog::backdrop { background: rgb(0 0 0 / 45%); }
.record-dialog .workspace-card { margin: 0; }
.record-dialog textarea { width: 100%; font: inherit; }
.record-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.record-toast { position: fixed; bottom: 20px; right: 20px; max-width: min(440px, calc(100vw - 32px)); z-index: 80; margin: 0; box-shadow: 0 6px 22px rgb(0 0 0 / 18%); }
.app-shell.is-read-only .record-actions,
.app-shell.is-read-only [data-fleet-edit],
.app-shell.is-read-only [data-edit-local-order] { display: none; }
.order-plan-options { display: grid; gap: .5rem; max-height: 18rem; overflow: auto; }
.order-plan-choice { display: flex; align-items: center; gap: .65rem; padding: .65rem; min-height: 44px; border: 1px solid #ddd; border-radius: 8px; }
.order-plan-choice input { width: 20px; height: 20px; flex: none; }

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px 0;
  border-top: 1px solid var(--line);
}

.form-footer span { color: var(--muted); font-size: 0.8rem; }

.reading-list { display: grid; }

.reading-item {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.reading-item:last-child { border-bottom: 0; }
.reading-item-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.reading-item-header small { color: var(--muted); }
.reading-item-values { display: flex; flex-wrap: wrap; gap: 7px; }
.reading-item-values span { padding: 5px 8px; border-radius: 7px; background: var(--surface-soft); font-size: 0.78rem; font-weight: 800; }
.reading-item p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.reading-empty { padding: 34px 20px; color: var(--muted); line-height: 1.5; text-align: center; }

.dashboard-section {
  display: grid;
  gap: 18px;
}

.service-order-intro { margin: 12px 0 18px; color: var(--muted); line-height: 1.5; }
.service-order-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.service-order-form { padding-bottom: 18px; }
.service-order-history { position: sticky; top: 18px; }
.service-order-parts { padding: 0 22px 16px; }
.service-order-parts .section-header { padding: 12px 0; }
.service-order-parts h4 { margin: 4px 0 0; font-size: 1rem; }
.service-order-part { display: grid; grid-template-columns: minmax(160px, 1fr) 80px 120px 36px; gap: 10px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.service-order-part .field { min-width: 0; }
.service-order-part-identity { display: grid; gap: 8px; min-width: 0; }
@media (max-width: 640px) { .service-order-part-identity { grid-column: 1 / -1; } .service-order-part-identity .field:first-child { grid-column: auto; } }
.service-order-part .field span { font-size: .7rem; }
.service-order-part-remove { align-self: end; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-weight: 800; }
.service-order-costs { border-top: 1px solid var(--line); }
.service-order-calculated { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 22px 16px; padding: 14px 16px; border-radius: 9px; background: var(--surface-warm); font-weight: 800; }
.service-order-history .profile-history { padding: 0 18px 14px; }
.service-order-history .dashboard-empty { padding: 24px 0; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.tire-cost-chart { overflow-x: auto; padding: 8px 20px 0; min-height: 120px; }
.tire-cost-chart svg { display: block; width: 100%; min-width: 600px; height: auto; }
.tire-cost-chart-legend { display: grid; gap: 8px; padding: 0 22px 20px; }
.tire-chart-legend-item { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
.tire-chart-legend-item small { color: var(--muted); }
.tire-chart-swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.tire-chart-selected { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 22px 12px; }
.tire-chart-chip { border: 1px solid var(--line); background: var(--surface-soft); border-radius: 16px; padding: 5px 10px; color: var(--ink); cursor: pointer; }
.service-order-form .form-footer { flex-wrap: wrap; }

.open-orders-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  padding: 18px 20px 4px;
}

.open-order-button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--text);
  background: var(--surface-soft);
  cursor: pointer;
}

.open-order-button:hover { border-color: var(--brand-hover); }
.open-order-button span { color: var(--muted); font-size: .8rem; }

.dashboard-filters-card { box-shadow: none; }

.dashboard-filters {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.date-filter { width: 150px; }
.vehicle-filter { width: min(260px, 30vw); }
.dashboard-metrics { margin-bottom: 0; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

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

.chart-list,
.maintenance-list,
.license-list {
  display: grid;
}

.chart-list { padding: 8px 18px 18px; }

.chart-row {
  display: grid;
  grid-template-columns: minmax(74px, 0.35fr) minmax(130px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
}

.chart-row-label {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.chart-bar {
  min-width: 3px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-hover), var(--brand));
}

.chart-row-value {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}
.chart-row.is-overdue .chart-bar { background: #bb4435; }
.chart-row.is-overdue .chart-row-value { color: #b42318; }
.maintenance-chart-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; padding: 18px; border-top: 1px solid var(--line); }
.maintenance-chart-filters .filter-field { min-width: min(100%, 280px); }
.vehicle-picker { position: relative; min-width: min(100%, 250px); }
.vehicle-picker summary { cursor: pointer; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; font-weight: 800; }
.vehicle-picker[open] { z-index: 4; }
.vehicle-picker-actions, .vehicle-picker-list { padding: 10px; background: var(--surface); border: 1px solid var(--line); }
.vehicle-picker-actions { display: flex; gap: 8px; }
.vehicle-picker-actions button { border: 0; background: transparent; color: var(--brand-hover); font: inherit; font-size: .75rem; font-weight: 800; cursor: pointer; }
.vehicle-picker-list { display: grid; gap: 6px; max-height: 230px; overflow: auto; }
.vehicle-picker-list label { display: flex; align-items: center; gap: 7px; font-size: .8rem; }
.profile-maintenance, .profile-fuel { margin-bottom: 18px; }
.fuel-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; padding: 18px; }
.fuel-form .field { min-width: 130px; flex: 1 1 150px; }
#tire-detail-add-cost { margin: 16px 0 0; }

.dashboard-empty {
  padding: 34px 20px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.maintenance-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.maintenance-item:last-child { border-bottom: 0; }
.maintenance-item-title { display: grid; gap: 4px; }
.maintenance-item-title strong { line-height: 1.3; }
.maintenance-item-title span { color: var(--muted); font-size: 0.76rem; }

.maintenance-balance {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 3px;
}

.maintenance-balance strong { font-size: 1rem; }
.maintenance-balance small { color: var(--muted); }

.status-pill {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.status-pill.is-overdue { background: #fee4e2; color: #b42318; }
.status-pill.is-attention { background: var(--warning-soft); color: var(--warning); }
.status-pill.is-ok { background: var(--success-soft); color: var(--success); }

.data-note {
  margin: 0;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.formula-note {
  display: grid;
  gap: 3px;
  max-width: 330px;
  padding: 10px 12px;
  border: 1px solid #ead58c;
  border-radius: 9px;
  background: var(--surface-warm);
  text-align: right;
}

.formula-note strong { font-size: 0.78rem; }
.formula-note span { color: var(--muted); font-size: 0.72rem; }

.tire-performance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1px;
  background: var(--line);
}

.tire-performance-card {
  display: grid;
  gap: 13px;
  padding: 17px;
  background: var(--surface);
}

.tire-title { display: grid; gap: 3px; }
.tire-title strong { font-size: 1rem; }
.tire-title span { color: var(--muted); font-size: 0.76rem; }

.tire-distance {
  display: grid;
  gap: 3px;
  padding: 11px;
  border-radius: 9px;
  background: var(--surface-soft);
}

.tire-distance span { color: var(--muted); font-size: 0.67rem; font-weight: 850; text-transform: uppercase; }
.tire-distance strong { font-size: 1.2rem; }

.tire-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}

.tire-cost-pending {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.7rem;
  font-weight: 850;
}

.report-panel { overflow: hidden; }
.report-tire-grid { max-height: 640px; overflow: auto; }
.tire-report-table-wrap { overflow: auto; }
.tire-report-table { min-width: 860px; }

.view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.view-switch-button {
  border: 0;
  border-radius: 6px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 850;
}

.view-switch-button.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.tire-cost-workspace { overflow: hidden; }
.tire-cost-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px minmax(160px, .65fr) auto;
  align-items: end;
  gap: 13px;
  padding: 18px;
  background: var(--surface-soft);
}

.tire-cost-form .primary-button { min-height: 42px; }
#tire-cost-form { grid-template-columns: repeat(4, minmax(130px, 1fr)) auto; }
@media (max-width: 900px) { #tire-cost-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } #tire-cost-form .primary-button { grid-column: 1 / -1; } }

.tire-map-card { overflow: hidden; }
.tire-map-header { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 18px; border-bottom: 1px solid var(--line); }
.tire-map-header h3 { margin: 4px 0 0; }
.tire-map-header p { margin: 0; color: var(--muted); font-size: .8rem; }
.tire-map-layout { display: grid; grid-template-columns: minmax(500px, 1.5fr) minmax(250px, .75fr); min-height: 530px; }
.vehicle-map { display: grid; justify-items: center; align-content: start; padding: 26px 34px; background: #f5f6f6; }
.vehicle-cab { display: grid; place-items: center; width: 42%; height: 72px; border: 5px solid #29353a; border-bottom: 0; border-radius: 48px 48px 10px 10px; background: #d9e0e0; color: #34454b; font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.vehicle-chassis { width: min(100%, 520px); padding: 18px 0 28px; background: linear-gradient(90deg, transparent 45%, #aab5b8 45%, #aab5b8 46%, transparent 46%, transparent 54%, #aab5b8 54%, #aab5b8 55%, transparent 55%); }
.vehicle-axle { position: relative; display: grid; grid-template-columns: minmax(118px, 1fr) 54px minmax(118px, 1fr); align-items: center; min-height: 110px; }
.axle-side { display: flex; gap: 7px; }
.axle-side.left { justify-content: end; }
.axle-side.right { justify-content: start; }
.axle-line { display: grid; place-items: center; height: 5px; background: #29353a; }
.axle-line span { position: absolute; transform: translateY(-25px); color: #64767b; font-size: .65rem; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.map-tire { width: 56px; min-height: 76px; padding: 7px 4px; border: 2px solid #26363b; border-radius: 10px; background: #253237; color: #fff; cursor: pointer; box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.map-tire:hover, .map-tire:focus-visible, .map-tire.is-selected { border-color: var(--brand); background: #37494f; outline: 3px solid rgba(251,184,0,.25); }
.map-tire strong, .map-tire small { display: block; overflow: hidden; text-overflow: ellipsis; }
.map-tire strong { font-size: .9rem; }
.map-tire small { margin-top: 5px; color: #d4e2e4; font-size: .54rem; line-height: 1.2; white-space: nowrap; }
.unmapped-tires { grid-column: 1 / -1; display: flex; justify-content: center; gap: 8px; padding-top: 8px; }
.tire-map-sidebar { border-left: 1px solid var(--line); background: var(--surface); min-width: 0; }
.tire-map-detail { display: grid; align-content: start; gap: 13px; padding: 20px 24px; background: var(--surface); }
.tire-stock-card { border-top: 1px solid var(--line); padding-bottom: 14px; transition: background .15s ease, outline .15s ease; }
.tire-stock-card.is-drop-target { background: #fff7db; outline: 3px dashed var(--brand); outline-offset: -5px; }
.tire-stock-card .section-header { padding: 16px 20px 10px; }
.tire-stock-search { display: grid; margin: 0 20px 10px; }
.tire-stock-card .data-note { margin: 0 20px 10px; font-size: .75rem; }
.tire-stock-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; max-height: 260px; overflow-y: auto; padding: 0 20px 10px; }
.stock-tire { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); padding: 8px; cursor: grab; text-align: left; }
.stock-tire small { color: var(--muted); font-size: .7rem; }
.stock-tire.is-selected { border-color: var(--brand); background: #fff7db; }
.map-tire { cursor: grab; }
.map-tire:active, .stock-tire:active { cursor: grabbing; }
.map-empty-slot { width: 56px; min-height: 76px; display: grid; place-items: center; padding: 4px; border: 2px dashed #9caeb2; border-radius: 10px; background: rgba(255,255,255,.65); color: #536a70; cursor: pointer; }
.map-empty-slot span { font-size: 1.3rem; line-height: 1; }
.map-empty-slot small { font-size: .55rem; line-height: 1.1; text-align: center; }
.map-empty-slot:hover, .map-empty-slot:focus-visible, .map-empty-slot.is-drop-target { border-color: var(--brand); background: #fff7db; outline: none; }
.tire-map-detail > strong { font-size: 1.12rem; line-height: 1.35; }
.tire-map-detail p { margin: 0; color: var(--muted); }
.tire-map-detail dl { display: grid; gap: 8px; margin: 4px 0; }
.tire-map-detail dl div { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tire-map-detail dt { color: var(--muted); font-size: .78rem; }
.tire-map-detail dd { margin: 0; font-weight: 850; }
.fleet-profile-link { color: inherit; text-decoration: underline; text-decoration-color: var(--brand); text-underline-offset: 3px; }
.fleet-profile-link:hover { color: var(--brand); }
.profile-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.profile-summary { padding: 20px; margin-bottom: 16px; }
.profile-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.profile-facts > div { display: grid; gap: 5px; padding: 12px; background: var(--surface-soft, #f5f6f6); border-radius: 8px; overflow-wrap: anywhere; }
.profile-facts span, .profile-history-item span { color: var(--muted); font-size: .78rem; }
.profile-facts strong { font-size: .92rem; }
.profile-history { max-height: 530px; overflow: auto; }
.profile-history-item { display: flex; justify-content: space-between; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.profile-history-item > div { display: grid; gap: 4px; }
.profile-history-item > div:last-child { text-align: right; }
.profile-note { color: var(--muted); font-size: .8rem; }
.page-back { margin: 0 0 16px; }
.profile-order-link { width: 100%; background: transparent; border: 0; font: inherit; text-align: left; cursor: pointer; }
.profile-order-link:hover, .profile-order-link:focus-visible { background: #fff9e8; outline: 2px solid var(--brand); outline-offset: 0; }
.profile-order-link > span { display: grid; gap: 4px; }
.profile-order-link > span:last-child { text-align: right; }
.profile-order-link strong { color: var(--ink, #202625); font-size: .9rem; }
.profile-order-link small { font-size: .75rem; }
.import-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; margin: 0 0 10px; }
.import-row p { margin: 5px 0 0; color: var(--muted); font-size: .82rem; }
.import-status { flex: none; border-radius: 999px; padding: 6px 10px; background: #e8f4eb; color: #1e6941; font-size: .75rem; font-weight: 800; }
.import-status.is-error { background: #ffe9e6; color: #a5291b; }
@media (max-width: 700px) { .profile-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .profile-facts { grid-template-columns: 1fr; } .profile-history-item { flex-direction: column; } .profile-history-item > div:last-child { text-align: left; } }
@media (max-width: 1100px) { .service-order-layout { grid-template-columns: 1fr; } .service-order-history { position: static; } }
@media (max-width: 640px) { .service-order-part { grid-template-columns: 1fr 1fr 38px; } .service-order-part .field:first-child { grid-column: 1 / -1; } .service-order-part-remove { grid-column: 3; grid-row: 2; } }

.license-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  min-height: 220px;
}

.license-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px;
  align-content: start;
  gap: 13px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: var(--surface-soft);
}

.license-form .field:first-child,
.license-form .field:nth-child(3),
.license-form .primary-button { grid-column: 1 / -1; }

.license-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.license-item:last-child { border-bottom: 0; }

.admin-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.admin-tab { border: 1px solid #d9d9d9; border-radius: 999px; background: #fff; color: #313131; padding: .65rem 1rem; font: inherit; font-weight: 700; cursor: pointer; }
.admin-tab.is-active { border-color: #a97a0b; background: #fff5d8; color: #684900; }
.admin-tab[aria-pressed="true"]:focus-visible { outline: 3px solid #a97a0b; outline-offset: 2px; }
.preventive-filters { margin: 1rem 0 1.25rem; }
.preventive-filters .admin-tabs { margin-top: .65rem; }
.preventive-filters .admin-tab span { font-size: .82em; opacity: .75; }
.admin-form { margin-top: 1rem; }
.admin-table { min-width: 780px; }
.admin-table td, .admin-table th { white-space: nowrap; }
.admin-table .text-button { white-space: nowrap; }
.admin-expired { color: #a22; font-weight: 800; }
.profile-facts + .data-note { margin-top: 1rem; }
.profile-document-upload { max-width: 34rem; margin-top: 1rem; }
.maintenance-packages summary { cursor: pointer; font-weight: 800; }
.maintenance-packages > .field, .maintenance-packages form { margin-top: 20px; }
.maintenance-packages fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.maintenance-packages h4 { margin: 0 0 14px; }
.maintenance-package-item { display: grid; grid-template-columns: minmax(0,2fr) minmax(90px,1fr) minmax(100px,1fr) auto; align-items: end; gap: 10px; margin: 12px 0; }
@media (max-width: 640px) { .maintenance-package-item { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } .maintenance-package-item > .field:first-child { grid-column: 1 / -1; } .maintenance-package-item > button { grid-column: 1 / -1; justify-self: end; } }
.fuel-trend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1rem; }
.fuel-trend { min-width: 0; padding: 1rem; background: #f8f9f8; border: 1px solid #e5e8e5; border-radius: 14px; }
.fuel-trend h4 { margin: 0 0 .65rem; font-size: 1rem; }
.fuel-chart-scroll { overflow-x: auto; }
.fuel-line-svg { display: block; width: 100%; min-width: 560px; height: auto; }
.fuel-chart-label { fill: #65706e; font-size: 11px; font-family: inherit; }
.fuel-chart-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: #535d5b; margin-top: .3rem; }
.fuel-chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.fuel-chart-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 5px; }
.fuel-trends-panel #fuel-monthly-table { margin-top: 1rem; }
@media (max-width: 1200px) { .fuel-trend-grid { grid-template-columns: 1fr; } }
.license-person { display: grid; gap: 3px; }
.license-person span { color: var(--muted); font-size: 0.76rem; }

.license-days {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.license-days strong { font-size: 1.02rem; }
.license-days small { color: var(--muted); }
.license-days.is-expired strong { color: #b42318; }
.license-days.is-critical strong { color: var(--warning); }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-header { align-items: stretch; flex-direction: column; }
  .section-tools { justify-content: stretch; }
  .search-field { width: 100%; }
  .workspace-grid { grid-template-columns: 1fr; }
  .dashboard-filters { justify-content: stretch; }
  .vehicle-filter { width: min(300px, 40vw); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-height: auto; min-width: 0; }
  .brand p, .sidebar-note { display: none; }
  .platform-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-nav-label { grid-column: 1 / -1; }
  .platform-nav-link { text-align: center; min-width: 0; }
  .module-nav { display: flex; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .module-nav-item { flex: 0 0 calc(66.666% - 5px); width: auto; min-width: 0; scroll-snap-align: start; }
  .module-nav-item small { display: none; }
  .module-nav-hint { display: block; margin: -12px 0 0; color: rgba(255,255,255,.75); font-size: .78rem; }
  .sidebar-note { margin-top: 0; }
  .main-content { padding: 22px 15px 36px; }
  .topbar { flex-direction: column; }
  .topbar-badges { justify-content: flex-start; }
  .section-tools { align-items: stretch; flex-direction: column; }
  .filter-field { width: 100%; }
  .dashboard-filters { align-items: stretch; flex-direction: column; }
  .license-layout { grid-template-columns: 1fr; }
  .license-form { border-right: 0; border-bottom: 1px solid var(--line); }
  .tire-cost-form { grid-template-columns: 1fr 1fr; }
  .tire-cost-form .field:first-child, .tire-cost-form .primary-button { grid-column: 1 / -1; }
  .tire-map-layout { grid-template-columns: 1fr; }
  .tire-map-sidebar { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .tire-map-header { align-items: stretch; flex-direction: column; }
  .vehicle-map { padding: 22px 8px; overflow-x: auto; justify-items: start; }
  .vehicle-cab, .vehicle-chassis { min-width: 330px; }
  .vehicle-chassis { width: 330px; }
}

@media (max-width: 520px) {
  .platform-nav-link { font-size: .78rem; padding: 10px 6px; }
  .sidebar { gap: 12px; }
  .brand { gap: 4px; padding-bottom: 8px; }
  .brand img { width: 125px; }
  .brand h1 { font-size: 1.3rem; }
  .workspace-card { min-width: 0; }
  input[type="file"] { max-width: 100%; }
  .metric-grid,
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .manual-header-actions { align-items: stretch; flex-direction: column; }
}
#maintenance-plan-table td small { display: block; margin-top: 4px; color: var(--muted, #777); }
