:root {
  color-scheme: dark;
  --bg: #080b0f;
  --panel: #10161d;
  --panel-2: #141c25;
  --panel-3: #1a2430;
  --panel-4: #202c3a;
  --line: rgba(196, 214, 232, 0.12);
  --line-strong: rgba(196, 214, 232, 0.2);
  --text: #f6f9fc;
  --muted: #a8b4c2;
  --muted-2: #788696;
  --green: #35c76b;
  --green-2: #1f9b56;
  --blue: #4a8dff;
  --amber: #f3b33d;
  --red: #ef6b68;
  --red-panel: rgba(160, 58, 58, 0.3);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
  --radius: 9px;
  --border: var(--line-strong);
  --surface: var(--panel-2);
  --text-muted: var(--muted);
  --primary: var(--blue);
  --btn-radius: 9px;
  --btn-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --green-bright: #4ade80;
  --blue-bright: #60a5fa;
  --amber-bright: #fbbf24;
  --red-bright: #f87171;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 22rem),
    linear-gradient(135deg, #07090d 0%, #0b1117 52%, #080b0f 100%);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

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

button {
  border: 0;
}

a {
  color: inherit;
}

.app {
  min-height: 100vh;
}

/* ------------------------------------------------------------------ */
/*  LOGIN SCREEN                                                       */
/* ------------------------------------------------------------------ */
.login-screen {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
  min-height: 100vh;
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 42px;
  background:
    linear-gradient(rgba(8, 12, 16, 0.72), rgba(8, 12, 16, 0.86)),
    linear-gradient(135deg, rgba(53, 199, 107, 0.22), rgba(74, 141, 255, 0.08)),
    #0d141a;
  border-right: 1px solid var(--line);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid rgba(53, 199, 107, 0.4);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(53, 199, 107, 0.22), rgba(74, 141, 255, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  object-fit: contain;
  padding: 5px;
}

.brand-text strong {
  display: block;
  font-size: 1.02rem;
}

.brand-text span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.login-copy {
  max-width: 620px;
}

.eyebrow {
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.login-copy h1 {
  margin: 16px 0 14px;
  font-size: clamp(2.4rem, 5vw, 5.7rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.login-copy p {
  margin: 0;
  color: #cbd5df;
  font-size: 1rem;
  line-height: 1.7;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.metric-tile {
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.metric-tile strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1;
}

.metric-tile span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-panel {
  width: min(100%, 440px);
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(18, 24, 32, 0.94);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.35);
}

.login-panel h2,
.section-title h2,
.form-card h3,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.login-panel h2 {
  font-size: 1.55rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.login-panel .hint {
  margin: 8px 0 24px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field label,
.field-label {
  color: #d9e2ea;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.field input,
.field select,
.field textarea,
.table-control {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0c1219;
  color: var(--text);
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
}

.field textarea {
  min-height: 98px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.table-control:focus {
  border-color: rgba(53, 199, 107, 0.85);
  box-shadow: 0 0 0 3px rgba(53, 199, 107, 0.14);
  background: #0e141b;
}

.login-actions {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.demo-accounts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-login {
  min-height: 36px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all var(--btn-transition);
  color: var(--text);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
  position: relative;
  outline: none;
}

.quick-login:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.quick-login:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.quick-login[data-role="admin"] { color: #93c5fd; }
.quick-login[data-role="admin"]:hover { background: rgba(147, 197, 253, 0.1); border-color: rgba(147, 197, 253, 0.2); }
.quick-login[data-role="dispatcher"] { color: #86efac; }
.quick-login[data-role="dispatcher"]:hover { background: rgba(134, 239, 172, 0.1); border-color: rgba(134, 239, 172, 0.2); }
.quick-login[data-role="owner"] { color: #fcd34d; }
.quick-login[data-role="owner"]:hover { background: rgba(252, 211, 77, 0.1); border-color: rgba(252, 211, 77, 0.2); }

.login-note {
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 0.78rem;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ */
/*  PORTAL SHELL – SIDEBAR + MAIN                                     */
/* ------------------------------------------------------------------ */
.portal-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 12px;
  border-right: 1px solid var(--line);
  background: rgba(7, 11, 15, 0.96);
  backdrop-filter: blur(18px);
}

.sidebar-top {
  display: grid;
  gap: 14px;
}

.account-card {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  font-size: 0.82rem;
}

.account-card strong {
  display: block;
  font-size: 0.88rem;
}

.account-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: grid;
  gap: 6px;
  overflow: auto;
  padding-right: 4px;
}

.nav-btn {
  position: relative;
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.015);
  color: #d8e1ea;
  font-weight: 600;
  font-size: 0.89rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.055);
  color: #f0f5fa;
  transform: translateX(1px);
}

.nav-btn.active {
  background: rgba(53, 199, 107, 0.12);
  border-color: rgba(53, 199, 107, 0.18);
  color: #ffffff;
  font-weight: 700;
}

.nav-btn.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: var(--green);
}

.nav-btn.active .nav-ico {
  color: #ffffff;
  opacity: 1;
}

.nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #6ee69f;
  opacity: 0.95;
}
.nav-btn .nav-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--green), #7fb5ff);
  color: #05120b;
  font-weight: 900;
}

.user-chip strong,
.user-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 0.86rem;
}

.user-chip span {
  color: var(--muted);
  font-size: 0.76rem;
}

.main {
  min-width: 0;
}

.main--hos {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content--hos {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 10px 14px;
  gap: 8px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 18, 0.92);
  backdrop-filter: blur(16px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.topbar-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.78rem;
}

.topbar--compact {
  min-height: 50px;
  padding: 8px 14px;
}

.topbar--compact h1 {
  font-size: 1rem;
}

.topbar--compact .topbar-sub {
  font-size: 0.76rem;
}

.topbar--compact .search input {
  min-height: 34px;
  font-size: 0.82rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  position: relative;
  width: min(34vw, 360px);
}

.search input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  outline: 0;
}

.search::before {
  content: "⌘";
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: #dfe8ef;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all var(--btn-transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  transform: scale(1.04);
  box-shadow: var(--shadow-sm);
}

/* ------------------------------------------------------------------ */
/*  CONTENT & GENERAL LAYOUT                                           */
/* ------------------------------------------------------------------ */
.content {
  display: grid;
  gap: 18px;
  padding: 26px 28px;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-title h2 {
  font-size: 1.42rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-title p {
  max-width: 780px;
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-card,
.panel,
.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(19, 27, 36, 0.96), rgba(13, 19, 26, 0.96));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
}

.stat-card {
  position: relative;
  padding: 16px 18px;
  min-height: 112px;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  border-color: var(--line-strong);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2.5px;
  background: linear-gradient(90deg, var(--green), rgba(74, 141, 255, 0.65));
}

.stat-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: 2rem;
  line-height: 1;
  font-weight: 900;
}

.stat-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.panel,
.form-card {
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
}

.panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.panel-body {
  padding: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.52fr);
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stack {
  display: grid;
  gap: 14px;
}

.mini-list {
  display: grid;
  gap: 9px;
}

.mini-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  transition: background .1s;
}

.mini-item:hover {
  background: rgba(255, 255, 255, 0.055);
}

.mini-item strong,
.mini-item span {
  display: block;
}

.mini-item strong {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}

.mini-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.pill.green {
  border-color: rgba(53, 199, 107, 0.28);
  background: rgba(53, 199, 107, 0.18);
  color: #77efa4;
}

.pill.blue {
  border-color: rgba(74, 141, 255, 0.28);
  background: rgba(74, 141, 255, 0.18);
  color: #a8c8ff;
}

.pill.amber {
  border-color: rgba(243, 179, 61, 0.3);
  background: rgba(243, 179, 61, 0.16);
  color: #ffd88a;
}

.pill.red {
  border-color: rgba(239, 107, 104, 0.33);
  background: rgba(239, 107, 104, 0.16);
  color: #ffb3b0;
}

.pill.gray {
  color: #c2cad3;
}

/* ------------------------------------------------------------------ */
/*  TABLES                                                             */
/* ------------------------------------------------------------------ */
.table-wrap {
  width: 100%;
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(8, 12, 17, 0.72);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table {
  min-width: 1120px;
}

.recap-table {
  min-width: 2200px;
}

th,
td {
  border-bottom: 1px solid rgba(196, 214, 232, 0.09);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 11px;
  background: #0c131b;
  color: #a9b8c7;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

td {
  padding: 9px 11px;
  color: #e9f0f7;
  font-size: 0.83rem;
}

tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.012);
}

tbody tr:hover td {
  background: rgba(74, 141, 255, 0.07);
}

.row-number {
  width: 36px;
  color: var(--muted-2);
  text-align: right;
}

.driver-cell {
  min-width: 170px;
  font-weight: 850;
}

.muted {
  color: var(--muted);
}

.compact {
  font-size: 0.82rem;
  line-height: 1.45;
}

.vrids {
  min-width: 300px;
  max-width: 360px;
}

.vrid-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: flex-start;
}

.vrid-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(74, 141, 255, 0.24);
  border-radius: 5px;
  background: rgba(74, 141, 255, 0.1);
  color: #d5e5ff;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.76rem;
  line-height: 1;
  white-space: nowrap;
}

.vrid-chip.more {
  border-color: rgba(53, 199, 107, 0.24);
  background: rgba(53, 199, 107, 0.12);
  color: #b7f4cd;
}

.id-cell,
.id-cell .table-control {
  min-width: 145px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
}

.table-control {
  min-width: 94px;
  min-height: 34px;
  padding: 6px 8px;
  color: #f5f9fd;
  font-size: 0.82rem;
  background: rgba(5, 9, 13, 0.82);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  outline: 0;
}

select.table-control {
  padding-right: 24px;
}

textarea.table-control {
  width: 280px;
  min-height: 78px;
  resize: vertical;
}

.cell-required {
  background: var(--red-panel) !important;
}

.cell-required .table-control {
  border-color: rgba(255, 153, 150, 0.24);
  background: rgba(72, 24, 24, 0.5);
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #434a52;
  cursor: pointer;
  vertical-align: middle;
}

.toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cfd7df;
  transform: translateY(-50%);
  transition: left 0.15s ease, background 0.15s ease;
}

.toggle:checked {
  border-color: rgba(53, 199, 107, 0.4);
  background: rgba(53, 199, 107, 0.48);
}

.toggle:checked::after {
  left: 17px;
  background: #ffffff;
}

/* ------------------------------------------------------------------ */
/*  FORMS                                                              */
/* ------------------------------------------------------------------ */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.form-card {
  padding: 16px;
}

.form-card h3 {
  font-size: 1rem;
}

.form-card p {
  margin: 5px 0 15px;
  color: var(--muted);
  font-size: 0.83rem;
}

.inline-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 9, 13, 0.62);
}

