:root {
  --green: #0b0e0d;
  --lime: #0b0e0d;
  --hoppy-green: #0b0e0d;
  --hoppy-cyan: #2a2d2b;
  --chrome: #0b0e0d;
  --sidebar: #eceeec;
  --sidebar-active: #fff;
}

body { background: #f7f8f7; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 64px;
  gap: 22px;
  padding: 0 20px;
  background: var(--chrome);
  border: 0;
}

.logo { width: 190px; height: 42px; }
.logo img { width: 112px; max-height: 40px; }

.global-search {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 40vw);
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px 0 13px;
  border: 1px solid #414542;
  border-radius: 10px;
  background: #272a28;
  color: #cfd5d1;
}

.global-search:focus-within { border-color: var(--hoppy-green); box-shadow: 0 0 0 3px #4cda9626; }
.global-search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.global-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 14px; }
.global-search input::placeholder { color: #aeb5b0; }
.global-search input::-webkit-search-cancel-button { filter: invert(1); opacity: .7; }
.global-search kbd { border: 1px solid #4a4e4b; border-radius: 5px; padding: 2px 6px; color: #aeb5b0; font: 11px/1.3 inherit; }

.account-menu { margin-left: auto; gap: 9px; color: #fff; }
.user-profile { display: flex; align-items: center; gap: 9px; color: #fff; }
.user-avatar { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg,var(--hoppy-green),var(--hoppy-cyan)); color: #10362a; font-size: 11px; font-weight: 700; }
.user-copy { display: grid; line-height: 1.2; text-align: left; }
.user-copy strong { font-size: 13px; font-weight: 600; }
.user-copy small { margin-top: 3px; color: #9ca59f; font-size: 11px; }
.top-action { border: 1px solid #414542; background: #272a28; color: #d9dfdb; border-radius: 7px; padding: 8px 10px; font-size: 12px; }
.top-action:hover { border-color: #5c625e; background: #303431; }

.app-shell { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 240px minmax(0,1fr); }
.sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); display: flex; flex-direction: column; justify-content: space-between; padding: 12px; background: var(--sidebar); border-right: 1px solid #dfe3e0; }
.sidebar-nav { display: grid; gap: 4px; }
.nav-item { min-height: 40px; display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 9px; color: #3e4742; text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-item:hover { background: #f5f6f5; }
.nav-item.active { background: var(--sidebar-active); color: #173f33; box-shadow: 0 1px 2px #1d30260a; font-weight: 650; }
.nav-item svg { flex: 0 0 auto; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.settings-nav { margin-top: auto; }
.app-main, .app-main main { min-width: 0; width: 100%; }

.content { padding-top: 32px; }
.heading { align-items: center; margin-bottom: 0; }
.heading h1 { margin: 0; }
.dashboard-tabs { margin-bottom: 24px; }
.primary { background: #0b0e0d; color: #fff; }
.primary:hover { background: #202421; }
.table-tools { justify-content: flex-end; }

@media(max-width:1180px){
  .global-search { width: 34vw; }
  .user-copy, #usersButton { display: none !important; }
  .app-shell { grid-template-columns: 76px minmax(0,1fr); }
  .sidebar { padding-inline: 9px; }
  .nav-item { justify-content: center; padding-inline: 0; }
  .nav-item span { display: none; }
}

@media(max-width:760px){
  .topbar { padding-inline: 14px; gap: 10px; }
  .logo { width: 82px; }
  .logo img { width: 82px; }
  .global-search { position: static; transform: none; flex: 1; width: auto; }
  .global-search kbd, .user-profile { display: none; }
  .top-action { padding: 7px 8px; }
  .app-shell { grid-template-columns: 58px minmax(0,1fr); }
  .sidebar { padding: 8px 6px; }
  .nav-item { min-height: 42px; }
  .content { padding-top: 24px; }
}


.view-panel[hidden] { display: none; }
.section-heading { margin-bottom: 22px; }
.section-heading .eyebrow { color: #6f8178; }
.section-count { border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 8px 13px; color: #60746a; font-size: 13px; }
.section-toolbar, .schedule-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-toolbar select, .schedule-toolbar select { border: 1px solid #dce5df; border-radius: 8px; padding: 10px 34px 10px 12px; background: #fff; color: #4f6559; font-size: 14px; }
.segmented, .month-switch { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid #dde5e0; border-radius: 10px; background: #eef1ef; }
.segmented button, .month-switch button { border: 0; border-radius: 7px; padding: 8px 13px; background: transparent; color: #6f7f77; font-size: 13px; }
.segmented button.selected, .month-switch button.selected { background: #fff; color: #173f33; box-shadow: 0 1px 3px #173f3314; font-weight: 700; }
.data-card { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.driver-table td { height: 68px; }
.person-cell { display: flex; align-items: center; gap: 11px; }
.person-cell strong { display: block; color: #243e33; font-size: 14px; }
.person-avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #e7f8ef; color: #236748; font-size: 11px; font-weight: 800; }
.driver-table a { color: #315f4b; text-decoration: none; }
.driver-table a:hover { text-decoration: underline; }
.contract-badge { display: inline-block; border-radius: 999px; padding: 5px 9px; background: #e7f7ee; color: #28714e; font-size: 12px; font-weight: 600; }
.contract-badge.student { background: #ecf0ff; color: #5267a3; }
.schedule-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.schedule-summary div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 16px 18px; }
.schedule-summary span { color: #667970; font-size: 13px; }
.schedule-summary strong { color: #173f33; font-size: 24px; }
.schedule-toolbar { margin: 0; padding: 14px 16px; border-bottom: 1px solid #e7ece9; }
.schedule-toolbar span { color: #708078; font-size: 13px; font-weight: 600; }
.schedule-scroll { max-width: 100%; overflow: auto; }
.schedule-table { width: max-content; min-width: 100%; white-space: normal; border-collapse: separate; border-spacing: 0; }
.schedule-table th, .schedule-table td { border-right: 1px solid #edf1ef; border-bottom: 1px solid #edf1ef; }
.schedule-table thead th { min-width: 86px; padding: 9px 7px; text-align: center; background: #f7f9f8; }
.schedule-table thead th span { display: block; color: #8a9890; font-size: 10px; text-transform: uppercase; }
.schedule-table thead th strong { display: block; margin-top: 2px; color: #314a3e; font-size: 16px; }
.schedule-table tbody th { min-width: 190px; max-width: 190px; padding: 11px 13px; background: #fff; color: #385044; font-size: 12px; line-height: 1.35; text-align: left; }
.schedule-table td { width: 86px; min-width: 86px; height: 74px; padding: 6px; vertical-align: top; background: #fff; }
.schedule-table .weekend { background: #fbfcfb; }
.schedule-table .sticky-col { position: sticky; left: 0; z-index: 2; box-shadow: 6px 0 10px -10px #1b352c66; }
.schedule-table thead .sticky-col { z-index: 3; text-align: left; }
.shift-chip { display: block; margin-bottom: 4px; border-left: 2px solid var(--hoppy-green); border-radius: 3px; background: #effaf4; padding: 4px 5px; color: #315846; font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
@media(max-width:760px){
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .section-toolbar select { width: 100%; }
  .schedule-summary { grid-template-columns: 1fr; }
  .schedule-summary div { padding: 12px 14px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .month-switch { width: 100%; }
  .month-switch button { flex: 1; }
  .schedule-toolbar { align-items: flex-start; flex-direction: column; }
}


.home-heading { margin-bottom: 24px; }
.home-date { color: #667970; font-size: 14px; }
.home-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.home-metrics button { min-height: 158px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 22px; color: #243e33; text-align: left; transition: .16s ease; }
.home-metrics button:hover { transform: translateY(-2px); border-color: #afc9bc; box-shadow: 0 10px 28px #18352d0d; }
.home-metrics span { display: block; font-size: 14px; font-weight: 600; }
.home-metrics strong { display: block; margin: 18px 0 7px; color: #173f33; font-size: 42px; line-height: 1; }
.home-metrics small { color: #7d8d85; font-size: 12px; }
.driver-table tbody tr { cursor: pointer; }
.driver-table tbody tr:hover .person-cell strong { color: #16885b; }
.shift-chip { width: 100%; border-width: 0 0 0 2px; border-color: var(--hoppy-green); cursor: pointer; text-align: left; }
.shift-chip:hover { background: #dcf5e8; }
.close-modal { border: 0; background: #f2f5f1; border-radius: 50%; font-size: 24px; width: 34px; height: 34px; color: #45644e; }
.small-dialog { width: min(520px,94vw); }
.small-dialog form { padding: 0; }
.stack-fields { display: grid; gap: 15px; margin: 20px 0; }
.stack-fields label, .settings-card label { display: flex; flex-direction: column; gap: 7px; color: #576c5e; font-size: 13px; }
.stack-fields input, .settings-card select { width: 100%; border: 1px solid #d8e1d8; border-radius: 7px; background: #fff; padding: 11px; color: #243e33; font-size: 14px; }
.time-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.shift-context { display: flex; justify-content: space-between; gap: 12px; border-radius: 8px; background: #f2f6f3; padding: 12px 14px; color: #60756b; font-size: 13px; }
.shift-context strong { color: #2d4f40; }
.form-error { min-height: 20px; margin-top: 12px; color: #ad3737; font-size: 13px; }
.settings-content { max-width: 900px; margin-left: 0; }
.settings-card { display: grid; gap: 20px; max-width: 620px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 24px; }
.settings-card label small { color: #87958e; line-height: 1.4; }
.settings-card .primary { justify-self: start; }
@media(max-width:980px){ .home-metrics { grid-template-columns: 1fr 1fr; } }
@media(max-width:640px){ .home-metrics { grid-template-columns: 1fr; } .home-metrics button { min-height: 130px; } .time-fields { grid-template-columns: 1fr; } }
.account-menu { position: relative; margin-left: auto; }
.mobile-search-toggle { display: none; }
.user-icon { display: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.user-profile { min-width: 190px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #fff; border-radius: 9px; background: transparent; padding: 7px 10px; color: #fff; text-align: left; }
.user-profile:hover, .user-profile[aria-expanded="true"] { background: #202421; }
.user-profile .user-copy { display: grid; line-height: 1.2; }
.user-profile .user-copy strong { color: #fff; font-size: 13px; font-weight: 700; }
.user-profile .user-copy small { margin-top: 3px; color: #aeb6b1; font-size: 11px; }
.menu-chevron { color: #fff; font-size: 16px; transition: transform .15s; }
.user-profile[aria-expanded="true"] .menu-chevron { transform: rotate(180deg); }
.user-menu { position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; display: grid; width: 190px; overflow: hidden; border: 1px solid #dfe5e1; border-radius: 10px; background: #fff; box-shadow: 0 14px 38px #071a1438; padding: 6px; }
.user-menu[hidden] { display: none; }
.user-menu button { border: 0; border-radius: 7px; background: transparent; padding: 10px 11px; color: #294438; text-align: left; font-size: 13px; }
.user-menu button:hover { background: #eef4f0; }
.user-menu #logoutButton { color: #a23f3f; }
.primary { background: #0b0e0d; color: #fff; }
.primary:hover { background: #202421; }
.danger-button { margin-right: auto; border: 1px solid #b42318; border-radius: 7px; background: #fff; padding: 10px 13px; color: #b42318; font-weight: 700; }
.danger-button:hover { background: #fff1f0; }
.danger-link { border: 0; background: transparent; padding: 8px; color: #b42318; font-size: 12px; }
.danger-link:hover { text-decoration: underline; }
.dialog-top .eyebrow, .settings-content .eyebrow, .document-hero .eyebrow, .document-icon { display: none !important; }
.source-details { background: #f4f4f4; }
.global-search:focus-within { border-color: #fff; box-shadow: 0 0 0 2px #ffffff26; }
.nav-item.active, .person-cell strong, .home-metrics strong, .schedule-summary strong { color: #111; }
.contract-badge { background: #ededed; color: #222; }
.driver-table tbody tr:hover .person-cell strong { color: #000; }
.stat[data-filter="damage"] strong,.stat[data-filter="control"] strong,.stat[data-filter="maintenance"] strong { color: #111; }
.shift-chip { border-color: #111; background: #f2f2f2; color: #222; }
.shift-chip:hover { background: #e9e9e9; }
tr[draggable="true"] { cursor: grab; }
tr[draggable="true"]:active { cursor: grabbing; }
tr.dragging { opacity: .45; }
tr.drag-over td { border-top: 2px solid #111; }
.drag-handle { display: inline-grid; width: 20px; margin-right: 8px; place-items: center; color: #8b948e; font-size: 20px; line-height: 1; vertical-align: middle; cursor: grab; user-select: none; }
tr:active .drag-handle { cursor: grabbing; }
.warehouse-section { margin-top: 22px; background: transparent; }
#warehouseMap { position: relative; z-index: 0; isolation: isolate; width: 100%; height: 300px; overflow: hidden; border: 1px solid #d9dedb; border-radius: 12px; background: #e9e9e9; }
.warehouse-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.warehouse-grid button { display: grid; grid-template-columns: 54px minmax(0,1fr); grid-template-rows: auto 1fr; align-items: start; gap: 10px 16px; min-height: 112px; border: 1px solid #dfe3e0; border-radius: 12px; background: #fff; padding: 16px; color: #111; text-align: left; transition: border-color .15s,transform .15s,box-shadow .15s; }
.warehouse-grid button:hover { border-color: #111; transform: translateY(-1px); box-shadow: 0 5px 16px #1111110d; }
.warehouse-grid button.selected { border: 2px solid #111; padding: 15px; }
.warehouse-grid button>span { grid-row: 1/3; display: grid; width: 54px; height: 54px; place-items: center; border-radius: 9px; background: #0b0e0d; color: #fff; font-size: 13px; font-weight: 800; }
.warehouse-grid strong { padding-top: 5px; font-size: 16px; line-height: 1.15; }
.warehouse-grid strong em { display: inline-block; margin-left: 7px; border-radius: 4px; background: #0b0e0d; padding: 3px 5px; color: #fff; font-size: 10px; font-style: normal; vertical-align: 2px; }
.warehouse-grid small { grid-column: 2; color: #737c77; font-size: 13px; line-height: 1.45; white-space: pre-line; }
.warehouse-pin-wrap { background: transparent; border: 0; }
.warehouse-pin { display: grid; width: 30px; height: 30px; place-items: center; border: 3px solid #fff; border-radius: 50% 50% 50% 0; background: #050505; box-shadow: 0 2px 8px #0005; color: #fff; transform: rotate(-45deg); }
.warehouse-pin b { font-size: 11px; transform: rotate(45deg); }
.document-page { background: #f5f5f5; }
.document-page .document-hero { background: #0b0e0d; }
.document-page .document-hero p,.document-page .qr-garage span,.document-page .qr-assistance span { color: #ddd; }
.document-page .qr-garage small,.document-page .qr-assistance small { color: #bbb; }
.document-page .qr-garage a,.document-page .qr-assistance a { color: #fff; }
.document-page .appointment-link { background: #fff; color: #111 !important; }
.document-page .document-file-list a { justify-content: center; border-color: #ccc; color: #111; }
.doc-actions button,.doc-actions a { background: #fff; color: #111; }
@media(max-width:980px){.warehouse-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){#warehouseMap{height:300px}.warehouse-grid{grid-template-columns:1fr}.warehouse-grid button{min-height:104px}}
.legal-footer { padding: 4px clamp(18px,4vw,64px) 24px; color: #819087; text-align: right; font-size: 12px; }
html { min-height: 100%; background: #f7f8f7; -webkit-text-size-adjust: 100%; }
body:not(.login-page) { min-height: 100vh; overflow-x: hidden; }
body:not(.login-page) .topbar { position: fixed; inset: 0 0 auto 0; z-index: 2000; width: 100%; }
body:not(.login-page) .app-shell { display: block; min-height: 100vh; padding: 64px 0 0 240px; }
body:not(.login-page) .sidebar { position: fixed; inset: 64px auto 0 0; z-index: 1500; width: 240px; height: auto; overflow: hidden; }
body:not(.login-page) .app-main { min-height: calc(100vh - 64px); overflow: visible; }
body:not(.login-page) .legal-footer { margin-left: 240px; }
#fleet .heading { margin-bottom: 22px; }
.stat.selected { border-color: #202421; box-shadow: 0 0 0 1px #202421; }
.sort-header { display: inline-flex; align-items: center; gap: 6px; color: inherit; cursor: pointer; }
.sort-header:hover, th[aria-sort="ascending"] .sort-header, th[aria-sort="descending"] .sort-header { color: #0b0e0d; }
.sort-header span { min-width: 12px; color: #5b6761; font-size: 13px; }
.doc-actions .qr-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #cfd5d1; border-radius: 7px; background: #fff; color: #0b0e0d; padding: 0; }
.doc-actions .qr-button:hover { border-color: #0b0e0d; background: #f4f5f4; }
.qr-icon { width: 19px; height: 19px; fill: currentColor; }
.driver-table .person-cell { gap: 0; }
.plate { display: inline-flex; align-items: center; gap: 7px; }
.electric-mark { display: block; width: 18px; height: 18px; flex: 0 0 auto; }

#vehicleDialog { width: min(920px,94vw); border-color: #d8ded9; border-radius: 16px; padding: 34px; color: #193a2f; }
#vehicleDialog .fields { gap: 18px 22px; }
#vehicleDialog .fields input,#vehicleDialog .fields select { min-height: 48px; border-color: #d2dbd4; border-radius: 8px; padding-inline: 14px; color: #193a2f; }
#vehicleDialog .garage-contact { grid-template-columns: 1.35fr 1fr 1.3fr; gap: 12px 28px; border: 1px solid #d9dedb; border-radius: 10px; background: #f5f7f5; padding: 18px 20px; color: #193a2f; }
#vehicleDialog .garage-contact strong { font-size: 14px; }
#vehicleDialog .garage-contact a { color: #111; text-decoration: underline; }
#vehicleDialog .garage-contact a:last-child { grid-column: 1/-1; }
#vehicleDialog .damage-section { margin-top: 26px; padding-top: 24px; }
#vehicleDialog .damage-section h3 { margin-bottom: 10px; font-size: 19px; }
#vehicleDialog .report { min-height: 62px; }
#vehicleDialog .report-add input { min-height: 48px; }
#vehicleDialog .dialog-footer { margin-top: 28px; }
#vehicleDialog .dialog-footer .primary { min-width: 145px; }
#vehicleDialog .dialog-footer .secondary { min-height: 44px; padding-inline: 18px; }
#vehicleDialog .danger-button { min-height: 44px; border-color: #111; color: #111; }
#vehicleDialog .danger-link { border: 1px solid #111; border-radius: 7px; color: #111; font-size: 13px; }
#vehicleDialog .danger-link:hover { background: #f3f3f3; text-decoration: none; }

.login-page { min-height: 100vh; display: grid; grid-template-rows: 1fr auto; background: #0b0e0d !important; color: #0b0e0d; }
.login-topbar { display: none; }
.login-topbar .login-logo { display: block; width: 112px !important; max-height: 40px; margin: 0; border-radius: 0; background: transparent; padding: 0; object-fit: contain; }
.login-page .login-shell { min-height: 0; display: grid; place-items: center; padding: 48px 24px; background: #0b0e0d; }
.login-page .login-card { width: min(420px,100%); border: 1px solid #dfe3e0; border-radius: 12px; background: #fff; padding: 40px; box-shadow: 0 18px 55px #0b0e0d12; }
.login-page .login-card-logo { display: block; width: 126px; height: auto; margin: 0 0 28px; filter: brightness(0); }
.login-page .login-heading h1 { margin: 0 0 8px; color: #0b0e0d; }
.login-page .login-heading p { margin-bottom: 28px; color: #6e7772; }
.login-page .login-form label { color: #303633; }
.login-page .login-form input { border-color: #cfd5d1; color: #0b0e0d; }
.login-page .login-form input:focus { border-color: #0b0e0d; box-shadow: 0 0 0 3px #0b0e0d12; }
.login-page .password-wrap button { background: #f0f1f0; color: #303633; }
.login-page .primary { background: #0b0e0d; color: #fff; }
.login-page .primary:hover { background: #252927; }
.dialog-doc-links a { color: #111; }
.dialog-doc-links span { color: #777; background: #f4f4f4; }
.login-footer { padding: 0 clamp(20px,4vw,64px) 24px; color: #8b918e; text-align: right; font-size: 12px; }

@media(max-width:1100px){
  body:not(.login-page) .app-shell { padding-left: 76px; }
  body:not(.login-page) .sidebar { width: 76px; }
  body:not(.login-page) .legal-footer { margin-left: 76px; }
}
@media(max-width:700px){
  body:not(.login-page) .app-shell { padding-left: 58px; }
  body:not(.login-page) .sidebar { width: 58px; }
  body:not(.login-page) .legal-footer { margin-left: 58px; }
  .login-page .login-card { padding: 30px 24px; }
}
@media(max-width:700px){ .user-profile { min-width: 0; padding: 7px 9px; } .user-profile .user-copy { display: none; } .menu-chevron { font-size: 18px; } }
#vehicleDialog .dialog-top .eyebrow, #driverDialog .dialog-top .eyebrow { display: none; }
#vehicleDialog .dialog-top h2, #driverDialog .dialog-top h2 { margin-top: 0; }

/* Mobile application layout */
@media(max-width:760px){
  body:not(.login-page) .topbar {
    height: 64px;
    display: flex;
    gap: 8px;
    padding: 0 10px 0 12px;
  }
  body:not(.login-page) .logo { width: 100px; margin-right: auto; }
  body:not(.login-page) .logo img { width: 100px; }
  body:not(.login-page) .global-search {
    display: none;
    position: fixed;
    top: 70px;
    left: 10px;
    right: 10px;
    width: auto;
    height: 44px;
    min-width: 0;
    transform: none;
    border-color: #252a27;
    background: #111513;
    box-shadow: 0 12px 32px #0006;
    z-index: 2100;
    transform: translateZ(0);
  }
  body:not(.login-page) .topbar.search-open .global-search { display: flex; }
  body:not(.login-page) .global-search kbd { display: none; }
  body:not(.login-page) .global-search input { font-size: 16px; }
  body:not(.login-page) .mobile-search-toggle {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    border: 1px solid #fff;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    padding: 0;
  }
  body:not(.login-page) .mobile-search-toggle[aria-expanded="true"] { background: #fff; color: #0b0e0d; }
  body:not(.login-page) .mobile-search-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  body:not(.login-page) .account-menu { align-self: center; margin-left: 0; }
  body:not(.login-page) .user-profile {
    display: flex;
    width: 40px;
    min-width: 40px;
    height: 40px;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
  }
  body:not(.login-page) .user-profile .user-copy { display: none !important; }
  body:not(.login-page) .user-profile .user-icon { display: block; }
  body:not(.login-page) .menu-chevron { display: none; }
  body:not(.login-page) .user-menu { top: 46px; }

  body:not(.login-page) .app-shell { padding: 64px 0 0 56px; }
  body:not(.login-page) .sidebar { inset: 64px auto 0 0; width: 56px; padding: 8px 6px; }
  body:not(.login-page) .legal-footer { margin-left: 56px; padding: 4px 14px 22px; }
  .sidebar-nav { gap: 6px; }
  .nav-item { width: 44px; min-height: 44px; justify-content: center; padding: 0; }
  .nav-item svg { width: 19px; height: 19px; }
  .nav-item span,.coming-soon-nav { display: none; }
  .content { padding: 22px 14px 38px; }
  .heading,.section-heading { min-height: 42px; margin-bottom: 16px; align-items: center; flex-direction: row; gap: 10px; }
  .heading h1,.section-heading h1 { font-size: 31px; line-height: 1.1; }
  .heading .primary,.section-heading .primary { min-height: 40px; margin-left: auto; padding: 10px 12px; font-size: 13px; white-space: nowrap; }

  .home-heading { align-items: flex-start; margin-bottom: 16px; }
  .home-date { max-width: 210px; font-size: 11px; line-height: 1.4; text-align: right; }
  .home-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .home-metrics button { min-height: 126px; padding: 16px; }
  .home-metrics strong { margin: 14px 0 6px; font-size: 34px; }
  .home-metrics .coming-soon-card { display: none; }
  .warehouse-section { margin-top: 14px; }
  #warehouseMap { height: 270px; border-radius: 10px; }
  .warehouse-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .warehouse-grid button { grid-template-columns: 54px minmax(0,1fr); gap: 6px 14px; min-height: 96px; padding: 15px; border-radius: 10px; }
  .warehouse-grid button.selected { padding: 14px; }
  .warehouse-grid button>span { width: 54px; height: 54px; border-radius: 9px; font-size: 12px; }
  .warehouse-grid strong { padding-top: 4px; font-size: 15px; overflow-wrap: anywhere; }
  .warehouse-grid strong em { margin-left: 3px; padding: 2px 4px; font-size: 8px; }
  .warehouse-grid small { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }

  #fleet .heading { margin-bottom: 16px; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
  .stat { min-height: 140px; padding: 15px; }
  .stat strong { margin: 12px 0 7px; font-size: 32px; }
  .stat small { line-height: 1.35; }
  .fleet,.data-card { overflow: visible; border: 0; background: transparent; }
  .fleet .table-scroll,.data-card .table-scroll { overflow: visible; }
  #fleet table,#fleet tbody,#fleet tr,#fleet td,.driver-table,.driver-table tbody,.driver-table tr,.driver-table td { display: block; width: 100%; min-width: 0; white-space: normal; }
  #fleet thead,.driver-table thead { display: none; }
  #rows,#driverRows { display: grid; gap: 10px; }
  #rows tr,#driverRows tr {
    position: relative;
    border: 1px solid #dfe3e0;
    border-radius: 12px;
    background: #fff;
    padding: 18px 58px 18px 18px;
    box-shadow: 0 2px 10px #11111108;
  }
  #rows tr + tr { margin-top: 10px; }
  #rows td,#driverRows td { height: auto; border: 0; padding: 0; }
  #rows .vehicle-primary { min-height: 56px; padding-left: 30px; }
  #rows .vehicle-primary .drag-handle,#driverRows .driver-primary .drag-handle {
    position: absolute;
    left: 14px;
    top: 21px;
    width: 25px;
    height: 38px;
    margin: 0;
    touch-action: none;
    cursor: grab;
  }
  #rows .plate { font-size: 16px; }
  #rows .vehicle-primary>small { display: block; margin: 5px 0 0; padding-left: 2px; }
  #rows .vehicle-primary>small:last-child { color: #8a918d; font-size: 10px; }
  #rows .vehicle-location,#rows .vehicle-driver,#driverRows .driver-region {
    display: flex;
    gap: 7px;
    align-items: baseline;
    margin-top: 8px;
    padding-left: 30px;
    color: #263b32;
    font-size: 12px;
  }
  #rows .vehicle-location::before,#rows .vehicle-driver::before,#driverRows .driver-region::before { content: attr(data-label); min-width: 66px; color: #829087; font-size: 10px; text-transform: uppercase; }
  #rows .vehicle-fuel,#rows .vehicle-expiry { display: none; }
  #rows .vehicle-expiry.is-alert {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 10px 0 0 30px;
    border-radius: 7px;
    background: #fff2ef;
    padding: 7px 9px;
    color: #a63225;
    font-size: 11px;
  }
  #rows .vehicle-expiry.is-alert::before { content: attr(data-label); font-weight: 700; }
  #rows .vehicle-docs { position: absolute; top: 18px; right: 14px; width: 34px; }
  #rows .empty,#driverRows .empty { padding: 22px; text-align: center; }
  .table-footer { padding: 12px 2px 0; font-size: 11px; }

  .section-toolbar { gap: 10px; margin-bottom: 12px; align-items: stretch; flex-direction: column; }
  .section-toolbar .segmented { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .section-toolbar .segmented::-webkit-scrollbar { display: none; }
  .section-toolbar .segmented button { flex: 0 0 auto; }
  .section-toolbar select { width: 100%; }
  #driverRows tr { padding-right: 18px; }
  #driverRows .driver-primary { min-height: 50px; padding-left: 30px; }
  #driverRows .person-cell { display: block; }
  #driverRows .person-cell strong { font-size: 15px; }
  #driverRows .person-cell small { display: block; margin-top: 6px; color: #8a918d; font-size: 10px; }
  #driverRows .driver-extra { display: none; }
  #driverRows .driver-region { padding-left: 30px; }

  tr.touch-dragging { z-index: 5; opacity: .82; box-shadow: 0 12px 28px #1113 !important; transform: scale(1.015); }
  body.touch-reordering { user-select: none; overscroll-behavior: contain; }

  body:not(.login-page) input,body:not(.login-page) select,body:not(.login-page) textarea { font-size: 16px; }

  .login-page { min-height: 100dvh; overflow-x: hidden; grid-template-rows: minmax(0,1fr) auto; }
  .login-page .login-shell { min-height: 100dvh; align-items: center; overflow-y: auto; padding: max(16px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom)); }
  .login-page .login-card { width: min(100%,420px); border-radius: 14px; padding: 28px 22px; }
  .login-page .login-card-logo { width: 112px; margin-bottom: 22px; }
  .login-page .login-heading h1 { font-size: 28px; }
  .login-page .login-heading p { margin-bottom: 22px; }
  .login-page .login-form { gap: 14px; }
  .login-page .login-form input { min-height: 48px; font-size: 16px; }
  .login-page .password-wrap button { top: 8px; min-height: 32px; }
  .login-page .login-footer { padding: 0 16px max(16px,env(safe-area-inset-bottom)); text-align: center; }

  dialog#vehicleDialog,dialog#driverDialog,dialog#usersDialog,dialog.small-dialog {
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 18px;
    overflow: auto;
  }
  #vehicleDialog form,#driverDialog form { min-height: calc(100dvh - 36px); display: flex; flex-direction: column; }
  #vehicleDialog .dialog-top,#driverDialog .dialog-top,dialog.small-dialog .dialog-top {
    position: sticky;
    top: -18px;
    z-index: 5;
    margin: 0 0 14px;
    background: #fff;
    padding: 16px 0 12px;
  }
  #vehicleDialog .fields,#driverDialog .fields { grid-template-columns: 1fr !important; gap: 14px; }
  #vehicleDialog .garage-contact { grid-template-columns: 1fr; gap: 9px; padding: 15px; }
  #vehicleDialog .garage-contact a:last-child { grid-column: auto; }
  #vehicleDialog .damage-section { margin-top: 20px; padding-top: 18px; }
  #vehicleDialog .report { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 11px; }
  #vehicleDialog .report .danger-link { grid-column: 2; }
  #vehicleDialog .report-add { align-items: stretch; flex-direction: column; }
  #vehicleDialog .report-add button { width: 100%; }
  #vehicleDialog .dialog-footer,#driverDialog .dialog-footer {
    position: sticky;
    bottom: -18px;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
    background: #fff;
    padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  }
  #vehicleDialog .dialog-footer button,#driverDialog .dialog-footer button { width: 100%; min-height: 44px; margin: 0; }
  #vehicleDialog .dialog-footer .danger-button,#driverDialog .dialog-footer .danger-button { grid-column: 1/-1; grid-row: 2; }
}

@media(max-width:380px){
  .warehouse-grid { grid-template-columns: 1fr; }
  .home-date { max-width: 170px; }
}
