/* Tradeswork tenant app. Visual reference: design/JTR Command Center v2.dc.html.
   One neutral UI for every tenant; only --accent (and its derived text colours) and the logo
   change, set per tenant in base.html from app.branding.AccentPalette. Status colours are fixed. */
:root {
  --accent: #475569;       /* brand colour: fills, borders, selected states */
  --on-accent: #ffffff;    /* text on accent fills */
  --accent-text: #475569;  /* accent-coloured text on white (AA) */
  --accent-soft: color-mix(in srgb, var(--accent) 11%, white);

  --txt: #15171a;
  --txt2: #454b54;
  --mute: #6b717b;
  --line: rgba(21, 23, 26, 0.09);
  --line2: rgba(21, 23, 26, 0.16);
  --bg: #f5f5f3;
  --bg2: #eeeeeb;
  --low: #fbfbfa;
  --card: #ffffff;

  --good: #1f9d5c;
  --warn: #b98300;
  --bad: #d42a32;
  --info: #2276d6;

  --radius: 12px;
  --radius-sm: 8px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-cond: "Saira Condensed", "Arial Narrow", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; color: var(--txt); background: var(--bg); line-height: 1.5; }
a { color: var(--accent-text); }
.muted { color: var(--mute); }
.icon { flex: none; display: block; }

/* ------------------------------------------------------------ shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--low); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar__brand { display: flex; align-items: center; gap: 11px; padding: 18px 18px 16px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; }
.sidebar__logo { width: 46px; height: 46px; flex: none; border-radius: 9px; overflow: hidden; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(20, 22, 26, 0.1); display: grid; place-items: center; }
.sidebar__logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar__monogram { font-family: var(--font-cond); font-weight: 700; font-size: 18px; color: var(--on-accent);
  background: var(--accent); width: 100%; height: 100%; display: grid; place-items: center; }
.sidebar__brand-text { min-width: 0; display: grid; }
.sidebar__name { font-family: var(--font-cond); font-weight: 700; font-size: 20px; letter-spacing: 0.02em; line-height: 1;
  text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__sub { font-size: 11px; color: var(--mute); letter-spacing: 0.04em; margin-top: 3px; }
.sidebar__nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-group__label { font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--mute);
  font-weight: 600; padding: 0 8px 8px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; color: var(--txt2); text-decoration: none; white-space: nowrap; }
.nav-item + .nav-item { margin-top: 3px; }
.nav-item:hover { background: var(--bg2); color: var(--txt); }
.nav-item--active, .nav-item--active:hover { background: var(--accent-soft); color: var(--accent-text);
  box-shadow: inset 3px 0 0 var(--accent); }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sidebar__user { display: flex; align-items: center; gap: 11px; padding: 14px; border-top: 1px solid var(--line); }
.sidebar__user form { margin: 0 0 0 auto; }
.sidebar__user-text { min-width: 0; display: grid; }
.sidebar__user-name { font-size: 13.5px; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: 11px; color: var(--mute); }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 40%, transparent); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); color: var(--txt2); cursor: pointer; }
.icon-button:hover { color: var(--txt); border-color: var(--line2); }
.icon-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.main { flex: 1; min-width: 0; width: 100%; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; padding: 0 24px;
  background: var(--bg2); border-bottom: 1px solid var(--line); }
.topbar__title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.topbar__bar { width: 5px; height: 24px; border-radius: 3px; background: var(--accent); flex: none; }
.topbar__h1 { margin: 0; font-family: var(--font-cond); font-size: 26px; font-weight: 700; letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__date { font-size: 13px; color: var(--mute); white-space: nowrap; }
.topbar__actions { display: flex; align-items: center; gap: 12px; flex: none; }
.content { flex: 1; padding: 22px 24px 40px; }

/* ------------------------------------------------------------ layout helpers */
.grid { display: grid; gap: 16px; align-items: start; }
.grid--main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stack-lg { display: grid; gap: 16px; }
.stack { display: grid; gap: 0.875rem; }

