:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --bg2: #efe9de;
  --surface: #fffdf8;
  --surface2: #f1ece2;
  --line: #e2dccf;
  --line2: #d3c9b8;
  --text: #11161c;
  --muted: #5b6876;
  --faint: #8894a1;
  --accent: #1f4e79;
  --accent-ink: #fffdf8;
  --good: #1f7a3d;
  --warn: #9a5b00;
  --bad: #b3261e;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(17, 22, 28, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg2), var(--bg)) fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.ic { width: 22px; height: 22px; flex: 0 0 auto; }
.wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 18px 18px 130px; }
.top { display: flex; align-items: center; gap: 10px; padding: 4px 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.brand small { display: block; font-weight: 700; color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.top .spacer { flex: 1; }
.linkbtn { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 13px; padding: 10px; border-radius: 10px; cursor: pointer; }
.linkbtn:hover { color: var(--text); background: var(--surface); }
.prog { display: flex; gap: 6px; margin: 2px 0 18px; }
.prog .seg { flex: 1; height: 6px; border-radius: 99px; background: var(--surface2); border: 1px solid var(--line); overflow: hidden; transition: background .2s; }
.prog .seg.on { background: var(--accent); border-color: transparent; }
.prog .seg.done { background: color-mix(in srgb, var(--good) 70%, var(--surface2)); border-color: transparent; }
.panel { display: none; animation: pop .18s ease-out; }
.panel.on { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.08; margin: 8px 0 10px; letter-spacing: -.02em; }
h2 { font-size: clamp(21px, 3vw, 30px); line-height: 1.12; margin: 0 0 6px; letter-spacing: -.01em; }
.lead { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 0 0 18px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; min-height: 54px; padding: 14px 16px;
  background: var(--surface2); border: 1.5px solid var(--line); border-radius: 14px;
  color: var(--text); outline: none; font-size: 17px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, textarea.input:focus, select.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
textarea.input { min-height: 108px; resize: vertical; }
.hint { color: var(--faint); font-size: 13px; line-height: 1.5; }
.err { color: var(--bad); font-size: 14px; font-weight: 700; min-height: 20px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.tile {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 9px; min-height: 104px; padding: 16px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
  cursor: pointer; transition: transform .1s, border-color .15s, background .15s;
}
.tile:hover { border-color: var(--line2); }
.tile:active { transform: scale(.985); }
.tile.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.tile .ic { width: 30px; height: 30px; color: var(--accent); }
.tile .tl { font-weight: 800; font-size: 15px; line-height: 1.2; }
.tile .ts { color: var(--muted); font-size: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 14px 22px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  font-weight: 800; font-size: 17px; cursor: pointer;
  transition: transform .1s, border-color .15s, background .15s, opacity .15s;
}
.btn:hover { border-color: var(--line2); }
.btn:active { transform: scale(.99); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; }
.btn-good { background: var(--good); border-color: transparent; color: #06130a; }
.btn-bad { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn-lg { min-height: 66px; font-size: 18px; padding: 16px 26px; width: 100%; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1; min-width: 160px; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: linear-gradient(180deg, transparent, var(--bg) 34%);
  padding: 18px env(safe-area-inset-right) calc(18px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}
.nav-inner { max-width: 900px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.nav .back { flex: 0 0 auto; }
.nav .next { flex: 1; }
.nav.hide { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface2); color: var(--text);
  padding: 10px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.chip.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface2)); }
.chip:hover { border-color: var(--line2); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; min-height: 1px; }
.review { display: grid; gap: 0; }
.review .row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.review .row:last-child { border-bottom: 0; }
.review .k { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.review .v { font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface2); cursor: pointer; }
.check input { width: 24px; height: 24px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.check span { font-size: 14px; line-height: 1.45; color: var(--muted); }
.sigwrap { margin-top: 14px; }
.sigmeta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sigpad { width: 100%; height: 170px; background: var(--surface2); border: 1.5px dashed var(--line2); border-radius: 14px; touch-action: none; display: block; }
.success { text-align: center; padding: 20px 0 6px; }
.success .mark { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: color-mix(in srgb, var(--good) 18%, var(--surface)); border: 2px solid var(--good); color: var(--good); }
.success .mark .ic { width: 44px; height: 44px; }
.rnum { display: inline-block; font-size: clamp(22px, 4vw, 32px); font-weight: 900; letter-spacing: .5px; padding: 10px 18px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); margin: 10px 0 4px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; border: 1px solid var(--line); background: var(--surface2); color: var(--muted); }
.badge.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.toast {
  position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%) translateY(10px);
  max-width: min(92vw, 560px); padding: 14px 18px; border-radius: 14px;
  background: #1f2937; color: #fff; font-weight: 700; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 60;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: #7f1d1d; }
.modal { position: fixed; inset: 0; z-index: 80; display: none; background: rgba(0, 0, 0, .72); padding: 20px; }
.modal.on { display: grid; place-items: center; }
.modal .box { width: min(720px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.modal video { width: 100%; aspect-ratio: 4 / 3; background: #000; border-radius: 12px; object-fit: cover; }
.modal .mt { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.dash-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 6px; }
.dash-top .grow { flex: 1; min-width: 180px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stat .n { font-size: 30px; font-weight: 900; line-height: 1.05; }
.stat .l { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; margin-top: 4px; }
.stat.alert .n { color: var(--warn); }
.stat.bad .n { color: var(--bad); }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.rowcard { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.rowcard:hover { border-color: var(--line2); }
.rowcard .rnum-sm { font-weight: 900; font-size: 13px; letter-spacing: .3px; color: var(--muted); }
.rowcard .rmain { flex: 1; min-width: 0; }
.rowcard .rt { font-weight: 800; font-size: 15px; }
.rowcard .rs { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowcard .ra { text-align: right; flex: 0 0 auto; }
.searchbar { display: flex; gap: 10px; margin: 14px 0 4px; }
.searchbar .input { min-height: 48px; }
.empty { color: var(--muted); text-align: center; padding: 28px; border: 1px dashed var(--line2); border-radius: 14px; }
.btn-sm { min-height: 42px; padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.banner { padding: 14px 16px; border-radius: 14px; font-weight: 700; border: 1px solid var(--line); margin: 0 0 16px; }
.banner.ok { background: color-mix(in srgb, var(--good) 12%, var(--surface)); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); color: var(--good); }
.banner.bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--bad); }
.section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin: 18px 0 12px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 99px; padding: 9px 14px; font-weight: 800; font-size: 13px; cursor: pointer; }
.tab span { display: inline-block; margin-left: 5px; padding: 1px 7px; border-radius: 99px; background: var(--surface2); color: var(--muted); font-size: 11px; }
.tab.on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.tab.on span { background: var(--accent); color: var(--accent-ink); }
.tabpanel { display: none; }
.tabpanel.on { display: block; }
.quickgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.quickcard { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; color: var(--text); }
.quickcard:hover { border-color: var(--accent); }
.quickcard .qic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, var(--surface2)); color: var(--accent); }
.quickcard .qt { font-weight: 900; font-size: 15px; }
.quickcard .qs { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.adslot { margin: 0 0 16px; }
.adslot > * { max-width: 100%; }
.repair, .precheck { display: flex; gap: 14px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.precheck { flex-wrap: wrap; }
.repair .rmain, .precheck .pmain { flex: 1; min-width: 0; }
.repair .rt, .precheck .rt { font-weight: 800; font-size: 15px; }
.repair .rs, .precheck .rs { color: var(--muted); font-size: 13px; line-height: 1.45; }
.repair .ra { flex: 0 0 auto; }
.pdate { flex: 0 0 auto; text-align: center; min-width: 92px; padding: 8px 10px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; }
.pdate strong { display: block; color: var(--text); font-size: 15px; letter-spacing: 0; text-transform: none; margin-top: 2px; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .formgrid { grid-template-columns: 1fr; } .repair, .precheck { flex-wrap: wrap; } }
.portal-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.6; }

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); grid-template-areas: "top top" "side main"; min-height: 100vh; min-width: 0; }
.topbar { grid-area: top; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; }
.top-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; }
.top-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.top-brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
.top-search { display: flex; gap: 8px; flex: 1; max-width: 520px; margin: 0 auto; min-width: 0; }
.top-search .input { min-height: 44px; min-width: 0; }
.top-search .btn { min-height: 44px; padding: 8px 14px; }
.top-user { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--muted); }
.top-new { white-space: nowrap; }
.top-reset { white-space: nowrap; }
.menu-btn { display: none; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font-size: 18px; cursor: pointer; }
.side { grid-area: side; position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow: auto; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--line); }
.side-label { color: var(--faint); font-size: 10px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; padding: 14px 12px 6px; }
.side-link { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; }
.side-link:hover { color: var(--text); background: var(--surface2); }
.side-link.active { color: var(--text); background: color-mix(in srgb, var(--accent) 13%, var(--surface2)); }
.side-count { margin-left: auto; min-width: 22px; text-align: center; padding: 1px 6px; border-radius: 99px; background: var(--surface2); color: var(--muted); font-size: 11px; }
.side-spacer { flex: 1 1 auto; min-height: 24px; }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 12px; border-top: 1px solid var(--line); margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.ok { background: var(--good); }
.dot.bad { background: var(--bad); }
.content { grid-area: main; padding: 22px; width: 100%; max-width: 1440px; margin: 0 auto; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 10px; }
.block-head h2 { margin: 0; font-size: 18px; }
.block-head .sub { color: var(--muted); font-size: 12px; font-weight: 700; }
.filterchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filterchips .chip.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface2)); }
.searchrow { display: flex; gap: 10px; align-items: stretch; }
.searchrow .input { flex: 1; min-width: 0; }
.searchrow .btn { flex: 0 0 auto; }
.results { display: grid; gap: 6px; margin: 8px 0 4px; max-height: 280px; overflow: auto; }
.resultrow { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface2); color: var(--text); cursor: pointer; }
.resultrow:hover { border-color: var(--accent); }
.resultrow .rn { font-weight: 800; }
.resultrow .rs { color: var(--muted); font-size: 12.5px; }
.side-overlay { display: none; }
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; grid-template-areas: "top" "main"; }
  .topbar { position: sticky; flex-wrap: wrap; }
  .menu-btn { display: inline-flex; }
  .top-search { order: 10; flex: 1 1 100%; max-width: none; width: 100%; }
  .top-new { order: 11; }
  .top-reset { order: 11; }
  .top-user { order: 12; margin-left: auto; }
  .side { position: fixed; left: 0; top: 0; height: 100vh; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform .2s; border-right: 1px solid var(--line); }
  .side.open { transform: none; }
  .side-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 40; }
  .side-overlay.on { display: block; }
  .content { padding: 16px; }
  .page-head { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .searchrow { flex-direction: column; }
  .searchrow .btn { width: 100%; }
  .topbar { padding: 10px 12px; }
}

