/* Lohian Transport fleet portal — navy, white and amber. */
:root {
  --navy-900: #071a33;
  --navy-800: #0b2545;
  --navy-700: #13315c;
  --navy-600: #1d4477;
  --navy-100: #e6ecf5;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-100: #fef3c7;
  --amber-800: #92400e;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --text: #16202e;
  --text-muted: #5b6678;
  --border: #d8dee8;
  --border-strong: #b9c3d3;
  --green-700: #15803d;
  --green-100: #dcfce7;
  --red-700: #b91c1c;
  --red-100: #fee2e2;
  --orange-700: #c2410c;
  --orange-100: #ffedd5;
  --blue-700: #1d4ed8;
  --blue-100: #dbeafe;
  --purple-700: #6d28d9;
  --purple-100: #ede9fe;
  --grey-700: #475569;
  --grey-100: #eef1f5;
  --focus: #f59e0b;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(11, 37, 69, 0.06), 0 2px 8px rgba(11, 37, 69, 0.06);
  --sidebar-w: 248px;
  --tap: 44px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}
h1, h2, h3 { line-height: 1.25; color: var(--navy-800); margin: 0; }
h1 { font-size: 1.75rem; font-weight: 700; }
p { margin: 0 0 0.75rem; }
a { color: var(--navy-600); text-underline-offset: 2px; }
a:hover { color: var(--navy-800); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; background: var(--grey-100); padding: 0.05em 0.35em; border-radius: 4px; }
ul, ol { padding-left: 1.25rem; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--amber-500); color: var(--navy-900); padding: 0.6rem 1rem; border-radius: var(--radius-sm); font-weight: 700; }
.skip-link:focus { top: 0.5rem; }
.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.mt { margin-top: 1.25rem; }
.mt-sm { margin-top: 0.75rem; }

/* Demo banner */
.demo-banner {
  position: sticky; top: 0; z-index: 60;
  background: var(--amber-500); color: var(--navy-900);
  text-align: center; font-size: 0.85rem; padding: 0.3rem 1rem; font-weight: 500;
}

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px;
  background: var(--amber-500); color: var(--navy-900); font-weight: 800; letter-spacing: -0.02em; font-size: 1.05rem;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: 0.02em; text-transform: uppercase; }
