:root {
  --bg: #f4f7f8;
  --panel: #ffffff;
  --text: #182126;
  --muted: #66747b;
  --brand: #103a43;
  --brand2: #1f6977;
  --line: #dbe3e6;
  --danger: #b92f3b;
  --warning: #b37611;
  --success: #2c7a55;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; background: var(--bg); color: var(--text); }
.sidebar { position: fixed; top: 0; left: 0; width: 235px; height: 100vh; background: var(--brand); color: white; padding: 24px 18px; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 34px; }
.logo { width: 44px; height: 44px; border-radius: 12px; background: white; color: var(--brand); display: grid; place-items: center; font-weight: 800; }
.brand strong, .brand small { display:block; }
.brand small { opacity:.7; margin-top:4px; }
nav a { display:block; color:#e9f1f3; text-decoration:none; padding:12px 14px; border-radius:9px; margin:4px 0; }
nav a:hover { background:rgba(255,255,255,.1); }
.main { margin-left:235px; padding:28px; }
.topbar { display:flex; justify-content:space-between; align-items:center; margin-bottom:24px; }
h1 { margin:0; font-size:30px; }
.topbar p { margin:6px 0 0; color:var(--muted); }
.tm-badge { background:#e7f0f2; color:var(--brand); padding:10px 14px; border-radius:20px; font-weight:700; }
.score-strip { display:grid; grid-template-columns:2fr repeat(5,1fr); gap:14px; margin-bottom:20px; }
.score-card,.metric,.panel { background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:18px; box-shadow:0 3px 10px rgba(21,40,46,.04); }
.score-card span,.metric span { color:var(--muted); font-size:13px; }
.score-card strong { display:block; font-size:34px; margin:6px 0; }
.metric strong { display:block; font-size:30px; margin-top:9px; }
.progress { height:8px; background:#e8edef; border-radius:20px; overflow:hidden; }
.progress i { display:block; height:100%; background:var(--brand2); }
.metric.danger strong { color:var(--danger); }
.metric.warning strong { color:var(--warning); }
.grid.two { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin-bottom:20px; }
.panel h2 { margin-top:0; font-size:19px; }
.panel-title { display:flex; justify-content:space-between; align-items:center; }
.panel-title a { color:var(--brand2); font-size:14px; text-decoration:none; }
.alert-row { display:flex; justify-content:space-between; gap:15px; padding:13px 0; border-top:1px solid var(--line); }
.alert-row.danger b { color:var(--danger); }
.alert-row.warning b { color:var(--warning); }
.empty { color:var(--muted); }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-grid label { font-size:13px; color:var(--muted); font-weight:600; }
.form-grid label.wide { grid-column:1/-1; }
input,select,textarea { width:100%; padding:11px; margin-top:6px; border:1px solid #cbd5d9; border-radius:8px; font:inherit; background:white; }
textarea { min-height:80px; resize:vertical; }
button { border:0; background:var(--brand2); color:white; border-radius:8px; padding:11px 16px; font-weight:700; cursor:pointer; width:max-content; }
button.small { padding:7px 10px; font-size:12px; }
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th,td { text-align:left; padding:11px 8px; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.flash { padding:12px 15px; border-radius:9px; margin-bottom:15px; background:#edf4f6; }
.flash.success { border-left:4px solid var(--success); }
.flash.danger { border-left:4px solid var(--danger); }
@media (max-width: 1000px) {
  .score-strip { grid-template-columns:1fr 1fr; }
}
@media (max-width: 760px) {
  .sidebar { position:static; width:100%; min-height:auto; }
  nav { display:flex; overflow-x:auto; gap:4px; }
  nav a { white-space:nowrap; }
  .main { margin-left:0; padding:16px; }
  .grid.two,.score-strip,.form-grid { grid-template-columns:1fr; }
  .form-grid label.wide { grid-column:auto; }
  .topbar { align-items:flex-start; gap:12px; }
  .tm-badge { display:none; }
}


.vehicle-link { color: var(--brand2); text-decoration: none; }
.vehicle-link:hover { text-decoration: underline; }

.vehicle-status-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin-bottom:20px;
}
.status-box {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:14px;
  padding:16px;
  border-left:5px solid var(--brand2);
}
.status-box span { display:block; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.status-box strong { display:block; margin-top:7px; font-size:18px; }
.status-box.good { border-left-color:var(--success); }
.status-box.warning { border-left-color:var(--warning); }
.status-box.danger { border-left-color:var(--danger); }

@media (max-width: 900px) {
  .vehicle-status-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 520px) {
  .vehicle-status-grid { grid-template-columns:1fr; }
}

.summary-list { display:grid; gap:10px; }
.summary-list div { display:flex; justify-content:space-between; align-items:center; padding:13px 0; border-bottom:1px solid var(--line); }
.summary-list span { color:var(--muted); }
.summary-list b { font-size:20px; }

.action-bar { display:flex; justify-content:flex-end; margin-bottom:16px; }
.button-link { display:inline-block; background:var(--brand2); color:white; text-decoration:none; padding:11px 16px; border-radius:8px; font-weight:700; }
.check-row { display:grid; grid-template-columns:1.4fr .7fr 1.6fr 1fr 1fr 1.1fr; gap:10px; align-items:center; padding:12px 0; border-top:1px solid var(--line); }
.check-row input, .check-row select { margin-top:0; }
.check-name { padding-right:8px; }
.muted { color:var(--muted); }
.declaration { display:flex; gap:10px; align-items:flex-start; font-weight:600; }
.declaration input { width:auto; margin-top:3px; }
.pill { display:inline-block; border-radius:999px; padding:5px 9px; font-size:12px; font-weight:700; }
.pill.good { background:#e7f4ec; color:var(--success); }
.pill.danger { background:#fae8ea; color:var(--danger); }
.evidence-photo { max-width:100%; max-height:360px; border-radius:10px; border:1px solid var(--line); }
@media (max-width: 1100px) {
  .check-row { grid-template-columns:1fr 1fr; }
  .check-name { grid-column:1/-1; }
}


/* Driver Portal / Driver Walkaround */
.driver-body { background:#eef3f4; margin:0; }
.driver-shell { max-width:760px; margin:0 auto; padding:18px; }
.walk-shell { max-width:860px; }
.driver-brand { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.driver-brand .logo { flex:0 0 auto; }
.driver-brand strong, .driver-brand small { display:block; }
.driver-brand strong { font-size:20px; color:var(--brand); }
.driver-brand small { color:var(--muted); margin-top:2px; }

.driver-hero, .driver-card {
  background:white;
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  margin-bottom:16px;
  box-shadow:0 3px 10px rgba(21,40,46,.04);
}
.driver-hero h1, .driver-card h1 { margin:0 0 6px; }
.driver-card h2 { margin:0 0 14px; }

.driver-actions { display:grid; gap:12px; }
.driver-action {
  display:flex;
  gap:14px;
  align-items:center;
  text-decoration:none;
  background:white;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  box-shadow:0 3px 10px rgba(21,40,46,.04);
}
.driver-action.primary { background:var(--brand); color:white; }
.driver-action strong, .driver-action small { display:block; }
.driver-action strong { font-size:18px; }
.driver-action small { opacity:.72; margin-top:3px; }
.driver-action.disabled { opacity:.5; pointer-events:none; }
.driver-icon {
  width:46px; height:46px; border-radius:12px;
  display:grid; place-items:center;
  background:rgba(31,105,119,.12);
  font-size:24px; font-weight:800;
}
.driver-action.primary .driver-icon { background:rgba(255,255,255,.16); }
.driver-back { display:block; text-align:center; margin-top:18px; color:var(--brand2); }

.driver-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.driver-form-grid label { font-weight:700; font-size:14px; color:var(--muted); }
.driver-form-grid input, .driver-form-grid select { min-height:48px; font-size:16px; }

.walk-tools {
  position:sticky;
  top:0;
  z-index:5;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  background:#eef3f4;
  padding:10px 0;
  margin-bottom:8px;
}
.mark-all-btn { background:var(--brand); padding:12px 14px; }
#progressText { color:var(--muted); font-weight:700; }

.check-section { padding-top:14px; }
.mobile-check-item {
  border-top:1px solid var(--line);
  padding:16px 0;
}
.mobile-check-item:first-of-type { border-top:0; }
.mobile-check-item.has-defect {
  background:#fff7f7;
  margin:0 -10px;
  padding:16px 10px;
  border-radius:10px;
}
.mobile-check-title { font-size:18px; font-weight:800; margin-bottom:12px; }
.result-buttons { display:grid; grid-template-columns:1fr 1fr .72fr; gap:8px; }
.result-btn {
  width:100%;
  min-height:50px;
  font-size:16px;
  background:#edf2f3;
  color:var(--text);
  border:2px solid transparent;
}
.result-btn.ok.selected { background:#e5f4eb; color:var(--success); border-color:var(--success); }
.result-btn.defect.selected { background:#fae5e7; color:var(--danger); border-color:var(--danger); }
.result-btn.na.selected { background:#eceff1; color:#536169; border-color:#87959b; }

.defect-extra {
  display:none;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
  padding:14px;
  border-radius:12px;
  background:white;
  border:1px solid #efc8cc;
}
.defect-extra.show { display:grid; }
.defect-extra label { font-size:13px; font-weight:700; color:var(--muted); }
.defect-extra textarea { min-height:90px; }
.defect-extra label:first-child { grid-column:1/-1; }

.mobile-declaration { margin-bottom:16px; font-size:15px; }
.submit-walkaround {
  width:100%;
  min-height:56px;
  font-size:18px;
  margin-top:18px;
  background:var(--success);
}

@media (max-width: 620px) {
  .driver-shell { padding:12px; }
  .driver-form-grid { grid-template-columns:1fr; }
  .driver-card { padding:15px; border-radius:14px; }
  .mobile-check-title { font-size:17px; }
  .result-buttons { grid-template-columns:1fr 1fr .7fr; }
  .result-btn { padding:10px 6px; font-size:15px; }
  .defect-extra { grid-template-columns:1fr; }
  .defect-extra label:first-child { grid-column:auto; }
  .walk-tools { align-items:stretch; flex-direction:column; }
  .walk-tools .mark-all-btn { width:100%; }
  #progressText { text-align:center; }
}

.timer-shell { max-width:760px; }
.timer-identity { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.timer-identity span, .timer-card span { display:block; color:var(--muted); font-size:12px; text-transform:uppercase; }
.timer-identity strong { display:block; font-size:18px; margin-top:4px; }
.next-break-card { background:var(--brand); color:white; border-radius:18px; padding:24px 18px; text-align:center; margin-bottom:16px; }
.timer-eyebrow { font-size:13px; font-weight:800; letter-spacing:.08em; opacity:.8; }
.big-countdown { font-size:64px; line-height:1; font-weight:900; margin:12px 0 8px; font-variant-numeric:tabular-nums; }
.timer-reason { font-size:16px; font-weight:700; }
.next-break-card.timer-warning { background:#8a6515; }
.next-break-card.timer-danger { background:#9f2632; }
.timer-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-bottom:16px; }
.timer-card { background:white; border:1px solid var(--line); border-radius:16px; padding:16px; }
.timer-card strong { display:block; font-size:32px; margin:5px 0; font-variant-numeric:tabular-nums; }
.timer-card small { color:var(--muted); }
.mini-progress { height:7px; background:#e7ecee; border-radius:20px; overflow:hidden; margin-top:12px; }
.mini-progress i { display:block; height:100%; background:var(--brand2); width:0; }
.current-activity { font-size:28px; font-weight:900; text-align:center; background:#eef3f4; border-radius:12px; padding:16px; margin-bottom:14px; }
.activity-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.activity-btn { width:100%; min-height:58px; font-size:17px; }
.activity-btn.driving { background:#2b6572; }
.activity-btn.work { background:#475c65; }
.activity-btn.poa { background:#6c7278; }
.activity-btn.break { background:#2f7a57; }
.alert-log { display:grid; gap:8px; margin-top:12px; }
.timer-alert { background:#eef3f4; border-left:4px solid var(--brand2); border-radius:8px; padding:10px 12px; font-weight:700; }
.end-duty-btn { width:100%; min-height:54px; background:var(--danger); font-size:17px; }
@media (max-width:420px) { .timer-grid { grid-template-columns:1fr; } .big-countdown { font-size:48px; } }

.live-hours-summary { display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:20px; }
.live-summary-card { background:white; border:1px solid var(--line); border-radius:14px; padding:16px; border-left:5px solid var(--brand2); }
.live-summary-card span { display:block; color:var(--muted); font-size:12px; text-transform:uppercase; }
.live-summary-card strong { display:block; font-size:30px; margin-top:7px; }
.live-summary-card.green { border-left-color:var(--success); }
.live-summary-card.amber { border-left-color:var(--warning); }
.live-summary-card.red { border-left-color:var(--danger); }

.driver-live-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.driver-live-card { background:white; border:1px solid var(--line); border-top:5px solid var(--brand2); border-radius:14px; padding:16px; min-width:0; }
.driver-live-card.green { border-top-color:var(--success); }
.driver-live-card.amber { border-top-color:var(--warning); }
.driver-live-card.red { border-top-color:var(--danger); }

.driver-live-head { display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
.driver-live-name { display:block; font-size:19px; font-weight:800; }
.driver-live-head small { display:block; color:var(--muted); margin-top:3px; }

.live-status-pill { border-radius:999px; padding:5px 8px; font-size:11px; font-weight:800; white-space:nowrap; }
.live-status-pill.green { background:#e5f4eb; color:var(--success); }
.live-status-pill.amber { background:#fbf0d8; color:#8a6515; }
.live-status-pill.red { background:#fae5e7; color:var(--danger); }

.current-duty-line { display:flex; justify-content:space-between; gap:10px; padding:13px 0; border-bottom:1px solid var(--line); margin-top:8px; }
.current-duty-line span, .live-break-focus span, .live-clock-pair span { color:var(--muted); font-size:12px; text-transform:uppercase; }

.live-break-focus { text-align:center; padding:17px 0; }
.live-break-focus strong { display:block; font-size:28px; margin:4px 0; }
.live-break-focus small { color:var(--muted); font-weight:700; }

.live-clock-pair { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.live-clock-pair > div { background:#f4f7f8; border-radius:10px; padding:10px; }
.live-clock-pair b { display:block; font-size:18px; margin-top:3px; }

.driver-live-footer { display:flex; justify-content:space-between; gap:10px; margin-top:14px; font-size:12px; color:var(--muted); }
.driver-live-footer a { color:var(--brand2); font-weight:700; text-decoration:none; }

@media (max-width:1200px) { .driver-live-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:900px) { .live-hours-summary { grid-template-columns:1fr 1fr; } }
@media (max-width:650px) { .driver-live-grid { grid-template-columns:1fr; } }

.v8stats{display:grid;grid-template-columns:1fr 1fr;gap:8px}.v8stats>div{background:#f4f7f8;border-radius:9px;padding:9px}.v8stats span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase}.v8stats b{display:block;margin-top:3px}.extension-line{background:#eef3f4;border-radius:8px;padding:9px;font-size:12px}.ackform{display:flex;gap:6px;min-width:280px}.ackform input{min-width:170px}

.planner-form{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;align-items:end}.planner-form label,.stack-form label{display:grid;gap:5px;font-size:12px;font-weight:700;color:var(--muted)}.planner-form .wide{grid-column:span 3}.planner-form input,.planner-form select,.stack-form input,.stack-form select,.stack-form textarea{width:100%;box-sizing:border-box}.pmi-detail-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.stack-form{display:grid;gap:12px}.stack-form textarea{min-height:75px}@media(max-width:900px){.planner-form{grid-template-columns:1fr 1fr}.planner-form .wide{grid-column:span 1}.pmi-detail-grid{grid-template-columns:1fr}}

.vehicle-pmi-summary{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:14px 0 20px}
.vehicle-pmi-summary>div{background:#f4f7f8;border:1px solid var(--line);border-radius:10px;padding:12px}
.vehicle-pmi-summary span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase}
.vehicle-pmi-summary strong{display:block;margin-top:4px;font-size:17px}
.text-danger{color:var(--danger)}.text-warning{color:#8a6515}.text-success{color:var(--success)}
@media(max-width:900px){.vehicle-pmi-summary{grid-template-columns:1fr 1fr}}

.pmi-early,.pmi-late,.pmi-ontime{display:inline-block;margin-left:7px;padding:3px 7px;border-radius:999px;font-size:10px;font-weight:800}
.pmi-early{background:#e5f4eb;color:var(--success)}
.pmi-late{background:#fae5e7;color:var(--danger)}
.pmi-ontime{background:#eef3f4;color:var(--brand)}

.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 8px; }
.sidebar::-webkit-scrollbar-track { background: rgba(255,255,255,.04); }
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent; }

.tm-badge a { color: var(--brand); font-weight:700; }


/* V19 Driver Daily Checks & Defect Management */
.driver-day-summary{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.driver-day-summary>div{background:#f4f7f8;border:1px solid var(--line);border-radius:12px;padding:14px}
.driver-day-summary span{display:block;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.04em}
.driver-day-summary strong{display:block;margin-top:6px;font-size:18px}
button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:520px){.driver-day-summary{grid-template-columns:1fr}}


/* Driver Messages / Acknowledgements */
.driver-message-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; }
.driver-message-body { white-space:pre-wrap; line-height:1.55; background:#f7f9fa; border:1px solid var(--line); border-radius:10px; padding:14px; margin:12px 0; }
.message-acknowledged { margin-top:12px; padding:12px 14px; border-radius:10px; background:#e7f4ec; color:var(--success); font-weight:800; }
.message-card h2 { margin-bottom:8px; }
details summary { cursor:pointer; font-weight:700; color:var(--brand2); padding:6px 0; }
button:disabled { opacity:.45; cursor:not-allowed; }


/* Grouped responsive application navigation */
.sidebar {
  width: 258px;
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  z-index: 60;
}
.main { margin-left: 258px; }
.sidebar-brand {
  position: sticky;
  top: -18px;
  z-index: 3;
  background: var(--brand);
  margin: 0 -2px 14px;
  padding: 18px 2px 14px;
}
.brand-copy { min-width: 0; }
.sidebar-close {
  display: none;
  margin-left: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255,255,255,.10);
  font-size: 25px;
  line-height: 1;
}
.side-nav {
  display: block;
  overflow: visible;
  flex: 1 1 auto;
}
.nav-group {
  border-top: 1px solid rgba(255,255,255,.09);
  padding: 5px 0;
}
.nav-group:first-child { border-top: 0; }
.nav-group summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 9px;
  color: rgba(255,255,255,.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .055em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-chevron {
  font-size: 20px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .16s ease;
  opacity: .65;
}
.nav-group[open] .nav-chevron { transform: rotate(90deg); }
.nav-links { padding: 1px 0 6px; }
.side-nav a {
  display: block;
  color: #e9f1f3;
  text-decoration: none;
  padding: 9px 12px 9px 18px;
  border-radius: 8px;
  margin: 2px 0;
  font-size: 13px;
  line-height: 1.3;
  border-left: 3px solid transparent;
}
.side-nav a:hover { background: rgba(255,255,255,.09); }
.side-nav a.active {
  background: rgba(255,255,255,.14);
  border-left-color: #fff;
  color: #fff;
  font-weight: 800;
}
.sidebar-user {
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 13px 12px;
  border-top: 1px solid rgba(255,255,255,.13);
  color: rgba(255,255,255,.82);
}
.sidebar-user span,
.sidebar-user strong,
.sidebar-user small { display: block; }
.sidebar-user span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.sidebar-user strong { margin-top: 5px; color: #fff; font-size: 14px; }
.sidebar-user small { margin-top: 3px; opacity: .72; }
.sidebar-user a {
  display: inline-block;
  margin-top: 10px;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}
.menu-toggle {
  display: none;
  align-items: center;
  gap: 4px;
  min-height: 42px;
  padding: 9px 11px;
  background: var(--brand);
  flex: 0 0 auto;
}
.menu-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  background: #fff;
  border-radius: 4px;
}
.menu-toggle span + span { margin-top: 3px; }
.menu-toggle b { margin-left: 6px; font-size: 13px; }
.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
  background: rgba(9,20,24,.48);
}
.topbar-title { min-width: 0; }

@media (max-width: 760px) {
  body.nav-open { overflow: hidden; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(88vw, 330px);
    height: 100dvh;
    min-height: 100vh;
    padding: 14px;
    transform: translateX(-104%);
    transition: transform .2s ease;
    box-shadow: 12px 0 34px rgba(0,0,0,.24);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-scrim { display: block; }
  .sidebar-brand {
    top: -14px;
    padding: 14px 0 12px;
    margin-bottom: 8px;
  }
  .sidebar-close { display: grid; place-items: center; }
  .side-nav {
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
  }
  .side-nav a { white-space: normal; }
  .nav-group summary { min-height: 46px; font-size: 13px; }
  .nav-links { padding-bottom: 7px; }
  .side-nav a { padding: 11px 12px 11px 20px; font-size: 14px; }
  .main { margin-left: 0; padding: 14px; }
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0,1fr);
    align-items: start;
    gap: 12px;
    margin-bottom: 18px;
  }
  .menu-toggle { display: inline-flex; flex-direction: column; justify-content: center; }
  .menu-toggle b { position: absolute; left: -9999px; }
  .topbar h1 { font-size: 24px; line-height: 1.15; }
  .topbar p { font-size: 13px; }
  .tm-badge { display: none; }
}


/* Priority-led dashboard */
.dashboard-hero {
  display:grid;
  grid-template-columns:minmax(280px,.8fr) minmax(0,1.7fr);
  gap:18px;
  margin-bottom:22px;
}
.health-card,
.priority-summary {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:0 4px 16px rgba(21,40,46,.05);
}
.health-card {
  padding:20px;
  border-top:5px solid var(--brand2);
}
.health-card.good { border-top-color:var(--success); }
.health-card.warning { border-top-color:var(--warning); }
.health-card.danger { border-top-color:var(--danger); }
.health-topline {
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
}
.eyebrow {
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.075em;
}
.health-score {
  font-size:58px;
  line-height:1;
  font-weight:900;
  margin:8px 0 12px;
  font-variant-numeric:tabular-nums;
}
.health-score small { font-size:22px; color:var(--muted); margin-left:2px; }
.health-label {
  background:#eef3f4;
  color:var(--brand);
  border-radius:999px;
  padding:6px 9px;
  font-size:11px;
  font-weight:800;
  white-space:nowrap;
}
.health-card.good .health-label { background:#e7f4ec; color:var(--success); }
.health-card.warning .health-label { background:#fbf0d8; color:#8a6515; }
.health-card.danger .health-label { background:#fae5e7; color:var(--danger); }
.health-progress {
  height:9px;
  background:#e8edef;
  border-radius:999px;
  overflow:hidden;
}
.health-progress i { display:block; height:100%; background:var(--brand2); }
.health-card.good .health-progress i { background:var(--success); }
.health-card.warning .health-progress i { background:var(--warning); }
.health-card.danger .health-progress i { background:var(--danger); }
.health-card p { margin:11px 0 0; color:var(--muted); font-size:12px; line-height:1.45; }

.priority-summary { padding:20px; }
.priority-heading,
.section-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:14px;
}
.priority-heading h2,
.section-heading h2 {
  margin:4px 0 0;
  font-size:20px;
}
.text-link,
.more-link {
  color:var(--brand2);
  text-decoration:none;
  font-size:13px;
  font-weight:800;
}
.text-link:hover,
.more-link:hover { text-decoration:underline; }
.priority-mini-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin-top:16px;
}
.priority-mini {
  display:block;
  text-decoration:none;
  color:var(--text);
  background:#f6f8f9;
  border:1px solid var(--line);
  border-radius:12px;
  padding:13px;
  border-left:4px solid #9aabb1;
  min-width:0;
}
.priority-mini.warning { border-left-color:var(--warning); }
.priority-mini.danger { border-left-color:var(--danger); background:#fff9f9; }
.priority-mini span,
.priority-mini small { display:block; }
.priority-mini span { color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; }
.priority-mini strong { display:block; font-size:27px; margin:5px 0 3px; }
.priority-mini small { color:var(--muted); font-size:11px; line-height:1.3; }

.dashboard-section { margin:22px 0; }
.section-total {
  background:#eef3f4;
  border-radius:999px;
  padding:7px 10px;
  color:var(--brand);
  font-size:12px;
  font-weight:800;
}
.today-grid {
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:12px;
  margin-top:13px;
}
.today-card {
  display:block;
  min-width:0;
  text-decoration:none;
  color:var(--text);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:13px;
  padding:15px;
  box-shadow:0 3px 10px rgba(21,40,46,.035);
}
.today-card:hover,
.priority-mini:hover,
.management-lines a:hover,
.indicator:hover {
  border-color:#b7c8cd;
  box-shadow:0 5px 14px rgba(21,40,46,.07);
}
.today-card span,
.today-card small { display:block; }
.today-card span { color:var(--muted); font-size:11px; font-weight:800; text-transform:uppercase; }
.today-card strong { display:block; font-size:26px; margin:7px 0 5px; }
.today-card small { color:var(--muted); font-size:11px; line-height:1.3; }

.management-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:13px;
}
.management-card {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:14px;
  padding:17px;
  box-shadow:0 3px 10px rgba(21,40,46,.035);
}
.management-card-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}
.card-kicker {
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.management-card h3 { margin:4px 0 0; font-size:17px; }
.status-count {
  min-width:38px;
  height:38px;
  border-radius:11px;
  display:grid;
  place-items:center;
  padding:0 8px;
  font-weight:900;
  background:#e7f4ec;
  color:var(--success);
}
.status-count.warning { background:#fbf0d8; color:#8a6515; }
.status-count.danger { background:#fae5e7; color:var(--danger); }
.management-lines {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
}
.management-lines a {
  display:flex;
  justify-content:space-between;
  gap:10px;
  color:var(--text);
  text-decoration:none;
  background:#f7f9fa;
  border:1px solid #e7edef;
  border-radius:9px;
  padding:10px;
  font-size:12px;
}
.management-lines a span { color:var(--muted); }
.management-lines a b { font-size:14px; }

.alert-board {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:13px;
}
.dashboard-alert-panel { padding:16px; }
.dashboard-alert-panel .panel-title { margin-bottom:5px; }
.dashboard-alert-panel h3 { margin:0; font-size:16px; }
.dashboard-alert {
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px 0;
  border-top:1px solid var(--line);
}
.dashboard-alert:first-of-type { border-top:0; }
.alert-dot {
  width:9px;
  height:9px;
  border-radius:999px;
  background:var(--warning);
  margin-top:4px;
  flex:0 0 auto;
}
.dashboard-alert.danger .alert-dot { background:var(--danger); }
.dashboard-alert b,
.dashboard-alert small { display:block; }
.dashboard-alert b { font-size:13px; line-height:1.35; }
.dashboard-alert small { color:var(--muted); margin-top:3px; font-size:11px; }
.success-empty {
  background:#f0f8f3;
  color:var(--success);
  border-radius:9px;
  padding:11px 12px;
  font-weight:700;
  font-size:12px;
}
.more-link { display:inline-block; margin-top:8px; }

.dashboard-details {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
}
.dashboard-details summary {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  list-style:none;
  cursor:pointer;
  padding:16px 18px;
  color:var(--text);
}
.dashboard-details summary::-webkit-details-marker { display:none; }
.dashboard-details summary strong { display:block; margin-top:4px; }
.dashboard-details summary > span { color:var(--brand2); font-size:12px; font-weight:800; }
.indicator-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  padding:0 18px 18px;
}
.indicator {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  min-height:56px;
  border:1px solid var(--line);
  border-left:4px solid var(--success);
  border-radius:10px;
  padding:10px 11px;
  color:var(--text);
  text-decoration:none;
  font-size:12px;
  background:#fbfcfc;
}
.indicator.warning { border-left-color:var(--warning); }
.indicator.danger { border-left-color:var(--danger); }
.indicator span { color:var(--muted); }
.indicator b { text-align:right; }

@media (max-width:1250px) {
  .today-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .priority-mini-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .indicator-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:900px) {
  .dashboard-hero { grid-template-columns:1fr; }
  .management-grid { grid-template-columns:1fr; }
  .alert-board { grid-template-columns:1fr; }
  .indicator-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:620px) {
  .dashboard-section { margin:18px 0; }
  .priority-heading,
  .section-heading { align-items:flex-start; }
  .section-heading { flex-direction:column; gap:7px; }
  .today-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .priority-mini-grid { grid-template-columns:1fr 1fr; }
  .management-lines { grid-template-columns:1fr; }
  .indicator-grid { grid-template-columns:1fr; padding:0 14px 14px; }
  .health-score { font-size:48px; }
}
@media (max-width:420px) {
  .today-grid,
  .priority-mini-grid { grid-template-columns:1fr; }
}


/* Action Centre usability */
.action-hero {
  display:grid;
  grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);
  gap:18px;
  align-items:stretch;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
  box-shadow:0 4px 16px rgba(21,40,46,.05);
}
.action-hero h2 { margin:5px 0 7px; font-size:24px; }
.action-hero p { margin:0; color:var(--muted); max-width:700px; line-height:1.5; }
.action-summary-grid {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
}
.action-summary {
  width:100%;
  min-width:0;
  background:#f5f8f9;
  color:var(--text);
  border:1px solid var(--line);
  border-radius:11px;
  padding:12px 9px;
  text-align:left;
}
.action-summary span,
.action-summary strong { display:block; }
.action-summary span { font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
.action-summary strong { margin-top:5px; font-size:24px; }
.action-summary.warning { background:#fffaf0; border-color:#ead6ad; }
.action-summary.danger { background:#fff7f7; border-color:#efcdd0; }
.action-summary:hover { border-color:#9fb4ba; }

.action-centre-heading { align-items:center; }
.action-tools { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:6px; }
.filter-chip {
  width:auto;
  background:#eef3f4;
  color:var(--brand);
  border:1px solid #d9e2e5;
  border-radius:999px;
  padding:7px 10px;
  font-size:11px;
}
.filter-chip.active { background:var(--brand); color:#fff; border-color:var(--brand); }
.action-list { display:grid; gap:10px; margin-top:13px; scroll-margin-top:12px; }
.action-card {
  background:var(--panel);
  border:1px solid var(--line);
  border-left:5px solid var(--success);
  border-radius:13px;
  box-shadow:0 3px 10px rgba(21,40,46,.035);
  overflow:hidden;
}
.action-card.warning { border-left-color:var(--warning); }
.action-card.danger { border-left-color:var(--danger); }
.action-card-main {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:15px 16px;
}
.action-priority {
  align-self:start;
  min-width:72px;
  text-align:center;
  border-radius:999px;
  padding:6px 8px;
  background:#e7f4ec;
  color:var(--success);
  font-size:10px;
  font-weight:900;
  letter-spacing:.035em;
}
.action-priority.warning { background:#fbf0d8; color:#8a6515; }
.action-priority.danger { background:#fae5e7; color:var(--danger); }
.action-category {
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.action-card h3 { margin:4px 0 7px; font-size:16px; line-height:1.35; }
.action-meta { display:flex; flex-wrap:wrap; gap:6px 14px; color:var(--muted); font-size:11px; }
.action-meta b { color:var(--text); font-weight:800; }
.action-card-controls { display:flex; gap:7px; align-items:center; }
.secondary-button {
  background:#eef3f4;
  color:var(--brand);
  border:1px solid #d9e2e5;
  padding:8px 10px;
  font-size:11px;
}
.action-edit-panel {
  display:none;
  border-top:1px solid var(--line);
  background:#f8fafb;
  padding:14px 16px 16px;
}
.action-edit-panel.open { display:block; }
.action-update-form {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:11px;
}
.action-update-form label {
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.action-update-form .wide { grid-column:1/-1; }
.action-form-buttons { display:flex; gap:8px; }
.secondary-form-button { background:#dfe7e9; color:var(--brand); }
.all-clear-card {
  display:flex;
  gap:14px;
  align-items:center;
  background:#f0f8f3;
  border:1px solid #cfe6d7;
  border-radius:13px;
  padding:18px;
}
.all-clear-mark {
  width:40px;
  height:40px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:var(--success);
  color:#fff;
  font-size:22px;
  font-weight:900;
}
.all-clear-card strong,
.all-clear-card small { display:block; }
.all-clear-card small { color:var(--muted); margin-top:3px; }
.no-filter-results {
  display:none;
  background:#f7f9fa;
  border:1px dashed var(--line);
  border-radius:12px;
  padding:18px;
  text-align:center;
  color:var(--muted);
}
.action-details {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
}
.action-details summary {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:16px 18px;
  list-style:none;
  cursor:pointer;
}
.action-details summary::-webkit-details-marker { display:none; }
.action-details summary strong { display:block; margin-top:4px; }
.action-details summary > span { color:var(--brand2); font-size:12px; font-weight:800; }
.action-create-form { padding:0 18px 18px; }
.action-history { padding:0 18px 18px; }
.management-disclaimer { color:var(--muted); margin:10px 2px 0; }

@media (max-width:1050px) {
  .action-hero { grid-template-columns:1fr; }
}
@media (max-width:760px) {
  .action-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .action-centre-heading { align-items:flex-start; }
  .action-tools { justify-content:flex-start; }
  .action-card-main { grid-template-columns:1fr; gap:9px; }
  .action-priority { width:max-content; }
  .action-card-controls { justify-content:flex-start; }
  .action-update-form { grid-template-columns:1fr; }
  .action-update-form .wide { grid-column:auto; }
  .action-form-buttons { flex-wrap:wrap; }
}


/* Global find and record navigation */
.topbar-search {
  flex:0 1 420px;
  min-width:220px;
}
.global-search-form {
  display:flex;
  align-items:center;
  gap:7px;
}
.global-search-form input {
  margin:0;
  min-height:40px;
  border-radius:10px;
}
.global-search-form button {
  min-height:40px;
  padding:9px 12px;
}
.context-nav {
  display:flex;
  align-items:center;
  gap:7px;
  margin:-10px 0 14px;
}
.context-nav a,
.context-back {
  display:inline-flex;
  align-items:center;
  min-height:34px;
  width:auto;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--panel);
  color:var(--brand);
  text-decoration:none;
  font-size:12px;
  font-weight:800;
  box-shadow:0 2px 6px rgba(21,40,46,.025);
}
.context-back { cursor:pointer; }
.context-nav a:hover,
.context-back:hover { border-color:#aebfc4; background:#f8fafb; }

.page-jump-nav {
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  gap:6px;
  overflow-x:auto;
  white-space:nowrap;
  padding:8px 0 10px;
  margin-bottom:10px;
  background:linear-gradient(var(--bg) 75%, rgba(244,247,248,0));
  scrollbar-width:thin;
}
.page-jump-nav[hidden] { display:none; }
.page-jump-label,
.page-jump-more {
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.055em;
  flex:0 0 auto;
}
.page-jump-nav a {
  flex:0 0 auto;
  color:var(--brand);
  text-decoration:none;
  border:1px solid var(--line);
  background:var(--panel);
  border-radius:999px;
  padding:7px 9px;
  font-size:11px;
  font-weight:800;
}
.page-jump-nav a:hover { border-color:#aebfc4; background:#f7f9fa; }
section.panel { scroll-margin-top:58px; }

.search-hero {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:16px;
  padding:20px;
  box-shadow:0 4px 16px rgba(21,40,46,.045);
}
.search-page-form { max-width:820px; }
.search-page-form input { min-height:48px; font-size:15px; }
.search-page-form button { min-height:48px; }
.search-hero p { margin:9px 0 0; color:var(--muted); font-size:12px; }
.quick-search-results { display:grid; gap:8px; margin-top:13px; }
.quick-search-result {
  display:grid;
  grid-template-columns:110px minmax(0,1fr) auto auto;
  gap:12px;
  align-items:center;
  color:var(--text);
  text-decoration:none;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:13px 14px;
}
.quick-search-result:hover { border-color:#aebfc4; box-shadow:0 4px 12px rgba(21,40,46,.05); }
.search-result-type {
  color:var(--brand2);
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.search-result-copy strong,
.search-result-copy small { display:block; }
.search-result-copy strong { font-size:15px; }
.search-result-copy small { color:var(--muted); margin-top:3px; font-size:12px; }
.search-result-status {
  color:var(--muted);
  border-radius:999px;
  background:#eef3f4;
  padding:5px 8px;
  font-size:10px;
  font-weight:800;
}
.search-result-arrow { color:var(--brand2); font-size:25px; }
.search-help { margin-top:16px; }
.search-empty { margin-top:3px; }

@media (max-width:1050px) {
  .topbar-search { display:none; }
}
@media (max-width:760px) {
  .context-nav { margin:-4px 0 10px; overflow-x:auto; }
  .context-nav a,.context-back { flex:0 0 auto; }
  .page-jump-nav { top:0; margin-left:-14px; margin-right:-14px; padding-left:14px; padding-right:14px; }
  .quick-search-result {
    grid-template-columns:1fr auto;
    gap:6px 10px;
  }
  .search-result-type { grid-column:1; }
  .search-result-copy { grid-column:1; }
  .search-result-status { grid-column:2; grid-row:1/3; align-self:center; }
  .search-result-arrow { display:none; }
}


/* Register and dispatch workspaces */
.register-summary {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:12px;
  margin-bottom:16px;
}
.register-stat {
  width:100%;
  text-align:left;
  background:var(--panel);
  color:var(--text);
  border:1px solid var(--line);
  border-left:5px solid var(--brand2);
  border-radius:13px;
  padding:14px;
  box-shadow:0 3px 10px rgba(21,40,46,.035);
}
button.register-stat { cursor:pointer; }
.register-stat span,
.register-stat strong { display:block; }
.register-stat span {
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.register-stat strong { font-size:24px; margin-top:6px; }
.register-stat.good { border-left-color:var(--success); }
.register-stat.warning { border-left-color:var(--warning); }
.register-stat.danger { border-left-color:var(--danger); }
.filter-stat:hover { border-color:#aebfc4; }
.register-panel { margin-bottom:16px; }
.register-title { gap:14px; align-items:flex-end; }
.register-title h2 { margin-bottom:4px; }
.register-title span { color:var(--muted); font-size:12px; }
.register-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
}
.register-filter {
  width:min(260px,35vw);
  min-width:170px;
  margin:0;
  min-height:38px;
}
.register-table tbody tr,
.register-table tr[data-register-row],
.register-table tr[data-job-row] { transition:background .12s ease; }
.register-table tr[data-register-row]:hover,
.register-table tr[data-job-row]:hover { background:#f8fafb; }
.register-create {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:14px;
  overflow:hidden;
  margin-bottom:14px;
}
.register-create summary {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:15px 17px;
  list-style:none;
  cursor:pointer;
}
.register-create summary::-webkit-details-marker { display:none; }
.register-create summary strong { display:block; margin-top:3px; }
.register-create summary > span { color:var(--brand2); font-size:12px; font-weight:800; }
.register-create-form { padding:0 17px 17px; }
.operations-create-grid {
  display:grid;
  grid-template-columns:1.35fr .65fr;
  gap:14px;
  align-items:start;
}
.customer-register { margin-top:0; }

@media (max-width:1100px) {
  .register-summary { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .operations-create-grid { grid-template-columns:1fr; }
}
@media (max-width:760px) {
  .register-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .register-title { align-items:flex-start; flex-direction:column; }
  .register-actions { width:100%; justify-content:flex-start; }
  .register-filter { width:100%; min-width:0; }
  .register-create summary { padding:14px; }
  .register-create-form { padding:0 14px 14px; }
}
@media (max-width:420px) {
  .register-summary { grid-template-columns:1fr 1fr; gap:8px; }
  .register-stat { padding:11px; }
  .register-stat strong { font-size:21px; }
}