/* Staff shell refinements */
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-brand .brand-logo { height: 30px; width: auto; display: block; }
.brand .brand-logo { height: 34px; width: auto; display: block; }

.top-brand .brand-mark { display: block; width: 38px; height: 38px; flex: none; }
.top-brand .brand-wordmark { display: block; height: 30px; width: auto; }
@media (max-width: 640px) {
  .top-brand .brand-mark { width: 32px; height: 32px; }
  .top-brand .brand-wordmark { height: 26px; }
}

/* Repairs bench */
.filterchips .chip .count { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface2); color: var(--muted); font-size: 10.5px; font-weight: 800; }
.filterchips .chip.sel .count { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); color: var(--accent); background: var(--surface); }
.stat.alert .n { color: var(--warn); }
.repair-hero { margin-bottom: 14px; }
.repair-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.repair-hero-id { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.repair-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.repair-meta { display: flex; flex-wrap: wrap; gap: 12px 26px; margin-top: 14px; }
.rmeta { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.rmeta .k { color: var(--muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.rmeta .v { font-weight: 800; font-size: 14px; }
.stagebar { display: flex; align-items: flex-start; gap: 4px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.stage-step { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 78px; padding: 2px 6px; border: 0; background: none; color: var(--muted); font-size: 10.5px; font-weight: 800; text-align: center; cursor: pointer; }
.stage-step .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--surface2); color: var(--muted); font-size: 11px; font-weight: 900; }
.stage-step.done .dot { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--surface)); color: var(--good); }
.stage-step.current .dot { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.stage-step.current { color: var(--text); }
.stage-step:disabled { cursor: default; opacity: 1; }
.stage-line { flex: 1 0 12px; min-width: 12px; height: 2px; margin-top: 14px; background: var(--line); }
.stage-line.done { background: var(--good); }
.repair-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .9fr); gap: 14px; align-items: start; }
.repair-main, .repair-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 980px) { .repair-grid { grid-template-columns: 1fr; } }
.repair-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.rtab { appearance: none; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 800; letter-spacing: .02em; padding: 10px 12px; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; margin-bottom: -1px; }
.rtab:hover { color: var(--text); }
.rtab.on { color: var(--text); border-bottom-color: var(--accent); }
.rtab-count { min-width: 18px; padding: 2px 6px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line); font-size: 10px; font-weight: 800; color: var(--muted); text-align: center; }
.rtab.on .rtab-count { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.repair-tabpanel { display: none; }
.repair-tabpanel.on { display: block; }
.next-actions { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.na-head { font-size: 10.5px; letter-spacing: .7px; text-transform: uppercase; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.na-list { display: flex; flex-wrap: wrap; gap: 8px; }
.na-item { display: inline-flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); color: var(--text); font-size: 12.5px; font-weight: 700; }
.na-item b { color: var(--accent); font-size: 11.5px; }
.na-item:hover { border-color: var(--line2); text-decoration: none; }
.finish-summary { padding: 10px 12px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; margin: 4px 0 8px; }
.repair-tabpanel > .card + .card { margin-top: 14px; }
.work-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 14px; align-items: start; }
.work-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tabs-ready .tabs-source { display: none; }
@media (max-width: 980px) { .work-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .repair-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .rtab { flex: 0 0 auto; }
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-head h3 { margin: 0; font-size: 16px; }
.kvlist { display: flex; flex-direction: column; }
.kv { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; flex: 0 0 auto; }
.kv .v { text-align: right; font-weight: 700; overflow-wrap: anywhere; }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.mini-row:last-child { border-bottom: 0; }
.mini-row .grow { flex: 1; min-width: 0; }
.mini-row.link { color: inherit; text-decoration: none; }
.mini-row.link:hover { color: var(--accent); }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex: 0 0 auto; }
.tl-body { min-width: 0; }
.tl-desc { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.tl-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* Parts management */
.parts-add { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--surface2); }
.part-form { display: grid; grid-template-columns: minmax(0,2fr) 100px 100px 70px auto; gap: 8px; align-items: end; margin-top: 8px; }
.part-form .field { margin-bottom: 0; }
@media (max-width: 720px) { .part-form { grid-template-columns: 1fr 1fr; } }
.inv-results { display: flex; flex-direction: column; }
.inv-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.inv-row:last-child { border-bottom: 0; }
.inv-row .inv-name { flex: 1; min-width: 0; }
.part-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.part-actions .btn { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.part-row { flex-wrap: wrap; }

/* Customer parts approval */
.approval-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface2); }
.approval-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.approval-line { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.approval-line .grow { flex: 1; min-width: 0; }

/* Repair photos */
.photo-upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.photo-upload .input[type="file"] { flex: 1 1 220px; min-height: 46px; padding: 8px 10px; }
.photo-upload #photoCaption { flex: 1 1 160px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo { margin: 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface2); display: flex; flex-direction: column; gap: 6px; }
.photo img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; background: var(--surface); display: block; }
.photo figcaption { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.photo .btn { min-height: 28px; padding: 3px 8px; font-size: 12px; align-self: flex-start; }

/* Reports */
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .report-cols { grid-template-columns: 1fr; } }