/* ------------------------------------------------------------ cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card--narrow { max-width: 36rem; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card__title { margin: 0; font-family: var(--font-cond); font-size: 17px; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase; border-left: 3px solid var(--accent); padding-left: 10px; line-height: 1.2; }
.card__meta { font-size: 12px; color: var(--mute); }

/* KPI tile (used as real numbers arrive) */
.kpi { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.kpi__label { font-size: 11.5px; color: var(--txt2); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.kpi__value { font-family: var(--font-cond); font-size: 32px; font-weight: 700; line-height: 0.95; margin-top: 9px; }
.kpi__sub { font-size: 12px; color: var(--mute); margin-top: 5px; }

/* setup steps */
.progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--bg2); overflow: hidden; margin-bottom: 6px; }
.progress::-webkit-progress-bar { background: var(--bg2); border-radius: 3px; }
.progress::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.progress::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step__icon { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg2); color: var(--txt2); }
.step--done .step__icon { background: color-mix(in srgb, var(--good) 14%, white); color: var(--good); }
.step__text { display: grid; }
.step__title { font-weight: 600; }
.step--done .step__title { color: var(--txt2); }
.step__detail { font-size: 13px; color: var(--mute); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; }

/* ------------------------------------------------------------ status, alerts */
.status { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.status--good { color: var(--good); background: color-mix(in srgb, var(--good) 10%, white); }
.status--warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, white); }
.status--bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, white); }
.status--info { color: var(--info); background: color-mix(in srgb, var(--info) 10%, white); }
.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }
.alert { margin: 0 0 1rem; padding: 0.625rem 0.75rem; border-radius: var(--radius-sm); font-size: 13.5px; }
.alert--bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 8%, white); }

/* ------------------------------------------------------------ forms, buttons */
.field { display: grid; gap: 0.25rem; }
.field__label { font-size: 13px; font-weight: 600; }
.field__hint { font-size: 12.5px; color: var(--mute); }
.field input, .field select, .field textarea { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line2);
  border-radius: var(--radius-sm); background: var(--card); color: var(--txt); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 0.55rem 0.95rem; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--line2);
  background: var(--card); color: var(--txt); text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--txt2); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); border-color: color-mix(in srgb, var(--accent) 88%, black); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }

.small { font-size: 12.5px; }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.btn--small { padding: 0.3rem 0.7rem; font-size: 13px; }
.alert--good { color: var(--good); background: color-mix(in srgb, var(--good) 8%, white); }
.alert--info { color: var(--info); background: color-mix(in srgb, var(--info) 8%, white); }
.alert--warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, white); }
.field-row { display: grid; gap: 0.875rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: start; }
.field--bad input, .field--bad select { border-color: var(--bad); }
.field__error { font-size: 12.5px; color: var(--bad); }
.check { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 13.5px; }
.check input { margin-top: 3px; accent-color: var(--accent); }

/* ------------------------------------------------------------ settings */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card);
  color: var(--txt2); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.tab:hover { border-color: var(--line2); color: var(--txt); }