.tab-btn {
  min-height: 32px;
  padding: 0 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--btn-transition);
}

.tab-btn.active {
  background: rgba(53, 199, 107, 0.16);
  color: #ffffff;
}

.recap-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 26, 35, 0.94), rgba(12, 18, 25, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.compact-field {
  min-width: 210px;
  margin: 0;
}

.date-select {
  min-width: 190px;
}

.day-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 42px;
  color: var(--muted);
  font-size: 0.84rem;
  padding: 0 2px;
}

.file-import {
  position: relative;
  min-height: 42px;
  overflow: hidden;
  background: linear-gradient(145deg, #2ecc71, #1a9c54);
  border-radius: var(--btn-radius);
  color: #ffffff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
  transition: all var(--btn-transition);
}

.file-import input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-import:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
  background: linear-gradient(145deg, #3ddc84, #1fb05e);
}

/* ------------------------------------------------------------------ */
/*  SHIFT CARDS & TIMELINE                                             */
/* ------------------------------------------------------------------ */
.shift-card {
  display: grid;
  gap: 14px;
  padding: 17px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(53, 199, 107, 0.1), rgba(74, 141, 255, 0.05)), rgba(255, 255, 255, 0.035);
  transition: border-color .15s, box-shadow .15s;
}

.shift-card:hover {
  border-color: rgba(53, 199, 107, 0.22);
}

.shift-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.shift-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.shift-meta div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.18);
}

.shift-meta span,
.shift-meta strong {
  display: block;
}

.shift-meta span {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.shift-meta strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(53, 199, 107, 0.12);
}

.timeline-item strong {
  display: block;
  font-size: 0.88rem;
}

.timeline-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 40px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #111922;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green);
}

.status-dot.idle {
  background: var(--amber);
}

.status-dot.offline {
  background: var(--muted-2);
}

/* ------------------------------------------------------------------ */
/*  BUTTONS (PRIMARY, SECONDARY, DANGER, SMALL)                        */
/* ------------------------------------------------------------------ */
.btn,
.quick-login,
.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--btn-radius);
  font-weight: 600;
  font-size: 0.865rem;
  line-height: 1;
  cursor: pointer;
  transition: all var(--btn-transition);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
  position: relative;
  outline: none;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-btn:focus-visible,