/* Mobilesentrix cached catalogue */
.ms-panel { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--surface2); }
.ms-controls { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr 1.6fr; gap: 8px; }
@media (max-width: 720px) { .ms-controls { grid-template-columns: 1fr 1fr; } }
.ms-results { max-height: 320px; overflow: auto; margin-top: 8px; }
.ms-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ms-row:last-child { border-bottom: 0; }
.ms-row .grow { flex: 1; min-width: 0; }

/* 2026 brand typography */
@font-face {
  font-family: 'Public Sans';
  src: url('fonts/public-sans-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
body, button, input, textarea, select { font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
h1, h2, h3, .brand, .top-brand, .side-label { font-family: 'Space Grotesk', 'Public Sans', -apple-system, sans-serif; }
.side-link { letter-spacing: -.005em; }
.side { scrollbar-width: thin; }
.empty { padding: 22px; }
.inv-table .btn-sm { min-height: 34px; padding: 5px 9px; font-size: 11px; }
.inv-table .input { min-height: 34px; padding: 5px 7px; }
.inv-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
@media (min-width: 1100px) {
  .inv-table .name { min-width: 320px; }
}

/* Overflow actions */
.more-menu { position: relative; display: inline-block; }
.more-menu > summary { list-style: none; cursor: pointer; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 190px; padding: 8px; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.more-menu-list .btn { justify-content: flex-start; min-height: 40px; padding: 8px 10px; }

/* Collapsible side groups */
.side-group { margin: 2px 0; }
.side-group > summary { list-style: none; cursor: pointer; }
.side-group > summary::-webkit-details-marker { display: none; }
.side-group-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 800; font-size: 13px; user-select: none; }
.side-group-head::before { content: ''; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; flex: none; }
.side-group[open] > .side-group-head::before { transform: rotate(45deg); }
.side-group-head:hover { color: var(--text); background: var(--surface2); }
.side-group-links { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 18px; }
.side-group-links .side-link { font-size: 13px; padding: 8px 12px; }
.side-group-head .side-count { margin-left: auto; }

/* Keep v2 shell controls unstyled by legacy page CSS */
.topbar .btn, .topbar .linkbtn, .topbar .input, .side-link, .side-group-head, .page-actions .btn { text-transform: none !important; letter-spacing: normal !important; }

.topbar .top-search .btn, .topbar .top-new, .topbar .top-reset { text-transform: none !important; letter-spacing: normal !important; }

/* Repair stage help */
.stage-help { margin: 8px 0 4px; color: var(--muted); font-size: 12px; }
.stage-help summary { cursor: pointer; font-weight: 700; color: var(--muted); width: fit-content; }
.stage-help summary:hover { color: var(--text); }
.stage-help-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 18px; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); }
.stage-help-grid div { display: flex; flex-direction: column; gap: 1px; }
.stage-help-grid strong { color: var(--text); font-size: 12px; }
.stage-help-grid span { line-height: 1.4; }
@media (max-width: 700px) { .stage-help-grid { grid-template-columns: 1fr; } }

/* Command palette and accessibility */
.skip-link { position:absolute; left:-9999px; top:8px; z-index:2000; padding:10px 14px; border-radius:8px; background:var(--surface); color:var(--text); font-weight:800; box-shadow:var(--shadow); }
.skip-link:focus { left:12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
.cmd-overlay { position:fixed; inset:0; z-index:1600; background:rgba(17,22,28,.38); backdrop-filter:blur(3px); display:grid; place-items:start center; padding:10vh 16px 16px; }
.cmd-overlay[hidden] { display:none; }
.cmd-panel { width:min(620px,100%); background:var(--surface); border:1px solid var(--line); border-radius:16px; box-shadow:0 24px 80px rgba(17,22,28,.24); overflow:hidden; }
.cmd-input { border:0 !important; border-bottom:1px solid var(--line) !important; border-radius:0 !important; padding:16px 18px !important; font-size:17px !important; box-shadow:none !important; }
.cmd-list { max-height:50vh; overflow:auto; padding:6px; }
.cmd-item { display:block; width:100%; text-align:left; border:0; background:transparent; border-radius:9px; padding:10px 12px; color:var(--text); font-weight:700; cursor:pointer; }
.cmd-item:hover, .cmd-item.sel { background:color-mix(in srgb, var(--accent) 11%, var(--surface2)); }
.cmd-hint { padding:9px 14px; border-top:1px solid var(--line); color:var(--faint); font-size:11px; }