.tab--on, .tab--on:hover { color: var(--accent-text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, white); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.card__sub { margin: 4px 0 0; font-size: 13px; color: var(--mute); }
.card__foot { margin: 12px 0 0; font-size: 12.5px; }
.card--form { max-width: 48rem; }
.people { list-style: none; margin: 0 -18px; padding: 0; border-top: 1px solid var(--line); }
.person-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; }
.person-row:hover { background: var(--low); }
.person-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.person-row--inactive { opacity: 0.6; }
.person-row__main { min-width: 0; flex: 1; display: grid; }
.person-row__name { font-weight: 600; }
.person-row__sub { font-size: 12.5px; color: var(--mute); }
.person-row__status { flex: none; }
.avatar--sm { width: 34px; height: 34px; font-size: 12.5px; box-shadow: none; }
.avatar--quiet { background: var(--bg2); color: var(--txt2); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; max-width: 50%; }
.chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--bg2); color: var(--txt2); white-space: nowrap; }
.chip--accent { background: var(--accent-soft); color: var(--accent-text); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table thead th { font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.table tr:last-child th, .table tr:last-child td { border-bottom: 0; }
.table .center { text-align: center; }
.role-table tbody th { font-weight: 400; min-width: 14rem; }
.role-table__label { display: block; font-weight: 600; }
.role-table__hint { display: block; font-size: 12.5px; color: var(--mute); }
.role-table .yes { display: inline-grid; color: var(--good); }
.role-table .no { color: var(--mute); }
.role-table__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.toggle { appearance: none; position: relative; width: 34px; height: 20px; margin: 0; border-radius: 999px;
  background: var(--line2); cursor: pointer; transition: background 0.15s; vertical-align: middle; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(20, 22, 26, 0.25); transition: transform 0.15s; }
.toggle:checked { background: var(--accent); }
.toggle:checked::after { transform: translateX(14px); }
.toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .toggle, .toggle::after { transition: none; } }
.role-table__group th { padding-top: 18px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.assistant-tools { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }

/* ------------------------------------------------------------ asset registry */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 13px; font-weight: 600; text-decoration: none; }
.empty-state { text-align: center; padding: 32px 18px; }
.empty-state .card__title { border: 0; padding: 0; }
.empty-state__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.type-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 10px; margin-bottom: 14px; }
.type-tile { display: grid; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none; }
.type-tile:hover { border-color: var(--line2); }
.type-tile--on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.type-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.type-tile__name { font-size: 12.5px; font-weight: 600; color: var(--txt2); }
.type-tile__count { font-family: var(--font-cond); font-size: 28px; font-weight: 700; line-height: 1; }
.type-tile__sub { font-size: 12px; color: var(--mute); }
.card--flush { padding: 0; overflow: hidden; }
.card--flush .card__foot { padding: 0 18px 14px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 14rem; padding: 0 10px; border: 1px solid var(--line2);
  border-radius: var(--radius-sm); background: var(--card); color: var(--mute); }