.quick-login:focus-visible,
.tab-btn:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(145deg, #2ecc71, #1a9c54);
  color: #ffffff;
  border: none;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 22px rgba(46, 204, 113, 0.45);
  background: linear-gradient(145deg, #3ddc84, #1fb05e);
}

.btn-primary:active {
  transform: translateY(0px);
  box-shadow: 0 1px 4px rgba(46, 204, 113, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.13);
  color: #e2e8f0;
  backdrop-filter: blur(4px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: #f4f8fc;
}

.btn-secondary:active {
  transform: translateY(0px);
  background: rgba(255, 255, 255, 0.07);
}

.btn-danger {
  background: rgba(239, 107, 104, 0.15);
  border: 1px solid rgba(239, 107, 104, 0.25);
  color: #fca5a5;
}

.btn-danger:hover {
  background: rgba(239, 107, 104, 0.25);
  border-color: rgba(239, 107, 104, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(239, 107, 104, 0.25);
}

.btn-small {
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
}

/* ------------------------------------------------------------------ */
/*  OWNER HOME / MOBILE APP – FRESH REDESIGN (clean, modern, mobile-first) */
/* ------------------------------------------------------------------ */
.owner-mobile-app {
  display: grid;
  gap: 16px;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 20px;
}

/* ---------- HERO / SAFETY STATUS (cleaner, less glow, more scannable) ---------- */
.mobile-hero {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0f161f;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: stretch;
  min-height: 168px;
  padding: 18px 18px 16px;
}

.mobile-hero--warning {
  border-color: rgba(243, 179, 61, 0.35);
  background: #16130a;
}

.mobile-hero--critical {
  border-color: rgba(239, 107, 104, 0.4);
  background: #1a0f0f;
}

.mobile-hero-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-hero-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  width: fit-content;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.mobile-hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 4px var(--green);
  flex-shrink: 0;
}
.mobile-hero-badge-dot.warning { background: var(--amber); box-shadow: 0 0 4px var(--amber); }
.mobile-hero-badge-dot.critical { background: var(--red); box-shadow: 0 0 4px var(--red); }

.mobile-hero-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.mobile-hero-sub {
  margin: 0;
  font-size: 0.85rem;
  color: #a8b9cc;
  line-height: 1.4;
  max-width: 420px;
}

.hero-alert-name {
  color: var(--amber);
  font-weight: 700;
}

.mobile-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.mhero-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.mhero-btn--primary {
  background: var(--green);
  color: #01150b;
  border-color: var(--green);
}

.mhero-btn--primary:hover {
  filter: brightness(1.08);
}

.mhero-btn--ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: rgba(255,255,255,0.1);
}

.mhero-btn--ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

/* ---------- KPI STRIP (now buttons, great on mobile) ---------- */
.mobile-kpi-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (min-width: 520px) {
  .mobile-kpi-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.kpi-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 13px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.035);
  color: inherit;
  text-align: left;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  min-height: 72px;
  cursor: pointer;
}

.kpi-card:hover, .kpi-card:focus-visible {
  background: rgba(255,255,255,0.065);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.kpi-card:active {
  transform: scale(0.985);
}

.kpi-card--risk  { border-color: rgba(239,107,104,0.2); }
.kpi-card--trips { border-color: rgba(74,141,255,0.2);  }
.kpi-card--issues { border-color: rgba(243,179,61,0.22); }
.kpi-card--netradyne { border-color: rgba(74, 141, 255, 0.22); }

.kpi-icon {
  font-size: 1.15rem;
  line-height: 1;
  margin-bottom: 1px;
}

.kpi-value {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
  margin-top: 1px;
}

.kpi-value.kpi-red   { color: var(--red); }
.kpi-value.kpi-amber { color: var(--amber); }
.kpi-value.kpi-green { color: var(--green); }

.kpi-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 1px;
}

/* ---------- MOBILE SECTIONS (consistent, clean cards) ---------- */
.mobile-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(13, 18, 25, 0.95);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.mobile-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.section-head-text {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.section-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 1.05rem;
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}

.hos-icon, .late-icon, .recap-icon, .followup-icon, .dispatch-icon {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}

.mobile-section-head h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text);
}

.mobile-section-head p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.status-pill-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}

.status-pill-badge.badge-red   { background: rgba(239,107,104,0.14); color: var(--red); }
.status-pill-badge.badge-amber { background: rgba(243,179,61,0.14); color: var(--amber); }
.status-pill-badge.badge-green { background: rgba(53,199,107,0.13); color: var(--green); }

.mobile-section-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}

.mobile-section-btn:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
}

/* Card list used by netradyne etc */
.mobile-card-list {
  display: grid;
  gap: 8px;
}

/* ---------- HOS RISK CARD V2 ---------- */
.hos-risk-card-v2 {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 14px;
  transition: transform 0.15s ease;
}

.hos-risk-card-v2:hover { transform: translateY(-1px); }

.hos-risk-card-v2.critical {
  border-color: rgba(239,107,104,0.38);
  background: linear-gradient(160deg, rgba(95,20,22,0.4) 0%, rgba(14,20,28,0.95) 100%);
  box-shadow: 0 4px 20px rgba(239,107,104,0.12);
}

.hos-risk-card-v2.warning {
  border-color: rgba(243,179,61,0.32);
  background: linear-gradient(160deg, rgba(80,54,10,0.38) 0%, rgba(14,20,28,0.95) 100%);
  box-shadow: 0 4px 20px rgba(243,179,61,0.1);
}

.hrc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.hrc-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hrc-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-size: 1.15rem;
  font-weight: 900;
  background: rgba(74,141,255,0.18);
  color: var(--blue);
  border: 1px solid rgba(74,141,255,0.25);
  flex-shrink: 0;
}

.hrc-avatar.critical {
  background: rgba(239,107,104,0.2);
  color: var(--red);
  border-color: rgba(239,107,104,0.3);
}

.hrc-avatar.warning {
  background: rgba(243,179,61,0.2);
  color: var(--amber);
  border-color: rgba(243,179,61,0.3);
}

.hrc-name-block { min-width: 0; }

.hrc-name {
  display: block;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}

.hrc-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.hrc-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.hrc-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.hrc-badge--critical { background: rgba(239,107,104,0.2); color: var(--red);   border: 1px solid rgba(239,107,104,0.35); }
.hrc-badge--warning  { background: rgba(243,179,61,0.2);  color: var(--amber); border: 1px solid rgba(243,179,61,0.35);  }
.hrc-badge--safe     { background: rgba(53,199,107,0.15); color: var(--green); border: 1px solid rgba(53,199,107,0.3);   }

.hrc-status-pill {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.1);
}

.hrc-metrics {
  display: grid;
  gap: 8px;
}

.hrc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.hrc-footer-item {
  font-size: 0.78rem;
  color: var(--muted);
}

.hrc-footer-item strong { color: var(--text); font-weight: 700; }
.hrc-footer-time { font-style: italic; }

.hos-risk-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .hos-risk-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

.hos-metric-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.hos-metric-row .hos-metric-label {
  grid-column: 1;
  grid-row: 1 / 3;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hos-metric-row .hos-metric-bar-wrap {
  grid-column: 2;
  grid-row: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.hos-metric-row .hos-metric-bar {
  height: 100%;
  border-radius: inherit;
  transition: width 0.3s ease;
}

.hos-metric-row .hos-metric-value {
  grid-column: 3;
  grid-row: 1;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
  min-width: 48px;
}

.hos-metric-row .hos-metric-status {
  grid-column: 2 / 4;
  grid-row: 2;
  font-size: 0.68rem;
  font-weight: 600;
}

.hos-metric-row.critical {
  background: rgba(239, 107, 104, 0.08);
  border: 1px solid rgba(239, 107, 104, 0.15);
}

.hos-metric-row.warning {
  background: rgba(243, 179, 61, 0.06);
  border: 1px solid rgba(243, 179, 61, 0.12);
}

.hos-metric-row.caution {
  background: rgba(74, 141, 255, 0.05);
}

.hos-metric-row.no-data {
  opacity: 0.65;
}

/* ---------- LATE / NETRADYNE ALERT CARD (modern mobile friendly) ---------- */
.late-item-card {
  padding: 13px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 10px;
  transition: transform 0.12s ease;
}

.late-item-card:hover { transform: translateY(-1px); }

.late-item-card.severe-alert {
  border-color: rgba(239, 107, 104, 0.35);
  background: rgba(30, 15, 16, 0.6);
}

.lic-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lic-info { min-width: 0; }

.lic-driver {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.lic-vrid {
  display: block;
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 1px;
}

.lic-late-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 7px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  white-space: nowrap;
  align-self: flex-start;
}

.lic-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.lic-detail-item {
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.04);
  font-size: 0.78rem;
}

.lic-detail-label {
  display: block;
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted-2);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 3px;
}

