:root {
  --black: #0a0a0a;
  --black-800: #161616;
  --black-700: #232323;
  --red: #e3192b;
  --red-600: #c8101e;
  --red-400: #ff3b3b;
  --red-50: #fdecee;
  --ink: #121212;
  --muted: #666b72;
  --line: #e2e2e4;
  --grid: #ececee;
  --paper: #f5f5f6;
  --white: #fff;
  --washed: #16a34a;
  --washed-bg: #e3f7ea;
  --unwashed: #c27803;
  --unwashed-bg: #fff4dc;
  --broken: #b91c1c;
  --broken-bg: #fde8e8;
  --off: #64748b;
  --off-bg: #eceff3;
  --radius: 10px;
  --header-h: 76px;
  --side-w: 292px;
  --font: "Barlow", system-ui, sans-serif;
  --display: "Barlow Condensed", "Barlow", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --chart-ink: #3b3b3f;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.spacer { flex: 1; }
.link { background: none; border: 0; padding: 0; color: var(--red); font-weight: 700; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- Brand bar ---------- */
.brandbar {
  display: flex; align-items: center; gap: 12px;
  height: var(--header-h);
  padding: 0 clamp(12px, 2.4vw, 28px);
  background:
    repeating-linear-gradient(-55deg, transparent 0 22px, rgba(255,255,255,.025) 22px 44px),
    linear-gradient(100deg, #000, var(--black-800) 55%, #1f1f1f);
  color: var(--white);
  position: sticky; top: 0; z-index: 40;
  border-bottom: 3px solid var(--red);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; }
.logo { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 2px 6px rgba(227,25,43,.35)); }
.company {
  font-family: var(--display); font-weight: 800; font-style: italic; letter-spacing: .03em; text-transform: uppercase;
  font-size: clamp(24px, 3.4vw, 32px); line-height: 1; margin: 0;
}
.company span { color: var(--red); margin-left: .12em; }
.tagline {
  margin: 4px 0 0; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: #bdbdbd; font-weight: 600;
}
.menu-btn {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; flex: none;
}
.menu-btn span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-btn:hover { background: rgba(255,255,255,.12); }
.menu-btn.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.active span:nth-child(2) { opacity: 0; }
.menu-btn.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  padding: 9px 14px; border-radius: 8px; font-weight: 600; cursor: pointer; white-space: nowrap;
  text-decoration: none; font-size: 14px;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: #bdbdc2; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--red); color: var(--white); border-color: var(--red); }
.btn.primary:hover { background: var(--red-600); border-color: var(--red-600); }
.btn.danger { background: var(--broken); color: #fff; border-color: var(--broken); }
.btn.ghost-light { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.22); }
.btn.ghost-light:hover { background: rgba(255,255,255,.14); }
.btn:disabled { opacity: .55; cursor: progress; }
.icon-btn {
  border: 0; background: transparent; cursor: pointer; width: 32px; height: 32px; border-radius: 8px;
  display: inline-grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--grid); color: var(--ink); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.center { justify-content: center; }

/* ---------- Layout + side menu ---------- */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100dvh - var(--header-h)); }
body.side-collapsed .layout { grid-template-columns: 0 minmax(0, 1fr); }
body.side-collapsed .sidebar { visibility: hidden; }
.sidebar {
  position: sticky; top: var(--header-h); height: calc(100dvh - var(--header-h));
  background: var(--black); color: #e8e8e8; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; border-right: 1px solid #000;
}
.side-nav { display: grid; gap: 2px; padding: 14px 12px; border-bottom: 1px solid #262626; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; border: 0; background: none;
  color: #d6d6d6; text-decoration: none; font-weight: 600; cursor: pointer; text-align: left; font-size: 15px;
}
.side-nav svg { width: 20px; height: 20px; flex: none; color: #8a8a8a; }
.side-nav a:hover, .side-nav button:hover { background: #1b1b1b; color: #fff; }
.side-nav a.active { background: var(--red); color: #fff; }
.side-nav a.active svg { color: #fff; }
.side-sites { padding: 16px 12px 28px; display: grid; gap: 10px; align-content: start; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.side-head h2 { margin: 0; font-family: var(--display); font-size: 15px; letter-spacing: .18em; text-transform: uppercase; color: #fff; }
.count-pill { font-family: var(--mono); font-size: 12px; background: #262626; color: #fff; padding: 2px 8px; border-radius: 99px; }
.side-hint { margin: -4px 4px 0; font-size: 12px; color: #8a8a8a; }
.sidebar input[type=search] { background: #161616; border-color: #2c2c2c; color: #fff; padding: 9px 12px; }
.sidebar input[type=search]::placeholder { color: #777; }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.side-site {
  display: grid; gap: 6px; padding: 11px 12px; border-radius: 10px; text-decoration: none; color: inherit;
  background: #141414; border: 1px solid #232323; border-left: 3px solid #333;
  transition: background .15s, border-color .15s;
}
.side-site:hover { background: #1d1d1d; border-left-color: var(--red); }
.side-site.active { background: #1f0e10; border-color: #3a1519; border-left-color: var(--red); }
.side-site-name { font-weight: 700; color: #fff; line-height: 1.2; }
.side-site-sub { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #9a9a9a; }
.side-site-sub b { font-family: var(--mono); color: #fff; font-weight: 700; }
.side-empty { color: #8a8a8a; font-size: 13px; padding: 10px 4px; line-height: 1.6; }
.side-backdrop { position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0,0,0,.55); z-index: 29; backdrop-filter: blur(2px); }
.mini-progress { display: flex; height: 5px; border-radius: 99px; overflow: hidden; background: #3a3a3a; }
.mini-progress i { display: block; height: 100%; }

@media (max-width: 1023px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0; height: auto; width: min(320px, 86vw); z-index: 30;
    transform: translateX(-100%); transition: transform .22s ease-out; box-shadow: 10px 0 40px rgba(0,0,0,.35);
  }
  .sidebar.open { transform: none; }
  body.side-collapsed .sidebar { visibility: visible; }
}
@media (min-width: 1024px) { .side-backdrop { display: none; } }

main { padding: 20px clamp(14px, 2.6vw, 32px) 60px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ---------- Common bits ---------- */
.eyebrow { margin: 0; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--red); font-weight: 700; }
.eyebrow.light { color: var(--red-400); }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
.page-head h2 { font-family: var(--display); font-size: clamp(28px, 3.4vw, 40px); margin: 2px 0 4px; line-height: 1; text-transform: uppercase; }
.page-head p { margin: 0; }
.page-head .field { min-width: 240px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 28px 0 12px; }
.section-head h3 { font-family: var(--display); font-size: 24px; margin: 0; text-transform: uppercase; letter-spacing: .02em; }

/* ---------- Home ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; color: #fff;
  background:
    radial-gradient(600px 260px at 88% 40%, rgba(227,25,43,.45), transparent 70%),
    linear-gradient(120deg, #000 0%, #151515 60%, #1d1d1d 100%);
  padding: clamp(22px, 4vw, 44px); display: flex; align-items: center; gap: 28px;
  border: 1px solid #000;
}
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: repeating-linear-gradient(90deg, var(--red) 0 40px, #fff 40px 52px);
}
.hero-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.hero h2 {
  font-family: var(--display); font-weight: 800; text-transform: uppercase; margin: 6px 0 10px;
  font-size: clamp(32px, 5.4vw, 60px); line-height: .95; letter-spacing: .01em;
}
.wordmark { font-style: italic; white-space: nowrap; }
.wordmark b { color: var(--red); margin-left: .1em; }
.hero-sub { margin: 0 0 22px; color: #cfcfcf; font-size: clamp(15px, 1.6vw, 18px); max-width: 560px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 640px; }
.hero-stats a {
  position: relative; display: block; color: inherit; text-decoration: none;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; padding: 12px 14px;
  transition: background .15s, border-color .15s, transform .15s;
}
.hero-stats a:hover, .hero-stats a:focus-visible { background: rgba(227,25,43,.22); border-color: var(--red); transform: translateY(-2px); outline: none; }
.hero-stats i { position: absolute; top: 10px; right: 12px; font-style: normal; color: #8a8a8a; transition: transform .15s, color .15s; }
.hero-stats a:hover i { color: #fff; transform: translateX(3px); }
.hero-stats b { display: block; font-family: var(--mono); font-size: clamp(20px, 2.6vw, 28px); line-height: 1.1; }
.hero-stats span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #a8a8a8; font-weight: 700; }
.hero-logo { width: clamp(130px, 20vw, 230px); flex: none; position: relative; z-index: 1; filter: drop-shadow(0 12px 30px rgba(227,25,43,.45)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-1.5deg); } }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 18px; }
.tile {
  position: relative; display: grid; gap: 6px; align-content: start; text-align: left; cursor: pointer;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 20px;
  text-decoration: none; color: inherit; overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--red); transform: scaleY(0); transform-origin: top; transition: transform .2s; }
.tile:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.1); border-color: #cfcfd3; }
.tile:hover::before { transform: none; }
.tile-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--black); color: #fff; display: grid; place-items: center; margin-bottom: 6px; }
.tile-icon svg { width: 26px; height: 26px; }
.tile:hover .tile-icon { background: var(--red); }
.tile-title { font-family: var(--display); font-weight: 800; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.tile-sub { color: var(--muted); font-size: 14px; }

.site-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.site-card {
  display: grid; gap: 10px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.site-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); border-color: var(--red); }
.site-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.site-card-name { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.05; text-transform: uppercase; }
.site-card-pct { font-family: var(--mono); font-weight: 700; font-size: 22px; color: var(--red); }
.site-card-pct small { font-size: 13px; }
.site-card-meta { font-size: 13px; color: var(--muted); line-height: 1.5; }
.site-card .mini-progress { background: var(--grid); height: 7px; }
.site-card-foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.site-card-foot .go { color: var(--ink); font-weight: 700; }
.site-card:hover .go { color: var(--red); }

/* ---------- Controls ---------- */
.controls {
  display: flex; flex-wrap: wrap; gap: 12px 18px; padding: 14px 16px; margin-bottom: 16px;
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.grow { flex: 1 1 280px; }
.field > span { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field > span em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 500; }
.field small { color: var(--muted); font-size: 12px; }
input[type=text], input[type=search], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--white);
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(227,25,43,.16); }
#onsiteName.needs { border-color: var(--broken); box-shadow: 0 0 0 3px rgba(185,28,28,.18); animation: nudge .3s; }
@keyframes nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
#projectSelect { font-weight: 600; }

/* ---------- Empty ---------- */
.empty { display: grid; place-items: center; padding: 50px 0; }
.empty-card { background: var(--white); border: 1px dashed #c4c4c8; border-radius: 14px; padding: 32px; text-align: center; max-width: 480px; }
.empty-card.inline { max-width: none; grid-column: 1 / -1; }
.empty-card img { margin-bottom: 8px; }
.empty-card h2 { font-family: var(--display); font-size: 28px; margin: 0 0 8px; text-transform: uppercase; }
.empty-card p { color: var(--muted); margin: 0 0 18px; }

/* ---------- Summary ---------- */
.summary { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; }
.summary-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.summary h2 { font-family: var(--display); font-size: clamp(26px, 3vw, 36px); margin: 2px 0 4px; line-height: 1.05; text-transform: uppercase; }
.meta { margin: 0; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
.meta span:empty { display: none; }
.total { text-align: right; flex: none; }
.total-num { display: block; font-family: var(--mono); font-weight: 700; font-size: 40px; line-height: 1; color: var(--black); }
.total-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.progress { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--grid); margin: 16px 0 12px; }
.progress i { display: block; height: 100%; transition: width .4s; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; font-weight: 600; font-size: 13px;
  border: 1px solid transparent; cursor: pointer; background: none;
}
.chip b { font-family: var(--mono); }
.chip.active { outline: 2px solid currentColor; outline-offset: 1px; }

.s-washed { color: var(--washed); background: var(--washed-bg); }
.s-unwashed { color: var(--unwashed); background: var(--unwashed-bg); }
.s-broken { color: var(--broken); background: var(--broken-bg); }
.s-not_on_site { color: var(--off); background: var(--off-bg); }

/* ---------- Sheet ---------- */
.sheet-wrap { background: var(--white); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.sheet-toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); background: #fafafa; align-items: center; }
.sheet-toolbar input { max-width: 260px; }
.sheet-toolbar select { max-width: 180px; }
.sheet-scroll { overflow: auto; max-height: 70vh; }
.sheet { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; font-size: 14px; }
.sheet th {
  position: sticky; top: 0; z-index: 2; background: var(--black); text-align: left;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #fff; font-weight: 700;
  padding: 11px 10px; border-bottom: 2px solid var(--red); border-right: 1px solid #2a2a2a;
}
.sheet td { padding: 6px 10px; border-bottom: 1px solid var(--grid); border-right: 1px solid var(--grid); vertical-align: middle; }
.sheet tbody tr:nth-child(even) td { background: #fbfbfb; }
.sheet tbody tr:hover td { background: #fff5f6; }
.sheet tbody tr.flash td { animation: flash 1s; }
@keyframes flash { from { background: #ffd9dd; } }
.c-idx { width: 48px; text-align: center !important; color: var(--muted); font-family: var(--mono); font-size: 12px; }
td.c-idx { text-align: center; }
.c-type { width: 200px; }
.type-select { padding: 6px 28px 6px 10px !important; font-weight: 600; font-size: 13px; border-color: transparent !important; background-color: transparent; cursor: pointer; }
.type-select:hover { border-color: var(--line) !important; }
.type-select:focus { border-color: var(--red) !important; background-color: #fff; }
.type-select.empty { color: var(--muted); font-weight: 500; font-style: italic; }
.c-unit { width: 160px; }
.c-status { width: 160px; }
.c-photos { width: 220px; }
.c-upd { width: 170px; }
.c-del { width: 44px; }
.cell-input {
  border: 1px solid transparent !important; background: transparent !important; padding: 6px 8px !important; border-radius: 6px;
}
.cell-input:hover { border-color: var(--line) !important; }
.cell-input:focus { background: #fff !important; border-color: var(--red) !important; }
.unit-input { font-family: var(--mono); font-weight: 700; }
.status-select {
  appearance: none; -webkit-appearance: none; border: 0 !important; border-radius: 99px; padding: 6px 28px 6px 12px !important;
  font-weight: 700; font-size: 13px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23333'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 10px center !important;
}
.status-select.s-washed { background-color: var(--washed-bg); }
.status-select.s-unwashed { background-color: var(--unwashed-bg); }
.status-select.s-broken { background-color: var(--broken-bg); }
.status-select.s-not_on_site { background-color: var(--off-bg); }
.photos-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.thumb { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; cursor: zoom-in; border: 1px solid var(--line); background: var(--grid); }
.cam-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 10px; border-radius: 6px;
  border: 1px dashed #b0b0b6; background: #f8f8f8; color: var(--black); font-weight: 700; font-size: 12px; cursor: pointer;
}
.cam-btn:hover { border-style: solid; border-color: var(--red); background: var(--red-50); color: var(--red-600); }
.cam-btn.small { padding: 0 8px; }
.cam-btn.busy { opacity: .6; pointer-events: none; }
.upd { font-size: 12px; color: var(--muted); line-height: 1.3; }
.upd b { color: var(--ink); font-weight: 600; }
.sheet tfoot td { background: #fafafa; border-bottom: 0; }
.add-units { display: flex; gap: 8px; }
.add-units input { max-width: 560px; }
.no-rows td { text-align: center; color: var(--muted); padding: 28px !important; }

/* Sheets list */
.sheets-table { min-width: 900px; }
.sheets-table td { padding: 10px; }
.sheets-table .num { text-align: right; font-family: var(--mono); width: 90px; }
.sheets-table th.num { font-family: var(--font); }
.sheet-link { font-weight: 700; color: var(--ink); text-decoration: none; }
.sheet-link:hover { color: var(--red); }
.sheets-table .sub { font-size: 12px; color: var(--muted); }
.prog-cell { min-width: 160px; white-space: nowrap; }
.prog-cell .mini-progress { display: inline-flex; width: calc(100% - 46px); vertical-align: middle; background: var(--grid); height: 7px; }
.prog-cell span { display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 700; width: 40px; text-align: right; }
.sheets-table .actions { white-space: nowrap; text-align: right; }
.sheets-table .actions .btn { padding: 7px 11px; font-size: 13px; }

/* ---------- Gallery ---------- */
.gallery { display: grid; gap: 22px; }
.gallery-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid var(--black); }
.gallery-head h3 { margin: 0; font-family: var(--display); font-size: 22px; text-transform: uppercase; }
.gallery-head .link { margin-left: auto; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.g-item {
  position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: zoom-in; background: var(--black);
  aspect-ratio: 1; text-align: left;
}
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s, opacity .3s; }
.g-item:hover img { transform: scale(1.05); opacity: .85; }
.g-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; color: #fff; font-size: 12px; line-height: 1.35;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
}
.g-cap b { font-family: var(--mono); font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: 6px; background: currentColor; vertical-align: middle; }
.dot.s-washed { color: #4ade80; } .dot.s-unwashed { color: #fbbf24; } .dot.s-broken { color: var(--red-400); } .dot.s-not_on_site { color: #cbd5e1; }

/* ---------- Notes ---------- */
.notes { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.notes h3 { font-family: var(--display); font-size: 22px; margin: 0 0 12px; text-transform: uppercase; }
.note-form { display: flex; gap: 10px; align-items: flex-end; }
.note-form textarea { resize: vertical; }
.notes-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.notes-list li { border-left: 3px solid var(--red); background: #f8f8f8; padding: 10px 14px; border-radius: 0 8px 8px 0; position: relative; }
.notes-list .note-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.notes-list .note-meta b { color: var(--black); }
.notes-list p { margin: 0; white-space: pre-wrap; }
.notes-list .icon-btn { position: absolute; top: 6px; right: 6px; }

/* ---------- Drawer ---------- */
dialog { border: 0; padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(520px, 100vw);
  background: var(--white); display: none; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.25);
}
.drawer[open] { display: flex; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(30px); opacity: .5; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; background: var(--black); color: #fff; border-bottom: 3px solid var(--red); }
.drawer-head h2 { font-family: var(--display); margin: 0; font-size: 26px; text-transform: uppercase; }
.drawer-head .icon-btn { color: #fff; }
.drawer-head .icon-btn:hover { background: #262626; }
.tabs { display: flex; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 10px 12px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; }
.tab.active { color: var(--black); border-bottom-color: var(--red); }
.tab-panel { padding: 18px 20px 40px; overflow: auto; flex: 1; }
.stack { display: grid; gap: 12px; }
.stack h3, .list-title { font-family: var(--display); font-size: 20px; margin: 0; text-transform: uppercase; }
.list-title { margin: 28px 0 10px; }
.manage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.manage-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.manage-list .row-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.manage-list .name { font-weight: 700; }
.manage-list .sub { font-size: 13px; color: var(--muted); }
.manage-list select { padding: 7px 10px; font-size: 14px; }

/* ---------- Map / directions links ---------- */
.map-link { display: inline-flex; align-items: flex-start; gap: 4px; color: inherit; text-decoration: underline; text-decoration-color: rgba(227,25,43,.45); text-underline-offset: 3px; cursor: pointer; }
.map-link svg { color: var(--red); flex: none; margin-top: .2em; }
.map-link:hover, .map-link:focus-visible { color: var(--red); text-decoration-color: var(--red); outline: none; }
.directions-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 10px; border-radius: 99px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700; text-decoration: none; vertical-align: middle;
}
.directions-btn:hover { background: var(--red-600); }

/* ---------- Edit site modal ---------- */
.modal { width: min(460px, 94vw); border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal form { padding: 0 20px 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin: 0 -20px 4px; padding: 14px 20px; background: var(--black); color: #fff; border-bottom: 3px solid var(--red); }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 22px; text-transform: uppercase; }
.modal-head .icon-btn { color: #fff; }
.modal-head .icon-btn:hover { background: #262626; }
.row.end { justify-content: flex-end; }
.small-btn { padding: 6px 10px; font-size: 13px; }
.total .small-btn { margin-bottom: 10px; }
.row-actions { display: inline-flex; align-items: center; gap: 4px; flex: none; }

/* ---------- Viewer ---------- */
.viewer { background: #000; max-width: min(960px, 96vw); width: 100%; border-radius: 12px; overflow: hidden; }
.viewer img { display: block; width: 100%; max-height: 75vh; object-fit: contain; background: #000; }
.viewer-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; background: var(--black-800); color: #fff; font-size: 13px; border-top: 2px solid var(--red); }

/* ---------- Category overview pages ---------- */
.stats-tabs { display: flex; gap: 4px; overflow-x: auto; margin: -4px 0 18px; border-bottom: 1px solid var(--line); }
.stats-tabs a {
  padding: 10px 14px; font-weight: 700; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.stats-tabs a:hover { color: var(--ink); }
.stats-tabs a.active { color: var(--black); border-bottom-color: var(--red); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.kpi.accent { background: var(--black); color: #fff; border-color: var(--black); box-shadow: inset 0 -4px 0 var(--red); }
.kpi-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.kpi.accent .kpi-label, .kpi.accent .kpi-sub { color: #b5b5b5; }
.kpi b { font-family: var(--mono); font-size: 30px; line-height: 1.05; }
.kpi-sub { font-size: 13px; color: var(--muted); }
.panels { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.panels > .panel:nth-child(n+2) { grid-column: 2; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; min-width: 0; margin-bottom: 14px; }
.panels .panel { margin-bottom: 0; }
.panel.add { border-top: 4px solid var(--red); grid-column: 1; grid-row: 1 / span 3; position: sticky; top: calc(var(--header-h) + 14px); }
.panel-title { font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 12px; }
.panel-title small { font-family: var(--font); font-size: 12px; letter-spacing: .04em; color: var(--muted); font-weight: 600; text-transform: none; margin-left: 6px; }
.footnote { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; padding: 2px 0; border-radius: 6px; }
.hbar:hover { background: #fafafa; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar-label a { color: inherit; text-decoration: none; }
.hbar-label a:hover { color: var(--red); }
.hbar-track { height: 12px; background: var(--grid); border-radius: 4px; overflow: hidden; display: flex; }
.hbar-track > i { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; transition: width .4s; }
.hbar-track.stack { gap: 2px; background: var(--grid); }
.hbar-track.stack > i { border-radius: 0; min-width: 3px; }
.hbar-track.stack > i:last-child { border-radius: 0 4px 4px 0; }
.hbar-val { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink); min-width: 44px; text-align: right; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i, .split-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.split { display: flex; gap: 2px; height: 28px; border-radius: 6px; overflow: hidden; }
.split i { display: block; min-width: 4px; }
.split-legend { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.split-legend li { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.split-legend b { font-family: var(--mono); }
.split-legend em { font-style: normal; color: var(--muted); font-family: var(--mono); font-size: 12px; }

.cols { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 190px; align-items: end; }
.col { display: grid; grid-template-rows: 16px 1fr 18px; height: 100%; gap: 2px; text-align: center; cursor: default; }
.col:hover .col-bar i { background: var(--red); }
.col-n { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--ink); }
.col-bar { display: flex; align-items: flex-end; border-bottom: 1px solid #cfcfd3; }
.col-bar i { display: block; width: 100%; background: var(--washed-chart, #15803d); border-radius: 4px 4px 0 0; min-height: 0; transition: height .4s, background .15s; }
.col-x { font-size: 10px; color: var(--muted); white-space: nowrap; }

.chart-tip {
  position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none; max-width: 280px;
  background: var(--black); color: #fff; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.table-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.table-tools input { max-width: 260px; }
.table-tools select { max-width: 200px; }
.table-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.table-scroll.tall { max-height: 520px; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; min-width: 720px; }
.data-table th {
  position: sticky; top: 0; background: var(--black); color: #fff; text-align: left; font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; padding: 10px; border-bottom: 2px solid var(--red); white-space: nowrap;
}
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
.data-table tbody tr:nth-child(even) td { background: #fbfbfb; }
.data-table tbody tr:hover td { background: #fff5f6; }
.data-table .num { text-align: right; font-family: var(--mono); }
.data-table th.num { font-family: var(--font); }
.data-table .actions { text-align: right; }
.data-table .actions .btn { padding: 6px 10px; font-size: 13px; }
.mono { font-family: var(--mono); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }

.check-all { font-weight: 700; font-size: 14px; display: flex; gap: 8px; align-items: center; }
.checklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 300px; overflow: auto; padding: 2px; }
.check { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; }
.check:has(input:checked) { border-color: var(--washed); background: var(--washed-bg); }
.check .pill { margin-left: auto; padding: 2px 7px; font-size: 10px; }
.check input, .check-all input { accent-color: var(--washed); width: 16px; height: 16px; }

@media (max-width: 1100px) {
  .panels { grid-template-columns: minmax(0, 1fr); }
  .panels > .panel:nth-child(n) { grid-column: auto; }
  .panel.add { grid-row: auto; position: static; }
}
@media (max-width: 640px) {
  .two { grid-template-columns: 1fr; }
  .kpi b { font-size: 24px; }
  .hbar { grid-template-columns: minmax(70px, 38%) 1fr auto; }
  .cols { height: 150px; }
  .col-x { font-size: 9px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--black); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: .2s; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 90vw; border-left: 4px solid var(--red);
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.error { background: var(--broken); border-left-color: #fff; }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hero { flex-direction: column-reverse; align-items: flex-start; }
  .hero-logo { width: 110px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  :root { --header-h: 66px; }
  .hide-sm { display: none; }
  .logo { width: 42px; height: 42px; }
  .tagline { letter-spacing: .16em; font-size: 10px; }
  .summary-head { flex-direction: column; }
  .total { text-align: left; }
  .note-form, .add-units { flex-direction: column; align-items: stretch; }
  .sheet-toolbar input, .sheet-toolbar select { max-width: none; flex: 1 1 140px; }
  .tile { padding: 14px; }
  .tile-title { font-size: 18px; }
  .tile-sub { font-size: 13px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .hide-xs { display: none; }
  .tagline { display: none; }
}

/* ---------- Time clock ---------- */
.summary-head > div:first-child { flex: 1; min-width: 0; }
.clock {
  display: flex; align-items: center; gap: 16px; flex: none;
  padding: 10px 18px 10px 10px; border-radius: 999px; background: #f6faf7; border: 1px solid #d5eadb;
  transition: background .3s, border-color .3s;
}
.clock.running { background: #fff3f4; border-color: #f5c9ce; }
.clock-btn {
  --c: #16a34a; --c2: #22c55e; --glow: 34, 197, 94;
  position: relative; width: 104px; height: 104px; border-radius: 50%; border: 4px solid #fff; cursor: pointer; flex: none;
  background: radial-gradient(circle at 35% 30%, var(--c2), var(--c) 70%);
  color: #fff; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 0 0 3px var(--c), 0 0 22px 6px rgba(var(--glow), .55), inset 0 -6px 12px rgba(0,0,0,.18), inset 0 6px 10px rgba(255,255,255,.25);
  animation: clockGlow 2.2s ease-in-out infinite;
  transition: transform .1s, background .3s;
}
.clock-btn span { position: relative; text-shadow: 0 2px 3px rgba(0,0,0,.3); }
.clock-btn:hover { transform: scale(1.04); }
.clock-btn:active { transform: scale(.96); }
.clock-btn:focus-visible { outline: 3px solid var(--black); outline-offset: 4px; }
.clock-btn:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .6; animation: none; }
.clock-btn.running {
  --c: #b91c1c; --c2: #ef4444; --glow: 227, 25, 43;
  animation-duration: 1.2s;
}
/* Inlay look for the STOP state */
.clock-btn.running span {
  color: #7f1010; text-shadow: 0 1px 0 rgba(255,255,255,.45), 0 -1px 0 rgba(0,0,0,.35);
}
@keyframes clockGlow {
  50% { box-shadow: 0 0 0 3px var(--c), 0 0 34px 12px rgba(var(--glow), .75), inset 0 -6px 12px rgba(0,0,0,.18), inset 0 6px 10px rgba(255,255,255,.25); }
}
@media (prefers-reduced-motion: reduce) { .clock-btn { animation: none; } }
.clock-info { display: grid; gap: 4px; min-width: 170px; }
.clock-time { font-family: var(--mono); font-size: 34px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--black); }
.clock.running .clock-time { color: var(--broken); }
.clock-sub { font-size: 12px; color: var(--muted); }
.clock-sub a { color: var(--red); font-weight: 700; }
.clock-who { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.clock-who select { padding: 5px 8px; font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); max-width: 180px; }

.site-time { margin-top: 14px; }
.site-time:empty { display: none; }
.site-time-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; margin-bottom: 8px; }
.site-time-head b { font-family: var(--display); font-size: 16px; text-transform: uppercase; letter-spacing: .04em; }
.site-time-head span { color: var(--muted); }
.site-time-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.st-person { display: grid; gap: 2px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: #fafafa; }
.st-person.live { border-color: #86d39d; background: var(--washed-bg); }
.st-name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.st-meta { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.st-person.live .st-meta { color: var(--washed); font-weight: 700; }
.st-nums { font-size: 12px; color: var(--muted); }
.st-nums b { color: var(--ink); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; display: inline-block; box-shadow: 0 0 0 0 rgba(22,163,74,.6); animation: livePulse 1.6s infinite; flex: none; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.live-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--washed); white-space: nowrap; }
.live-tag a { color: inherit; }

/* Crew tick boxes */
.crew-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 220px; overflow: auto; padding: 2px; }
.crew-checks .check:has(input:checked) { border-color: var(--red); background: var(--red-50); }
.crew-checks .check input { accent-color: var(--red); }
.muted.small { font-size: 13px; margin: 0; }

/* Week navigation + timesheets */
.week-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; }
.week-nav .btn[aria-label] { min-width: 40px; font-size: 18px; padding: 6px 10px; }
.week-label { display: grid; line-height: 1.15; padding: 0 6px; }
.week-label b { font-family: var(--display); font-size: 18px; text-transform: uppercase; }
.week-label span { font-size: 13px; color: var(--muted); }
.timesheet { min-width: 640px; }
.timesheet th small { font-weight: 500; opacity: .75; }
.timesheet td.zero { color: #b5b5b9; }
.timesheet tfoot td { background: #f3f3f4; border-top: 2px solid var(--black); }
.sheet-link.light { color: #fff; }
.sheet-link.light:hover { color: var(--red-400); }

@media (max-width: 900px) {
  .summary-head { flex-wrap: wrap; }
  .clock { order: 3; width: 100%; border-radius: 18px; }
}
@media (max-width: 640px) {
  .clock-btn { width: 88px; height: 88px; font-size: 22px; }
  .clock-time { font-size: 28px; }
  .clock-info { min-width: 0; }
}

/* ---------- Employee profile ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: var(--black); color: #fff; font-weight: 800; font-family: var(--display); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); vertical-align: middle; }
.emp-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 700; text-decoration: none; }
.emp-link:hover span { color: var(--red); text-decoration: underline; }
.emp-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.crew-name { color: inherit; font-weight: 600; }
.crew-name:hover { color: var(--red); }
.profile-card { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.headshot-wrap { display: grid; gap: 10px; justify-items: center; }
.headshot { width: 148px; height: 148px; border-radius: 50%; object-fit: cover; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--red), 0 10px 26px rgba(0,0,0,.18); background: var(--grid); }
.headshot.initials { display: grid; place-items: center; background: var(--black); color: #fff; font-family: var(--display); font-weight: 800; font-size: 54px; }
.headshot-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 240px; }
.profile-info { flex: 1; min-width: 260px; display: grid; gap: 12px; }
.profile-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.profile-form .field { flex: 1 1 180px; }
.profile-status { font-size: 14px; }
.profile-sites { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.chip-link { display: inline-block; padding: 4px 12px; border-radius: 99px; background: var(--black); color: #fff; text-decoration: none; font-size: 13px; font-weight: 600; }
.chip-link:hover { background: var(--red); }
.panels.two-col > .panel:nth-child(n) { grid-column: auto; grid-row: auto; }
.panels.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .panels.two-col { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .headshot { width: 120px; height: 120px; } .profile-card { justify-content: center; } }

/* ---------- Assets ---------- */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.vehicle-card { display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; background: var(--white); transition: transform .15s, box-shadow .15s, border-color .15s; }
.vehicle-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); border-color: var(--red); }
.vehicle-img { aspect-ratio: 16 / 9; background: var(--black); display: grid; place-items: center; color: #555; }
.vehicle-img img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-img svg { width: 64px; height: 64px; }
.vehicle-body { display: grid; gap: 6px; padding: 12px 14px 14px; justify-items: start; }
.vehicle-name { font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: uppercase; line-height: 1.05; }
.plate { font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: .08em; padding: 2px 8px; border: 2px solid var(--black); border-radius: 5px; background: #fff; }
.plate.big { font-size: 18px; padding: 4px 12px; }
.due { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--off-bg); color: var(--off); }
.due b { font-weight: 700; margin-right: 2px; }
.due-ok { background: var(--washed-bg); color: var(--washed); }
.due-soon { background: var(--unwashed-bg); color: #8a5300; }
.due-overdue { background: var(--broken-bg); color: var(--broken); }
.muted.small, small.muted { font-size: 12px; }
.vehicle-photo { width: 260px; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; border: 3px solid var(--black); box-shadow: 0 10px 26px rgba(0,0,0,.18); background: var(--black); }
.vehicle-photo.placeholder { display: grid; place-items: center; color: #555; }
.vehicle-photo.placeholder svg { width: 90px; height: 90px; }
.vehicle-profile .row { align-items: center; }
.gas-card { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 14px; border-radius: 10px; background: #f6f6f7; border: 1px dashed #c4c4c8; font-size: 14px; }
.gas-label { font-weight: 700; }
.gas-pin b { letter-spacing: .12em; }
.edit-vehicle summary { list-style: none; display: inline-flex; }
.edit-vehicle summary::-webkit-details-marker { display: none; }
.edit-vehicle[open] summary { margin-bottom: 10px; }
.vehicle-notes { margin: 0; white-space: pre-wrap; color: var(--muted); }
.supplies-panel .panel-title { margin: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field.inline input { width: 170px; padding: 7px 10px; }
.warn { color: var(--broken); }
.supply-group { margin: 16px 0 8px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.supply-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.supply { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "name step del" "level level level"; align-items: center; gap: 6px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.supply.low { border-color: #f1b3b9; background: #fff6f7; }
.supply-name { grid-area: name; display: grid; min-width: 0; }
.supply-name b { font-size: 14px; }
.supply-name small { color: var(--muted); font-size: 11px; }
.supply .stepper { grid-area: step; }
.supply .icon-btn { grid-area: del; width: 28px; height: 28px; }
.supply .level { grid-area: level; height: 8px; border-radius: 99px; background: var(--grid); overflow: hidden; display: block; }
.supply .level i { display: block; height: 100%; background: var(--black); border-radius: 99px; transition: width .3s; }
.supply.low .level i { background: var(--red); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.step { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #f3f3f4; font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer; color: var(--ink); }
.step:hover { background: var(--black); color: #fff; border-color: var(--black); }
.step.add { background: var(--black); color: #fff; border-color: var(--black); }
.step.add:hover { background: var(--red); border-color: var(--red); }
.step:disabled { opacity: .5; }
.qty { width: 64px !important; text-align: center; font-family: var(--mono); font-weight: 700; padding: 7px 4px !important; }
.supply.low .qty { color: var(--broken); }
.unit { font-size: 12px; color: var(--muted); min-width: 22px; }
.add-supply { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.add-supply input[name=name] { flex: 1 1 240px; }
.add-supply input[name=quantity] { width: 90px; }
.add-supply select { width: auto; }
@media (max-width: 640px) { .supply-list { grid-template-columns: 1fr; } .field.inline { width: 100%; } .field.inline input { flex: 1; width: auto; } }

/* ---------- Restock breakdown ---------- */
button.kpi { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.kpi.clickable { border-color: #f1b3b9; }
.kpi.clickable:hover, .kpi.clickable.active { border-color: var(--red); box-shadow: 0 6px 18px rgba(227,25,43,.15); transform: translateY(-1px); }
.kpi.clickable .kpi-label i { font-style: normal; color: var(--red); font-size: 10px; }
.restock-panel { border-top: 4px solid var(--red); }
.restock-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.restock-card { border: 1px solid #f1b3b9; background: #fff6f7; border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; align-content: start; }
.restock-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.restock-head .sheet-link { font-weight: 800; font-size: 16px; }
.restock-head .count-pill { margin-left: auto; background: var(--red); }
.restock-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.restock-card li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0; border-bottom: 1px dashed #f1c6cb; }
.restock-card li b { font-family: var(--mono); color: var(--broken); white-space: nowrap; }
.restock-card .btn { justify-self: start; }

/* ---------- Logins & roles ---------- */
.side-nav { border-bottom: 0; padding-top: 18px; gap: 4px; }
.side-user {
  margin-top: auto; padding: 14px 16px 20px; border-top: 1px solid #262626;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.side-user[hidden] { display: none; }
.side-user-who { display: grid; min-width: 0; }
.side-user-who b { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-who span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: #8a8a8a; font-weight: 600; }
.side-user .btn { background: #1b1b1b; border-color: #333; color: #e8e8e8; }

body.role-employee [data-admin] { display: none !important; }
body.auth-loading .brandbar, body.auth-loading .layout,
body.auth-required .brandbar, body.auth-required .layout { display: none; }
.warn-text { color: var(--unwashed); font-weight: 600; }

.auth {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(circle at 20% 0%, rgba(227,25,43,.22), transparent 55%), linear-gradient(160deg, #000, #1a1a1a);
}
.auth[hidden] { display: none; }
.auth-card {
  width: min(420px, 100%); background: var(--white); border-radius: 16px; padding: 28px 26px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); border-top: 4px solid var(--red);
}
.auth-card [hidden] { display: none !important; }
.auth-card h2 { font-family: var(--display); text-transform: uppercase; font-size: 26px; margin: 0 0 8px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand .tagline { color: var(--muted); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.auth-tabs button {
  border: 0; background: none; padding: 10px; border-radius: 8px; font: 700 15px var(--font); color: var(--muted); cursor: pointer;
}
.auth-tabs button.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.auth-tabs.hide { display: none; }
.btn.big { padding: 13px 16px; font-size: 16px; justify-content: center; }
.auth-msg { min-height: 1.4em; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.auth-msg.error { color: var(--broken); font-weight: 600; }
.auth .link { justify-self: center; }

/* Password show/hide toggle */
input[type=email], input[type=password] {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--white);
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 70px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  border: 0; background: var(--paper); color: var(--ink); border-radius: 6px;
  padding: 6px 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.pw-toggle:hover { background: var(--line); }
.pw-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }

/* ============ Fleet page ============ */
.page-head .week-nav { margin: 0; padding: 4px 8px; }
.fleet-notice { background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--off); border-radius: 10px; padding: 10px 14px; margin: 0 0 10px; font-size: 14px; }
.fleet-notice.warn { border-left-color: var(--broken); background: var(--broken-bg); }
.fleet-notice code { font-family: var(--mono); font-size: 12px; background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 4px; }
.fleet-map-panel { padding: 0; overflow: hidden; position: relative; }
.fleet-map { height: min(62vh, 540px); min-height: 320px; background: #e8eaed; z-index: 0; }
.fleet-map.placing { cursor: crosshair; }
.fleet-map.placing .leaflet-grab { cursor: crosshair; }
.fleet-map-note { position: absolute; z-index: 500; top: 10px; left: 50%; transform: translateX(-50%); background: var(--black); color: #fff; padding: 8px 10px 8px 14px; border-radius: 99px; display: flex; gap: 10px; align-items: center; font-size: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.25); max-width: calc(100% - 20px); }
.fleet-map-note[hidden] { display: none; }
.fleet-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.fleet-legend span { display: inline-flex; align-items: center; gap: 6px; }
.fm-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.fm-ring { width: 14px; height: 14px; border-radius: 50%; border: 2px dashed var(--red); background: rgba(227,25,43,.08); display: inline-block; }
.fm-onsite { background: var(--red); }
.fm-moving { background: var(--washed); }
.fm-parked { background: #2f3a4a; }
.fm-offline { background: #9aa3ae; }

.fm-marker { background: none; border: 0; }
.fm-pin { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.fm-pin svg { width: 18px; height: 18px; }
.fm-pin.fm-onsite { background: var(--red); }
.fm-pin.fm-moving { background: var(--washed); }
.fm-pin.fm-parked { background: #2f3a4a; }
.fm-pin.fm-offline { background: #9aa3ae; }
.fm-heading { position: absolute; inset: -9px; pointer-events: none; }
.fm-heading::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 8px solid var(--washed); border-top: 0; }
.fm-label { position: absolute; left: 50%; top: 36px; transform: translateX(-50%); white-space: nowrap; background: rgba(10,10,10,.86); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; pointer-events: none; }
.fm-popup { display: grid; gap: 4px; font-family: var(--font); font-size: 13px; min-width: 190px; }
.fm-popup b { font-size: 15px; }
.fm-popup-links { display: flex; gap: 12px; margin-top: 4px; }
.fm-popup-links a { color: var(--red-600); font-weight: 700; }

.fs { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.fs-onsite { background: var(--red-50); color: var(--red-600); }
.fs-moving { background: var(--washed-bg); color: var(--washed); }
.fs-parked { background: #e6e9ee; color: #2f3a4a; }
.fs-offline, .fs-unlinked { background: var(--off-bg); color: var(--off); }

.fleet-table td { vertical-align: top; }
.fleet-veh .plate { margin-left: 4px; }
.fleet-due, .fleet-supplies { display: flex; flex-wrap: wrap; gap: 4px; }
.fleet-supplies .chem { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: #e8f1fb; color: #1d4f86; white-space: nowrap; }
.fleet-supplies .chem.low { background: var(--broken-bg); color: var(--broken); }
.fence-list li { display: grid; gap: 8px; }
.fence-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fence-actions select { width: auto; padding: 6px 8px; }
.visit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.visit-list li { padding: 9px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.visit-list li:last-child { border-bottom: 0; }
.visit-list.compact li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; }
.visit-list.compact li > span:first-child { flex: 1; }

/* Tracking panel on a vehicle's page */
.tracking-panel .field.inline select { width: auto; max-width: 320px; padding: 7px 10px; }
.tracking-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.tracking-info { display: grid; gap: 8px; align-content: start; }
.tracking-info > .btn { justify-self: start; }
.tracking-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tracking-kpis div { background: var(--paper); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.tracking-kpis span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tracking-kpis b { font-family: var(--mono); font-size: 22px; }
.asset-map { height: 280px; border-radius: 12px; border: 1px solid var(--line); z-index: 0; }
@media (max-width: 760px) { .tracking-grid { grid-template-columns: 1fr; } .fleet-map { height: 52vh; } }
.add-kind-tabs { margin-bottom: 14px; }

/* Phone / GPS tracker setup on a vehicle's Assets page */
.tracking-panel .table-tools { flex-wrap: wrap; gap: 8px; }
.tracker-setup { display: grid; gap: 10px; }
.tracker-setup p { margin: 0; }
.tracker-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.tracker-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.tracker-field > span { min-width: 120px; }
.tracker-field code { padding: 4px 8px; border-radius: 6px; background: rgba(127, 127, 127, 0.14); font-size: 14px; word-break: break-all; user-select: all; }
.tracker-details { margin-top: 14px; }
.tracker-details > .tracker-setup { margin-top: 10px; }

/* ---------- Shifts ---------- */
body:not(.role-employee) [data-employee] { display: none !important; }
.muted.small, .small { font-size: 13px; }
.grid-full { grid-column: 1 / -1; margin: 4px 0 0; }
.shifts-tools { align-items: flex-end; }
.shifts-tools .field { min-width: 200px; }

.cal-panel { padding: 0; overflow: hidden; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cal-head h3 { margin: 0 6px; font-family: var(--display); font-size: 24px; text-transform: uppercase; letter-spacing: .02em; min-width: 190px; text-align: center; }
.cal-head .btn { padding: 6px 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; }
.cal-dow { background: var(--black); color: #cfcfd3; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 8px; text-align: center; }
.cal-day { background: var(--white); min-height: 118px; padding: 6px; position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-day.out { background: #fafafb; }
.cal-day.out .cal-num { color: #b3b3b8; }
.cal-day.past:not(.today) { background: #fbfbfc; }
.cal-num { font-family: var(--mono); font-weight: 700; font-size: 13px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--red); color: #fff; }
.cal-add { position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; color: var(--red); font-weight: 800; font-size: 18px; opacity: 0; transition: opacity .12s; }
.cal-grid.editable .cal-day { cursor: pointer; }
.cal-grid.editable .cal-day:hover { background: var(--red-50); }
.cal-grid.editable .cal-day:hover .cal-add, .cal-day:focus-visible .cal-add { opacity: 1; }
.cal-day:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shift-chip {
  display: flex; flex-wrap: wrap; gap: 0 5px; align-items: baseline; text-align: left; width: 100%; min-width: 0;
  border: 0; border-left: 3px solid var(--red); background: #f1f1f3; color: var(--ink); border-radius: 5px; padding: 3px 6px;
  font: inherit; font-size: 12px; line-height: 1.3; cursor: pointer;
}
.shift-chip:hover { background: var(--black); color: #fff; }
.shift-chip b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.sc-time { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--red); }
.shift-chip:hover .sc-time { color: var(--red-400); }
.sc-site { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; flex-basis: 100%; }
.shift-chip:hover .sc-site { color: #cfcfd3; }
@media (max-width: 760px) {
  .cal-day { min-height: 74px; padding: 3px; }
  .cal-dow { padding: 6px 2px; letter-spacing: .04em; }
  .shift-chip { padding: 2px 3px; font-size: 10px; border-left-width: 2px; }
  .shift-chip b, .sc-site { display: none; }
  .sc-time { font-size: 10px; }
  .cal-add { display: none; }
  .cal-head h3 { min-width: 0; font-size: 20px; }
}

.shift-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.shift-card {
  display: flex; gap: 14px; background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s, border-color .12s;
}
.shift-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.08); border-color: var(--red); }
.shift-card-date { flex: 0 0 62px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--black); color: #fff; border-radius: 10px; padding: 8px 4px; border-bottom: 3px solid var(--red); align-self: flex-start; }
.shift-card-date b { font-family: var(--display); font-size: 30px; line-height: 1; }
.shift-card-date span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
.shift-card-date small { font-size: 11px; color: #aaa; text-transform: uppercase; letter-spacing: .1em; }
.shift-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.shift-rel { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.shift-card-site { font-family: var(--display); font-weight: 800; font-size: 21px; line-height: 1.05; text-transform: uppercase; }
.shift-card-time { font-weight: 600; font-size: 14px; }
.shift-card-addr { font-size: 13px; color: var(--muted); }
.shift-card-role { font-size: 13px; background: var(--paper); border-left: 3px solid var(--red); border-radius: 6px; padding: 6px 8px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.shift-card-role em { display: block; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.shift-card .go { font-weight: 700; font-size: 13px; margin-top: 2px; }
.shift-card:hover .go { color: var(--red); }

.shift-banner { background: var(--black); color: #fff; border-radius: 14px; padding: 14px 18px 16px; margin-bottom: 14px; border-bottom: 4px solid var(--red); }
.shift-banner-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.link.light { color: var(--red-400); }
.shift-banner h2 { font-family: var(--display); font-size: clamp(26px, 3.4vw, 38px); margin: 2px 0 6px; line-height: 1; text-transform: uppercase; }
.shift-banner-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-weight: 600; color: #e6e6e9; }
.job-role { margin-top: 12px; background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 14px; border-left: 5px solid var(--red); }
.job-role-label { font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--red); }
.job-role p { margin: 4px 0 0; font-size: 15px; line-height: 1.5; }

.shift-dlg-day { margin: 8px 0 0; font-weight: 700; font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: .02em; }
.shift-times .field { flex: 1 1 140px; }

/* Shift allocation summary (admins) */
.shift-summary { margin-top: 14px; }
.shift-summary > p { margin: 0 0 10px; font-weight: 600; }
.ok-text { color: var(--washed); font-weight: 600; }
.sum-table { min-width: 640px; }
.sum-table td.num, .sum-table th.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.sum-table tr.idle td { color: var(--muted); }
.sum-table td.over { color: var(--broken); font-weight: 700; background: var(--broken-bg) !important; }
.clash-tag { border: 0; background: var(--broken-bg); color: var(--broken); font: inherit; font-size: 12px; font-weight: 700; border-radius: 5px; padding: 2px 6px; cursor: pointer; margin: 1px 0; }
.clash-tag:hover { background: var(--broken); color: #fff; }
.shift-chip.clash { border-left-color: var(--broken); background: var(--broken-bg); outline: 1px dashed var(--broken); }

/* ---------- Quality Control ---------- */
.qc-setup .qc-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.qc-vehicles { display: flex; flex-wrap: wrap; gap: 6px; }
.qc-veh { font: inherit; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); cursor: pointer; }
.qc-veh:hover { border-color: var(--ink); }
.qc-veh[aria-checked="true"] { background: var(--black); color: #fff; border-color: var(--black); box-shadow: inset 0 -3px 0 var(--red); }
.qc-emp-score { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.qc-emp-score:empty { display: none; }

.qc-views { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.qc-view { margin: 0; }
.qc-view-side { grid-column: 1 / -1; order: -1; }
.qc-svg { width: 100%; height: auto; display: block; max-height: 360px; user-select: none; -webkit-tap-highlight-color: transparent; }
.qc-view-front .qc-svg, .qc-view-back .qc-svg { max-width: 360px; margin: 0 auto; }
.qc-p { fill: #e7e9ee; stroke: #2b2d31; stroke-width: 2; cursor: pointer; transition: fill .15s, filter .15s; stroke-linejoin: round; }
.qc-p.tire { fill: #3a3c41; }
.qc-p:hover { fill: #fde2e5; }
.qc-p.tire:hover { fill: #5b5e66; }
.qc-p.rated:hover { filter: brightness(1.1); }
.qc-p.active { stroke: var(--red); stroke-width: 4; }
.qc-base { fill: #cfd2d8; stroke: #2b2d31; stroke-width: 2; pointer-events: none; }
.qc-base.light { fill: #f3f4f6; }
.qc-base.dark { fill: #2b2d31; }
.qc-deco { pointer-events: none; fill: none; stroke: rgba(20,20,22,.45); stroke-width: 2; stroke-linecap: round; }
.qc-deco circle { fill: rgba(255,255,255,.5); }
.qc-deco .qc-hub { fill: #9ca0a8; stroke: #2b2d31; }
.qc-deco .qc-hub-in { fill: #2b2d31; stroke: none; }
.qc-glass, .qc-deco .qc-glass { fill: rgba(80,120,160,.18); stroke: rgba(20,20,22,.4); pointer-events: none; }
.qc-tail, .qc-deco .qc-tail { fill: var(--red); stroke: none; }
.qc-ground { stroke: #c4c6cc; stroke-width: 2; stroke-dasharray: 6 6; }

.qc-pop { position: fixed; z-index: 1000; width: 220px; background: var(--white); border-radius: 12px; box-shadow: 0 16px 40px rgba(0,0,0,.28); border: 1px solid var(--line); padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.qc-pop[hidden] { display: none; }
.qc-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.qc-pop-head b { font-family: var(--display); font-size: 17px; text-transform: uppercase; line-height: 1.1; }
.qc-opt { display: flex; align-items: center; gap: 10px; font: inherit; font-weight: 700; text-align: left; padding: 9px 10px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; }
.qc-opt i { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; }
.qc-opt span { margin-left: auto; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.qc-opt:hover, .qc-opt:focus-visible { background: color-mix(in srgb, var(--c) 14%, #fff); border-color: var(--c); outline: none; }
.qc-opt.on { background: var(--c); color: #fff; }
.qc-opt.on span { color: #fff; }
.qc-clear { align-self: center; font-size: 13px; padding: 4px; }

.qc-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: color-mix(in srgb, var(--c) 16%, #fff); color: color-mix(in srgb, var(--c) 70%, #000); border: 1px solid color-mix(in srgb, var(--c) 45%, #fff); }
.qc-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.qc-score { display: inline-flex; align-items: baseline; gap: 1px; padding: 2px 9px; border-radius: 8px; background: var(--c); color: #fff; font-family: var(--mono); white-space: nowrap; }
.qc-score b { font-size: 15px; }
.qc-score small { font-size: 11px; opacity: .85; }
.qc-score.big { padding: 6px 14px; border-radius: 12px; }
.qc-score.big b { font-size: 30px; }
.qc-score.big small { font-size: 14px; }

.qc-sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; }
.qc-sum-group h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.qc-sum-group ul { list-style: none; margin: 0; padding: 0; }
.qc-sum-group li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--grid); }
.link.plain { color: var(--ink); font-weight: 600; text-align: left; }
.qc-aggregate { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--c) 10%, #fff); border: 2px solid var(--c); }
.qc-aggregate > div:first-child { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qc-agg-label { font-family: var(--display); font-size: 22px; font-weight: 800; text-transform: uppercase; }
.qc-agg-word { font-size: 18px; color: color-mix(in srgb, var(--c) 75%, #000); }
.qc-agg-meta { font-size: 13px; color: var(--muted); text-align: right; }
.qc-bands { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; margin-top: 6px; }
.qc-notes { margin: 14px 0 10px; }

.qc-leader { list-style: none; margin: 0; padding: 0; }
.qc-leader li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--grid); }
.qc-leader li > :first-child { flex: 1; min-width: 0; }
.qc-review { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: var(--white); }
.qc-review summary { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; list-style: none; }
.qc-review summary::-webkit-details-marker { display: none; }
.qc-rev-main { flex: 1; min-width: 0; font-size: 14px; }
.qc-review[open] summary { border-bottom: 1px solid var(--grid); }
.qc-rev-list { list-style: none; margin: 0; padding: 6px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 16px; }
.qc-rev-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; font-size: 14px; }
.qc-rev-notes, .qc-review > .muted { margin: 0 12px 8px; font-size: 14px; }
.my-quality-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.my-quality-head .panel-title { margin-bottom: 2px; }
.my-quality-head p { margin: 0; }
.my-quality-score { display: flex; align-items: center; gap: 10px; }
#myQuality .my-quality { margin-top: 18px; }
@media (max-width: 760px) {
  .qc-views { grid-template-columns: 1fr; }
  .qc-agg-meta { text-align: left; }
  .qc-bands { justify-content: flex-start; }
}

/* Side menu group separators */
.side-nav .nav-sep { border: 0; border-top: 1px solid #2e2e2e; margin: 6px 4px; width: auto; }

/* Admin home: quality-control review reminders */
#qcReminder .qc-reminder { margin: 18px 0 4px; border-left: 4px solid var(--washed); }
#qcReminder .qc-reminder.has-due { border-left-color: #eab308; }
#qcReminder .qc-reminder.has-overdue { border-left-color: var(--broken); }
.qc-reminder-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.qc-reminder-head .panel-title { margin-bottom: 2px; }
.qc-reminder-head p { margin: 0; }
.qc-due-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.qc-due { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); }
.qc-due.overdue { background: var(--broken-bg); border-color: #f5c2c2; }
.qc-due.due { background: #fef9e1; border-color: #f3e2a0; }
.qc-due-who { display: grid; flex: 1; min-width: 0; }
.qc-due-who small { color: var(--muted); font-size: 12.5px; }
.qc-due-badge { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; color: #fff; background: #ca8a04; }
.qc-due.overdue .qc-due-badge { background: var(--broken); }

/* ---------- Vehicles on a site ---------- */
.site-vehicles { margin: 14px 0; }
.site-vehicles > .muted.small { margin: 0 0 10px; }
.sv-pick { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.sv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sv-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fcfcfc; }
.sv-head { display: flex; gap: 10px; align-items: center; }
.sv-head > span:last-child { display: grid; gap: 3px; }
.sv-img { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 10px; overflow: hidden; background: var(--grid); display: grid; place-items: center; }
.sv-img img { width: 100%; height: 100%; object-fit: cover; }
.sv-img svg { width: 28px; height: 28px; color: var(--muted); }
.sv-card .row .btn { flex: 1 1 auto; }
.sv-log { margin-top: 12px; font-size: 14px; }
.sv-log summary { cursor: pointer; font-weight: 700; }
.sv-log ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }

/* ---------- Gas cards ---------- */
.gas-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gas-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.gas-list .spacer { flex: 1; }
.gas-list select { width: auto; max-width: 220px; }
.gas-spare .add-supply input[name=number] { flex: 1 1 180px; }
.gas-spare .add-supply input[name=notes] { flex: 1 1 180px; }
.gas-spare .add-supply input[name=passcode] { width: 130px; }

/* ---------- Revenue ---------- */
.rev-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 8px; }
.rev-table { min-width: 560px; }
.rev-table input { width: 110px; text-align: right; }
.rev-table select { min-width: 170px; }
.rev-table tfoot td { padding: 9px 10px; border-top: 2px solid var(--line); }
.rev-pill { font-size: 13px; padding: 4px 12px; border-radius: 99px; background: var(--grid); }
.rev-pill b { font-family: var(--mono); }
.rev-sum { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: flex-end; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.rev-sum b { font-family: var(--mono); }
.rev-sum-profit b { font-size: 20px; }
.rev-pos { color: var(--washed); }
.rev-neg { color: var(--broken); }
.kpi.accent .rev-pos { color: #4ade80; }
.kpi.accent .rev-neg { color: #f87171; }

/* ---------- Employee "My vehicle" ---------- */
.my-vehicle-name { font-family: var(--display); font-size: 26px; text-transform: uppercase; margin: 0 0 6px; }
.supply.readonly { grid-template-columns: 1fr auto; grid-template-areas: "name qty"; }
.qty-read { grid-area: qty; font-weight: 700; font-variant-numeric: tabular-nums; }
.shift-vehicle-released { margin: -4px 0 0; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Acid/soap used on the current shift (My vehicle) and per shift on Revenue */
.chem-used { margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px; background: #f1f7f4; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.chem-used > span { color: var(--muted, #666); margin-right: 4px; }
.rev-chem { margin-top: 8px; }
.rev-chem > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