.search input { flex: 1; border: 0; padding: 0.5rem 0; font: inherit; background: transparent; color: var(--txt); min-width: 0; }
.search input:focus { outline: none; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.toolbar__select select { font: inherit; padding: 0.5rem 0.6rem; border: 1px solid var(--line2); border-radius: var(--radius-sm); background: var(--card); }
.toolbar__check { align-items: center; }
.unit-table td, .unit-table th { padding-left: 18px; }
.unit-link { font-weight: 700; text-decoration: none; }
.row-link { cursor: pointer; }
.row-link:hover td, .row-link:focus-within td { background: color-mix(in srgb, var(--accent) 5%, white); }
.unit-table__place { display: inline-flex; align-items: center; gap: 6px; }
.unit-table__place .icon { color: var(--mute); }
.list-empty { padding: 16px 18px; margin: 0; }
.unit-head { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-start; margin-bottom: 16px; }
.unit-head__main { flex: 1; min-width: 14rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.unit-head__main p { width: 100%; margin: 0; }
.unit-head__code { margin: 0; font-size: 26px; }
.unit-head__place { display: grid; gap: 2px; min-width: 12rem; }
.unit-head__actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; padding-top: 12px; border-top: 1px solid var(--line); }
.chips--filter { justify-content: flex-start; max-width: none; margin-bottom: 12px; }
.chips--filter .chip { text-decoration: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { position: relative; display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline__item:last-child { border-bottom: 0; }
.timeline__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--line2); }
.timeline__item--move .timeline__dot { background: var(--info); }
.timeline__item--service .timeline__dot { background: var(--good); }
.timeline__item--damage .timeline__dot { background: var(--bad); }
.timeline__item--reading .timeline__dot, .timeline__item--status .timeline__dot { background: var(--warn); }
.timeline__item--registered .timeline__dot { background: var(--accent); }
.timeline__item--voided .timeline__body > :not(.text-bad) { text-decoration: line-through; opacity: 0.6; }
.timeline__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.timeline__photo { display: block; width: fit-content; margin: 4px 0; }
.timeline__photo img { display: block; max-width: min(220px, 100%); max-height: 160px; border-radius: 6px; border: 1px solid var(--line); object-fit: cover; }
.timeline__top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.timeline__fix { color: var(--mute); }
.rule-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.svc-rule { display: grid; gap: 1px; padding: 8px 10px; border-radius: var(--radius-sm); border-left: 3px solid var(--good); background: var(--low); }
.svc-rule--due_soon { border-left-color: var(--warn); }
.svc-rule--overdue { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 5%, white); }
.svc-rule--unknown { border-left-color: var(--line2); }
.svc-rule__name { font-weight: 600; }
.svc-rule__detail { font-size: 12.5px; color: var(--txt2); }
.site-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-list__item { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--low); }
.site-list__notes { margin-top: 4px; white-space: pre-line; color: var(--txt2); }
.problems { margin: 0; padding-left: 1.1rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.upload-form { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.how { margin: 0 0 14px; padding-left: 1.2rem; display: grid; gap: 6px; }

/* ------------------------------------------------------------ modal + employee form */
.modal { border: 0; padding: 0; border-radius: 14px; width: min(46rem, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  box-shadow: 0 20px 60px rgba(20, 22, 26, 0.25); color: var(--txt); }
.modal::backdrop { background: rgba(20, 22, 26, 0.45); }
.modal__body { padding: 22px 24px; }
.modal__alert { margin: 16px 24px 0; }
.drawer { margin: 0 0 0 auto; border: 0; border-left: 1px solid var(--line2); padding: 0; width: min(444px, 100vw);
  max-width: 100vw; height: 100dvh; max-height: 100dvh; color: var(--txt); background: var(--card);
  box-shadow: -24px 0 60px rgba(20, 22, 26, 0.12); }
.drawer[open] { animation: drawer-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.drawer::backdrop { background: rgba(20, 22, 26, 0.35); }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }
.drawer__alert { margin: 12px 18px 0; }
.drawer__body, .drawer__panel { height: 100%; }
.drawer__panel { display: flex; flex-direction: column; border-top: 3px solid var(--accent); }
.drawer__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer__badge { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px;
  border: 1px solid var(--line2); background: var(--low); color: var(--txt2); }
.drawer__heading { flex: 1; min-width: 0; }
.drawer__heading p { margin: 2px 0 0; }
.drawer__code { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.1; }
.drawer__facts { display: flex; margin: 0; border-bottom: 1px solid var(--line); }
.drawer__facts > div { flex: 1; min-width: 0; padding: 10px 14px; border-right: 1px solid var(--line); }
.drawer__facts > div:last-child { border-right: 0; }
.drawer__facts dt { font-size: 11px; color: var(--mute); }
.drawer__facts dd { margin: 2px 0 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.drawer__scroll { flex: 1; overflow-y: auto; padding: 16px 18px; display: grid; gap: 20px; align-content: start; }
.drawer__label { margin: 0 0 8px; font-size: 11px; font-weight: 600; color: var(--mute); text-transform: uppercase;
  letter-spacing: 0.05em; }
.drawer__foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.drawer__open { margin-left: auto; }
.timeline--compact .timeline__item { padding: 8px 0; }
.pricing { margin-bottom: 16px; }
.pricing__head { align-items: flex-start; }
.pricing__head p { margin: 2px 0 0; }
.pricing__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pricing__group { padding: 12px 18px 4px; }
.pricing__label { margin-bottom: 6px; }
.pricing__edit { text-align: right; }
.pricing__delete { margin-right: auto; color: var(--bad); }
.pricing__quote { margin-top: 14px; }
.quote { margin: 0; display: grid; gap: 6px; }
.quote__line { display: flex; justify-content: space-between; gap: 12px; }
.quote__line dt { color: var(--txt2); }
.quote__line dd { margin: 0; font-weight: 600; }
.quote__total { padding-top: 8px; border-top: 1px solid var(--line); }
.quote__total dt { color: var(--txt); font-weight: 600; }
.quote__notes { margin: 10px 0 0; padding-left: 18px; }
.person__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.person__title { margin: 0; font-family: var(--font-cond); font-size: 24px; font-weight: 700; letter-spacing: 0.01em; }
.person__head p { margin: 2px 0 0; }
.person__close { margin-left: auto; font-size: 20px; }
.person__form { display: grid; gap: 4px; }
.person__section { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0 6px; display: grid; gap: 12px; min-width: 0; }
.person__section legend { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); padding: 0 8px 0 0; }
.person__footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: 6px; }
.person__invite { margin-top: 10px; }
.person__telegram { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.person__subhead { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-text); }
.person__invite-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.skill { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.skill--bad { border-color: var(--bad); }
.skill .check { flex: 1; min-width: 12rem; }
.skill__expiry { display: flex; align-items: center; gap: 6px; }
.skill__expiry input { font: inherit; padding: 0.3rem 0.5rem; border: 1px solid var(--line2); border-radius: 6px; }
.invite { display: flex; gap: 16px; align-items: flex-start; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.invite__qr { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.invite__text { flex: 1; min-width: 14rem; }
.invite__text p { margin: 0 0 8px; }
.invite__link { word-break: break-all; }

/* ------------------------------------------------------------ public pages (sign in) */
.page { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1rem; }
.page--centered { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.auth-card { width: 100%; max-width: 24rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 1px 3px rgba(20, 22, 26, 0.06); }
/* Tradeswork brand band. #151b33 is the logo's own background, so the image edge is invisible. */
.auth-card__brand { display: grid; place-items: center; padding: 0.5rem; background: #151b33; border-bottom: 3px solid #18ebee; }
.auth-card__brand img { display: block; }
.auth-card__body { padding: 1.5rem; }
.auth-card__title { margin: 0 0 1rem; font-family: var(--font-cond); font-size: 22px; font-weight: 700; letter-spacing: 0.01em; }
.auth-card__links { margin: 1rem 0 0; font-size: 13px; }

/* ------------------------------------------------------------ mobile (the owner uses it from his truck) */
@media (max-width: 860px) {
  .grid--main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar__brand { padding: 11px 14px 10px; }
  .sidebar__logo { width: 34px; height: 34px; }
  .sidebar__name { font-size: 16px; }
  .sidebar__nav { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 10px; }
  .nav-group { display: flex; gap: 6px; }
  .nav-group + .nav-group { margin-top: 0; }
  .nav-group__label { display: none; }
  .nav-item { min-height: 44px; padding: 11px 14px; }
  .nav-item + .nav-item { margin-top: 0; }
  .sidebar__user { padding: 8px 14px; border-top: 1px solid var(--line); }
  .sidebar__user .avatar { width: 30px; height: 30px; font-size: 12px; }
  .topbar { min-height: auto; padding: 10px 14px; }
  .topbar__h1 { font-size: 19px; }
  .topbar__date { display: none; }
  .content { padding: 14px 12px 34px; }
  .card__head { flex-wrap: wrap; }
  .person-row { flex-wrap: wrap; }
  .chips { max-width: none; justify-content: flex-start; order: 3; width: 100%; padding-left: 46px; }
  .modal__body { padding: 16px; }
}
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi--warn::before { background: var(--warn); }
.kpi--bad::before { background: var(--bad); }
.hours-table__act { text-align: right; }
.hours-table--week .num { text-align: right; white-space: nowrap; }
.hours-week { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.hours-week__nav { display: flex; align-items: center; gap: 8px; }
.punch { display: block; font-size: 11.5px; color: var(--txt2); text-decoration: none; white-space: nowrap; }
a.punch:hover { color: var(--accent-text); text-decoration: underline; }
.punch--open { color: var(--good); font-weight: 600; }
.punch--add { color: var(--mute); font-size: 15px; }
.hours-settings { max-width: 46rem; }
.hours-settings .check .field__hint { display: block; margin-left: 24px; }

/* Address suggestions under an address input (partials/address_field.html). */
.address-field { position: relative; }
.suggestions { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); box-shadow: 0 6px 18px rgb(15 23 42 / 0.08); }
.suggestions__item { display: flex; gap: 6px; align-items: center; width: 100%; padding: 8px; border: 0; background: none; text-align: left; font: inherit; color: inherit; border-radius: 6px; cursor: pointer; }
.suggestions__item:hover, .suggestions__item:focus-visible { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.suggestions__credit { margin: 2px 0 0; text-align: right; }

/* The Live asset board (partials/asset_board.html, map.js): Command Center and the Map page.
   Legend colours are the fixed status colours: on site good, needs attention bad, in yard muted. */
.asset-board { padding: 0; overflow: hidden; }
.asset-board__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.asset-board__title { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.asset-board__title .card__title { border-left: 3px solid var(--accent); padding-left: 10px; margin: 0; }
.asset-board__filters { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-filter { font: inherit; font-size: 11.5px; font-weight: 600; color: var(--txt2); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; min-height: 30px; cursor: pointer; }
.pill-filter[aria-pressed="true"] { color: var(--txt); background: color-mix(in srgb, var(--accent) 11%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.asset-board__body { display: flex; flex-wrap: wrap; }
.asset-board__map { position: relative; flex: 1.6 1 360px; min-width: 0; height: 330px; border-right: 1px solid var(--line); background: #d9dcd6; isolation: isolate; }
.asset-board__canvas { position: absolute; inset: 0; }
.asset-board__fail { padding: 24px; text-align: center; }
.asset-board__legend { position: absolute; left: 10px; bottom: 10px; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; background: rgb(255 255 255 / 0.95); padding: 6px 10px; border-radius: 8px; box-shadow: 0 1px 4px rgb(20 22 26 / 0.2); font-size: 11px; font-weight: 500; color: var(--txt2); pointer-events: none; }
.asset-board__legend span { display: flex; align-items: center; gap: 6px; }
.asset-board__dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.asset-board__dot--out { background: var(--good); }
.asset-board__dot--attention { background: var(--bad); }
.asset-board__dot--yard { background: var(--mute); }
.asset-board__modes { position: absolute; right: 10px; top: 10px; z-index: 1; display: flex; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgb(20 22 26 / 0.2); overflow: hidden; }
.asset-board__modes button { border: 0; font: inherit; font-size: 11.5px; font-weight: 600; padding: 6px 11px; background: #fff; color: var(--txt2); cursor: pointer; }
.asset-board__modes button[aria-pressed="true"] { background: var(--txt); color: #fff; }
.asset-board__detail { flex: 1 1 240px; min-width: 0; padding: 15px; display: grid; align-content: start; gap: 12px; }
.asset-board__place { display: grid; gap: 10px; }
.asset-board__place-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.asset-board__place-title { font-size: 15px; }
.asset-board__facts { display: grid; gap: 2px 0; margin: 0; }
.asset-board__facts dt { font-size: 10.5px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.05em; }
.asset-board__facts dd { margin: 0 0 6px; font-size: 13.5px; }
.asset-board__units { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.asset-board__go { width: 100%; justify-content: center; }
.unit-map__side { display: grid; gap: 16px; }
@media (max-width: 900px) { .unit-map.grid--main { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .asset-board__map { height: 240px; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--line); }
}

/* The day plan (day/plan.html). */
.day-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.day-nav__pick { display: flex; gap: 6px; }
.day-nav__pick input { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.day-plan__summary { margin: 0 0 14px; }
.day-plan { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.day-plan__driver { display: grid; gap: 10px; }
.stop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stop { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stop:last-child { border-bottom: 0; }
.stop--closed { opacity: 0.6; }
.stop__n { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--bg2); color: var(--txt2); }
.stop__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.stop__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stop__note { color: var(--txt2); }
.stop__actions { display: flex; gap: 2px; flex: none; }
.stop__actions form { margin: 0; }

/* Staff & Hours → Schedule (hours/schedule.html, partials/schedule_form.html). */
.schedule-table__today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.schedule-form { display: grid; gap: 8px; }
.schedule-form__day { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 8px; align-items: center; }
.schedule-form__day input { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.schedule-form__day .field__error { grid-column: 2 / -1; }

/* Command Center numbers (home.html): label with its icon, the whole tile a link when it has one. */
.kpi__label--icon { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi__label--icon .icon { color: var(--mute); flex: none; }
a.kpi { display: block; color: inherit; text-decoration: none; }
a.kpi:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