.lic-detail-item strong { font-size: 0.86rem; }

.lic-yes { color: var(--green); }
.lic-no  { color: var(--red);   }

/* ---------- RECAP CARD V2 ---------- */
.recap-card-v2 {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  display: grid;
  gap: 12px;
  transition: transform 0.15s;
}

.recap-card-v2:hover { transform: translateY(-1px); }

.recap-card-v2.has-issue {
  border-color: rgba(243,179,61,0.22);
  background: rgba(243,179,61,0.04);
}

.rcv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.rcv-driver {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rcv-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(74,141,255,0.16);
  color: var(--blue);
  font-weight: 900;
  font-size: 1rem;
  border: 1px solid rgba(74,141,255,0.22);
  flex-shrink: 0;
}

.rcv-name {
  display: block;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}

.rcv-sub {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.rcv-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.rcv-issue-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 800;
}

.rcv-issue-badge.issue { background: rgba(243,179,61,0.18); color: var(--amber); border: 1px solid rgba(243,179,61,0.3); }
.rcv-issue-badge.clean { background: rgba(53,199,107,0.14); color: var(--green); border: 1px solid rgba(53,199,107,0.28); }

.rcv-times {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}

.rcv-time-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
}

.rcv-time-item span {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}

.rcv-time-item strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text);
}

.rcv-issue-text {
  font-size: 0.8rem;
  color: var(--amber);
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(243,179,61,0.08);
  border: 1px solid rgba(243,179,61,0.18);
  line-height: 1.4;
}

/* ---------- PRIORITY CARD V2 ---------- */
.priority-card-v2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(243,179,61,0.2);
  background: rgba(243,179,61,0.04);
  transition: transform 0.15s;
}

.priority-card-v2:hover { transform: translateY(-1px); }

.pcv-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.pcv-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(243,179,61,0.18);
  color: var(--amber);
  font-size: 1rem;
  font-weight: 900;
  border: 1px solid rgba(243,179,61,0.28);
  flex-shrink: 0;
}

.pcv-body { min-width: 0; }

.pcv-name {
  display: block;
  font-size: 0.94rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.pcv-trip {
  display: block;
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 2px;
}

.pcv-issue {
  display: block;
  font-size: 0.78rem;
  color: var(--amber);
  margin-top: 4px;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.pcv-right { flex-shrink: 0; }

.pcv-bol {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
}

.pcv-bol.bol-ok      { background: rgba(53,199,107,0.15); color: var(--green); border: 1px solid rgba(53,199,107,0.28); }
.pcv-bol.bol-pending { background: rgba(243,179,61,0.15); color: var(--amber); border: 1px solid rgba(243,179,61,0.28); }

/* ---------- SHIFT CARD V2 ---------- */
.shift-card-v2 {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
  transition: transform 0.15s;
}

.shift-card-v2:hover { transform: translateY(-1px); }

.shift-card-v2.shift-active {
  border-color: rgba(53,199,107,0.28);
  background: rgba(53,199,107,0.05);
  box-shadow: 0 0 0 1px rgba(53,199,107,0.1);
}

.scv-time-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 120px;
}

.scv-time {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
}

.scv-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.scv-dispatcher {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.scv-handoff {
  font-size: 0.78rem;
  color: var(--muted);
  overflow-wrap: anywhere;
  line-height: 1.4;
}

/* ---------- EMPTY STATES ---------- */
.mobile-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.12);
  text-align: center;
}

.mobile-empty-state .empty-icon {
  font-size: 1.8rem;
}

.mobile-empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* ===================================================================== */
/* ===================================================================== */
/*  HOS PAGE                                                             */
/* ===================================================================== */

.hos-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 8px;
  width: 100%;
  max-width: none;
}

/* ----- Status banner ----- */
.hos-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(13, 18, 25, 0.96);
}

.hos-status-banner--warning {
  border-color: rgba(243, 179, 61, 0.32);
}

.hos-status-banner--critical {
  border-color: rgba(239, 107, 104, 0.38);
}

.hos-status-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hos-status-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.1rem;
  background: rgba(53, 199, 107, 0.15);
  border: 1px solid rgba(53, 199, 107, 0.25);
  flex-shrink: 0;
}

.hos-status-banner--warning .hos-status-banner-icon {
  background: rgba(243, 179, 61, 0.15);
  border-color: rgba(243, 179, 61, 0.3);
}

.hos-status-banner--critical .hos-status-banner-icon {
  background: rgba(239, 107, 104, 0.18);
  border-color: rgba(239, 107, 104, 0.35);
}

.hos-status-banner-content strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.hos-status-banner-content span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

.hos-status-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.hos-page-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hos-page-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ----- Summary stat cards ----- */
.hos-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  flex-shrink: 0;
}

.hos-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  font: inherit;
  color: inherit;
}

.hos-stat-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
}

.hos-stat-card.active {
  border-color: var(--green);
  background: rgba(53, 199, 107, 0.1);
  box-shadow: 0 0 0 1px rgba(53, 199, 107, 0.15);
}

.hos-stat-card--green.active { border-color: var(--green); background: rgba(53, 199, 107, 0.1); }
.hos-stat-card--amber.active { border-color: var(--amber); background: rgba(243, 179, 61, 0.1); }
.hos-stat-card--red.active { border-color: var(--red); background: rgba(239, 107, 104, 0.1); }

.hos-stat-card.has-alert {
  animation: hosPulse 2.5s ease-in-out infinite;
}

@keyframes hosPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 107, 104, 0); }
  50% { box-shadow: 0 0 0 3px rgba(239, 107, 104, 0.15); }
}

.hos-stat-icon {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.85;
}

.hos-stat-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.hos-stat-value {
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
  color: var(--text);
}

/* ----- Filters drawer ----- */
.hos-filters-drawer {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 21, 30, 0.6);
  overflow: hidden;
}

.hos-filters-toggle {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  list-style: none;
  user-select: none;
}

.hos-filters-toggle::-webkit-details-marker { display: none; }