.brand-sub { font-size: 0.7rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--amber-400); font-weight: 600; }
.brand-lg .brand-mark { width: 52px; height: 52px; font-size: 1.35rem; }
.brand-lg .brand-name { font-size: 1.5rem; color: var(--navy-800); }
.brand-lg .brand-sub { color: var(--amber-800); font-size: 0.8rem; }
.brand-link { color: #fff; text-decoration: none; }

/* Shell */
body { --banner-h: 0px; }
body.has-demo { --banner-h: 28px; }
.shell { display: flex; min-height: calc(100vh - var(--banner-h)); }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--navy-800); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: var(--banner-h); height: calc(100vh - var(--banner-h));
}
.sidebar-brand { padding: 1.25rem 1.25rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.sidebar-brand .brand-name { color: #fff; }
.nav-list { list-style: none; margin: 0; padding: 0.75rem 0.6rem; display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: 0.75rem; min-height: var(--tap);
  padding: 0.6rem 0.85rem; border-radius: 8px; color: #d6e0ef; text-decoration: none; font-weight: 500;
}
.nav-link:hover { background: var(--navy-700); color: #fff; }
.nav-link.is-active { background: var(--navy-600); color: #fff; box-shadow: inset 3px 0 0 var(--amber-500); }
.nav-link .icon { width: 20px; height: 20px; flex-shrink: 0; }
.nav-link:focus-visible { outline-color: var(--amber-400); }
.sidebar-foot { margin-top: auto; padding: 1rem 1.25rem 1.25rem; font-size: 0.8rem; color: #b9c7dc; }
.today-chip strong { color: #fff; display: block; font-size: 0.95rem; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1.5rem;
  background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: var(--banner-h); z-index: 40;
}
.topbar-brand { display: none; color: var(--navy-800); text-decoration: none; }
.topbar-brand .brand-mark { width: 34px; height: 34px; font-size: 0.95rem; }
.topbar-brand .brand-name { color: var(--navy-800); font-size: 1rem; }
.topbar-brand .brand-sub { color: var(--amber-800); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
.user-name { font-weight: 600; }
.icon-btn.nav-toggle { display: none; }
main { padding: 1.5rem; flex: 1; width: 100%; max-width: 1280px; }
main:focus { outline: none; }
.app-footer { padding: 1rem 1.5rem 1.5rem; font-size: 0.8rem; color: var(--text-muted); }

.icon { width: 18px; height: 18px; vertical-align: middle; }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px; color: var(--navy-800); cursor: pointer;
}
.icon-btn .icon { width: 22px; height: 22px; }

/* Role pills and badges */
.role-pill { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.role-admin { background: var(--navy-800); color: #fff; }
.role-manager { background: var(--amber-100); color: var(--amber-800); }
.role-viewer { background: var(--grey-100); color: var(--grey-700); }
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.18rem 0.6rem; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent; letter-spacing: 0.01em;
}
.badge-green { background: var(--green-100); color: var(--green-700); border-color: #bbf7d0; }
.badge-red { background: var(--red-100); color: var(--red-700); border-color: #fecaca; }
.badge-amber { background: var(--amber-100); color: var(--amber-800); border-color: #fde68a; }
.badge-orange { background: var(--orange-100); color: var(--orange-700); border-color: #fed7aa; }
.badge-blue { background: var(--blue-100); color: var(--blue-700); border-color: #bfdbfe; }
.badge-grey { background: var(--grey-100); color: var(--grey-700); border-color: var(--border); }
.badge-navy { background: var(--navy-100); color: var(--navy-800); border-color: #c9d6ea; }
.badge-dot { font-size: 0.72rem; padding: 0.1rem 0.45rem; margin-left: 0.25rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: var(--tap); padding: 0.55rem 1.1rem; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}
.btn-sm { min-height: 38px; padding: 0.4rem 0.8rem; font-size: 0.875rem; }
.btn-lg { min-height: 50px; padding: 0.7rem 1.4rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy-800); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--navy-800); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--navy-100); color: var(--navy-900); }
.btn-ghost { background: transparent; color: var(--navy-700); }
.btn-ghost:hover { background: var(--navy-100); }
.btn-danger { background: var(--red-700); color: #fff; }
.btn-danger:hover { background: #991b1b; color: #fff; }
.btn-danger-ghost { background: var(--surface); color: var(--red-700); border-color: #f1b4b4; }
.btn-danger-ghost:hover { background: var(--red-100); color: #991b1b; }
.btn-success { background: var(--green-700); color: #fff; }
.btn-success:hover { background: #166534; color: #fff; }
.btn.is-disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn.is-busy { position: relative; opacity: 0.8; cursor: progress; }
.btn.is-busy::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; margin-left: 0.35rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.inline-form { display: inline; margin: 0; }

/* Page header */
.page-header { margin-bottom: 1.25rem; }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-subtitle { color: var(--text-muted); margin: 0.35rem 0 0; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.back-link { display: inline-block; margin-bottom: 0.4rem; font-size: 0.9rem; font-weight: 600; text-decoration: none; padding: 0.35rem 0; }
.back-link:hover { text-decoration: underline; }
.profile-sub { display: inline-flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Cards and grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 620px; }
.card-alert { border-color: #f3b7b7; box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.07), var(--shadow); }
.card-danger-zone { border-color: #f1c4c4; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.card-title { font-size: 1.12rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.card > .card-title { margin-bottom: 0.9rem; }
.subhead { font-size: 0.95rem; margin: 1rem 0 0.4rem; }
.link-more { font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.link-more:hover { text-decoration: underline; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card, .grid-2 + section { margin-top: 1.25rem; }
.grid-dash { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.25rem; }
.stack { display: flex; flex-direction: column; gap: 0.9rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.25rem; }
.stack-lg > .card { margin: 0; }
.prose { white-space: normal; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.9rem; margin-bottom: 1.5rem; }
.stat-card {
  display: flex; flex-direction: column; gap: 0.2rem; padding: 1rem 1.1rem; min-height: 112px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); border-top: 4px solid var(--navy-800); transition: transform 0.12s, box-shadow 0.12s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(11, 37, 69, 0.12); color: var(--text); }
.stat-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.stat-value { font-size: 2.1rem; font-weight: 800; line-height: 1.1; color: var(--navy-800); }
.stat-note { font-size: 0.78rem; color: var(--text-muted); }
.tone-green { border-top-color: var(--green-700); }
.tone-green .stat-value { color: var(--green-700); }
.tone-orange { border-top-color: var(--orange-700); }
.tone-orange .stat-value { color: var(--orange-700); }
.tone-blue { border-top-color: var(--blue-700); }
.tone-blue .stat-value { color: var(--blue-700); }
.tone-amber { border-top-color: var(--amber-500); }
.tone-amber .stat-value { color: var(--amber-800); }
.tone-red { border-top-color: var(--red-700); }
.tone-red .stat-value { color: var(--red-700); }
.tone-purple { border-top-color: var(--purple-700); }
.tone-purple .stat-value { color: var(--purple-700); }

/* Summary chips (fleet totals) */
.summary-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.summary-chip {
  display: flex; align-items: baseline; gap: 0.5rem; padding: 0.6rem 1rem; min-height: var(--tap);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text);
}
.summary-chip:hover { border-color: var(--navy-600); color: var(--text); }
.summary-chip.is-active { border-color: var(--navy-800); box-shadow: inset 0 -3px 0 var(--amber-500); }
.summary-value { font-size: 1.35rem; font-weight: 800; color: var(--navy-800); }
.summary-label { font-size: 0.88rem; color: var(--text-muted); font-weight: 600; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: flex-end; }
.filters .field { min-width: 180px; }
.filters .field.grow { flex: 1 1 260px; }
.filter-actions { display: flex; gap: 0.5rem; }
.filter-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 1rem; border-bottom: 2px solid var(--border); }
.filter-tab {
  display: inline-flex; align-items: center; gap: 0.45rem; min-height: var(--tap); padding: 0.5rem 1rem;
  text-decoration: none; font-weight: 600; color: var(--text-muted); border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.filter-tab:hover { color: var(--navy-800); }
.filter-tab.is-active { color: var(--navy-800); border-bottom-color: var(--amber-500); }
.count { display: inline-block; min-width: 1.6em; padding: 0 0.4em; border-radius: 999px; background: var(--grey-100); color: var(--grey-700); font-size: 0.78rem; text-align: center; font-weight: 700; }
.filter-tab.is-active .count { background: var(--navy-800); color: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); background: #f8fafc; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: #f8fafd; }
.table .num { text-align: right; white-space: nowrap; }
.table .cell-actions { text-align: right; white-space: nowrap; }
.table .cell-actions > * { margin-left: 0.3rem; margin-bottom: 0.25rem; }
.table tr.is-inactive td { color: var(--text-muted); }
.rego { font-weight: 800; font-size: 1rem; letter-spacing: 0.03em; }
.filename { word-break: break-all; }
.table-meta { color: var(--text-muted); font-size: 0.88rem; margin: 0.75rem 0; }
.pagination { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; }
.pagination-links { display: flex; gap: 0.5rem; }
.creds-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.creds-table th, .creds-table td { text-align: left; padding: 0.45rem 0.4rem; border-bottom: 1px solid var(--border); }
.creds-table th { font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }

/* Details lists */
.details { display: grid; grid-template-columns: 1fr; margin: 0; }
.details > div { display: grid; grid-template-columns: 11rem 1fr; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--grey-100); }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.details.compact > div { grid-template-columns: 8rem 1fr; }

/* Forms */
.form-card { max-width: 920px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.form-grid.inner { gap: 0.9rem 1.25rem; }
.span-2 { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; margin: 0; min-width: 0; }
legend { font-weight: 700; color: var(--navy-800); padding: 0 0.4rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field label, .field > .label { font-weight: 600; font-size: 0.92rem; }
.req { color: var(--red-700); }
.optional { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; }
input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input:not([type]), select, textarea {
  width: 100%; min-height: var(--tap); padding: 0.55rem 0.75rem; font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: 8px;
}
textarea { resize: vertical; min-height: 5rem; }
input:hover, select:hover, textarea:hover { border-color: var(--navy-600); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(245, 158, 11, 0.55); outline-offset: 0; border-color: var(--navy-700); }
input[type="file"] { font: inherit; padding: 0.5rem; border: 1px dashed var(--border-strong); border-radius: 8px; background: #fbfcfe; width: 100%; min-height: var(--tap); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--navy-800); flex-shrink: 0; margin-top: 0.15rem; }
.hint { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.field-error { color: var(--red-700); font-size: 0.87rem; font-weight: 600; margin: 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red-700); background: #fffafa; }
.form-errors { border: 1px solid #f3b7b7; background: var(--red-100); color: #7f1d1d; border-radius: var(--radius-sm); padding: 0.8rem 1rem; margin-bottom: 1rem; }
.form-errors ul { margin: 0.25rem 0 0; }
.form-errors p { margin: 0; }
.form-errors:focus { outline: 3px solid var(--red-700); }
.form-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.check-row { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.45rem 0; cursor: pointer; font-weight: 400; }
.static-value { margin: 0; padding: 0.35rem 0; }
.radio-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.radio-card { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.85rem 1rem; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; min-height: var(--tap); }
.radio-card span { display: flex; flex-direction: column; }
.radio-card:has(input:checked) { border-color: var(--navy-800); background: var(--navy-100); }
.issue-draft { margin-bottom: 0.9rem; background: #fffbeb; border-color: #fde68a; display: flex; flex-direction: column; gap: 0.8rem; }
.issue-draft.has-error { border-color: var(--red-700); }
.issue-draft > .btn { align-self: flex-start; }

/* Inline disclosure panels */
.inline-details { position: relative; display: inline-block; }
.inline-details > summary { list-style: none; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-panel {
  margin-top: 0.6rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(11, 37, 69, 0.15); width: min(360px, calc(100vw - 3rem)); text-align: left;
}
.inline-panel.wide { width: min(560px, calc(100vw - 3rem)); }
.inline-details.align-right .inline-panel { position: absolute; right: 0; z-index: 30; }
.card-head .inline-details:not(.align-right) .inline-panel { position: absolute; z-index: 30; }

/* Flash / notices */
.flash { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; border: 1px solid; font-weight: 500; }
.flash-success { background: var(--green-100); border-color: #bbf7d0; color: #14532d; }
.flash-error { background: var(--red-100); border-color: #fecaca; color: #7f1d1d; }
.flash-info { background: var(--blue-100); border-color: #bfdbfe; color: #1e3a8a; }
.flash-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; cursor: pointer; color: inherit; min-width: 32px; min-height: 32px; border-radius: 6px; }
.notice { padding: 0.85rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; border: 1px solid var(--border); }
.notice-grey { background: var(--grey-100); }
.date-notice { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 90; background: var(--navy-800); color: #fff; padding: 0.8rem 1.2rem; border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.date-notice a { color: var(--amber-400); font-weight: 700; }

/* Empty / error states */
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: #fbfcfe; }
.empty-title { font-weight: 700; color: var(--text); font-size: 1.02rem; margin-bottom: 0.3rem; }
.error-page { max-width: 560px; margin: 3rem auto; text-align: center; }
.error-page h1 { margin-bottom: 0.75rem; }
.error-code { font-weight: 700; color: var(--amber-800); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.85rem; }

/* Reminders */
.reminder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.reminder { border: 1px solid var(--border); border-left: 6px solid var(--blue-700); border-radius: var(--radius); background: var(--surface); padding: 0.9rem 1.1rem; box-shadow: var(--shadow); }
.reminder-overdue { border-left-color: var(--red-700); background: #fffafa; }
.reminder-due_today { border-left-color: var(--amber-500); background: #fffdf5; }
.reminder-top { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.35rem; }
.reminder-countdown { font-weight: 700; color: var(--navy-800); }
.reminder-overdue .reminder-countdown { color: var(--red-700); }
.reminder-headline { font-size: 1.02rem; font-weight: 600; margin: 0 0 0.25rem; }
.reminder-headline a { color: var(--text); text-decoration: none; }
.reminder-headline a:hover { text-decoration: underline; color: var(--navy-800); }
.reminder-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.reminder-issues { margin-top: 0.6rem; padding: 0.6rem 0.8rem; background: var(--amber-100); border-radius: var(--radius-sm); border: 1px solid #fde68a; }
.reminder-issues-title { font-weight: 700; font-size: 0.88rem; margin: 0 0 0.35rem; color: var(--amber-800); }
.reminder-issues ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.reminder-issues li { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.92rem; }
.reminder-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.reminder-list.is-compact .reminder { box-shadow: none; padding: 0.7rem 0.9rem; }

/* Activity */
.activity-list { list-style: none; padding: 0; margin: 0; }
.activity-list li { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.65rem 0; border-bottom: 1px solid var(--grey-100); }
.activity-list li:last-child { border-bottom: 0; }
.activity-link { display: flex; flex-direction: column; text-decoration: none; color: var(--text); min-width: 0; }
.activity-link:hover .activity-main { text-decoration: underline; }
.activity-meta { font-size: 0.84rem; color: var(--text-muted); }

/* Truck profile */
.section-nav { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.section-nav a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.45rem 0.85rem; min-height: 40px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; font-weight: 600; font-size: 0.9rem; color: var(--navy-800); }
.section-nav a:hover { border-color: var(--navy-600); }
.issue-list { display: flex; flex-direction: column; gap: 0.75rem; }
.issue { border: 1px solid var(--border); border-left: 5px solid var(--blue-700); border-radius: var(--radius); padding: 0.9rem 1rem; background: #fff; }
.issue-high { border-left-color: var(--orange-700); }
.issue-critical { border-left-color: var(--red-700); background: #fffafa; }
.issue-low { border-left-color: var(--grey-700); }
.issue.is-resolved { border-left-color: var(--green-700); background: #fbfdfb; }
.issue-head { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin-bottom: 0.4rem; }
.issue-target { font-size: 0.88rem; font-weight: 600; color: var(--navy-700); }
.issue-target.is-late { color: var(--red-700); }
.issue-desc { font-weight: 600; margin-bottom: 0.3rem; }
.issue-truck { margin: 0 0 0.25rem; }
.issue-meta { font-size: 0.84rem; color: var(--text-muted); margin: 0; }
.issue-resolution { margin-top: 0.5rem; padding: 0.55rem 0.75rem; background: var(--green-100); border-radius: var(--radius-sm); font-size: 0.92rem; }
.issue-resolution p { margin: 0.25rem 0 0; }
.issue-notes { list-style: none; margin: 0.6rem 0 0; padding: 0 0 0 0.9rem; border-left: 3px solid var(--navy-100); display: flex; flex-direction: column; gap: 0.45rem; }
.issue-notes p { margin: 0; }
.issue-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; align-items: flex-start; }
.resolved-block { margin-top: 1rem; }
.resolved-block > summary { cursor: pointer; font-weight: 600; color: var(--navy-700); padding: 0.4rem 0; min-height: var(--tap); display: flex; align-items: center; }
.resolved-block .issue-list { margin-top: 0.5rem; }
.schedule-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.schedule-item { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: #fbfcfe; }
.schedule-type { font-weight: 700; margin: 0; }
.schedule-due { margin: 0.1rem 0; }
.schedule-state { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0.25rem 0 0; font-weight: 600; font-size: 0.92rem; }
.schedule-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: flex-start; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--grey-100); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-date { font-weight: 700; color: var(--navy-800); }
.timeline-title { font-weight: 700; margin-bottom: 0.15rem; }
.timeline-body p { margin-bottom: 0.35rem; }
.timeline-body .link-more { margin-left: 0.5rem; }
.sort-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.sort-toggle a { padding: 0.4rem 0.8rem; min-height: 38px; display: inline-flex; align-items: center; text-decoration: none; font-size: 0.87rem; font-weight: 600; color: var(--navy-700); }
.sort-toggle a.is-active { background: var(--navy-800); color: #fff; }
.next-due { font-weight: 600; margin-right: 0.35rem; }

/* Dialog */
.dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 460px; width: calc(100vw - 2rem); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); }
.dialog::backdrop { background: rgba(7, 26, 51, 0.55); }
.dialog-body { padding: 1.4rem; }
.dialog-title { font-size: 1.2rem; margin-bottom: 0.6rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1.2rem; flex-wrap: wrap; }

/* Sign-in */
.public-body { background: linear-gradient(160deg, var(--navy-800) 0%, var(--navy-700) 45%, var(--bg) 45%); min-height: 100vh; }
.public-main { max-width: 1040px; margin: 0 auto; padding: 3rem 1rem; }
.login-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.login-card, .demo-creds { background: var(--surface); border-radius: 14px; padding: 2rem; box-shadow: 0 18px 44px rgba(7, 26, 51, 0.25); }
.login-card { border-top: 5px solid var(--amber-500); }
.login-brand { margin-bottom: 1.25rem; }
.login-card h1 { font-size: 1.45rem; margin-bottom: 0.35rem; }
.demo-creds { border: 2px dashed var(--amber-500); }
.demo-creds h2 { font-size: 1.1rem; margin-bottom: 0.35rem; }

/* Quick search (top bar) */
.quick-search { position: relative; flex: 0 1 300px; }
.quick-search input { width: 100%; padding: 0.45rem 0.7rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit; background: var(--surface); }
.quick-search-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; margin: 0; padding: 0.25rem 0; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(7, 26, 51, 0.15);
}
.quick-search-item { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.92rem; }
.quick-search-item.is-active, .quick-search-item:hover { background: var(--navy-100); }

/* Fleet register: filter collapse and phone cards */
.filters-details > .filters-summary { display: none; margin-bottom: 0.6rem; }
.filters-details > .filters-summary::-webkit-details-marker { display: none; }
.filter-tabs-sub { margin-top: -0.4rem; }
.fleet-cards { display: none; list-style: none; margin: 0; padding: 0; }
.fleet-card {
  display: grid; gap: 0.2rem; padding: 0.75rem 0.9rem; margin-bottom: 0.5rem; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.fleet-card .rego { color: var(--navy-700); font-size: 1.05rem; }
.fleet-card-mid { color: var(--text-muted); font-size: 0.88rem; }
.fleet-card-bottom { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.85rem; }
.rego-summary { display: grid; gap: 0.35rem; }

/* Responsive */
@media (max-width: 1100px) {
  .grid-dash { grid-template-columns: 1fr; }
  .fleet-table .col-type, .fleet-table .col-odo { display: none; }
}
@media (max-width: 700px) {
  .fleet-cards { display: block; }
  .fleet-table { display: none; }
  .filters-details > .filters-summary { display: inline-flex; }
  .quick-search { flex: 1 1 auto; min-width: 0; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; z-index: 80;
    transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 8px 0 30px rgba(0, 0, 0, 0.3);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(7, 26, 51, 0.5); z-index: 70; }
  .icon-btn.nav-toggle { display: inline-grid; }
  .topbar-brand { display: inline-flex; }
  .topbar { padding: 0.5rem 1rem; }
  .user-name { display: none; }
  main { padding: 1rem; }
  .grid-2, .login-wrap { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.4rem; }
  .topbar-user .btn span { display: none; }
  .topbar-user .role-pill { display: none; }
  .card { padding: 1rem; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .stat-card { min-height: 96px; padding: 0.8rem; }
  .stat-value { font-size: 1.7rem; }
  .radio-cards { grid-template-columns: 1fr; }
  .details > div { grid-template-columns: 1fr; gap: 0.1rem; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.2rem; }
  .filters .field { min-width: 100%; }
  .page-actions { width: 100%; }
  .page-actions > .btn, .page-actions > .inline-form { flex: 1 1 auto; }
  .page-actions > .inline-form .btn { width: 100%; }
  .inline-details.align-right .inline-panel, .card-head .inline-details:not(.align-right) .inline-panel { position: static; width: 100%; }
  .inline-details { display: block; }
  .inline-details > summary { display: flex; }
  .card-head > .inline-details { width: 100%; }
  /* Tables become stacked cards on phones */
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--border); padding: 0.6rem 0.9rem; }
  .table td { border: 0; padding: 0.25rem 0; text-align: left !important; }
  .table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 700; }
  .table .cell-actions { padding-top: 0.5rem; }
  .table .cell-actions > * { margin: 0 0.3rem 0.3rem 0; }
  .public-main { padding: 1.5rem 1rem; }
  .login-card, .demo-creds { padding: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sidebar, .topbar, .demo-banner, .page-actions, .issue-actions, .schedule-actions { display: none !important; }
  .card { box-shadow: none; }
}
