:root {
  --red: #d0121a;
  --red-dark: #a30e14;
  --charcoal: #1c1c1c;
  --white: #ffffff;
  --page: #f3f3f3;
  --line: #d7d7d7;
  --muted: #5c5c5c;
  --ok: #1f7a3a;
  --ok-bg: #e7f5ec;
  --bad-bg: #fde8e8;
  --shadow: 0 8px 24px rgba(28, 28, 28, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--charcoal);
  background: var(--page);
  line-height: 1.45;
}

a { color: var(--red-dark); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 20px;
  background: var(--white);
  color: var(--charcoal);
  border-bottom: 1px solid var(--line);
}

.brand-bar { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 700;
}

.brand-logo, .login-logo, .card-logo {
  object-fit: contain;
  background: var(--white);
  border-radius: 0;
}

.brand-logo { height: 56px; width: auto; }
.login-logo { height: 104px; width: auto; display: block; margin: 0 auto 8px; }
.card-logo { height: 40px; width: auto; }

.header-user { display: flex; align-items: center; gap: 12px; }
.top-nav { display: none; }
.who { font-size: .92rem; color: var(--charcoal); }

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(180deg, #e4232b 0%, #9d1016 100%);
  border-right: 0;
  color: #fff;
  padding: 18px 12px 16px;
  overflow: hidden;
}
.side-nav .brand, .side-nav .brand-name { color: #fff; }
.side-menu { flex: 1; overflow: auto; min-height: 0; scrollbar-width: none; }
.side-menu::-webkit-scrollbar, .work-list::-webkit-scrollbar { width: 0; height: 0; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.side-tools { display: flex; align-items: center; gap: 6px; }
.side-pin { display: none; }
.side-top .brand-logo { height: 44px; }
.side-close {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.side-go {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 6px 4px 8px;
  border-radius: 12px;
  background: #1c1c1c;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.side-go:hover { background: #000; color: #fff; }
.side-label {
  margin: 14px 12px 4px;
  color: rgba(255, 255, 255, .72);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.side-link, .side-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.side-link, .side-logout { transition: background-color .12s ease, color .12s ease; }
.side-link { white-space: nowrap; }
.side-link:hover, .side-logout:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.side-link.is-current { background: #fff; color: var(--red-dark); }
.side-link.is-current .menu-count { background: var(--red); color: #fff; }
.nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-count {
  margin-left: auto;
  min-width: 1.35rem;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--red-dark);
  font-size: .72rem;
  line-height: 1.35rem;
  text-align: center;
}
.side-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255, 255, 255, .22); }
.side-foot .who { display: none; margin: 0 0 8px; font-weight: 700; color: #fff; }
.side-foot form { margin: 0; }
.side-foot .button { margin-top: 0; }

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(28, 28, 28, .45);
  animation: fade-in .14s ease;
}
.nav-backdrop[hidden] { display: none; }

.tab-bar {
  display: none;
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 20;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  height: 70px;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(28, 28, 28, .14);
}
.tab-notch {
  position: absolute;
  z-index: 0;
  top: -34px;
  left: 0;
  width: 68px;
  height: 68px;
  margin-left: -34px;
  border: 6px solid var(--page);
  border-radius: 50%;
  background: var(--white);
  opacity: 0;
  pointer-events: none;
}
.tab-notch.is-ready { opacity: 1; transition: left .5s cubic-bezier(.45, .05, .2, 1); }
.tab-notch.is-first::before, .tab-notch.is-last::after { opacity: 0; }
.tab-bar a:focus, .tab-bar a:focus-visible, .tab-bar button:focus, .tab-bar button:focus-visible { outline: none; }
.tab-notch::before,
.tab-notch::after {
  content: "";
  position: absolute;
  top: 32px;
  width: 22px;
  height: 20px;
  background: transparent;
}
.tab-notch::before {
  left: -27px;
  border-top-right-radius: 18px;
  box-shadow: 4px -8px 0 0 var(--white);
}
.tab-notch::after {
  right: -27px;
  border-top-left-radius: 18px;
  box-shadow: -4px -8px 0 0 var(--white);
}
.tab-item, .tab-add {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  border: 0;
  background: transparent;
  color: #9a9a9a;
  text-decoration: none;
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.tab-item span, .tab-add span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
}
.tab-bar a.is-current { color: var(--red); }
.tab-icon {
  width: 26px;
  height: 26px;
  margin-bottom: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .5s cubic-bezier(.45, .05, .2, 1);
}
.tab-bar a.is-current .tab-icon {
  transform: translateY(-32px);
  stroke-width: 2.3;
}

@media (min-width: 960px) {
  .site-header {
    position: sticky;
    top: 0;
    z-index: 8;
    flex-wrap: wrap;
    justify-content: flex-start;
    background: var(--white);
  }
  .header-user { margin-left: auto; }
  .side-nav {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(320px, 86vw);
    height: 100vh;
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .16s cubic-bezier(.2, .8, .2, 1), visibility .16s;
    box-shadow: var(--shadow);
  }
  .side-nav.is-open { transform: none; visibility: visible; }
  .site-header .brand-bar { display: flex; order: 2; }
  .header-menu { display: inline-flex; order: 1; }
  .header-user { order: 3; }
  .top-nav { order: 4; }
  body.menu-open { overflow: hidden; }
  .top-nav {
    display: flex;
    flex: 1 0 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }
  .top-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    color: var(--charcoal);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 700;
    white-space: nowrap;
  }
  .top-link .nav-icon { width: 16px; height: 16px; flex-basis: 16px; }
  .top-link:hover { background: #f6f6f6; }
  .top-link.is-current { background: #fde8e8; color: var(--red-dark); }
  .tab-bar { display: none; }
  .side-pin {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
  }
  .side-pin[aria-pressed="true"] { background: #fff; color: var(--red-dark); }
  body.menu-pinned {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: 100vh;
    overflow: hidden;
  }
  body.menu-pinned .side-nav {
    position: sticky;
    top: 0;
    grid-column: 1;
    grid-row: 1 / span 2;
    width: auto;
    height: 100vh;
    transform: none;
    visibility: visible;
    box-shadow: none;
  }
  body.menu-pinned .site-header,
  body.menu-pinned .page { grid-column: 2; }
  body.menu-pinned .site-header { flex-wrap: nowrap; }
  body.menu-pinned .site-header .brand-bar,
  body.menu-pinned .header-menu,
  body.menu-pinned .side-close,
  body.menu-pinned .nav-backdrop { display: none; }
  body.menu-pinned .top-nav {
    order: 2;
    flex: 1 1 auto;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  body.menu-pinned .header-user { order: 3; }
  body.menu-pinned .page {
    height: 100%;
    min-height: 0;
    margin: 0;
    width: 100%;
    overflow: auto;
  }
  body.menu-pinned.menu-open { overflow: hidden; }
}

@media (max-width: 959px) {
  .brand-bar { display: flex; }
  .header-user .who { display: none; }
  .side-foot .who { display: block; }
  .side-nav {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(320px, 86vw);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .16s cubic-bezier(.2, .8, .2, 1), visibility .16s;
    box-shadow: var(--shadow);
  }
  .side-nav.is-open { transform: none; visibility: visible; }
  .tab-bar { display: grid; }
  .bill-save { bottom: calc(124px + env(safe-area-inset-bottom)); }
  body.has-app { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
  body.menu-open { overflow: hidden; }
}
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 700;
}
.header-check {
  background: #1c1c1c;
  border-color: #1c1c1c;
  color: var(--white);
}
.header-check:hover { background: #000; border-color: #000; color: #fff; }
.header-check span { font-size: .78rem; }
.alert-link {
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 600;
}
.alert-link .count {
  position: absolute;
  top: -4px;
  right: -4px;
}
.count {
  min-width: 1.4rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: .8rem;
  text-align: center;
}

.page { width: min(1240px, calc(100% - 32px)); margin: 28px auto 64px; }
@media (min-width: 960px) {
  .page { width: calc(100% - 48px); max-width: none; margin: 20px auto 48px; }
}
.header-menu .tab-icon { width: 22px; height: 22px; margin: 0; }
.narrow { max-width: 760px; margin-inline: auto; }

.card, .check-card, .table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.card { padding: 24px; }
.auth-card { max-width: 440px; margin: 0 auto; }

h1 { margin: 0 0 8px; font-size: 1.6rem; }
h2 { margin: 28px 0 10px; font-size: 1.15rem; }
.lede { color: var(--muted); margin-top: 0; }

label { display: block; margin: 14px 0 6px; font-weight: 600; }

.input, select.input, textarea.input, input[type="password"], input[type="text"], input[type="email"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--white);
}

textarea { min-height: 80px; }

input:focus, select:focus, textarea:focus, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.side-nav a:focus, .side-nav button:focus { outline: none; }

.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: var(--red-dark); }
.button.button-secondary, button.button.button-secondary { background: var(--charcoal); }
.button.button-secondary:hover, button.button.button-secondary:hover { background: #111; }
button.button.button-quiet {
  margin: 0;
  min-height: 36px;
  padding: 0 12px;
  background: var(--white);
  color: var(--charcoal);
  border: 1px solid var(--line);
}
button.button.button-quiet:hover { background: #f6f6f6; }
.button-secondary { background: var(--charcoal); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.actions h1 { margin: 0; }
.actions form { margin: 0; }
.actions .button { margin-top: 0; }

.error-summary, .errorlist, .field-error {
  background: var(--bad-bg);
  color: #8d1016;
  border-radius: 8px;
  padding: 8px 12px;
}
.errorlist { list-style: none; margin: 8px 0 0; padding-left: 12px; }

.help, .muted { color: var(--muted); }
.messages { list-style: none; padding: 0; }
.messages li { background: var(--ok-bg); color: var(--ok); border-radius: 8px; padding: 12px 14px; margin-bottom: 16px; }

.steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
.steps span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: .9rem; }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px 18px 8px;
  margin: 16px 0;
}
.panel h2, .card h2 { margin-top: 14px; }
.check-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.panel .check-row:first-of-type { border-top: 0; }
.check-row.is-issue { background: #fff8f8; margin-inline: -18px; padding-inline: 18px; }
.check-title { flex: 1 1 200px; margin: 0; font-weight: 700; }
.note-box, .check-row > .help, .check-row > .errorlist { flex: 1 1 100%; }
.who-line { margin-top: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 4px 12px 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fafafa;
  font-weight: 600;
  cursor: pointer;
}
.choice input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--ok);
  cursor: pointer;
}
.choice-bad input { accent-color: var(--red); }
.choice-muted input { accent-color: var(--charcoal); }
.choice:has(input:checked) { border-color: var(--ok); background: var(--ok-bg); }
.choice-bad:has(input:checked) { border-color: var(--red); background: var(--bad-bg); }
.choice-muted:has(input:checked) { border-color: var(--charcoal); background: #eee; }
.note-box { margin-top: 10px; }
.zone-row { align-items: center; }
.zone-controls { flex: 1 1 220px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.sketch {
  width: 220px;
  max-width: 100%;
  height: auto;
  flex: 0 0 220px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
  color: var(--charcoal);
}

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-height: 96px; }
.kpi strong { display: block; font-size: 2rem; line-height: 1.1; letter-spacing: -0.03em; }
.kpi-figure { font-size: 1.25rem !important; }
.kpi span { display: block; margin-top: 6px; color: var(--muted); font-size: .9rem; line-height: 1.3; }
.kpi-warn { background: #fff8e6; border: 2px solid #c9a227; }
.kpi-wait { background: #fff4e8; border: 2px solid #e07a14; }
.kpi-alert { background: #fff1f3; border: 2px solid var(--red); }
.kpi-ok { background: #e7f5ec; border: 2px solid var(--ok); }
a.kpi.is-current { outline: 3px solid var(--charcoal); outline-offset: 2px; }
.doc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.doc-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.doc-row strong { font-size: 1.15rem; }
.doc-row span { color: var(--muted); }
.back-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.done-dialog {
  width: min(420px, calc(100vw - 32px));
  border: 0;
  border-radius: 16px;
  padding: 24px;
}
.done-dialog::backdrop { background: rgba(28, 28, 28, .55); }
.done-dialog h2 { margin-top: 0; }

.table-wrap { overflow-x: auto; }
.money { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.bill-form { display: flex; flex-direction: column; gap: 8px; }
.scan-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.scan-row .button { position: relative; min-height: 48px; }
.scan-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.scan-review {
  margin: 8px 0 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.scan-review[hidden], .scan-review [hidden] { display: none; }
.scan-loading { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.scan-spin {
  width: 28px;
  height: 28px;
  border: 3px solid #e6e6e6;
  border-top-color: #1c1c1c;
  border-radius: 50%;
  animation: scan-spin .8s linear infinite;
}
@keyframes scan-spin { to { transform: rotate(360deg); } }
.scan-wait { margin: 0; font-weight: 700; }
.scan-review h3 { margin: 0 0 8px; font-size: 1.05rem; }
.scan-vehicle { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #eef6ee; font-weight: 700; }
.scan-vehicle.is-missing { background: #fde8e8; }
.scan-facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.scan-facts li { display: grid; gap: 2px; margin: 0; }
.scan-facts span, .scan-line dt { font-size: .75rem; color: #666; }
.scan-facts .is-missing strong { color: var(--red); }
.scan-line {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
}
.scan-line p { margin: 0 0 6px; font-weight: 700; }
.scan-line dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin: 0; }
.scan-line dd { margin: 0; }
.scan-compare { margin: 10px 0 0; font-weight: 700; }
.scan-raw { margin-top: 12px; }
.scan-raw summary { font-weight: 700; cursor: pointer; min-height: 44px; }
.scan-raw pre {
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 10px;
  background: #f6f6f6;
  font-size: .85rem;
}
.scan-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.scan-actions .button { min-height: 48px; }
.is-reading .scan-row { opacity: .55; pointer-events: none; }
.mot-popup form { display: grid; gap: 10px; }
.mot-popup label { display: grid; gap: 4px; font-weight: 700; }
.mot-popup .button { min-height: 48px; }
.right-card h2 { margin: 0 0 4px; }
.right-card form { display: grid; gap: 10px; margin-top: 10px; }
.check-line { display: flex; align-items: flex-start; gap: 10px; min-height: 48px; font-weight: 700; }
.check-line input { width: 22px; height: 22px; margin-top: 2px; }
.check-line .help { font-weight: 400; }
.bill-block h2 { margin: 12px 0 4px; font-size: 1.05rem; }
.bill-block + .bill-block { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.bill-block .lede { margin-top: 0; }
.sheet { overflow-x: auto; border: 1px solid #d0d0d0; border-radius: 2px; background: #fff; }
.sheet-table { width: 100%; min-width: 760px; border-collapse: collapse; background: #fff; }
.sheet-table th, .sheet-table td { border: 1px solid #d9d9d9; padding: 0; vertical-align: middle; }
.sheet-table th {
  background: #f3f3f3;
  color: #333;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: left;
  padding: 8px 10px;
}
.sheet-table td .input, .sheet-table td input, .sheet-table td select {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.sheet-table td .input:focus, .sheet-table td input:focus, .sheet-table td select:focus {
  outline: 2px solid #1c1c1c;
  outline-offset: -2px;
}
.sheet-num { width: 36px; text-align: center; background: #f3f3f3; color: #666; font-variant-numeric: tabular-nums; font-size: .8rem; }
.sheet-del { width: 44px; text-align: center; position: sticky; right: 0; background: #fff; z-index: 1; box-shadow: -6px 0 8px rgba(28, 28, 28, .04); }
.sheet-table th.sheet-del { background: #f3f3f3; }
.sheet-del input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.sheet-x {
  border: 0;
  background: transparent;
  color: #666;
  font-size: 1.25rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  cursor: pointer;
}
.sheet-x:hover { color: var(--red); background: #fde8e8; }
.sheet-table tr.is-removed { display: none; }
@media (max-width: 800px) {
  .sheet { overflow: visible; border: 0; background: transparent; }
  .sheet-table { min-width: 0; }
  .sheet-table thead { display: none; }
  .sheet-table tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px;
    border: 1px solid #d9d9d9;
    background: #fff;
  }
  .sheet-table td { border: 0; }
  .sheet-table td[data-label] { grid-column: 1 / -1; }
  .sheet-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    padding: 4px 8px 0;
    font-size: .75rem;
    font-weight: 700;
  }
  .sheet-del { position: static; box-shadow: none; }
}
.bill-sum {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--charcoal);
  color: var(--white);
}
.bill-sum div { display: flex; flex-direction: column; gap: 2px; }
.bill-sum span { color: #f0d0d0; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.bill-sum strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.bill-sum .is-gross strong { font-size: 1.45rem; }
.bill-save {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  position: sticky;
  bottom: 12px;
  z-index: 4;
  margin-top: 8px;
  padding: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.bill-save .button { margin: 0; }
.bill-popup .bill-save { position: static; box-shadow: none; }
.supplier-box { margin-top: 8px; }
.supplier-add { margin: 8px 0 16px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fafafa; }
.supplier-add summary { cursor: pointer; font-weight: 700; width: fit-content; }
.supplier-add summary:hover { color: var(--red-dark); }
.check-line { font-weight: 600; }
.bill-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.bill-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.bill-meta dt { color: var(--muted); }
.bill-totals { max-width: 320px; margin-left: auto; }
.bill-totals div { display: flex; justify-content: space-between; gap: 24px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.bill-totals .gross { border-bottom: 0; font-size: 1.15rem; }
.bill-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bill-actions .button { margin: 0; }
.email-bill { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-top: 16px; }
.email-bill label { flex: 1 1 220px; }
.email-bill .button { margin: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; letter-spacing: .02em; text-transform: uppercase; color: var(--muted); background: #fafafa; }
tbody tr:hover { background: #fff8f8; }

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .8rem;
  font-weight: 700;
  background: #eee;
}
.badge-pass { background: var(--ok-bg); color: var(--ok); }
.badge-bad, .badge-critical { background: var(--bad-bg); color: #8d1016; }
.badge-review { background: #fff4d6; color: #6a4b00; }
.badge-muted { background: #eee; color: var(--muted); }

.desk-bar { margin-bottom: 16px; }
.bill-board.card { padding: 8px 8px 16px; }
.bill-board .table-wrap { border: 0; box-shadow: none; background: transparent; }
.desk-bar.card { padding: 16px 18px 18px; }
.desk-bar .actions { margin-bottom: 10px; }
.desk-bar .lede { margin: 0 0 12px; }
.desk-bar .filters { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 16px; }
.filters label { margin: 0; font-size: .85rem; }
.filters .input, .filters select { min-height: 40px; width: auto; }

.bar-row { display: grid; grid-template-columns: 70px 1fr 30px; gap: 8px; align-items: center; margin: 6px 0; }
.bar { height: 14px; background: var(--red); border-radius: 7px; display: block; }
.w0 { width: 4%; } .w1 { width: 10%; } .w2 { width: 20%; } .w3 { width: 30%; }
.w4 { width: 40%; } .w5 { width: 50%; } .w6 { width: 60%; } .w7 { width: 70%; }
.w8 { width: 80%; } .w9 { width: 90%; } .w10 { width: 100%; }
.text-button { background: none; border: 0; color: inherit; font: inherit; text-align: left; padding: 8px 0; min-height: 44px; cursor: pointer; }

.photo-tools { margin-top: 10px; }
.photo-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
button.button.button-camera,
button.button.button-file { margin-top: 0; min-height: 44px; }
button.button.button-file {
  background: var(--white);
  color: var(--charcoal);
  border: 1px solid var(--charcoal);
}
button.button.button-file:hover { background: #f6f6f6; }
.sr-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.thumbs, .photo-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.thumb-row { display: flex; align-items: center; gap: 10px; max-width: 100%; }
.thumb {
  width: 96px;
  height: 72px;
  object-fit: cover;
  flex: 0 0 96px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}
.thumb-row p, .photo-grid figcaption { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.photo-grid figure { margin: 0; width: 96px; }
.photo-limit { color: #8d1016; font-weight: 700; }
.viewer {
  width: min(960px, calc(100vw - 32px));
  border: 0;
  border-radius: 12px;
  padding: 12px;
}
.viewer img { width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: #111; }
.viewer::backdrop { background: rgba(0, 0, 0, .72); }
.period { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
button.button.period-on { background: var(--charcoal); }

.sign-block { margin-top: 12px; max-width: 100%; }
.sign-pad {
  width: 100%;
  height: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.sign-pad canvas {
  display: block;
  width: 100%;
  height: 180px;
  border: 0;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
.sign-missing { outline: 2px solid var(--red); }
.sign-hint { color: var(--muted); margin: 8px 0; }
.signature-view {
  display: block;
  width: min(100%, 420px);
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.log { padding-left: 18px; }
.log li { margin: 8px 0; }

.submit-bar { padding: 8px 0 4px; }
.submit-bar .button { width: 100%; margin-top: 0; }

.driver-card {
  width: 86mm;
  min-height: 54mm;
  border: 2px solid var(--charcoal);
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 28mm;
  gap: 8px;
  background: #fff;
}
.driver-card img.qr { width: 28mm; height: 28mm; }

.temp-password { font-family: Consolas, monospace; font-size: 1.2rem; background: #fff4d6; padding: 8px 12px; border-radius: 8px; }

@media (max-width: 720px) {
  .site-header { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px 12px; padding: 10px 12px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-logo { height: 40px; }
  .brand-name { font-size: .95rem; white-space: nowrap; }
  .header-user { flex: 0 0 auto; justify-content: flex-end; gap: 8px; }
  .who { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav { display: none; }
  .page { width: calc(100% - 20px); margin: 16px auto 24px; }
  .card, .panel { padding: 16px; }
  .actions { align-items: stretch; }
  .actions .button, .actions a.button { width: 100%; }
  .filters { display: grid; grid-template-columns: 1fr; }
  .filters .button { width: 100%; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .dash-head { align-items: stretch; }
  .period { width: 100%; }
  .period .button { flex: 1 1 0; padding-inline: 8px; }
  .choice { flex: 1 1 calc(50% - 8px); justify-content: center; min-height: 52px; border-radius: 14px; font-size: 1rem; }
  .choices { width: 100%; }
  .check-row { align-items: stretch; padding: 16px 0; }
  .check-title { flex-basis: 100%; font-size: 1.05rem; }
  .zone-row { flex-direction: column; align-items: stretch; }
  .steps { flex-wrap: nowrap; overflow-x: auto; }
  .sketch { flex-basis: auto; width: min(100%, 260px); }
  .report-row, article.report-row { grid-template-columns: 1fr; }
  .fleet-bar { grid-template-columns: 1fr auto; }
  .fleet-bar .fleet-track { grid-column: 1 / -1; }
  .driver-card { width: 100%; max-width: 100%; }
  .bin-actions { min-width: 0; }
  .alert-top { align-items: flex-start; }
  .alert-card time { white-space: normal; }
  .table-wrap { overflow: visible; border: 0; box-shadow: none; background: transparent; }
  .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    display: block;
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }
  .table-wrap td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    border: 0;
    padding: 7px 0;
    text-align: right;
  }
  .table-wrap td::before {
    content: attr(data-label);
    flex: 0 0 42%;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-align: left;
  }
  .table-wrap td:not([data-label])::before, .table-wrap td[data-label=""]::before, .table-wrap td[colspan]::before { content: none; }
  .table-wrap td[colspan] { display: block; text-align: left; }
  .table-wrap td.bin-actions { display: block; text-align: left; }
  .table-wrap td.bin-actions::before { display: block; margin-bottom: 8px; }
  tbody tr:hover { background: #fff; }
  .bill-popup {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    padding: 12px;
  }
  .table-wrap.sheet { overflow: visible; border: 0; background: transparent; }
  .table-wrap.sheet table, .table-wrap.sheet tbody { display: block; width: 100%; }
  .table-wrap.sheet thead { display: none; }
  .table-wrap.sheet tr {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 12px;
    background: #fff;
  }
  .table-wrap.sheet td {
    display: block;
    width: auto;
    text-align: left;
    padding: 0;
    border: 0;
  }
  .table-wrap.sheet td[data-label] { grid-column: 1 / -1; }
  .table-wrap.sheet td[data-label]::before {
    content: attr(data-label);
    display: block;
    flex: none;
    margin: 0 0 4px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    text-align: left;
  }
  .table-wrap.sheet td .input,
  .table-wrap.sheet td input,
  .table-wrap.sheet td select {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 16px;
    background: #fff;
  }
  .table-wrap.sheet .sheet-num,
  .table-wrap.sheet .sheet-del {
    display: flex;
    align-items: center;
    min-height: 48px;
    background: transparent;
  }
  .table-wrap.sheet .sheet-del { justify-content: flex-end; }
  .table-wrap.sheet .sheet-x { width: 48px; height: 48px; }
}

.dash-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: end; }
.dash-head h1, .dash-head h2 { margin-bottom: 0; }
.dash-head .button { margin-top: 0; }
a.button.period-on { background: var(--red); }
a.kpi { color: inherit; text-decoration: none; display: block; }
a.kpi:hover { border-color: var(--charcoal); }
a.kpi.kpi-warn:hover { border-color: #c9a227; }
a.kpi.kpi-wait:hover { border-color: #e07a14; }
a.kpi.kpi-alert:hover { border-color: var(--red); }
a.kpi.kpi-ok:hover { border-color: var(--ok); }
.kpi-alert strong { color: var(--red); }
.dash-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 16px 0;
  padding: 8px 0;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--page);
}
.chip-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
.chip-scroll .chip, .dash-tabs button { flex: 0 0 auto; }
.dash-tabs button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.dash-tabs button.is-on { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.dash-panel { margin-bottom: 16px; }
.dash-side { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr); gap: 28px; margin-top: 28px; align-items: start; }
.day-chart { display: grid; grid-template-columns: 2rem minmax(0, 1fr); column-gap: 8px; margin-top: 8px; }
.day-scale { display: flex; flex-direction: column; justify-content: space-between; height: 148px; margin-top: 18px; color: var(--muted); font-size: .75rem; font-weight: 700; text-align: right; }
.day-chart-scroll { overflow-x: auto; padding-top: 18px; padding-bottom: 2.6em; }
.day-plot {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 100%;
  height: 148px;
  border-bottom: 1px solid #d7d7d7;
  background-image: linear-gradient(to top, transparent calc(50% - 1px), #eee calc(50% - 1px), #eee 50%, transparent 50%);
}
.day-col { position: relative; flex: 1 1 0; min-width: 44px; display: flex; }
.days-30 .day-col { flex: 1 0 32px; min-width: 32px; }
.days-90 .day-col { flex: 1 0 28px; min-width: 28px; }
.day-bars { width: 100%; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.day-bar { position: relative; display: block; width: 46%; max-width: 44px; min-width: 8px; border-radius: 6px 6px 0 0; }
.days-30 .day-bar, .days-90 .day-bar { max-width: 14px; }
.day-bar-start, .day-bar-return { min-height: 10px; }
.day-bar-start { background: var(--charcoal); }
.day-bar-return { background: var(--red); }
.day-bar-gap { height: 0; background: transparent; }
.day-bar:hover { opacity: 0.78; }
.day-count { position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%); color: var(--charcoal); font-size: .75rem; font-weight: 700; line-height: 1; }
.day-label { position: absolute; top: calc(100% + 6px); left: 0; right: 0; color: var(--muted); font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.15; }
.day-label b { display: block; color: var(--charcoal); font-weight: 700; }
.bar-h-1 { height: 6.25%; }
.bar-h-2 { height: 12.5%; }
.bar-h-3 { height: 18.75%; }
.bar-h-4 { height: 25%; }
.bar-h-5 { height: 31.25%; }
.bar-h-6 { height: 37.5%; }
.bar-h-7 { height: 43.75%; }
.bar-h-8 { height: 50%; }
.bar-h-9 { height: 56.25%; }
.bar-h-10 { height: 62.5%; }
.bar-h-11 { height: 68.75%; }
.bar-h-12 { height: 75%; }
.bar-h-13 { height: 81.25%; }
.bar-h-14 { height: 87.5%; }
.bar-h-15 { height: 93.75%; }
.bar-h-16 { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.swatch { width: 12px; height: 12px; border-radius: 999px; display: inline-block; margin-right: 6px; background: #ccc; }
.swatch-daily { background: var(--charcoal); }
.swatch-return { background: var(--red); }
.swatch[data-swatch="CRITICAL"] { background: #d0121a; }
.swatch[data-swatch="HIGH"] { background: #e07a14; }
.swatch[data-swatch="MEDIUM"] { background: #c9a227; }
.swatch[data-swatch="LOW"] { background: #6b7280; }
.ring-row { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: center; }
.ring { width: 168px; height: 168px; }
.ring-total { font-size: 26px; font-weight: 700; fill: var(--charcoal); }
.ring-caption { font-size: 11px; font-weight: 700; fill: #6b6b6b; letter-spacing: .06em; }
.severity-list { display: grid; gap: 8px; min-width: 0; }
.severity-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 4px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.severity-row:hover { border-color: var(--charcoal); }
.severity-row .swatch { grid-row: 1 / span 2; width: 14px; height: 14px; margin: 0; }
.severity-name { font-weight: 700; }
.severity-count { font-size: 1.15rem; line-height: 1; }
.severity-meta { grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 2.6rem; gap: 8px; align-items: center; }
.severity-track { display: block; height: 8px; border-radius: 999px; background: #eee; overflow: hidden; }
.severity-fill { display: block; width: 0; height: 100%; border-radius: 999px; background: #ccc; }
.severity-fill[data-swatch="CRITICAL"] { background: #d0121a; }
.severity-fill[data-swatch="HIGH"] { background: #e07a14; }
.severity-fill[data-swatch="MEDIUM"] { background: #c9a227; }
.severity-fill[data-swatch="LOW"] { background: #6b7280; }
.severity-share { color: var(--muted); font-size: .8rem; font-weight: 700; text-align: right; }
.severity-row.is-zero { color: var(--muted); }
.severity-row.is-zero .severity-count { font-weight: 700; }
.meter-list { display: grid; gap: 10px; margin-top: 8px; }
.meter {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.meter:hover { border-color: var(--charcoal); }
.meter-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.meter-top strong { font-size: 1.25rem; }
.meter-hint { color: var(--muted); font-size: .82rem; }
.meter svg { width: 100%; height: 8px; display: block; }
.meter-track { fill: #eee; }
.meter-fill { fill: var(--charcoal); }
.meter-fill.meter-progress { fill: #c9a227; }
.meter-fill.meter-released { fill: var(--ok); }
.meter-fill.meter-held { fill: var(--red); }
.meter-fill[data-swatch="CRITICAL"] { fill: #d0121a; }
.meter-fill[data-swatch="HIGH"] { fill: #e07a14; }
.meter-fill[data-swatch="MEDIUM"] { fill: #c9a227; }
.meter-fill[data-swatch="LOW"] { fill: #6b7280; }
.legend-list { list-style: none; padding: 0; margin: 0; }
.legend-list li { margin: 6px 0; }
.legend-list button { background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; padding: 4px 0; }
.chip.is-on { background: var(--charcoal); color: #fff; }
.fleet-bars { display: grid; gap: 8px; }
.fleet-bar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 32px; gap: 10px; align-items: center; color: inherit; text-decoration: none; font-weight: 700; }
.fleet-track { display: block; height: 12px; border-radius: 999px; background: #eee; overflow: hidden; }
.fleet-fill { display: block; height: 100%; border-radius: 999px; background: var(--red); }
.bar-w-1 { width: 10%; }
.bar-w-2 { width: 20%; }
.bar-w-3 { width: 30%; }
.bar-w-4 { width: 40%; }
.bar-w-5 { width: 50%; }
.bar-w-6 { width: 60%; }
.bar-w-7 { width: 70%; }
.bar-w-8 { width: 80%; }
.bar-w-9 { width: 90%; }
.bar-w-10 { width: 100%; }

@media (max-width: 800px) {
  .dash-side, .ring-row { grid-template-columns: 1fr; }
  .ring { justify-self: center; }
}

@media (max-width: 720px) {
  .day-chart { grid-template-columns: 1.5rem minmax(0, 1fr); }
  .days-7 .day-col { min-width: 0; }
}

.print-only { display: none; }
.report-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0 0; }
.report-facts div { margin: 0; }
.report-facts dt { color: var(--muted); font-size: .8rem; font-weight: 700; }
.report-facts dd { margin: 2px 0 0; font-weight: 700; }
.report-list { display: grid; gap: 8px; }
.report-row {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(160px, 1fr) auto auto;
  gap: 8px 12px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
.report-row p { grid-column: 1 / -1; margin: 0; }
article.report-row { grid-template-columns: 180px 1fr; }
.bin-actions { display: flex; flex-direction: column; gap: 8px; min-width: 180px; }
.bin-actions form { margin: 0; }
.bin-actions .button { margin-top: 0; }
.bin-actions .choice { margin: 0; }
.alert-filters { display: flex; gap: 8px; margin: 0 0 16px; }
.alert-filters a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 700;
}
.alert-filters a.is-current { background: var(--charcoal); color: var(--white); }
.alert-filters a.is-current .count { background: var(--white); color: var(--charcoal); }
.alert-list { display: flex; flex-direction: column; gap: 12px; }
.alert-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 16px 8px;
  box-shadow: var(--shadow);
}
.alert-card.is-new { background: #fff8f6; border-color: #f0c8c4; }
.alert-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.alert-marks { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.alert-card h2 { margin: 10px 0 0; font-size: 1.15rem; }
.alert-meta { margin: 4px 0 0; color: var(--muted); }
.alert-note {
  margin: 12px 0 0;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.alert-card time { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.alert-card .button { margin-top: 8px; }

@media (max-width: 720px) {
  .filters .input, .filters select, .filters input { width: 100%; }
}

.page { animation: rise-in .14s ease; }
.workbench { display: grid; gap: 16px; align-items: start; }
.workbench:has(.work-pane) { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); }
.work-list { display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 180px); overflow: auto; padding: 8px; scrollbar-width: none; }
.meter-input { font-size: 1.7rem; font-weight: 800; letter-spacing: .03em; }
.meter-figure { margin: 8px 0; font-size: 2rem; font-weight: 800; letter-spacing: .03em; }
.meter-done { margin: 8px 0 12px; color: var(--ok); font-weight: 800; }
.meter-ask { margin: 8px 0 12px; }
.meter-question { margin: 0 0 8px; font-weight: 800; }
.meter-ask .choice { min-height: 52px; justify-content: center; border-radius: 14px; }
.meter-shot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fafafa;
  font-weight: 800;
  cursor: pointer;
}
.meter-shot .meter-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 12px; }
.pager form { margin: 0; }
.pager label { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; }
.pager select { width: auto; min-width: 4.5rem; }
.pager .button { margin: 0; }
.pager span { color: var(--muted); font-weight: 700; }
.invoice-doc { display: flex; flex-direction: column; gap: 12px; }
.invoice-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--charcoal);
}
.invoice-brand img { height: 56px; width: auto; }
.invoice-brand p { margin: 0; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.invoice-brand h1 { margin: 0; font-size: 1.35rem; }
.invoice-brand-no { margin-left: auto; text-align: right; }
.invoice-brand-no strong { display: block; font-size: 1.2rem; }
.invoice-brand-no span { color: var(--muted); }
.van-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  border-radius: 10px;
}
.van-row.is-current { background: var(--charcoal); color: var(--white); }
.van-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 10px 8px 10px 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}
.van-pick strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.van-pick:hover { background: #f6f6f6; }
.van-row.is-current .van-pick,
.van-row.is-current .van-pick:hover { background: transparent; color: var(--white); }
.van-row.is-current .badge { background: var(--white); color: var(--charcoal); }
.van-info-btn {
  width: 26px;
  height: 26px;
  margin-right: 6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--charcoal);
  font: italic 800 .95rem/1 Georgia, "Times New Roman", serif;
  cursor: pointer;
}
.van-row.is-current .van-info-btn { border-color: #fff; color: var(--red); }
.van-heading { display: flex; align-items: center; gap: 8px; }
.van-heading h2 { margin: 0; }
.van-info {
  position: fixed;
  z-index: 30;
  width: min(300px, calc(100vw - 16px));
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--charcoal);
  box-shadow: var(--shadow);
}
.van-info p { margin: 0 0 6px; overflow-wrap: anywhere; }
.van-info-name { font-weight: 800; }
.van-info-span { margin-top: 8px; font-weight: 800; }
.work-pane { min-width: 0; }
.van-desk { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.van-desk h2 { margin: 0 0 4px; }
.van-desk-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.van-desk-actions form { margin: 0; }
.van-desk-actions .button { margin-top: 0; }
.mot-line { margin: 0 0 4px; font-weight: 800; }
.mot-line.is-alert { color: var(--red); }
.mot-line.is-warn { color: #8a6208; }
.mot-line.is-ok { color: var(--ok); }
button.chip { margin: 0; font: inherit; font-weight: 700; cursor: pointer; }
button.chip.is-on { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.draft-note { margin: 0; color: var(--muted); font-weight: 700; }
.badge-draft { background: #fff4e8; color: #8a4b08; }
.sheet-table td:focus-within { outline: 2px solid var(--red); outline-offset: -2px; }
.supplier-field { position: relative; margin-top: 8px; }
.supplier-native { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.suggest-list {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 6px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow: auto;
}
.suggest-list button {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.suggest-list button:hover, .suggest-list button.is-active { background: #fde8e8; }
.suggest-list [hidden] { display: none; }
.is-hidden-field { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.popup {
  width: min(440px, calc(100vw - 32px));
  border: 0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.popup::backdrop { background: rgba(28, 28, 28, .45); }
.popup[open] { animation: rise-in .14s ease; }
.bill-popup {
  width: min(980px, calc(100vw - 24px));
  max-height: min(920px, calc(100vh - 24px));
  overflow: auto;
  padding: 16px 18px 18px;
}
.bill-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: -16px;
  z-index: 2;
  margin: -16px -18px 8px;
  padding: 14px 18px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.bill-popup-head h2 { margin: 0; }
.sheet-x svg { display: block; }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 959px) {
  .workbench:has(.work-pane) { grid-template-columns: 1fr; }
  .work-list { max-height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.analysis-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.analysis-tabs a, .analysis-tabs button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--charcoal);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.analysis-tabs a.is-on, .analysis-tabs button.is-on { background: var(--red); border-color: var(--red); color: #fff; }
.van-picks { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.compare-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.compare-pick input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--red); }
.compare-pick:has(input:checked) { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.analysis-bars { display: grid; gap: 10px; }
.analysis-bar { display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-weight: 700; }
.analysis-track { display: block; height: 14px; border-radius: 999px; background: #eee; overflow: hidden; }
.analysis-fill { display: block; height: 100%; border-radius: 999px; background: var(--red); }
.analysis-value { min-width: 5.5rem; text-align: right; }
.van-tone-1 { background: #d0121a; }
.van-tone-2 { background: #1c1c1c; }
.van-tone-3 { background: #6b7280; }
.van-tone-4 { background: #9d1016; }
.van-tone-5 { background: #e07a14; }
.van-tone-6 { background: #3d6b4f; }
.van-tone-7 { background: #c9a227; }
.van-tone-8 { background: #4b5563; }
.defect-pick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); font-weight: 700; }
.defect-pick input { width: 1.1rem; height: 1.1rem; margin-top: 2px; accent-color: var(--red); }
.defect-pick.is-suggested { background: #fff6f6; }
.board-filters { margin-bottom: 16px; }
.board-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr); gap: 12px; align-items: stretch; margin-bottom: 12px; }
.board-leader {
  margin: 0;
  padding: 22px;
  border-radius: 18px;
  background: linear-gradient(155deg, #1c1c1c 0%, #4a1216 100%);
  color: #fff;
}
.board-leader .board-kicker { margin: 0 0 6px; font-size: .8rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #f3c3c6; }
.board-leader a { color: #fff; font-size: 1.35rem; font-weight: 800; text-decoration: none; }
.board-leader strong { display: block; margin: 8px 0 6px; font-size: 2.4rem; line-height: 1; }
.board-leader p { margin: 0; color: #f4f4f4; }
.board-share { height: 10px; margin-top: 16px; border-radius: 999px; background: rgba(255,255,255,.22); overflow: hidden; }
.board-share span { display: block; height: 100%; border-radius: 999px; background: #fff; }
.board-split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr); gap: 12px; margin-bottom: 12px; }
.board-split:not(:has(section:nth-child(2))) { grid-template-columns: 1fr; }
.board-bars .analysis-bar { grid-template-columns: 28px minmax(72px, 108px) minmax(0, 1fr) auto; }
a.analysis-bar { color: inherit; text-decoration: none; }
.board-place {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f3f3f3;
  font-size: .85rem;
}
.analysis-bar.is-lead .board-place { background: var(--red); color: #fff; }
@media (max-width: 800px) {
  .board-grid, .board-split { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .nav, .side-nav, .tab-bar, .nav-backdrop, .no-print, .submit-bar, .done-dialog { display: none !important; }
  body.has-app { display: block; height: auto; overflow: visible; padding: 0; }
  .page { height: auto; overflow: visible; }
  .print-only { display: flex !important; }
  body, .page { background: #fff; margin: 0; width: auto; }
  .page { max-width: none; }
  .card, .check-card, .table-wrap, .report-row { box-shadow: none; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  th { text-transform: none; letter-spacing: 0; background: #fff; }
  table, th, td { border: 1px solid #ccc; }
  .report-mast { align-items: center; gap: 12px; margin-bottom: 16px; }
  .report-mast img { height: 64px; width: auto; }
  .report-mast p { margin: 0; font-weight: 700; }
  .report-mast h1 { margin: 0; font-size: 1.4rem; }
  .bill-popup[open] {
    position: static !important;
    width: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
  body:has(.bill-popup[open]) .desk-bar,
  body:has(.bill-popup[open]) .work-list,
  body:has(.bill-popup[open]) .van-desk,
  body:has(.bill-popup[open]) .work-pane > :not(.bill-popup) { display: none !important; }
  .invoice-brand { break-after: avoid; }
  .invoice-brand img { height: 72px; }
  .thumb { width: 140px; height: 100px; }
  .table-wrap { overflow: visible; border: 1px solid #ccc; background: #fff; box-shadow: none; }
  .table-wrap table { display: table; width: 100%; }
  .table-wrap thead { display: table-header-group; }
  .table-wrap tbody { display: table-row-group; }
  .table-wrap tr { display: table-row; margin: 0; padding: 0; border: 0; border-radius: 0; background: #fff; }
  .table-wrap td { display: table-cell; text-align: left; border: 1px solid #ccc; }
  .table-wrap td::before { content: none; }
}

.header-clock {
  color: var(--charcoal);
  font-weight: 700;
  text-decoration: none;
}
.clock-panel {
  max-width: 28rem;
  background: #fff;
  border-radius: 16px;
  padding: 20px;
}
.clock-panel label { display: block; font-weight: 700; margin-top: 12px; }
.clock-panel input[name="pin"] {
  width: 100%;
  font-size: 1.4rem;
  letter-spacing: .2em;
  padding: 10px 12px;
  margin: 6px 0 12px;
}
.clock-note { color: #5e5e5e; }
.clock-list { margin: 0; padding-left: 1.1rem; }