.hos-filters-hint {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.hos-filters-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

@media (min-width: 769px) {
  .hos-filters-drawer {
    border: none;
    background: transparent;
    overflow: visible;
  }

  .hos-filters-toggle {
    display: none;
  }

  .hos-filters-body {
    padding: 0;
  }
}

.hos-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 26, 35, 0.94), rgba(12, 18, 25, 0.94));
}

.toolbar-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 140px;
  flex: 1 1 auto;
}

.toolbar-group--search {
  flex: 2 1 200px;
}

.toolbar-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.toolbar-input {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(5, 9, 13, 0.82);
  color: var(--text);
  font-size: 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.recap-details {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

.recap-card-v2.expanded .recap-details {
  display: grid;
}

.rcv-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 6px 0;
}

.rcv-detail-row span {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.68rem;
}

.rcv-detail-row strong {
  color: var(--text);
  font-weight: 700;
  text-align: right;
  max-width: 60%;
  overflow-wrap: anywhere;
}

.rcv-expand-icon {
  font-size: 0.7rem;
  margin-left: 6px;
  transition: transform 0.2s;
  display: inline-block;
}
.toolbar-input:focus {
  outline: none;
  border-color: rgba(74, 141, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(74, 141, 255, 0.12);
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  font-family: inherit;
}

.quick-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.quick-chip.active {
  border-color: var(--green);
  background: rgba(53, 199, 107, 0.15);
  color: var(--green);
}

.hos-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.hos-meta-count {
  font-weight: 700;
  color: var(--text);
}

.hos-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18, 26, 35, 0.96), rgba(12, 18, 25, 0.96));
}

.hos-filters-toggle {
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.hos-controls-body {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(280px, 1fr) auto;
  gap: 10px;
  align-items: end;
}
@media (max-width: 768px) {
.hos-controls-body:not(.is-visible) {
  display: none;
}
}
.hos-controls-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 5px;
}

.hos-controls-search {
  min-width: 0;
}

.hos-search-input {
  min-height: 40px;
}

.hos-controls-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.hos-controls-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  min-width: 120px;
}

.hos-controls-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

.btn-compact {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.hos-quick-filters--mobile {
  display: none;
}

.hos-quick-filters--desktop {
  display: flex;
}

.hos-th-sortable {
  padding: 0;
  white-space: nowrap;
}

.hos-th-sort-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: left;
}

.hos-th-sort-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.hos-th-sortable.is-sorted .hos-th-sort-btn {
  color: var(--green);
}

.hos-sort-indicator {
  font-size: 0.62rem;
  opacity: 0.7;
}

.hos-th-sortable.is-sorted .hos-sort-indicator {
  opacity: 1;
  color: var(--green);
}

/* ----- Desktop table ----- */
.hos-table-wrapper {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 12, 17, 0.72);
  overflow: hidden;
  position: relative;
  flex: 1;
  min-height: auto;
  max-height: calc(100vh - 400px);
  display: flex;
  flex-direction: column;
}

.hos-table-wrapper.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 17, 0.45);
  pointer-events: none;
  z-index: 2;
}

.hos-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.hos-table-desktop {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  display: none;
}

.hos-table-desktop th,
.hos-table-desktop td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
}

.hos-table-desktop thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.hos-table-desktop th {
  background: #0e151d;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
  white-space: nowrap;
}

.hos-th-driver {
  min-width: 240px;
}

.hos-table-desktop tbody tr {
  transition: background 0.12s ease;
}

.hos-table-desktop tbody tr:hover td {
  background: rgba(74, 141, 255, 0.05);
}

.hos-row--critical td:first-child {
  box-shadow: inset 3px 0 0 var(--red);
}

.hos-row--warning td:first-child {
  box-shadow: inset 3px 0 0 var(--amber);
}

.hos-driver-cell {
  min-width: 220px;
}

.hos-driver-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hos-driver-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 900;
  background: rgba(74, 141, 255, 0.15);
  color: var(--blue);
  border: 1px solid rgba(74, 141, 255, 0.22);
  flex-shrink: 0;
}

.hos-driver-avatar.critical {
  background: rgba(239, 107, 104, 0.18);
  color: var(--red);
  border-color: rgba(239, 107, 104, 0.3);
}

.hos-driver-avatar.warning {
  background: rgba(243, 179, 61, 0.18);
  color: var(--amber);
  border-color: rgba(243, 179, 61, 0.3);
}

.hos-driver-meta {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.hos-driver-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hos-driver-name-row .driver-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.driver-subline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-since {
  font-size: 0.72rem;
  color: var(--muted-2);
}

.hos-risk-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
}

.hos-risk-badge.critical {
  background: rgba(239, 107, 104, 0.18);
  color: var(--red);
  border: 1px solid rgba(239, 107, 104, 0.3);
}

.hos-risk-badge.warning {
  background: rgba(243, 179, 61, 0.18);
  color: var(--amber);
  border: 1px solid rgba(243, 179, 61, 0.3);
}

/* ----- Mobile HOS cards (redesigned for clarity + premium feel on phones) ----- */
.hos-mobile-cards {
  display: none;
  padding: 4px 0;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hos-mobile-card {
  background: rgba(16, 22, 30, 0.98);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 13px 11px;
  display: grid;
  gap: 8px;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.hos-mobile-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.12);
}

.hos-mobile-card--critical {
  border-color: rgba(239, 107, 104, 0.45);
  background: rgba(22, 14, 15, 0.98);
}

.hos-mobile-card--warning {
  border-color: rgba(243, 179, 61, 0.38);
  background: rgba(20, 17, 12, 0.98);
}

.hos-mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.hos-mobile-card-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.hos-driver-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.hos-mobile-card--critical .hos-driver-avatar { background: rgba(239,107,104,0.25); }
.hos-mobile-card--warning .hos-driver-avatar { background: rgba(243,179,61,0.25); }

.hos-mobile-card-identity .driver-name {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hos-mobile-risk-alert {
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hos-mobile-risk-alert.critical {
  background: rgba(239, 107, 104, 0.18);
  color: var(--red);
  border: 1px solid rgba(239, 107, 104, 0.3);
}

.hos-mobile-risk-alert.warning {
  background: rgba(243, 179, 61, 0.16);
  color: var(--amber);
  border: 1px solid rgba(243, 179, 61, 0.28);
}

.hos-mobile-reset-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--muted);
}

.last-reset-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  font-size: 0.62rem;
}

.readiness-pill {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.readiness-READY { background: rgba(53, 199, 107, 0.15); color: var(--green); }
.readiness-NOT-READY { background: rgba(243, 179, 61, 0.15); color: var(--amber); }
.readiness-NO-LOGS { background: rgba(239, 107, 104, 0.15); color: var(--red); }

.hos-mobile-status-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hos-mobile-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 520px) and (max-width: 1023px) {
  .hos-mobile-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .hos-table-desktop { display: table; }
  .hos-mobile-cards { display: none; }

  .hos-table-scroll {
    min-height: calc(100vh - 210px);
  }

  .hos-metric {
    min-width: 88px;
  }

  .hos-metric .bar-track {
    height: 8px;
    margin-bottom: 2px;
  }

  .hos-metric-value {
    font-size: 1rem;
  }

  .hos-metric-label {
    font-size: 0.68rem;
  }

  .hos-driver-name-row .driver-name {
    font-size: 1rem;
  }

  .hos-driver-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
  }

  .hos-th-sort-btn {
    min-height: 44px;
    font-size: 0.72rem;
  }
}

