:root {
  color-scheme: light;
  --ink: #202a35;
  --muted: #74808c;
  --line: #e1e6eb;
  --paper: #fff;
  --canvas: #f2f4f6;
  --green: #111a24;
  --lime: #82b4e2;
  --soft-green: #e8f0f7;
  --amber: #f6ecd2;
  --red: #f9e6e1;
  font-family: "DM Sans", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.login-screen { min-height:100vh; display:grid; place-items:center; padding:28px 18px; }
.login-content { width:min(100%,390px); }
.login-content h1 { margin:20px 0 8px; font-size:28px; }
.login-content p { color:var(--muted); }
.login-content form { display:grid; gap:18px; margin-top:24px; }
.login-content label { display:grid; gap:7px; font-size:14px; }
.login-content input { width:100%; min-height:44px; padding:10px 12px; border:1px solid var(--line); border-radius:6px; background:var(--paper); color:var(--ink); }
.login-content .button { min-height:44px; }
#login-message { min-height:24px; color:#eeb28c; }
.connection-bar { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:9px 20px; border-bottom:1px solid var(--line); font-size:12px; }
#company-label { font-weight:600; }
#connection-status { margin-left:auto; color:var(--muted); }
.connection-bar .action-button { min-height:32px; }
body {
  margin: 0;
  min-width: 320px;
  background: #12171d;
  color: var(--ink);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.brand { display: inline-flex; align-items: center; gap: 9px; margin: 0; color: #e8edf2; text-decoration: none; font: 800 22px "Manrope", sans-serif; letter-spacing: -1.5px; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #6d8ca7; border-radius: 10px; background: linear-gradient(145deg, #263d53, #1a2a3a); color: #dce8f2; font-size: 19px; box-shadow: inset 0 1px 0 #ffffff20; }
.brand-dot { color: var(--lime); }
.topbar-brand .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
.topbar-brand .brand-logo { width: 190px; height: 50px; border-radius: 5px; background: #fffaf4; object-fit: cover; object-position: 50% 27%; }
.topbar-left { display: flex; min-width: 0; align-items: center; gap: 25px; }
.nav-item { display: flex; align-items: center; gap: 8px; border: 0; color: #738090; background: transparent; text-align: center; }
.nav-item > span { width: 18px; font-size: 17px; text-align: center; }
.damage-nav-badge { width: auto !important; flex: 0 0 auto; margin-left: auto; padding: 3px 6px; border-radius: 12px; background: #c94d3c; color: white; font-size: 8px !important; font-weight: 700; line-height: 1.2; text-align: center; white-space: nowrap; }
.damage-nav-badge[hidden] { display: none !important; }
.eyebrow { margin: 0 0 7px 10px; color: #8697a8; font-size: 9px; font-weight: 700; letter-spacing: 1.25px; }
.main-content { min-width: 0; min-height: 100vh; padding-bottom: 102px; }
.topbar { position: sticky; z-index: 4; top: 0; height: 72px; display: flex; justify-content: space-between; align-items: center; padding: 0 40px; border-bottom: 1px solid #2c3946; background: #121922f2; color: #e8edf2; backdrop-filter: blur(12px); }
.breadcrumbs { display: flex; align-items: center; gap: 10px; color: #9aa8b6; font-size: 12px; }
.breadcrumbs strong { color: #e8edf2; font-weight: 600; }
.crumb-separator { color: #607181; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.user-switch { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: #e8edf2; }
.user-switch-label { max-width: 140px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.prototype-warning { padding: 8px 18px; border-bottom: 1px solid #b9c9d6; background: #dce7f0; color: #304c64; font-size: 11px; text-align: center; }
.nav-item[hidden] { display: none !important; }
.today-label { color: #9aa8b6; font-size: 11px; text-transform: capitalize; }
.avatar { display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid #52687d; border-radius: 50%; background: #25384a; color: #dce8f2; font-size: 12px; font-weight: 700; }
.page-content { max-width: 1240px; margin: 0 auto; padding: 38px 40px 24px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading h1 { margin: 0; color: #edf2f6; font: 700 clamp(25px, 3vw, 32px) "Manrope", sans-serif; letter-spacing: -1.1px; }
.page-heading p { margin: 7px 0 0; color: #b0bdc9; font-size: 13px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 39px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.button-primary { border-color: #527594; background: #29445d; color: white; }
.button-primary:hover { background: #365b7a; }
.button-quiet { border-color: var(--line); background: white; color: var(--ink); }
.button-quiet:hover { background: #f5f7f3; }
.button-plus { color: #a9d2f3; font-size: 17px; line-height: 1; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.metric-card, .panel, .table-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.metric-card { min-height: 126px; padding: 17px 18px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.metric-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; background: var(--soft-green); color: #426587; font-size: 15px; }
.metric-value { margin-top: 12px; font: 700 27px "Manrope", sans-serif; letter-spacing: -1px; }
.metric-foot { margin-top: 3px; color: var(--muted); font-size: 10px; }
.metric-foot .positive { color: #3f719c; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(270px, 1fr); gap: 16px; }
.follow-up-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.follow-up-panel { min-width: 0; }
.follow-up-row { display: flex; align-items: center; gap: 11px; min-height: 57px; padding: 10px 0; border-top: 1px solid #edf0f3; }
.follow-up-date { min-width: 94px; color: #426587; }
.follow-up-date strong, .follow-up-date small, .follow-up-info strong, .follow-up-info small { display: block; }
.follow-up-date strong, .follow-up-info strong { font-size: 10px; font-weight: 700; }
.follow-up-date small, .follow-up-info small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.follow-up-date.overdue { color: #aa5146; }
.follow-up-info { min-width: 0; flex: 1; }
.follow-up-info strong, .follow-up-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-up-empty { padding: 17px 0 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.panel { padding: 19px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-heading h2, .table-title { margin: 0; font: 700 14px "Manrope", sans-serif; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.text-link { padding: 5px 0; border: 0; background: transparent; color: #456e91; font-size: 11px; font-weight: 600; }
.activity-list { display: grid; }
.activity-row { display: flex; align-items: center; gap: 11px; padding: 12px 0; border-top: 1px solid #f0f1ee; }
.activity-symbol { display: grid; flex: 0 0 34px; height: 34px; place-items: center; border-radius: 10px; background: #f1f3ed; color: #64734e; }
.activity-info { min-width: 0; flex: 1; }
.activity-info strong, .activity-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-info strong { font-size: 11px; font-weight: 600; }
.activity-info small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.activity-amount { font-size: 11px; font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 20px; background: var(--soft-green); color: #4a713c; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status-pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status-pill.warning { background: var(--amber); color: #946c21; }
.status-pill.inactive { background: #eff0ee; color: #78827b; }
.status-pill.expired { background: var(--red); color: #a34f3e; }
.fleet-list { display: grid; gap: 13px; }
.fleet-row { display: flex; align-items: center; gap: 10px; }
.vehicle-icon { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; background: #f0f2ed; font-size: 16px; }
.fleet-info { min-width: 0; flex: 1; }
.fleet-info strong, .fleet-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fleet-info strong { font-size: 11px; font-weight: 600; }
.fleet-info small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.fleet-footer { display: flex; justify-content: space-between; margin-top: 17px; padding-top: 13px; border-top: 1px solid #f0f1ee; color: var(--muted); font-size: 10px; }
.table-panel { overflow: hidden; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 17px 19px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th { padding: 10px 19px; background: #f8f9f7; color: #7d8780; font-size: 9px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
td { padding: 13px 19px; border-top: 1px solid #f0f1ee; font-size: 11px; }
td strong { font-weight: 600; }
.table-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.record-id { display: block; margin-top: 4px; color: #78827b; font-size: 9px; font-weight: 600; letter-spacing: .25px; }
.record-id:empty { display: none; }
.plate { display: inline-block; padding: 5px 8px; border: 1px solid #dfe5eb; border-radius: 5px; background: #f7f9fb; font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.action-button { padding: 5px 7px; border: 0; border-radius: 5px; background: transparent; color: #78827b; font-size: 10px; }
.action-button:hover { background: #f1f3ef; color: var(--ink); }
.document-link { color: #456e91; font-size: 10px; font-weight: 600; }
.empty-state { padding: 35px 20px; color: var(--muted); text-align: center; font-size: 12px; }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.calendar-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 17px 20px; }
.calendar-toolbar h2 { margin: 0; font: 700 16px "Manrope", sans-serif; text-transform: capitalize; }
.calendar-toolbar p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.calendar-controls { display: flex; align-items: center; gap: 7px; }
.calendar-controls .button { min-height: 34px; }
.calendar-arrow { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); font-size: 20px; }
.calendar-arrow:hover { background: #f5f7f3; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8f9f7; }
.calendar-weekdays span { padding: 10px 6px; color: var(--muted); font-size: 10px; font-weight: 600; text-align: center; }
.calendar-day { min-width: 0; min-height: 90px; padding: 7px; overflow: hidden; border: 0; border-right: 1px solid #eef0ec; border-bottom: 1px solid #eef0ec; background: white; text-align: left; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day:hover { background: #f5f8fb; }
.calendar-day.selected { background: #eaf2f8; box-shadow: inset 0 0 0 1px #9fbad1; }
.calendar-day.outside-month { background: #fafbf9; }
.calendar-day-number { display: inline-grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; color: #566159; font-size: 10px; }
.calendar-day.today .calendar-day-number { background: var(--green); color: white; }
.calendar-day-events { display: grid; gap: 3px; margin-top: 4px; }
.calendar-event-dot { display: block; overflow: hidden; padding: 3px 4px; border-left: 2px solid #7996b5; border-radius: 3px; background: #edf2f7; color: #496583; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-dot.insurance, .agenda-marker.insurance, .calendar-legend i.insurance { border-color: #c28b40; background: #fbf2df; color: #8d6325; }
.calendar-event-dot.maintenance, .agenda-marker.maintenance, .calendar-legend i.maintenance { border-color: #547a9c; background: #eaf1f7; color: #3d6282; }
.calendar-event-dot.completed, .agenda-marker.completed, .calendar-legend i.completed { border-color: #9aa39c; background: #eff1ef; color: #647068; }
.calendar-more { color: var(--muted); font-size: 9px; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--line); }
.calendar-legend span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.calendar-legend i { width: 9px; height: 9px; border-left: 3px solid #7996b5; border-radius: 2px; background: #edf2f7; }
.agenda-panel { margin-top: 14px; }
.agenda-list { display: grid; }
.agenda-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-top: 1px solid #f0f1ee; }
.agenda-item > div { display: grid; gap: 4px; }
.agenda-item strong { font-size: 11px; font-weight: 600; }
.agenda-item small { color: var(--muted); font-size: 10px; }
.agenda-marker { width: 8px; height: 25px; flex: 0 0 8px; border-left: 3px solid #7996b5; border-radius: 3px; background: #edf2f7; }
.agenda-empty { padding: 15px 0; color: var(--muted); font-size: 11px; }
dialog { width: min(460px, calc(100% - 28px)); max-height: calc(100% - 28px); padding: 0; overflow: auto; border: 0; border-radius: 14px; background: white; color: var(--ink); box-shadow: 0 24px 80px #10221933; }
dialog::backdrop { background: #14251dc4; backdrop-filter: blur(2px); }
dialog form { padding: 23px; }
.dialog-body { padding: 23px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 21px; }
.dialog-heading .eyebrow { margin: 0 0 6px; color: #829083; }
.dialog-heading h2 { margin: 0; font: 700 21px "Manrope", sans-serif; }
.icon-button { width: 30px; height: 30px; border: 0; border-radius: 7px; background: #f1f3ef; color: #647068; font-size: 20px; }
.form-fields { display: grid; gap: 14px; }
.field label { display: block; margin-bottom: 6px; color: #59645d; font-size: 11px; font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; min-height: 39px; padding: 9px 10px; border: 1px solid #dfe4de; border-radius: 7px; outline: none; background: white; color: var(--ink); font-size: 12px; }
.field textarea { min-height: 70px; resize: vertical; }
.current-file { color: var(--muted); font-size: 10px; }
.current-file a { margin-left: 3px; color: #52713f; }
.remove-file-label { display: flex !important; align-items: center; gap: 7px; margin: -7px 0 0 !important; color: var(--muted) !important; font-size: 10px !important; font-weight: 400 !important; }
.remove-file-label input { width: auto !important; min-height: auto !important; margin: 0; padding: 0 !important; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #6f9bc0; box-shadow: 0 0 0 3px #82b4e238; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.prototype-dialog-note { margin: -7px 0 15px; color: #8a641c; font-size: 11px; line-height: 1.5; }
.user-options { display: grid; gap: 8px; }
.user-option { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; text-align: left; }
.user-option:hover { background: #f5f7f3; }
.user-option strong, .user-option small { display: block; }
.user-option strong { color: var(--ink); font-size: 12px; }
.user-option small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.vehicle-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 17px; }
.vehicle-fact { padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafb; }
.vehicle-fact span, .vehicle-fact strong { display: block; }
.vehicle-fact span { color: var(--muted); font-size: 9px; }
.vehicle-fact strong { margin-top: 5px; font-size: 12px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 18px; }
.detail-section { margin-top: 18px; }
.detail-section h3 { margin: 0 0 9px; font: 700 13px "Manrope", sans-serif; }
.vehicle-history { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.vehicle-log { display: flex; gap: 9px; padding: 9px; border: 1px solid #eef0ec; border-radius: 7px; background: #fff; }
.vehicle-log-marker { width: 6px; flex: 0 0 6px; border-radius: 4px; background: #5f8db4; }
.vehicle-log-content { min-width: 0; }
.vehicle-log-content strong, .vehicle-log-content small { display: block; }
.vehicle-log-content strong { font-size: 10px; line-height: 1.4; }
.vehicle-log-content small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.damage-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.damage-photos img { width: 62px; height: 62px; object-fit: cover; border-radius: 6px; }
.history-details { color: #657269; font-size: 9px; }
.vehicle-assignment { margin-bottom: 15px; padding: 13px; border: 1px solid #d9e4ed; border-radius: 9px; background: #eff5f9; }
.vehicle-assignment strong { display: block; font-size: 11px; }
.vehicle-assignment p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.table-select { min-height: 30px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: 10px; }
.history-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.history-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 600; }
.history-filters input, .history-filters select { min-width: 150px; min-height: 35px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); font-size: 11px; }
.history-filter-actions { display: flex; gap: 7px; }
.history-filter-actions .button { min-height: 35px; }
.damage-history-label { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 10px; background: var(--red); color: #a34f3e; font-size: 10px; font-weight: 700; }
.bottom-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; justify-content: center; align-items: stretch; gap: 3px; min-height: 78px; overflow-x: auto; overflow-y: hidden; padding: 7px 12px max(7px, env(safe-area-inset-bottom)); border-top: 1px solid #dfe5eb; background: #fffffff2; box-shadow: 0 -8px 24px #1a2a3a0d; backdrop-filter: blur(14px); scrollbar-width: none; }
.bottom-nav::-webkit-scrollbar { display: none; }
.bottom-nav[data-role="driver"] { justify-content: center; }
.bottom-nav .nav-item { position: relative; display: grid; flex: 0 0 78px; justify-items: center; align-content: center; gap: 3px; min-width: 0; min-height: 54px; padding: 4px 3px; border: 0; border-radius: 8px; background: transparent; color: #718090; }
.bottom-nav .nav-item > span { width: auto; font-size: 17px; }
.bottom-nav .nav-item small { display: block; max-width: 72px; font-size: 9px; line-height: 1.15; text-align: center; }
.bottom-nav .nav-item.active { background: #eaf2f8; color: #3f6e96; }
.bottom-nav .damage-nav-badge { position: absolute; top: 2px; right: 8px; width: 7px !important; height: 7px; margin: 0; padding: 0; overflow: hidden; border: 1px solid white; border-radius: 50%; font-size: 0 !important; }

@media (max-width: 1000px) {
  .topbar { padding: 0 27px; }
  .page-content { padding: 30px 27px 50px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { height: 58px; padding: 0 18px; }
  .topbar-left { gap: 12px; }
  .topbar-brand { gap: 0; }
  .topbar-brand .brand-logo { width: 118px; height: 31px; object-position: 50% 29%; }
  .breadcrumbs { gap: 6px; font-size: 10px; }
  .today-label { display: none; }
  .page-content { padding: 27px 17px 18px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .page-heading .button { align-self: stretch; }
  .metrics-grid { gap: 9px; margin-bottom: 12px; }
  .metric-card { min-height: 108px; padding: 13px; }
  .metric-value { margin-top: 9px; font-size: 24px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
  .follow-up-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
  .panel { padding: 16px; }
  .user-switch-label { display: none; }
  .bottom-nav { justify-content: flex-start; gap: 1px; padding-right: 5px; padding-left: 5px; }
  .bottom-nav .nav-item { flex-basis: 68px; }
  .bottom-nav .nav-item small { max-width: 64px; font-size: 8px; }
  .table-toolbar { padding: 14px; }
  th, td { padding-right: 13px; padding-left: 13px; }
  .empty-state { white-space: normal; }
  .calendar-toolbar { padding: 14px; }
  .calendar-day { min-height: 68px; padding: 4px 3px; }
  .calendar-day-number { width: 20px; height: 20px; font-size: 9px; }
  .calendar-event-dot { height: 7px; padding: 0; overflow: hidden; border-left-width: 0; font-size: 0; }
  .calendar-more { font-size: 8px; }
  .calendar-legend { gap: 9px; padding: 11px; }
  .calendar-legend span { font-size: 8px; }
  .agenda-panel .panel-heading { align-items: flex-start; }
  .agenda-panel .text-link { white-space: nowrap; }
}

/* Phone layout: readable records and touch controls, without a second data view. */
@media (max-width: 720px) {
  body { min-width: 0; }
  .main-content { padding-bottom: calc(162px + env(safe-area-inset-bottom)); }
  .topbar { gap: 8px; padding: env(safe-area-inset-top) 14px 0; height: calc(60px + env(safe-area-inset-top)); }
  .topbar-left { flex: 1; gap: 10px; overflow: hidden; }
  .topbar-right { flex: 0 0 auto; }
  .breadcrumbs { min-width: 0; }
  .breadcrumbs > span { display: none; }
  .breadcrumbs strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-content { padding: 22px 12px 16px; }
  .page-heading h1 { font-size: 26px; }
  .page-heading p { line-height: 1.5; }
  .connection-bar { gap: 8px; padding: 10px 12px; }
  #company-label { flex: 1 1 40%; overflow-wrap: anywhere; }
  #connection-status { flex: 1 1 45%; margin-left: 0; text-align: right; overflow-wrap: anywhere; }
  .connection-bar .action-button { min-height: 44px; border: 1px solid #52687d; background: #fff; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; padding: 6px 5px max(6px,env(safe-area-inset-bottom)); overflow: visible; }
  .bottom-nav[data-role="driver"] { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bottom-nav .nav-item { width: 100%; min-height: 58px; padding: 4px 1px; }
  .bottom-nav .nav-item small { max-width: 100%; font-size: 10px; overflow-wrap: anywhere; }
  .bottom-nav .nav-item > span { font-size: 20px; }
  .button, .action-button, .text-link, .icon-button, .calendar-arrow, .user-switch { min-height: 44px; }
  .action-button { padding: 10px 12px; font-size: 13px; border: 1px solid var(--line); background: #f8fafb; }
  .text-link, .document-link { font-size: 14px; }
  .document-link { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
  .row-actions { flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
  .table-wrap { overflow: visible; padding: 0 10px 10px; }
  table { display: block; white-space: normal; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody { display: grid; gap: 12px; }
  tbody tr { display: block; min-width: 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
  tbody td { display: block; padding: 9px 0; font-size: 14px; overflow-wrap: anywhere; }
  tbody td:first-child { border-top: 0; }
  tbody td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: #63717e; font-size: 11px; font-weight: 600; }
  .table-sub, .record-id, .status-pill, .plate { font-size: 12px; }
  .table-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .table-title { font-size: 16px; line-height: 1.5; }
  .table-select, .history-filters input, .history-filters select, .field input, .field select, .field textarea, .login-content input { min-width: 0; max-width: 100%; min-height: 44px; font-size: 16px; }
  .history-filters { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .history-filters label { min-width: 0; }
  .history-filters input, .history-filters select { width: 100%; }
  .history-filter-actions { grid-column: 1 / -1; }
  .history-filter-actions .button { flex: 1; min-height: 44px; }
  dialog { width: calc(100% - 16px); max-width: 560px; max-height: calc(100dvh - 24px); overscroll-behavior: contain; }
  dialog form, .dialog-body { padding: 18px 14px max(18px,env(safe-area-inset-bottom)); }
  .dialog-heading { gap: 12px; }
  .dialog-heading h2 { min-width: 0; font-size: 20px; overflow-wrap: anywhere; }
  .icon-button { flex: 0 0 44px; }
  .field { min-width: 0; }
  .field label { font-size: 13px; line-height: 1.4; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .button { flex: 1; }
  .vehicle-fact { min-width: 0; overflow-wrap: anywhere; }
  .vehicle-fact span { font-size: 11px; }
  .vehicle-fact strong { font-size: 14px; }
  .detail-actions > * { flex: 1 1 140px; }
  .vehicle-log-content strong { font-size: 13px; }
  .vehicle-log-content small { font-size: 12px; overflow-wrap: anywhere; }
  .agenda-item { flex-wrap: wrap; }
  .agenda-item > div { flex: 1 1 65%; min-width: 0; }
  .agenda-item strong, .follow-up-info strong { font-size: 13px; }
  .agenda-item small, .follow-up-info small { font-size: 12px; }
  .follow-up-row { flex-wrap: wrap; }
  .calendar-toolbar { flex-wrap: wrap; gap: 10px; }
  .calendar-day { min-height: 48px; }
  .panel-heading { flex-wrap: wrap; }
  .metric-top { font-size: 12px; }
  .metric-foot { font-size: 11px; }
}
@media (max-width: 380px) {
  .topbar-brand .brand-logo { width: 100px; }
  .vehicle-facts { grid-template-columns: 1fr; }
  .history-filters { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

.login-content { padding: 24px; border-radius: 14px; background: white; box-shadow: 0 12px 50px #0003; }
.login-content p { line-height: 1.5; }
.login-content #login-message { color: #9e4829; }
@media (max-width: 1000px) and (min-width: 721px) {
  .bottom-nav { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .dashboard-grid, .follow-up-grid { grid-template-columns: minmax(0,1fr); }
  .panel, .metric-card { min-width: 0; }
  .activity-amount { overflow-wrap: anywhere; }
}
@media (max-width: 720px) {
  .activity-list, .fleet-list { grid-template-columns: minmax(0,1fr); }
  .activity-row, .fleet-row { min-width: 0; max-width: 100%; }
  .metric-top { gap: 4px; overflow-wrap: anywhere; }
}
.activity-list, .fleet-list { grid-template-columns: minmax(0,1fr); }
.activity-row, .fleet-row { min-width: 0; max-width: 100%; }
.connection-bar { color: #e8edf2; }
.nav-label-mobile { display: none; }
@media (max-width: 720px) {
  .nav-label-desktop { display: none; }
  .nav-label-mobile { display: inline; }
  .bottom-nav .nav-item small { overflow-wrap: normal; }
  tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 12px; }
  tbody td { min-width: 0; }
  tbody td:nth-child(-n+2), tbody td:last-child, tbody td[data-label="Descrição"], tbody td[data-label="Acesso"] { grid-column: 1 / -1; }
  body:has(.bottom-nav[data-role="driver"]:not([hidden])) .main-content { padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
}
.table-wrap { position: relative; min-width: 0; max-width: 100%; }

.record-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; max-width: 260px; line-height: 1.45; }
@media (max-width: 720px) { tbody td[data-label="Pedido"] { grid-column: 1 / -1; } .record-summary { max-width: none; } }

.compliance-list { max-height: 380px; overflow-y: auto; overscroll-behavior: contain; }
.fleet-info .text-link { max-width: 100%; text-align: left; }
@media (max-width: 720px) { .compliance-list { max-height: 340px; } }

.report-export-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.report-help { flex: 1 1 100%; margin: 0; color: #63717e; font-size: 11px; line-height: 1.5; }
.button:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 720px) { .report-export-actions { grid-column: 1 / -1; margin-left: 0; } .report-export-actions .button { flex: 1; white-space: normal; } .report-help { grid-column: 1 / -1; } }

/* Compact phone summaries; full forms keep comfortable touch targets. */
@media (max-width: 720px) {
  .page-content { padding-top: 12px; }
  .page-heading { margin-bottom: 12px; }
  .page-heading > div { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .page-heading:not(:has(.button)) { margin: 0; }
  .page-heading .button { min-height: 40px; }
  .connection-bar { padding-top: 6px; padding-bottom: 6px; font-size: 11px; }
  .report-filters { padding: 10px; gap: 8px; margin-bottom: 10px; }
  .report-filters input, .report-filters select { min-height: 40px; padding: 5px 7px; }
  .report-filters .button { min-height: 36px; padding: 6px 9px; font-size: 11px; }
  .report-help { font-size: 10px; }
  .table-toolbar { padding: 10px 12px; }
  .table-title { font-size: 14px; }
  .table-toolbar .table-sub { display: inline; margin-left: 4px; font-size: 10px; }
  .table-wrap { padding: 0 8px 8px; }
  tbody { gap: 8px; }
  tbody tr { padding: 4px 10px; column-gap: 10px; }
  tbody td { padding: 6px 0; font-size: 13px; }
  tbody td::before { margin-bottom: 3px; font-size: 10px; }
  tbody td:nth-child(-n+2) { grid-column: auto; border-top: 0; }
  tbody td:last-child { grid-column: 1 / -1; }
  tbody td[data-label="Intervenção"], tbody td[data-label="Oficina / fornecedor"], tbody td[data-label="Motorista"] { grid-column: 1 / -1; }
  tbody td[data-label="Marca e modelo"] { grid-column: 1 / -1; }
  .row-actions { gap: 6px; }
  .row-actions .action-button { min-height: 36px; padding: 6px 9px; font-size: 12px; }
  .row-actions .text-link, td .document-link { min-height: 36px; font-size: 12px; }
  .table-sub, .status-pill, .plate { font-size: 11px; }
  .record-summary { -webkit-line-clamp: 1; }
}

.dashboard-detail { margin-top: 14px; }
.dashboard-detail > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; cursor: pointer; min-height: 36px; font-size: 14px; }
.dashboard-detail summary::before { content: '▸'; }
.dashboard-detail[open] summary::before { content: '▾'; }
#monthly-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
#monthly-filter input { min-height: 40px; font-size: 16px; max-width: 100%; }
.field:has(input[type=checkbox]) { display: flex; align-items: center; gap: 10px; }
.field input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; flex: 0 0 22px; }

#pending-edit-fields fieldset { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
#pending-edit-fields label { display: grid; gap: 4px; }
#pending-edit-fields input { min-width: 0; width: 100%; min-height: 44px; font-size: 16px; }
#pending-list .activity-row { flex-wrap: wrap; }

#pending-edit-fields textarea { width: 100%; min-height: 90px; font-size: 16px; }
#pending-edit-fields input[type=checkbox] { width: 22px; min-height: 22px; height: 22px; }

.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.settings-tile { display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); text-align: left; }
.settings-tile span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.settings-storage h2 { margin-top: 0; font-size: 17px; }
#storage-settings-form fieldset { border: 0; padding: 0; display: grid; gap: 12px; margin: 16px 0; }
#storage-settings-form label { display: grid; gap: 6px; font-size: 13px; }
#storage-settings-form input, #storage-settings-form select { width: 100%; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 16px; }
.settings-message { font-size: 13px; overflow-wrap: anywhere; }
@media(max-width:720px) { .settings-grid { grid-template-columns: minmax(0,1fr); gap:8px; } .settings-tile { padding:12px; } .settings-storage { overflow-wrap:anywhere; } }

/* Dashboard lists retain all records; five rows remain visible at a time. */
[data-widget-scroll] { overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
[data-widget-scroll]:focus-visible { outline:2px solid #426587; outline-offset:3px; }
.mobile-menu-return { display:none; }
.mobile-home { max-width:720px; margin:0 auto; }
.mobile-home h1 { margin:4px 0 18px; font-size:20px; }
.mobile-menu-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.mobile-menu-tile { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; min-height:124px; padding:14px 8px; background:#fff; border:1px solid var(--line); border-radius:14px; color:#29445d; box-shadow:0 2px 6px #29445d08; }
.mobile-menu-tile strong { font-size:12px; line-height:1.35; overflow-wrap:anywhere; }
.mobile-menu-icon { display:grid; place-items:center; width:48px; height:48px; border-radius:12px; background:#edf3f9; font-size:28px; }
.mobile-menu-tile:active { background:#edf3f9; }
.mobile-menu-badge { position:absolute; top:8px; right:8px; min-width:22px; padding:3px 5px; border-radius:12px; background:#bf4038; color:#fff; font-size:11px; font-weight:700; }
@media(max-width:720px) {
  #authenticated-nav.bottom-nav { display:none; }
  .main-content { padding-bottom:20px; }
  .mobile-menu-return { display:flex; width:fit-content; align-items:center; margin:12px 12px 4px; min-height:40px; padding:7px 12px; background:#edf3f9; border:1px solid #d9e3ee; border-radius:8px; color:#29445d; font-weight:700; }
  #authenticated-app[data-page="home"] .mobile-menu-return { display:none; }
  .mobile-menu-grid { gap:10px; }
}
@media(max-width:360px) { .mobile-menu-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .mobile-menu-tile { min-height:108px; gap:8px; } }

.mobile-menu-icon svg { width:28px; height:28px; }

.report-filters .report-void-toggle { display:flex; flex-direction:row; align-items:center; gap:7px; }
.report-void-toggle input { width:18px; min-height:18px; height:18px; }

.invitation-driver-fields { grid-column:1 / -1; margin:4px 0 0; padding:14px; border:1px solid var(--line); border-radius:8px; }
.invitation-driver-fields legend { padding:0 6px; font-weight:700; font-size:14px; }
.invitation-driver-fields p { margin-top:0; }
.invitation-driver-fields .field + .field { margin-top:12px; }

/* Separate records and prioritize the primary action. */
.table-panel .record-row td { border-bottom:1px solid #d6e0e9; }
.table-panel .record-row:nth-child(even) { background:#f3f6f9; }
.table-panel .record-row:hover { background:#eaf1f7; }
.record-key { color:#233e55; }
.record-key strong { font-weight:700; }
.record-row .table-sub { color:#66788a; }
.row-actions .record-open-button { color:#284f70; background:#e9f1f8; border:1px solid #c9d9e7; font-weight:700; }
.row-actions .record-more-button { display:inline-flex; justify-content:center; align-items:center; flex:0 0 38px; min-width:38px; color:#29445d; border:1px solid #c9d9e7; background:white; font-size:23px; line-height:1; }
.record-action-menu { position:fixed; inset:auto; margin:0; min-width:176px; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow-y:auto; padding:6px; border:1px solid #c3d2df; border-radius:10px; background:#fff; color:#233e55; box-shadow:0 8px 30px #152c4530; z-index:30; }
.record-action-menu:popover-open,.record-action-menu[data-fallback-open] { display:grid; gap:3px; }
.record-action-menu .action-button { width:100%; min-height:42px; padding:9px 12px; color:#29445d; font-size:13px; text-align:left; border:0; border-radius:6px; background:white; }
.record-action-menu .action-button:hover,.record-action-menu .action-button:focus-visible { background:#eaf1f7; }
.record-action-menu [data-delete] { color:#a23730; }
.record-open-button:focus-visible,.record-more-button:focus-visible { outline:2px solid #426587; outline-offset:2px; }
.record-row.record-voided td { color:#815b58; background:#fcf3f2; }
.record-row.record-inactive td { color:#64717d; background:#f1f3f5; }
@media(max-width:720px) {
  .table-panel { background:#e9eef3; }
  .table-toolbar { background:white; }
  .table-panel tbody { gap:12px; }
  .table-panel .record-row,.table-panel .record-row:nth-child(even),.table-panel .record-row:hover { overflow:hidden; padding:0; column-gap:0; background:white; border:1px solid #b9cad9; border-left:4px solid #537b9c; border-radius:11px; box-shadow:0 2px 4px #18344c0b; }
  .table-panel .record-row td { min-width:0; padding:9px 11px; border-bottom:0; color:#536677; font-size:13px; }
  .table-panel .record-row td::before { margin-bottom:4px; color:#6b7e8e; font-size:10px; font-weight:500; }
  .table-panel .record-row .record-key { background:#f0f5f9; color:#243f56; font-size:14px; }
  .table-panel .record-row td:last-child { border-top:1px solid #e2e9ef; padding:8px 10px; }
  .record-row .row-actions { justify-content:flex-end; flex-wrap:nowrap; gap:8px; }
  .record-row .row-actions .record-open-button { min-height:40px; padding:8px 16px; }
  .record-row .row-actions .record-more-button { min-height:40px; }
  .table-panel .record-row.record-voided { border-left-color:#b8655e; }
  .table-panel .record-row.record-inactive { border-left-color:#94a0ab; }
  .table-panel .record-row.record-pending { border-left-color:#c68a35; }
  .record-row .status-pill { white-space:normal; }
  .record-row .record-summary { -webkit-line-clamp:2; }
}

.record-list-id { margin-right:auto; align-self:center; color:#698094; font-size:10px; white-space:nowrap; }
@media(max-width:720px) {
  .record-row .row-actions { flex-wrap:wrap; }
  .record-row .row-actions > .table-sub { flex-basis:100%; order:3; text-align:right; }
  .table-panel .record-row td:last-child::before { display:none; }
}

/* Complete per-record audit trail, shared by record and vehicle dialogs. */
.record-history-list { margin: 16px 0; padding-left: 24px; border-left: 2px solid #b8cbd8; list-style: none; }
.record-history-list li { position: relative; padding: 0 0 20px 8px; overflow-wrap: anywhere; }
.record-history-list li::before { content: ""; position: absolute; left: -31px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: #668da5; }
.record-history-list p { margin: 6px 0; }
.record-history-changes { white-space: pre-wrap; color: #465766; }
