/* ServApp styles — office (desktop) and technician (mobile) */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --ink: #111827;
  --ink-2: #4b5563;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --primary: #1f4e9c;
  --primary-ink: #ffffff;
  --success: #0b8043;
  --danger: #c62828;
  --warn: #b45309;
  --warn-bg: #fff7e6;
  --info-bg: #eef4ff;
  --radius: 10px;
  --co: #1f4e9c;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
h3:first-child { margin-top: 0; }
h4 { font-size: 13px; margin: 14px 0 6px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
code { background: #eef0f4; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-line; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.good { color: var(--success); }
.bad { color: var(--danger); }
.meh, .warn-text { color: var(--warn); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none !important; white-space: nowrap; min-height: 36px;
}
.btn:hover { background: #f3f4f6; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.success { background: var(--success); border-color: var(--success); color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #f1c4c4; }
.btn.small { padding: 4px 10px; min-height: 28px; font-size: 12px; }
.btn.block { display: flex; width: 100%; }
.icon-btn { border: 0; background: transparent; font-size: 18px; line-height: 1; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: #eef0f4; }
.linklike { border: 0; background: none; color: var(--primary); padding: 0; font: inherit; cursor: pointer; }

input, select, textarea {
  font: inherit; color: inherit; width: 100%;
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff;
  min-height: 38px;
}
textarea { resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
input[type=color] { padding: 2px; height: 38px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }
.warn-field { border-color: #f59e0b; background: var(--warn-bg); }

.form label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.form label > input, .form label > select, .form label > textarea { margin-top: 4px; font-weight: 400; color: var(--ink); }
.form label.inline, label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.form fieldset { border: 0; padding: 0; margin: 0; }
.pad-top { padding-top: 26px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.span2 { grid-column: span 2; }
.form-foot, .dlg-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.row-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.row-form > * { width: auto; }
.row-form select { min-width: 180px; flex: 1; }
.inline-form { display: inline-flex; gap: 6px; }
.inline-form input { width: 140px; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; margin-bottom: 12px; flex-wrap: wrap; }
.seg label { margin: 0 !important; padding: 7px 12px; cursor: pointer; display: flex !important; align-items: center; gap: 6px; font-weight: 600; }
.seg label:has(input:checked) { background: var(--primary); color: #fff; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1.5px solid var(--c, #999); color: var(--c, #333); font-weight: 600; font-size: 12px; cursor: pointer;
  margin: 0 4px 4px 0; background: #fff;
}
.chip.on, .chip:has(input:checked) { background: var(--c); color: #fff; }
.chip input { display: none; }
.tech-pick { border: 0; padding: 0; margin: 4px 0 12px; }
.tech-pick legend { font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.tech-pick .chip { font-size: 13px; padding: 6px 14px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.st-scheduled { background: #e8eefc; color: #1f4e9c; }
.st-in_progress { background: #fff1d6; color: #9a5b00; }
.st-completed { background: #dcf3e5; color: #0b6b39; }
.st-reviewed { background: #d9f0f7; color: #0d5f78; }
.st-invoiced { background: #ece7f7; color: #5b3ea0; }
.st-cancelled { background: #f1f1f1; color: #777; text-decoration: line-through; }

.alert { padding: 10px 14px; border-radius: 8px; margin: 0 0 12px; border: 1px solid; }
.alert.ok { background: #e9f7ef; border-color: #b7e2c8; color: #0b5e32; }
.alert.err { background: #fdecec; border-color: #f3c0c0; color: #8f1d1d; }
.alert.warn { background: var(--warn-bg); border-color: #f5d49a; color: #7a4a00; }
.alert.info { background: var(--info-bg); border-color: #c9d8f7; color: #1d3f7a; }
.alert.block { display: block; }
.alert pre { white-space: pre-wrap; font-size: 11px; }

#toasts { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 420px); }
.toast { background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); animation: pop .2s ease-out; width: 100%; text-align: center; }
.toast.err { background: #9b1c1c; }
.toast.warn { background: #92400e; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.wide { max-width: 1000px; }
.card.narrow { max-width: 640px; }
.card.empty { text-align: center; color: var(--muted); padding: 40px; }
details > summary { cursor: pointer; }
details.card > summary { margin: -4px 0; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl-wrap.tall { max-height: 60vh; overflow-y: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; position: sticky; top: 0; }
.tbl.small td { font-size: 12px; padding: 6px 8px; }
.tbl.hover tbody tr { cursor: pointer; }
.tbl.hover tbody tr:hover { background: #f7f9fc; }
.tbl tr.sel { background: #eef4ff; }
.tbl tr.group td { background: #f3f5f9; font-weight: 700; }
.tbl td.low { color: var(--danger); font-weight: 700; }
.tbl td.neg { color: var(--danger); font-weight: 700; background: #fdecec; }
.tbl input, .tbl select { min-height: 32px; padding: 5px 8px; }
.tbl.ocr tr.same td { color: var(--muted); }
.table-search { max-width: 280px; margin-bottom: 8px; }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #1f4e9c 0%, #10284f 100%); }
.auth-card { background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.auth-card h1 { margin: 0; }
.brand-row { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.brand-row img { border-radius: 10px; }

/* ---------- office layout ---------- */
.office { --top: 52px; }
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--top); z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: #fff; border-bottom: 3px solid var(--co);
}
.topbar .logo { font-weight: 800; font-size: 18px; color: var(--ink); letter-spacing: -.01em; }
.co-switch select { font-weight: 700; border-color: var(--co); color: var(--co); min-width: 220px; }
.topbar .who { color: var(--ink-2); font-weight: 600; }
.nav-toggle { display: none; }
.sidenav {
  position: fixed; top: var(--top); bottom: 0; left: 0; width: 190px; padding: 12px 8px;
  background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; z-index: 40;
}
.sidenav a { padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.sidenav a:hover { background: #f3f5f9; text-decoration: none; }
.sidenav a.on { background: color-mix(in srgb, var(--co) 12%, #fff); color: var(--co); }
.sidenav .count { background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; }
.nav-foot { margin-top: auto; padding: 8px 12px; font-size: 11px; }
.content { margin-left: 190px; padding: calc(var(--top) + 20px) 24px 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters > input, .filters > select { width: auto; flex: 1 1 160px; }
.filters label.inline input { width: auto; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-2); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-bottom: 3px solid transparent; color: var(--ink-2); font-weight: 600; margin-bottom: -1px; }
.tabs a.on { border-color: var(--co); color: var(--co); }
.tabs a:hover { text-decoration: none; }
.part-lines select { min-width: 220px; }
.steps li { margin-bottom: 6px; }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--muted); font-size: 12px; font-weight: 600; padding-top: 1px; }
.job-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.job-grid .card { margin: 0; }
.job-grid .span-all { grid-column: 1 / -1; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #eee; }
.gallery figcaption { font-size: 11px; color: var(--ink-2); margin-top: 4px; }
.log { list-style: none; padding: 0; margin: 0; max-height: 380px; overflow: auto; }
.log li { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; }

.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-card { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; align-items: center; margin: 0; }
.review-card .cover { display: block; width: 110px; height: 140px; border-radius: 8px; overflow: hidden; background: #eef0f4; display: grid; place-items: center; color: var(--muted); }
.review-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.review-card h3 { margin: 2px 0 4px; }
.review-card .checks { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; font-weight: 600; }
.review-card .side { display: flex; flex-direction: column; gap: 8px; }

/* ---------- calendar ---------- */
.content.cal-main { padding-bottom: 0; height: 100vh; display: flex; flex-direction: column; }
.cal-layout { display: grid; grid-template-columns: 210px 1fr; gap: 16px; flex: 1; min-height: 0; padding-bottom: 16px; }
.cal-side { overflow: auto; }
.cal-side h4 { margin-top: 20px; }
.tech-filter { list-style: none; padding: 0; margin: 0; }
.tech-filter li label { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 6px; cursor: pointer; font-weight: 500; }
.tech-filter li label:hover { background: #eef0f4; }
.tech-filter input { width: 16px; height: 16px; }
.tech-filter .dot { margin: 0; }
.legend { margin-top: 20px; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.lg { display: inline-block; width: 22px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.lg-done { background: repeating-linear-gradient(135deg, #3f51b5 0 4px, #8391d8 4px 8px); }
.lg-del { background: #3f51b5; border-left: 4px solid #ffd400; }
.cal-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 0; display: flex; flex-direction: column; position: relative; }
#calendar { flex: 1; min-height: 520px; }
#calendar.dimmed { flex: none; min-height: 0; height: auto !important; }
#calendar.dimmed .fc-view-harness { display: none; }
.fc .fc-team-button.on { background: var(--co); border-color: var(--co); color: #fff; }
.fc { --fc-border-color: var(--line); --fc-today-bg-color: #fffbea; --fc-button-bg-color: #fff; --fc-button-text-color: var(--ink); --fc-button-border-color: var(--line-2); --fc-button-hover-bg-color: #f3f4f6; --fc-button-hover-border-color: var(--line-2); --fc-button-active-bg-color: var(--co); --fc-button-active-border-color: var(--co); --fc-event-text-color: #fff; }
.fc .fc-button { font-weight: 600; text-transform: none; box-shadow: none !important; }
.fc .fc-button-active { color: #fff !important; }
.fc .fc-toolbar-title { font-size: 20px; margin-left: 8px; display: inline; vertical-align: middle; }
.fc .fc-toolbar.fc-header-toolbar { margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.fc-event { cursor: pointer; border-radius: 5px; }
.fc .ev { overflow: hidden; line-height: 1.25; padding: 1px 2px; font-size: 12px; }
.fc .ev b { font-weight: 600; }
.fc .ev-sub { opacity: .9; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc .ev-time { opacity: .9; }
.ev-tag { display: inline-block; background: #ffd400; color: #111; font-size: 10px; font-weight: 800; padding: 0 4px; border-radius: 3px; margin-right: 3px; vertical-align: 1px; }
.fc-timegrid-event.st-completed, .fc-timegrid-event.st-reviewed, .fc-timegrid-event.st-invoiced, .fc-daygrid-block-event.st-completed, .fc-daygrid-block-event.st-reviewed, .fc-daygrid-block-event.st-invoiced { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.0) 0 6px, rgba(255,255,255,.28) 6px 12px); }
.fc-list-event.st-completed td, .fc-list-event.st-reviewed td, .fc-list-event.st-invoiced td { opacity: .7; }
.fc-event.st-cancelled { opacity: .45; text-decoration: line-through; }
.fc-event.type-delivery { border-left: 4px solid #ffd400 !important; }
.fc-daygrid-event.fc-daygrid-dot-event .ev { color: var(--ink); }
.fc-list-event .ev { color: var(--ink); }
.fc-list-event .ev-sub { color: var(--muted); }

.team-view { overflow: auto; flex: 1; }
.team-scroll { overflow-x: auto; }
table.team { border-collapse: collapse; width: 100%; min-width: 900px; table-layout: fixed; }
table.team th, table.team td { border: 1px solid var(--line); padding: 6px; vertical-align: top; }
table.team thead th { background: #fafbfc; font-size: 12px; }
table.team thead th.today { background: #fffbea; }
table.team tbody th { width: 120px; white-space: nowrap; text-align: left; background: #fafbfc; }
table.team td { height: 110px; position: relative; }
table.team td.busy { background: #fff8f0; }
.team-ev { display: block; width: 100%; overflow-wrap: anywhere; text-align: left; border: 0; border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); border-radius: 4px; padding: 3px 6px; margin-bottom: 4px; font: inherit; font-size: 12px; cursor: pointer; }
.team-ev small { display: block; color: var(--ink-2); }
.team-ev.st-completed, .team-ev.st-reviewed, .team-ev.st-invoiced { opacity: .65; }
.team-add { position: absolute; right: 4px; bottom: 4px; border: 1px dashed var(--line-2); background: #fff; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; opacity: 0; }
table.team td:hover .team-add { opacity: 1; }

dialog.dlg { border: 0; border-radius: 14px; padding: 18px 20px; width: min(560px, 94vw); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
dialog.dlg::backdrop { background: rgba(17, 24, 39, .45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dlg-head h3 { margin: 0; font-size: 18px; }
.vbody .kv { grid-template-columns: 90px 1fr; }

/* ---------- technician app ---------- */
.tech { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); font-size: 15px; }
.tbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; background: var(--co); color: #fff;
}
.tbar h1 { font-size: 17px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbar .icon-btn { color: #fff; font-size: 30px; padding: 0 10px 4px; }
.co-pill select { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.45); font-weight: 700; min-height: 34px; padding: 4px 8px; width: auto; }
.co-pill option { color: #111; }
.q-badge, .net-badge { background: #ffd400; color: #111; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.q-badge.err { background: #fecaca; color: #7f1d1d; }
.net-badge { background: #111; color: #fff; }
.tmain { padding: 12px; max-width: 720px; margin: 0 auto; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabbar a span { font-size: 20px; line-height: 1.2; filter: grayscale(1); opacity: .7; }
.tabbar a.on { color: var(--co); }
.tabbar a.on span { filter: none; opacity: 1; }
.tabbar a:hover { text-decoration: none; }
.day-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin: 18px 4px 8px; }
.jcard {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center;
  background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 8px; color: var(--ink);
  border: 1px solid var(--line); border-left: 5px solid var(--line-2); box-shadow: var(--shadow);
}
.jcard:hover { text-decoration: none; }
.jcard.mine { border-left-color: var(--co); }
.jcard.st-completed, .jcard.st-reviewed, .jcard.st-invoiced { opacity: .7; }
.jtime { text-align: center; font-size: 12px; color: var(--ink-2); }
.jtime b { display: block; font-size: 18px; color: var(--ink); }
.jtitle { font-weight: 700; }
.jsub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.jstat .badge { font-size: 10px; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.daynav { display: flex; gap: 8px; align-items: center; justify-content: center; }
.daynav input { width: auto; }
.tcard { background: #fff; border-radius: 14px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.tcard h3 { margin-top: 0; }
.tcard details > summary { list-style: none; }
.tcard details > summary::-webkit-details-marker { display: none; }
.tcard details > summary h3 { display: inline; }
.tcard details > summary::after { content: '▾'; float: right; color: var(--muted); }
.tcard details[open] > summary::after { content: '▴'; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.jt { margin: 6px 0 8px; font-size: 19px; }
.tcard .kv { grid-template-columns: 84px 1fr; }
.note { background: var(--warn-bg); border: 1px solid #f5d49a; border-radius: 8px; padding: 8px 10px; margin: 10px 0; }
.btn-row { display: flex; gap: 8px; margin: 12px 0 8px; }
.btn-row .btn { flex: 1; }
.tech .btn { min-height: 44px; font-size: 15px; }
.tech input, .tech select, .tech textarea { min-height: 44px; font-size: 16px; } /* 16px stops iOS zoom */
.items-list { padding-left: 18px; margin: 4px 0; }
.gps-line { font-size: 13px; margin: 0 0 10px; padding: 6px 10px; border-radius: 8px; background: #f3f4f6; }
.gps-line.ok { background: #e9f7ef; color: #0b5e32; }
.gps-line.meh { background: var(--warn-bg); color: #7a4a00; }
.gps-line.bad { background: #fdecec; color: #8f1d1d; }
.cam-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cam-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
  min-height: 110px; border-radius: 14px; border: 2px dashed var(--line-2); background: #fafbfc;
  font-weight: 700; font-size: 14px; cursor: pointer; user-select: none;
}
.cam-btn .ic { font-size: 34px; }
.cam-btn.primary { border: 2px solid var(--co); background: color-mix(in srgb, var(--co) 8%, #fff); color: var(--co); }
.cam-btn:active { transform: scale(.98); }
.tgallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.tph { position: relative; display: block; border-radius: 8px; overflow: hidden; background: #eee; aspect-ratio: 3/4; }
.tph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tph .tag { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 4px; }
.tph.form { outline: 3px solid var(--co); outline-offset: -3px; }
.tph.pending img { opacity: .55; }
.tph.pending .tag { background: #b45309; }
.tph.failed .tag { background: var(--danger); }
.ocr-msg { margin: 10px 0 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.ocr-msg.busy { background: var(--info-bg); }
.ocr-msg.ok { background: #e9f7ef; color: #0b5e32; }
.ocr-msg.meh { background: var(--warn-bg); color: #7a4a00; }
.parts-used { list-style: none; padding: 0; margin: 0 0 10px; }
.parts-used li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.part-form { display: grid; grid-template-columns: 1fr; gap: 8px; }
.qty { display: grid; grid-template-columns: 48px 1fr 48px; gap: 6px; }
.qty button { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; font-size: 22px; }
.qty input { text-align: center; }
.done-msg { font-weight: 600; color: var(--success); }
.stock-list { list-style: none; padding: 0; margin: 0; }
.stock-list li { display: flex; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stock-list li.neg b { color: var(--danger); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .two-col, .job-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  .sidenav { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .nav-open .sidenav { transform: none; }
  .content { margin-left: 0; padding-left: 16px; padding-right: 16px; }
  .topbar .who, .topbar .logo { display: none; }
  .co-switch select { min-width: 0; }
  .cal-layout { grid-template-columns: 1fr; }
  .cal-side { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .cal-side h4, .legend { display: none; }
  .cal-side .tech-filter { display: flex; flex-wrap: wrap; }
  .cal-side .btn.block { width: auto; }
  .content.cal-main { height: auto; }
  #calendar { min-height: 70vh; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .review-card { grid-template-columns: 80px 1fr; }
  .review-card .cover { width: 80px; height: 100px; }
  .review-card .side { grid-column: 1 / -1; flex-direction: row; }
}
@media (max-width: 520px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .tcard .kv { grid-template-columns: 84px 1fr; gap: 8px; }
  .tech .grid2 { grid-template-columns: 1fr 1fr; }
}
@media print {
  .topbar, .sidenav, .page-head .actions { display: none; }
  .content { margin: 0; padding: 0; }
}