@media (max-width: 1023px) {
  .hos-table-desktop { display: none; }
  .hos-mobile-cards {
    display: grid;
    flex: 1;
    min-height: auto;
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    align-content: start;
    grid-template-columns: 1fr;
  }
}

/* ----- Metric cells ----- */
.hos-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 72px;
}

.hos-metric .bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.hos-metric .bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.3s ease;
}

.bar-green { background: var(--green); }
.bar-orange { background: var(--amber); }
.bar-red { background: var(--red); }

.hos-metric.warning .hos-metric-value { color: var(--amber); }
.hos-metric.violation .hos-metric-value { color: var(--red); }
.hos-metric.warning .bar-track { box-shadow: 0 0 0 1px rgba(243, 179, 61, 0.2); }
.hos-metric.violation .bar-track { box-shadow: 0 0 0 1px rgba(239, 107, 104, 0.25); }

.hos-metric-value {
  font-weight: 800;
  font-size: 0.88rem;
  line-height: 1.2;
}

.hos-metric-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-weight: 700;
}

.hos-mobile-metrics .hos-metric {
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Status pills */
.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-active { background: rgba(53, 199, 107, 0.15); color: var(--green); }
.status-off { background: rgba(255, 255, 255, 0.08); color: var(--muted); }
.status-sb { background: rgba(74, 141, 255, 0.15); color: var(--blue); }
.status-error { background: rgba(239, 107, 104, 0.15); color: var(--red); }
.status-nologs { background: rgba(243, 179, 61, 0.15); color: var(--amber); }

.row-READY td { background: rgba(53, 199, 107, 0.04); }
.row-NOTREADY td { background: rgba(243, 179, 61, 0.04); }
.row-NOLOGS td { background: rgba(239, 107, 104, 0.04); }

.hos-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
}

.hos-empty-icon {
  font-size: 2rem;
  opacity: 0.6;
}

.hos-empty-state strong {
  color: var(--text);
  font-size: 1rem;
}

.hos-empty-state p {
  margin: 0;
  font-size: 0.88rem;
}
@media (min-width: 1024px) {
  .hos-table-wrapper {
    max-height: none;        /* let flex handle the height */
  }
}

/* Auto-refresh toggle */
.btn-secondary[data-action="owner-hos-toggle-auto-refresh"] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
}

.btn-secondary[data-action="owner-hos-toggle-auto-refresh"]:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}

.btn-secondary[data-action="owner-hos-toggle-auto-refresh"].auto-on {
  background: rgba(53, 199, 107, 0.15);
  border-color: rgba(53, 199, 107, 0.35);
  color: #77efa4;
}

.btn-primary.is-loading {
  opacity: 0.7;
  cursor: wait;
}
.hamburger-btn {
  display: none;            /* hidden on desktop */
}

.last-reset-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: var(--muted);
}

.last-reset-line span {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.64rem;
  color: var(--muted-2);
}
.hamburger-btn {
  display: none;
}
/* Hamburger button */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 20;
}
/* Ensure overlay and close button are always available */
.sidebar-overlay {
  display: none;
}



.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.topbar-brand {
  display: none; /* hidden on desktop, shown on mobile */
  align-items: center;
  gap: 10px;
}

.topbar-brand .brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.topbar-brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.topbar-brand .brand-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.topbar-brand .brand-company {
  font-size: 11px;
  color: var(--muted, #64748b);
}

.hamburger-btn {
  display: none; /* hidden on desktop */
}
.hos-filters-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(7, 11, 15, 0.97);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 24px;
  overflow-y: auto;
}

.hos-filters-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hos-filters-overlay-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.hos-filters-overlay-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.hos-filters-overlay-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Hide desktop controls on mobile (already hidden by JS) */
.hos-controls-bar--desktop {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(18, 26, 35, 0.96), rgba(12, 18, 25, 0.96));
}

.hos-controls-bar--mobile {
  display: flex;
  justify-content: center;
  padding: 8px;
}

.hos-filters-toggle {
  width: 100%;
  justify-content: center;
  gap: 8px;
}
.last-reset-line time,
.hos-mobile-reset-row .last-reset {
  font-weight: 600;
  color: #d4dde8;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
}

/* -/* ===================================================================
   MOBILE OVERRIDES (max‑width: 1120px)
   =================================================================== */
/* ===================================================================
   MOBILE (max-width: 1120px) — consolidated, single source of truth
   =================================================================== */
/* ===================================================================
   MOBILE (max-width: 1120px) — consolidated, single source of truth
   =================================================================== */
/* ============================================
   MOBILE LAYOUT (<=1120px)
   ============================================ */
/* ====== TOPBAR BRAND ====== */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 18, 0.9);
  backdrop-filter: blur(16px);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-brand .brand-text strong {
  font-size: 0.95rem;
  display: block;
}

.topbar-brand .brand-text span {
  font-size: 0.75rem;
  color: var(--muted);
}

.topbar-title h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.topbar-title .topbar-sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ====== HAMBURGER BUTTON (hidden on desktop) ====== */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 20;
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ====== SIDEBAR (desktop: always visible, sticky) ====== */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 12px;
  border-right: 1px solid var(--line);
  background: rgba(7, 11, 15, 0.96);
  backdrop-filter: blur(18px);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 10px;
}
.hos-stat-card {
  padding: 12px 14px;       /* was 8px 10px */
  gap: 6px;
  border-radius: 12px;
}

.hos-stat-label {
  font-size: 0.72rem;       /* slightly larger */
}

.hos-stat-value {
  font-size: 1.35rem;
}
/* Severe Netradyne alert */
.late-item-card.severe-alert {
  border-color: rgba(239, 107, 104, 0.4);
  background: linear-gradient(160deg, rgba(95, 20, 22, 0.35) 0%, rgba(14, 20, 28, 0.95) 100%);
  box-shadow: 0 4px 20px rgba(239, 107, 104, 0.15);
}

