/* ============================================================================
   CT Logistics — Workshop Manager
   One stylesheet. Desktop sidebar collapses to a bottom bar on phones so the
   same app works on a workshop handset and an office screen.
   ========================================================================= */

:root {
  /* A workshop tool that lives on a bright shop floor and an office screen —
     it commits to one light identity rather than shipping a half-done dark
     mode. Declaring it keeps form controls light on dark-mode devices. */
  color-scheme: light;

  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --ink:       #0f172a;
  --ink-soft:  #475569;
  --muted:     #94a3b8;
  --line:      #e2e8f0;

  --brand:     #0ea5e9;
  --brand-ink: #0369a1;
  --navy:      #0f172a;

  --red:    #dc2626;  --red-bg:    #fef2f2;
  --amber:  #d97706;  --amber-bg:  #fffbeb;
  --green:  #16a34a;  --green-bg:  #f0fdf4;
  --blue:   #2563eb;  --blue-bg:   #eff6ff;
  --violet: #7c3aed;  --violet-bg: #f5f3ff;
  --grey:   #64748b;  --grey-bg:   #f1f5f9;

  --r:   10px;
  --r-lg: 14px;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 4px 12px rgba(15,23,42,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-ink); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.muted { color: var(--muted); font-size: .85em; }
.nowrap { white-space: nowrap; }

/* ============================================================ login screen */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(160deg, #0f172a, #1e3a5f 60%, #0369a1);
}
.login__box {
  width: min(460px, 100%); background: var(--surface);
  border-radius: var(--r-lg); padding: 28px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.login__hint { color: var(--ink-soft); font-size: 14px; margin: 6px 0 18px; }
.login__users { display: grid; gap: 8px; }
.login__user {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); cursor: pointer; text-align: left; font: inherit;
  transition: border-color .15s, background .15s;
}
.login__user:hover { border-color: var(--brand); background: #f8fbff; }
.login__user-info { display: flex; flex-direction: column; flex: 1; }
.login__pin { font-size: 11px; color: var(--muted); background: var(--grey-bg);
  padding: 3px 8px; border-radius: 99px; }

/* ================================================================== branding */
.brand { display: flex; align-items: center; gap: 11px; padding: 4px; }
.brand__mark {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  background: var(--brand); color: #fff; font-weight: 800; letter-spacing: .5px;
  border-radius: 9px; font-size: 15px;
}
.brand__name { font-weight: 700; font-size: 15px; }
.brand__sub { font-size: 12px; color: var(--muted); }
.brand--lg { margin-bottom: 14px; }
.brand--sm .brand__mark { width: 30px; height: 30px; font-size: 12px; }

/* ===================================================================== shell */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex: none; background: var(--navy); color: #cbd5e1;
  display: flex; flex-direction: column; padding: 16px 12px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand__sub { color: #64748b; }
.sidebar .brand__name { color: #fff; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 22px; flex: 1; }
.nav__item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  border-radius: 8px; font-size: 14px; color: #cbd5e1; transition: background .12s;
}
.nav__item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav__item--on { background: var(--brand); color: #fff; font-weight: 600; }
.nav__item--on:hover { background: var(--brand); color: #fff; }
.nav__icon { width: 18px; text-align: center; opacity: .9; }
.nav__label { flex: 1; }
.nav__badge {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
  background: rgba(255,255,255,.18); color: #fff;
}
.nav__badge--red { background: var(--red); }
.nav__badge--amber { background: var(--amber); }

.sidebar__foot { border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; }
/* buttons sitting on the dark sidebar need light text */
.sidebar__foot .btn {
  background: transparent; border-color: rgba(255,255,255,.2); color: #cbd5e1;
}
.sidebar__foot .btn:hover { background: rgba(255,255,255,.09); color: #fff; border-color: rgba(255,255,255,.35); }
.whoami { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.whoami strong { color: #fff; }
.whoami .muted { color: #64748b; }
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 12px;
}

.main { flex: 1; min-width: 0; }
.view { padding: 22px 26px 90px; max-width: 1280px; }

.topbar { display: none; }
.bottomnav { display: none; }

/* ================================================================= headings */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { font-size: 24px; letter-spacing: -.02em; }
.page-head__sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }
.page-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ==================================================================== tiles */
.tiles {
  display: grid; gap: 12px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; box-shadow: var(--shadow); display: block;
  border-left: 3px solid var(--line);
}
a.tile:hover { border-color: var(--brand); border-left-color: var(--brand); }
.tile__label { font-size: 12px; color: var(--ink-soft); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; }
.tile__value { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.tile__sub { font-size: 12px; color: var(--muted); }
.tile--red    { border-left-color: var(--red); }
.tile--red .tile__value { color: var(--red); }
.tile--amber  { border-left-color: var(--amber); }
.tile--green  { border-left-color: var(--green); }
.tile--blue   { border-left-color: var(--blue); }

/* ==================================================================== cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.card--red   { border-color: #fecaca; }
.card--amber { border-color: #fde68a; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card__title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card__sub { margin: 4px 0 12px; color: var(--ink-soft); font-size: 13px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; align-items: start; }

.pill {
  font-size: 12px; font-weight: 700; padding: 3px 11px; border-radius: 99px;
  background: var(--grey-bg); color: var(--ink-soft);
}
.pill--red   { background: var(--red-bg);   color: var(--red); }
.pill--amber { background: var(--amber-bg); color: var(--amber); }

/* =================================================================== badges */
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px;
  border-radius: 99px; vertical-align: middle; white-space: nowrap;
}
.badge--red    { background: var(--red-bg);    color: var(--red); }
.badge--amber  { background: var(--amber-bg);  color: var(--amber); }
.badge--green  { background: var(--green-bg);  color: var(--green); }
.badge--blue   { background: var(--blue-bg);   color: var(--blue); }
.badge--violet { background: var(--violet-bg); color: var(--violet); }
.badge--grey   { background: var(--grey-bg);   color: var(--grey); }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot--red { background: var(--red); } .dot--amber { background: var(--amber); }
.dot--green { background: var(--green); } .dot--blue { background: var(--blue); }

/* ================================================================== buttons */
.btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: #0284c7; border-color: #0284c7; }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--tiny { padding: 4px 9px; font-size: 12px; }
.icon-btn {
  background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--ink-soft); padding: 4px 8px; border-radius: 6px;
}
.icon-btn:hover { background: var(--grey-bg); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  font-size: 13px; font-weight: 600; padding: 5px 13px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
}
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }
.chip--on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip--on:hover { color: #fff; }

/* =================================================================== tables */
.table-wrap { overflow-x: auto; margin: 0 -18px -18px; padding: 0 18px 4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); font-weight: 700; padding: 8px 10px;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
tbody td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
.table--rows tbody tr { cursor: pointer; }
.table--rows tbody tr:hover { background: #f8fbff; }
.row--warn { background: var(--amber-bg); }
.cell--wide { min-width: 220px; }

/* ===================================================================== list */
.list { list-style: none; margin: 0; padding: 0; }
.list__row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.list__row:last-child { border-bottom: 0; }
.list__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.list__main .muted { font-size: 12px; }
.list__sub { font-size: 13px; color: var(--ink-soft); }
.list__meta { display: flex; align-items: center; gap: 7px; flex: none; }

.attention { list-style: none; margin: 0; padding: 0; }
.attention__row {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.attention__row:last-child { border-bottom: 0; }
.attention__what { font-weight: 600; flex: none; }
.attention__why { color: var(--ink-soft); font-size: 13px; }

/* =============================================================== truck cards */
.cards { display: grid; gap: 13px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.cards--sm { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.truck-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow); display: block; transition: border-color .12s;
}
.truck-card:hover { border-color: var(--brand); }
.truck-card__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 15px; background: var(--navy); color: #fff;
}
.truck-card__fleet { font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.truck-card__reg { font-size: 12px; color: #94a3b8; }
.truck-card__body { padding: 13px 15px; display: flex; flex-direction: column; gap: 7px; }
.truck-card__stats { display: flex; gap: 13px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }
.truck-card__foot { padding: 8px 15px; font-size: 12px; font-weight: 600; }
.truck-card__foot--overdue  { background: var(--red-bg);   color: var(--red); }
.truck-card__foot--due_soon { background: var(--amber-bg); color: var(--amber); }

.plan-card {
  background: #fbfdff; border: 1px solid var(--line); border-radius: var(--r); padding: 13px;
}
.plan-card__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.plan-card__tasks { margin: 0 0 10px; padding-left: 17px; font-size: 13px; color: var(--ink-soft); }
.plan-card__tasks li { margin-bottom: 2px; }
.plan-card__foot { display: flex; gap: 6px; }

/* =============================================================== definitions */
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }
.kv__total { font-weight: 700; border-top: 1px solid var(--line); padding-top: 8px; }

.callout { border-radius: var(--r); padding: 12px 14px; margin-top: 14px; font-size: 14px; }
.callout p { margin: 4px 0 0; font-size: 13px; }
.callout--red   { background: var(--red-bg);   color: #7f1d1d; border: 1px solid #fecaca; }
.callout--amber { background: var(--amber-bg); color: #78350f; border: 1px solid #fde68a; }
.callout--grey  { background: #f1f5f9;         color: #334155; border: 1px solid #e2e8f0; }

/* Cloud save indicator — a small pill in the corner, only when it matters. */
.cloud-status { position: fixed; bottom: 14px; right: 14px; z-index: 60;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: opacity .3s; }
.cloud-status--busy   { background: #fef9c3; color: #854d0e; }
.cloud-status--ok     { background: #dcfce7; color: #166534; }
.cloud-status--off    { background: #fee2e2; color: #991b1b; }
.cloud-status--hidden { opacity: 0; pointer-events: none; }

/* A row for something kept but out of use — deactivated driver, decommissioned vehicle. */
.table--rows tbody tr.row--muted td:not(:nth-child(2)) { opacity: .55; }

/* ================================================================= timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 2px; background: var(--line);
}
.tl { position: relative; padding: 0 0 18px; }
.tl:last-child { padding-bottom: 0; }
.tl__marker {
  position: absolute; left: -21px; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--grey); border: 2px solid var(--surface);
}
.tl__marker--green { background: var(--green); } .tl__marker--red { background: var(--red); }
.tl__marker--amber { background: var(--amber); } .tl__marker--blue { background: var(--blue); }
.tl__marker--violet { background: var(--violet); }
.tl__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.tl__date { color: var(--muted); font-size: 12px; margin-left: auto; }
.tl__fault { margin: 5px 0 0; font-size: 14px; }
.tl__work { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }
.tl__foot { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* ==================================================================== forms */
.form { display: flex; flex-direction: column; gap: 13px; }
.form-grid { display: grid; gap: 13px; grid-template-columns: 1fr 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field__hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=number], input[type=email], input[type=date],
input[type=password], select, textarea {
  font: inherit; font-size: 14px; padding: 9px 11px; border: 1px solid #cbd5e1;
  border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,165,233,.15);
}
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.checklist { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 9px; }

/* ==================================================================== modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 60;
  display: grid; place-items: center; padding: 18px; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: var(--r-lg); width: min(520px, 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,.3); max-height: 92vh; display: flex; flex-direction: column;
}
.modal--wide { width: min(720px, 100%); }
.modal__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.modal__head h2 { font-size: 16px; }
.modal__body { padding: 18px; overflow-y: auto; }

/* ==================================================================== toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 11px 20px; border-radius: 99px;
  font-size: 14px; font-weight: 600; z-index: 80; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  animation: rise .25s ease-out;
}
.toast--red { background: var(--red); }
.toast--out { opacity: 0; transition: opacity .3s; }
@keyframes rise { from { transform: translate(-50%, 14px); opacity: 0; } }

/* ===================================================================== bars */
.bar { background: var(--grey-bg); border-radius: 99px; height: 8px; min-width: 70px; overflow: hidden; }
.bar__fill { height: 100%; background: var(--blue); border-radius: 99px; }
.bar__fill--red { background: var(--red); }
.mini { width: 100%; }
.mini td { padding: 7px 8px; border: 0; }
.mini__label { font-size: 13px; white-space: nowrap; }
.mini__bar { width: 45%; }
.mini__val { text-align: right; font-size: 13px; white-space: nowrap; }

.split-bar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--grey-bg); margin: 6px 0 12px; }
.split-bar__seg--green { background: var(--green); }
.split-bar__seg--red { background: var(--red); }
.legend { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-soft); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.sw--green { background: var(--green); } .sw--red { background: var(--red); }

/* ==================================================================== empty */
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty__icon { font-size: 30px; opacity: .45; }
.empty__title { font-weight: 700; color: var(--ink-soft); margin-top: 8px; }
.empty__sub { font-size: 13px; margin-top: 3px; }

/* =============================================================== responsive */
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.4);
  }
  .sidebar--open { transform: none; }

  .topbar {
    display: flex; align-items: center; gap: 10px; padding: 9px 13px;
    background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30;
  }
  .topbar .brand { flex: 1; }
  .topbar .brand__name { color: #fff; font-size: 14px; }
  .topbar .icon-btn { color: #fff; font-size: 20px; }

  .view { padding: 14px 13px 96px; }
  .page-head h1 { font-size: 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 14px; border-radius: var(--r); }
  .table-wrap { margin: 0 -14px -14px; padding: 0 14px 4px; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .tile__value { font-size: 22px; }

  /* bigger tap targets for gloved hands on the shop floor */
  .btn { padding: 11px 16px; }
  .btn--tiny { padding: 7px 11px; }
  input, select, textarea { padding: 11px; font-size: 16px; }

  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 5px 2px calc(5px + env(safe-area-inset-bottom));
  }
  .bnav__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 2px; font-size: 10.5px; font-weight: 600; color: var(--muted);
    position: relative;
  }
  .bnav__item .nav__icon { font-size: 17px; }
  .bnav__item--on { color: var(--brand); }
  .bnav__dot {
    position: absolute; top: 4px; right: 22%; width: 7px; height: 7px;
    border-radius: 50%; background: var(--blue);
  }
  .bnav__dot--red { background: var(--red); }
  .bnav__dot--amber { background: var(--amber); }
}

/* ============================================================================
   PHASE 1 ADDITIONS
   ========================================================================= */

.is-hidden { display: none !important; }
.text--red { color: var(--red); }
.card__title--sm { font-size: 13px; margin-top: 14px; }

/* -------------------------------------------------------- notification bar
   Sits under the topbar on every page. Rows disappear on their own as the
   underlying item is dealt with, so there is nothing to dismiss.           */
.notify {
  margin: 14px 26px 0; border-radius: var(--r); padding: 11px 14px;
  border: 1px solid var(--amber); background: var(--amber-bg);
}
.notify--red { border-color: #fecaca; background: var(--red-bg); }
.notify__head { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.notify__count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  background: var(--amber); color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.notify--red .notify__count { background: var(--red); }
.notify__more {
  margin-left: auto; background: none; border: 0; font: inherit; font-size: 13px;
  font-weight: 600; color: var(--brand-ink); cursor: pointer; text-decoration: underline;
}
.notify__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.notify__list li { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.notify__list a { font-weight: 600; }

/* --------------------------------------------------------- language toggle */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.lang__btn {
  font: inherit; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.lang__btn--on { background: var(--brand); color: #fff; }
.sidebar .lang { border-color: rgba(255,255,255,.2); margin-bottom: 10px; }
.sidebar .lang__btn { color: #94a3b8; }
.sidebar .lang__btn--on { background: var(--brand); color: #fff; }
.topbar .lang { border-color: rgba(255,255,255,.25); }
.topbar .lang__btn { color: #cbd5e1; }
.login__top { display: flex; justify-content: space-between; align-items: flex-start; }

/* ------------------------------------------------------------- money input */
.money-input { display: flex; flex-direction: column; gap: 5px; }
.money-input__row { display: grid; grid-template-columns: 1fr 130px; gap: 8px; }
.money-input__rate {
  background: var(--blue-bg); border: 1px solid #dbeafe; border-radius: 8px; padding: 10px 12px;
}

/* ---------------------------------------------------------- permission grid */
.perm { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0; }
.perm legend { font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-soft); padding: 0 6px; }
.perm__grid { display: grid; gap: 7px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.perm__grid--wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.perm__grid .check { font-size: 13px; }
.perm-summary { list-style: none; margin: 8px 0; padding: 0; font-size: 12px; display: grid; gap: 4px; }
.perm-summary .muted { display: block; }

/* -------------------------------------------------------------- plain lists */
.plain { list-style: none; margin: 6px 0; padding: 0; font-size: 13px; display: grid; gap: 4px; }
.plain--rows li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.plain--rows li:last-child { border-bottom: 0; }
.card--inset {
  background: #f8fafc; border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px; margin-top: 14px;
}
.card--inset .card__title { margin-bottom: 4px; }
.callout--blue { background: var(--blue-bg); border: 1px solid #dbeafe; color: #1e3a5f; }
.form-actions--split { justify-content: space-between; align-items: center; }
.supplier-card { margin-bottom: 0; }
.checklist .check { padding: 3px 0; }

/* =============================================================== TOUCH
   The workshop runs this on a shared tablet, which is wide enough for the
   desktop layout but still operated with a thumb. Size the controls for a
   finger on any touch device, not just narrow ones.                        */
@media (pointer: coarse) {
  .btn { padding: 11px 16px; }
  .btn--sm { padding: 9px 13px; }
  .btn--tiny { padding: 8px 12px; font-size: 13px; }
  input[type=text], input[type=number], input[type=email], input[type=date],
  input[type=password], select, textarea { padding: 12px; font-size: 16px; }
  .check input { width: 22px; height: 22px; }
  .nav__item { padding: 12px 11px; }
  .chip { padding: 9px 15px; }
  tbody td { padding: 14px 10px; }
  .lang__btn { padding: 8px 14px; font-size: 12px; }
}

@media (max-width: 760px) {
  .notify { margin: 10px 13px 0; }
}

/* ================================================================== PRINT
   A closed job card should print as a clean record for the file.           */
@media print {
  .sidebar, .bottomnav, .topbar, .notify, .page-head__actions,
  .row-actions, .form-actions, .chips { display: none !important; }
  body { background: #fff; }
  .view { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  textarea { border: 0; padding: 0; resize: none; height: auto; }
  a { text-decoration: none; color: #000; }
}

/* ---------------------------------------------------------- trucks/trailers
   Trailers get a quieter header so a mixed fleet list separates at a glance
   without needing to read the labels.                                       */
.section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); margin: 4px 0 10px;
}
.cards + .section-title { margin-top: 22px; }
.truck-card--trailer .truck-card__head { background: #334155; }
.truck-card--trailer .truck-card__fleet { font-size: 16px; }

/* A close button that will be refused reads as a normal primary button and
   invites a pointless click. Show it as held back instead. */
.btn--blocked { background: var(--muted); border-color: var(--muted); }
.btn--blocked:hover { background: var(--grey); border-color: var(--grey); }

/* --------------------------------------------------------- price comparison
   Shown live while an order price is typed, against what was last paid.    */
.price-compare {
  display: flex; align-items: center; gap: 9px; font-size: 13px;
  padding: 9px 12px; border-radius: 8px; margin-top: -4px;
}
.price-compare--red   { background: var(--red-bg);   color: #7f1d1d; }
.price-compare--green { background: var(--green-bg); color: #14532d; }
.price-compare--grey  { background: var(--grey-bg);  color: var(--ink-soft); }

/* ============================================================================
   PHASE 2 — combobox, search, tyres
   ========================================================================= */

/* --------------------------------------------------------------- combobox */
.combo { position: relative; }
.combo__text { width: 100%; padding-right: 34px; }
.combo__caret {
  position: absolute; right: 1px; top: 1px; bottom: 1px; width: 32px;
  display: grid; place-items: center; border: 0; background: transparent;
  color: var(--muted); font-size: 12px; cursor: pointer; border-radius: 0 8px 8px 0;
}
.combo__caret:hover { color: var(--ink); background: var(--grey-bg); }
.combo--open .combo__caret { color: var(--brand); transform: rotate(180deg); }
.combo__menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  background: var(--surface); border: 1px solid #cbd5e1; border-radius: 8px;
  box-shadow: var(--shadow); max-height: 240px; overflow-y: auto;
}
.combo__opt { padding: 9px 12px; font-size: 14px; cursor: pointer; }
.combo__opt:hover, .combo__opt.is-active { background: var(--blue-bg); color: var(--brand-ink); }

/* ---------------------------------------------------------------- search */
.searchbar { position: relative; margin-bottom: 14px; max-width: 420px; }
.searchbar__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 14px; opacity: .5; pointer-events: none;
}
.searchbar__input {
  width: 100%; padding: 9px 12px 9px 34px; border: 1px solid var(--line);
  border-radius: 99px; font: inherit; font-size: 14px; background: var(--surface);
}
.searchbar__input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,165,233,.15); }

/* scrollable checklist for the retread batch picker */
.checklist--scroll { max-height: 320px; overflow-y: auto; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; }

/* pending-supplier and reorder chips reuse existing badge styles */
.card--inset .card__title { margin-bottom: 6px; }

/* ------------------------------------------------------------- segmented toggle
   Truck / Trailer choice at the top of the new job card.                    */
.segment { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segment__btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 18px; border: 0;
  background: var(--surface); color: var(--ink-soft); cursor: pointer;
}
.segment__btn + .segment__btn { border-left: 1px solid var(--line); }
.segment__btn--on { background: var(--brand); color: #fff; }

/* ------------------------------------------------------------------- audit */
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.filters .searchbar { margin-bottom: 0; max-width: none; }
.filters__row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.filters__row .field { gap: 4px; }
.audit-table td { font-size: 13px; }
.audit-change { color: var(--ink-soft); font-size: 12px; min-width: 200px; }