/* Severity pill – reuse existing .status-pill-badge if you want, or define new */
.status-pill-badge.badge-red {
  background: rgba(239, 107, 104, 0.2);
  color: var(--red);
  border: 1px solid rgba(239, 107, 104, 0.35);
}
.status-pill-badge.badge-amber {
  background: rgba(243, 179, 61, 0.2);
  color: var(--amber);
  border: 1px solid rgba(243, 179, 61, 0.35);
}
.status-pill-badge.badge-green {
  background: rgba(53, 199, 107, 0.15);
  color: var(--green);
  border: 1px solid rgba(53, 199, 107, 0.3);
}
.sidebar-close-btn,
.sidebar-overlay {
  display: none;
}
/* Hide topbar brand on desktop – brand is now in the sidebar */
@media (min-width: 1121px) {
  .topbar-brand {
    display: none;
  }
}
@media (max-width: 1120px) {
  .sidebar .sidebar-top,
  .sidebar .account-card {
    display: none;
  }
}
/* ====== MOBILE LAYOUT (≤ 1120px) ====== */
@media (max-width: 1120px) {
  /* Full-width single column */
  .portal-shell {
    grid-template-columns: 1fr;
  }
  .topbar-actions {
    margin-left: auto;       /* pushes the hamburger + settings to the right */
  }
  /* Hide desktop sidebar entirely */
  .sidebar {
    display: none;
  }

  /* Sidebar becomes fixed overlay when opened */
  .sidebar.sidebar--open {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 268px;
    z-index: 30;
    flex-direction: column;
    gap: 18px;
    padding: 22px 14px;
    background: rgba(7, 11, 15, 0.98);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--line);
    overflow-y: auto;
  }

  /* Overlay behind sidebar */
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 25;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  /* Close button inside open sidebar */
  .sidebar-close-btn {
    display: none;
  }

  .sidebar.sidebar--open .sidebar-close-btn {
    display: flex;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  /* Show hamburger button */
  .hamburger-btn {
    display: flex;
  }

  /* Hide page title on mobile (already in brand) */
  .topbar-title {
    display: none;
  }

  /* Hide search bar on mobile */
  .topbar .search {
    display: none;
  }

  /* Sidebar footer (logout) */
  .sidebar-footer {
    margin-top: auto;
  }

  /* Make nav buttons full width with text */
  .nav-btn {
    justify-content: flex-start;
    padding: 0 12px 0 10px;
  }
}

/* ====== TABLET / SMALL DESKTOP FINE-TUNING ====== */
@media (max-width: 820px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
    padding: 28px;
    gap: 42px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-metrics {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 14px;
  }

  .stats-grid,
  .grid-3,
  .form-grid,
  .shift-meta {
    grid-template-columns: 1fr;
  }

  .section-title {
    display: grid;
    align-items: start;
  }

  .owner-mobile-app {
    max-width: none;
  }

  .mobile-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .mobile-hero-content {
    grid-template-columns: 1fr auto;
    padding: 22px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .mobile-hero-title {
    font-size: 1.72rem;
  }

  .mobile-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-section-head {
    align-items: flex-start;
  }

  .shift-card-v2 {
    grid-template-columns: 1fr;
  }

  .scv-time-block {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .hos-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .hos-table-wrapper {
    max-height: none !important;   /* remove fixed height */
    flex: 1 1 auto;                /* let it grow naturally */
    display: flex;
    flex-direction: column;
  }

  .hos-mobile-cards {
    flex: 1 1 auto;
    overflow-y: visible;          /* no internal scroll, page scrolls instead */
    max-height: none;
  }
  .hos-summary-grid--desktop {
    display: none;
  }
}
/* ====== PHONE (≤ 768px) ====== */
@media (max-width: 768px) {
  .hos-page {
    padding: 8px;
    gap: 8px;
  }

  .hos-status-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .hos-status-banner-actions {
    justify-content: stretch;
  }

  .hos-status-banner-actions .btn {
    flex: 1 1 auto;
  }

  .hos-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hos-controls-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 8px;
    gap: 8px;
  }

  .hos-controls-filters {
    grid-template-columns: 1fr;
  }

  .hos-controls-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .hos-filters-toggle {
    display: flex;
  }

  /* Keep filter body hidden on mobile until toggled */
  .hos-controls-body:not(.is-visible) {
    display: none;
  }

  .hos-toolbar {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .toolbar-group {
    min-width: 100%;
  }

  .quick-filters {
    justify-content: flex-start;
  }

  .quick-chip {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .hos-th-sortable {
    display: none;
  }

  .hos-table-wrapper {
    max-height: calc(100vh - 280px);
  }

  .hos-mobile-cards {
    padding: 8px;
    gap: 8px;
  }

  .hos-mobile-card {
    padding: 12px;
  }

  .hos-metric-value {
    font-size: 0.82rem;
  }

  .hos-metric-label {
    font-size: 0.62rem;
  }
}

/* ====== SMALL PHONE (≤ 520px) ====== */
@media (max-width: 520px) {
  .login-panel-wrap {
    padding: 18px;
  }

  .login-panel {
    padding: 20px;
  }

  .demo-accounts {
    grid-template-columns: 1fr;
  }

  .actions-row,
  .topbar-actions {
    justify-content: stretch;
  }

  .actions-row .btn,
  .topbar-actions .btn {
    flex: 1 1 auto;
  }

  .mobile-hero {
    padding: 16px;
    min-height: 152px;
  }

  .mobile-hero-content {
    padding: 0;
  }

  .mobile-hero-title {
    font-size: 1.52rem;
  }

  .mobile-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-value { font-size: 1.7rem; }

  .mobile-section {
    padding: 14px;
  }

  .rcv-times {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lic-details {
    grid-template-columns: 1fr;
  }

  .mobile-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hos-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table,
  .recap-table {
    min-width: 100%;
  }

  th, td {
    min-width: 80px;
    white-space: nowrap;
  }

  .driver-cell,
  .vrids {
    min-width: 120px;
    white-space: normal;
  }

  .compact {
    white-space: normal;
  }

  .hos-stat-value {
    font-size: 1.3rem;
  }

  .hos-mobile-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

/* ====== DESKTOP TABLE RESTORE (≥ 1024px) ====== */
@media (min-width: 1024px) {
  .hos-table-desktop { display: table; }
  .hos-mobile-cards { display: none; }

  .hos-table-scroll {
    min-height: calc(100vh - 210px);
  }

  .hos-table-wrapper {
    max-height: none;
  }

  .hos-metric {
    min-width: 88px;
  }

  .hos-metric .bar-track {
    height: 8px;
  }

  .hos-metric-value {
    font-size: 1rem;
  }

  .hos-metric-label {
    font-size: 0.68rem;
  }

  .hos-driver-name-row .driver-name {
    font-size: 1rem;
  }

  .hos-driver-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
  }

  .hos-th-sort-btn {
    min-height: 44px;
    font-size: 0.72rem;
  }
}
@media (max-width: 768px) {
  .hos-page {
    padding-top: 0;
  }
  .hos-status-banner {
    margin-bottom: 0;
  }
}
/* Desktop only: show table, hide mobile cards */
@media (min-width: 1121px) {
  .hos-mobile-cards {
    display: none;
  }
}
@media (max-width: 768px) {
  .recap-table-desktop {
    display: none;
  }
  .recap-mobile-cards {
    display: block;
  }
}
@media (min-width: 769px) {
  .recap-mobile-cards {
    display: none;
  }
}
/* Recap mobile cards – better spacing */
.recap-mobile-cards {
  display: grid;
  gap: 16px;                    /* space between cards */
  padding: 4px 0;               /* slight padding top/bottom */
}

/* Enhance card design */
.recap-mobile-cards .recap-card-v2 {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  box-shadow: 0 4px 18px rgba(0,0,0,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 16px;
}

.recap-mobile-cards .recap-card-v2:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}

/* Make the driver name bolder */
.recap-mobile-cards .rcv-name {
  font-size: 1rem;
  font-weight: 800;
}

/* Improve the block ID subtitle */
.recap-mobile-cards .rcv-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Expandable details rows styling */
.recap-details .rcv-detail-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.recap-details .rcv-detail-row:last-child {
  border-bottom: none;
}

/* Issue text more visible */
.rcv-detail-row strong {
  color: var(--amber);          /* highlight issues in amber */
  font-weight: 700;
  line-height: 1.4;
}
.recap-mobile-cards {
  display: grid;
  gap: 16px;
  padding: 4px 0;
}

.recap-mobile-cards .recap-card-v2 {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.025);
  box-shadow: 0 4px 18px rgba(0,0,0,0.15);
  padding: 16px;
}

.recap-mobile-cards .rcv-name {
  font-size: 1rem;
  font-weight: 800;
}

.recap-details .rcv-detail-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.recap-details .rcv-detail-row:last-child {
  border-bottom: none;
}

.rcv-detail-row strong {
  color: var(--amber);
  font-weight: 700;
  line-height: 1.4;
}
/* iOS‑style push notification banner */
.push-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(28, 28, 30, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.push-banner.show {
  transform: translateY(0);
  opacity: 1;
}

.push-banner .banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(53, 199, 107, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.push-banner.critical .banner-icon {
  background: rgba(239, 107, 104, 0.2);
}

.push-banner .banner-body {
  flex: 1;
  min-width: 0;
}

.push-banner .banner-title {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.2;
  margin-bottom: 2px;
}

.push-banner .banner-text {
  font-size: 0.78rem;
  color: #c7c7cc;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.push-banner .banner-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.push-banner {
  z-index: 9999 !important;
}
/* Full‑screen filter overlay (mobile only) */

/* ===================================================================
   TABLET / SMALL DESKTOP (820px – 1120px)
   =================================================================== */
@media (max-width: 820px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
    padding: 28px;
    gap: 42px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-metrics {
    grid-template-columns: 1fr;
  }

  .portal-shell {
    display: block;         /* already single column from 1120px, but safe */
  }

  .content {
    padding: 18px;
  }

  .stats-grid,
  .grid-3,
  .form-grid,
  .shift-meta {
    grid-template-columns: 1fr;
  }

  .section-title {
    display: grid;
    align-items: start;
  }

  .owner-mobile-app {
    max-width: none;
  }

  .mobile-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .mobile-hero-content {
    grid-template-columns: 1fr auto;
    padding: 22px;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .mobile-hero-title {
    font-size: 1.72rem;
  }

  .mobile-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-section-head {
    align-items: flex-start;
  }

  .shift-card-v2 {
    grid-template-columns: 1fr;
  }

  .scv-time-block {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .hos-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hos-summary-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Keep topbar brand hidden on larger tablets? Actually 820px is still mobile-ish. We'll keep the brand visible and page title hidden, already done at 1120px */
}

/* ===================================================================
   PHONE (max‑width: 768px)
   =================================================================== */
@media (max-width: 768px) {
  .hos-page {
    padding: 8px;
    gap: 8px;
  }

  .hos-status-banner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .hos-status-banner-actions {
    justify-content: stretch;
  }

  .hos-status-banner-actions .btn {
    flex: 1 1 auto;
  }

  .hos-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hos-controls-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 8px;
    gap: 8px;
  }

  .hos-controls-filters {
    grid-template-columns: 1fr;
  }

  .hos-controls-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  /* Show filter toggle on mobile only */
  .hos-filters-toggle {
    display: flex;
  }

  /* Hide filter body when not toggled */
  @media (max-width: 768px) {
    .hos-controls-body:not(.is-visible) {
      display: none;
    }
  }

  .hos-filters-body {
    padding-top: 0;
  }

  .hos-toolbar {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .toolbar-group {
    min-width: 100%;
  }

  .quick-filters {
    justify-content: flex-start;
  }

  .quick-chip {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .hos-th-sortable {
    display: none;
  }

  .hos-table-wrapper {
    max-height: calc(100vh - 280px);   /* tighter on mobile */
  }

  .hos-mobile-cards {
    padding: 8px;
    gap: 8px;
  }

  .hos-mobile-card {
    padding: 12px;
  }

  .hos-metric-value {
    font-size: 0.82rem;
  }

  .hos-metric-label {
    font-size: 0.62rem;
  }

  /* Keep controls body hidden until toggled (already covered) */
}

/* ===================================================================
   SMALL PHONE (max‑width: 520px)
   =================================================================== */
@media (max-width: 520px) {
  .login-panel-wrap {
    padding: 18px;
  }

  .login-panel {
    padding: 20px;
  }

  .demo-accounts {
    grid-template-columns: 1fr;
  }

  .actions-row,
  .topbar-actions {
    justify-content: stretch;
  }

  .actions-row .btn,
  .topbar-actions .btn {
    flex: 1 1 auto;
  }

  .mobile-hero {
    padding: 16px;
    min-height: 152px;
  }

  .mobile-hero-content {
    padding: 0;
  }

  .mobile-hero-title {
    font-size: 1.52rem;
  }

  .mobile-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi-value { font-size: 1.7rem; }

  .mobile-section {
    padding: 14px;
  }

  .rcv-times {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lic-details {
    grid-template-columns: 1fr;
  }

  .mobile-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .hos-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table,
  .recap-table {
    min-width: 100%;
  }

  th, td {
    min-width: 80px;
    white-space: nowrap;
  }

  .driver-cell,
  .vrids {
    min-width: 120px;
    white-space: normal;
  }

  .compact {
    white-space: normal;
  }

  .hos-stat-value {
    font-size: 1.3rem;
  }

  .hos-mobile-metrics {
    grid-template-columns: 1fr 1fr;
  }
}
/* Bigger logo on both mobile and desktop */
.brand-mark {
  width: 60px;        /* was 44px */
  height: 60px;
  padding: 4px;       /* keep the same padding */
}
/* ===================================================================
   DESKTOP RESTORATION (min‑width: 1024px for HOS table)
   =================================================================== */
@media (min-width: 1024px) {
  .hos-table-desktop { display: table; }
  .hos-mobile-cards { display: none; }

  .hos-table-scroll {
    min-height: calc(100vh - 210px);
  }

  .hos-table-wrapper {
    max-height: none;               /* let flex fill the page */
  }

  .hos-metric {
    min-width: 88px;
  }

  .hos-metric .bar-track {
    height: 8px;
    margin-bottom: 2px;
  }

  .hos-metric-value {
    font-size: 1rem;
  }

  .hos-metric-label {
    font-size: 0.68rem;
  }

  .hos-driver-name-row .driver-name {
    font-size: 1rem;
  }

  .hos-driver-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
  }

  .hos-th-sort-btn {
    min-height: 44px;
    font-size: 0.72rem;
  }
}