:root {
  --navy: #14213d;
  --navy-2: #1f3260;
  --blue: #1d4fa3;
  --yellow: #f5b800;
  --teal: #0c9a8e;
  --bg: #eef1f5;
  --card: #ffffff;
  --line: #dde2e9;
  --text: #1b2330;
  --muted: #667185;
  --ok: #17924a;
  --ok-bg: #e5f6ec;
  --bad: #d12f2f;
  --bad-bg: #fde9e9;
  --na: #6c7686;
  --na-bg: #eef0f3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 6px 20px rgba(20, 33, 61, .07);
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
#app { height: 100%; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 12px; font-weight: 600; font-size: 16px; background: var(--card); border: 1px solid var(--line); transition: transform .08s, background .15s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn svg { width: 20px; height: 20px; flex: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; }

/* ------------------------------------------------ login */
.login { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100%; }
.login-hero { position: relative; background: var(--navy) center/cover no-repeat; overflow: hidden; }
.login-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(200deg, rgba(20,33,61,.3), rgba(20,33,61,.9)); }
.login-hero .brand { position: absolute; z-index: 1; left: 40px; top: 40px; right: 40px; color: #fff; }
.login-hero .brand img { width: 74px; border-radius: 10px; margin-bottom: 18px; }
.login-hero .brand h1 { font-size: 40px; font-weight: 800; letter-spacing: -.5px; }
.login-hero .brand p { margin: 8px 0 0; font-size: 18px; opacity: .8; }
.login-form { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--card); }
.login-form form { width: min(420px, 100%); display: grid; gap: 18px; }
.login-form h2 { font-size: 30px; font-weight: 800; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; font: inherit; font-size: 17px; padding: 13px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: #f9fafc; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(29,79,163,.15); }
.form-error { color: var(--bad); font-size: 14px; min-height: 18px; }

.creds { position: fixed; left: 18px; bottom: calc(18px + var(--safe-b)); z-index: 40; width: 330px; background: #fff; border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden; transform-origin: bottom left; animation: pop .35s cubic-bezier(.2,.9,.3,1.2); }
.creds header { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 16px; background: var(--navy); color: #fff; }
.creds header h3 { font-size: 15px; }
.creds .list { padding: 8px; display: grid; gap: 6px; }
.cred { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; text-align: left; padding: 10px; border-radius: 12px; border: 1px solid var(--line); }
.cred:active { background: #f1f4f9; }
.cred .av { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; }
.cred b { display: block; font-size: 15px; }
.cred code { font-size: 12.5px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.creds-fab { position: fixed; left: 18px; bottom: calc(18px + var(--safe-b)); z-index: 39; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ------------------------------------------------ app chrome */
.topbar { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 18px; background: var(--navy); color: #fff; flex: none; }
.topbar .logo { width: 38px; height: 38px; border-radius: 8px; }
.topbar h1 { font-size: 19px; font-weight: 700; white-space: nowrap; }
.topbar .crumb { font-size: 15px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.topbar .icon-btn { color: #fff; }
.topbar .icon-btn:active { background: rgba(255,255,255,.12); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 5px; border-radius: 30px; background: rgba(255,255,255,.1); }
.user-chip .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; }
.user-chip .who { line-height: 1.15; padding-right: 6px; }
.user-chip .who b { font-size: 14px; display: block; }
.user-chip .who span { font-size: 12px; opacity: .75; }
.role-supervisor { background: #7a4fd6; }
.role-operator { background: #e07b00; }
.role-mechanic { background: #0c9a8e; }

.page { flex: 1; overflow: auto; padding: 24px; -webkit-overflow-scrolling: touch; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 26px; font-weight: 800; }
.page-head .spacer { flex: 1; }

/* ------------------------------------------------ equipment list */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.eq-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-align: left; display: flex; flex-direction: column; transition: transform .12s; }
.eq-card:active { transform: scale(.985); }
.eq-card .ph { aspect-ratio: 16 / 9; background: #dfe4ea center/cover no-repeat; position: relative; }
.eq-card .ph .tag { position: absolute; left: 12px; top: 12px; background: rgba(20,33,61,.85); color: #fff; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 20px; letter-spacing: .3px; }
.eq-card .body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.eq-card h3 { font-size: 20px; font-weight: 800; }
.eq-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14px; }
.eq-meta dt { color: var(--muted); }
.eq-meta dd { margin: 0; font-weight: 600; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 12.5px; font-weight: 600; padding: 5px 10px; border-radius: 20px; background: #eef2f8; color: var(--navy-2); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: #fff4d6; color: #9a6a00; }

/* ------------------------------------------------ equipment detail */
.detail { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel h3 { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.hero-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #dfe4ea; }
.hero-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.spec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; margin-top: 18px; }
.spec div { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.spec dt { font-size: 12.5px; color: var(--muted); }
.spec dd { margin: 3px 0 0; font-weight: 700; }
.start-panel { display: grid; gap: 14px; }
.start-panel h3 { margin-bottom: 0; }
.start-panel .cl-card + .cl-card { margin-top: 0; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 44px; background: #f7f9fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2314213d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center; font-weight: 600; color: var(--ink, #14213d); }
.field select:focus { border-color: var(--blue); background-color: #fff; box-shadow: 0 0 0 3px rgba(29,79,163,.15); outline: none; }
.unit-id { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.unit-id div { background: #fff; padding: 10px 12px; }
.unit-id dt { font-size: 12px; color: var(--muted); }
.unit-id dd { margin: 3px 0 0; font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.unit-id div:last-child:nth-child(3n + 1) { grid-column: span 3; }
.unit-id div:last-child:nth-child(3n + 2) { grid-column: span 2; }
#unitBody { display: grid; gap: 14px; }
#unitBody:empty { display: none; }
#unitBody .form-error { margin-top: -8px; }
.cl-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 16px; border-radius: 14px; border: 1px solid var(--line); text-align: left; width: 100%; background: #fff; }
.cl-card + .cl-card { margin-top: 12px; }
.cl-card:active { background: #f5f7fb; }
.cl-card .ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.cl-card .ic svg { width: 28px; height: 28px; }
.cl-card h4 { margin: 0; font-size: 17px; }
.cl-card p { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.cl-card .go { color: var(--muted); }
.progress-mini { height: 6px; border-radius: 3px; background: #e7ebf1; overflow: hidden; margin-top: 8px; }
.progress-mini i { display: block; height: 100%; background: var(--teal); }
.hist { width: 100%; border-collapse: collapse; font-size: 14px; }
.hist th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.hist td { padding: 10px 6px; border-bottom: 1px solid #eef1f5; }
.hist tr[data-href] { cursor: pointer; }
.hist tr[data-href]:active td { background: #f5f7fb; }
.empty { color: var(--muted); font-size: 14.5px; padding: 6px 0; }

/* ------------------------------------------------ inspection */
.inspect { flex: 1; display: grid; grid-template-columns: 1fr 420px; min-height: 0; }
.stage { position: relative; min-height: 0; background: #e9edf1; overflow: hidden; }
.stage .viewer { position: absolute; inset: 0; }
.stage .viewer canvas { display: block; touch-action: none; }
.viewer-labels { position: absolute; inset: 0; pointer-events: none; }
.viewer-marker { display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.viewer-marker .pin { width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(245,184,0,.7); animation: ping 1.6s infinite; }
.viewer-marker .txt { order: -1; margin-bottom: 6px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px; white-space: nowrap; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(245,184,0,.7); } 80%, 100% { box-shadow: 0 0 0 16px rgba(245,184,0,0); } }
.stage-tools { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.stage-tools .icon-btn { background: rgba(255,255,255,.95); box-shadow: var(--shadow); color: var(--navy); }
.stage-tools .icon-btn.on { background: var(--navy); color: #fff; }
.stage-title { position: absolute; left: 14px; top: 14px; right: 80px; z-index: 5; display: flex; gap: 10px; align-items: center; pointer-events: none; }
.stage-title .badge { background: var(--navy); color: #fff; font-weight: 800; font-size: 14px; padding: 7px 11px; border-radius: 10px; }
.stage-title .photo-btn { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.95); box-shadow: var(--shadow);
  font-weight: 700; font-size: 14px; padding: 7px 12px; border-radius: 10px; color: var(--navy); }
.stage-title .photo-btn svg { width: 16px; height: 16px; }
.stage-title .photo-btn.on { background: var(--navy); color: #fff; }
.stage-title .nm { background: rgba(255,255,255,.95); box-shadow: var(--shadow); font-weight: 700; font-size: 14px; padding: 7px 12px; border-radius: 10px; }
.part-pop { position: absolute; z-index: 8; max-width: 240px; background: var(--navy); color: #fff; font-weight: 700; font-size: 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  padding: 8px 12px; transform: translate(-50%, calc(-100% - 12px)); animation: pop .2s ease; pointer-events: none; white-space: nowrap; }
.part-pop::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--navy); transform: translateX(-50%) rotate(45deg); }
.stage-photo { position: absolute; left: 14px; top: 62px; z-index: 6; width: clamp(220px, 34%, 400px); margin: 0; border-radius: 14px; overflow: hidden; background: #1b2330;
  box-shadow: 0 10px 30px rgba(10,16,30,.28); border: 3px solid #fff; cursor: zoom-in; animation: fade .3s; }
.stage-photo img { width: 100%; height: clamp(150px, 30vh, 300px); object-fit: cover; }
.stage-photo figcaption { position: absolute; left: 8px; bottom: 8px; background: rgba(20,33,61,.88); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; background: #e9edf1; z-index: 9; transition: opacity .4s; }
.loading .spin { width: 46px; height: 46px; border-radius: 50%; border: 4px solid #cfd6de; border-top-color: var(--blue); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.side { background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side-head { padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.side-head .row { display: flex; align-items: center; gap: 10px; }
.side-head .count { font-size: 13px; color: var(--muted); font-weight: 600; }
.bar { height: 8px; background: #e7ebf1; border-radius: 4px; overflow: hidden; margin-top: 10px; display: flex; }
.bar i { display: block; height: 100%; }
.bar .s-ok { background: var(--ok); } .bar .s-bad { background: var(--bad); } .bar .s-na { background: #a7afbb; }
.side-body { flex: 1; overflow: auto; padding: 18px; display: grid; gap: 16px; align-content: start; }
.sec-name { font-size: 12.5px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: .5px; }
.item-title { display: flex; gap: 12px; align-items: flex-start; }
.item-title .code { flex: none; font-weight: 800; background: var(--navy); color: #fff; border-radius: 9px; padding: 5px 9px; font-size: 14px; }
.item-title h2 { font-size: 21px; font-weight: 800; }
.guide { font-size: 14.5px; color: #3c4658; line-height: 1.45; background: #f4f7fb; border-radius: 12px; padding: 11px 13px; border-left: 4px solid var(--blue); }
.na-note { font-size: 13.5px; color: var(--muted); }
.ref { position: relative; border-radius: 12px; overflow: hidden; background: #e4e8ee; cursor: zoom-in; }
.ref img { width: 100%; height: 200px; object-fit: cover; }
.ref span { position: absolute; left: 8px; bottom: 8px; background: rgba(20,33,61,.85); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { min-height: 54px; border-radius: 12px; border: 2px solid var(--line); font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; background: #fff; }
.seg button svg { width: 20px; height: 20px; }
.seg button.ok.on { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.seg button.bad.on { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.seg button.na.on { background: var(--na-bg); border-color: var(--na); color: var(--na); }
.lbl { font-size: 13.5px; font-weight: 700; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
.lbl em { font-style: normal; color: var(--bad); }
textarea.comment { width: 100%; min-height: 86px; resize: vertical; font: inherit; font-size: 15.5px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f9fafc; outline: none; }
textarea.comment:focus { border-color: var(--blue); background: #fff; }
textarea.comment.err { border-color: var(--bad); }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photos .th { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #e4e8ee center/cover; }
.photos .th button { position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.photos .th button svg { width: 14px; height: 14px; }
.photos .add { aspect-ratio: 1; border-radius: 10px; border: 2px dashed #c3cad4; display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.photos .add span { display: grid; justify-items: center; gap: 2px; }
.photos .add svg { width: 26px; height: 26px; }
.side-foot { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px 18px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }

.drawer-bg { position: fixed; inset: 0; background: rgba(10,16,30,.4); z-index: 30; animation: fade .2s; }
.drawer { position: fixed; top: 0; bottom: 0; right: 0; width: min(440px, 92vw); background: #fff; z-index: 31; display: flex; flex-direction: column; animation: slide .25s ease; }
.drawer header { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); gap: 10px; }
.drawer header h3 { flex: 1; font-size: 18px; }
.drawer .list { overflow: auto; flex: 1; padding: 6px 0 20px; }
.drawer .sec { font-size: 12.5px; font-weight: 700; color: var(--teal); text-transform: uppercase; padding: 14px 18px 6px; letter-spacing: .4px; }
.step-row { width: 100%; display: grid; grid-template-columns: 54px 1fr 26px; gap: 10px; align-items: center; text-align: left; padding: 10px 18px; font-size: 14.5px; }
.step-row.cur { background: #eef3fb; }
.step-row .c { font-weight: 700; color: var(--muted); font-size: 13px; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c7ced8; display: grid; place-items: center; }
.dot svg { width: 13px; height: 13px; color: #fff; }
.dot.ok { background: var(--ok); border-color: var(--ok); }
.dot.bad { background: var(--bad); border-color: var(--bad); }
.dot.na { background: #a7afbb; border-color: #a7afbb; }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(100%); } }

.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5,8,15,.92); display: grid; place-items: center; animation: fade .2s; }
.lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 8px; }
.lightbox .cap { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); text-align: center; color: #fff; font-weight: 600; }
.lightbox .icon-btn { position: absolute; right: 16px; top: 16px; color: #fff; background: rgba(255,255,255,.12); }

/* ------------------------------------------------ report */
.report { max-width: 1060px; margin: 0 auto; }
.rep-head { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 20px; margin-bottom: 18px; }
.rep-head h2 { font-size: 28px; font-weight: 800; }
.rep-head .sub { color: var(--muted); margin-top: 4px; }
.rep-head img { width: 76px; border-radius: 8px; }
.kv { width: 100%; border-collapse: collapse; font-size: 14.5px; background: #fff; }
.kv th { width: 18%; text-align: left; background: #f1f4f8; font-weight: 600; color: #3c4658; }
.kv th, .kv td { border: 1px solid var(--line); padding: 9px 11px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.stat { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px; }
.stat b { display: block; font-size: 30px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 14px; }
.stat.ok b { color: var(--ok); } .stat.bad b { color: var(--bad); } .stat.na b { color: var(--na); }
.chk { width: 100%; border-collapse: collapse; background: #fff; font-size: 14.5px; margin-bottom: 18px; }
.chk th, .chk td { border: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.chk thead th { background: #e7ebf1; }
.chk .secrow th { background: var(--navy); color: #fff; text-align: left; }
.chk td.code { width: 70px; font-weight: 600; }
.chk td.ans { width: 120px; font-weight: 700; }
.chk td.ans.ok { color: var(--ok); } .chk td.ans.bad { color: var(--bad); } .chk td.ans.na { color: var(--na); } .chk td.ans.pending { color: #b0b7c3; font-weight: 500; }
.chk .cmt { color: #3c4658; font-size: 13.5px; margin-top: 3px; }
.chk .pics { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chk .pics img { width: 92px; height: 70px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.repairs { display: grid; gap: 12px; margin-bottom: 18px; }
.repair { background: #fff; border-radius: 12px; border: 1px solid var(--line); padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; }
.repair .what { font-weight: 700; }
.repair .sec { color: var(--muted); font-size: 13px; }
.repair .cmt { grid-column: 1 / -1; font-size: 14px; }
.repair .pics { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.repair .pics img { width: 140px; height: 100px; object-fit: cover; border-radius: 8px; }
.notes { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; font-size: 14px; }
.notes ol { margin: 6px 0 0; padding-left: 20px; }
.rep-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin: 18px 0 30px; }
.sigline { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 26px 0 8px; }
.sigline div { border-top: 1px solid #9aa3af; padding-top: 6px; font-size: 13px; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(26px + var(--safe-b)); transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 12px 18px;
  border-radius: 12px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------ responsive */
@media (max-width: 1100px) { .inspect { grid-template-columns: 1fr 380px; } }
@media (orientation: portrait) { .stage-photo { width: clamp(150px, 30%, 260px); } .stage-photo img { height: clamp(110px, 18vh, 200px); } }
@media (max-width: 900px), (orientation: portrait) {
  .login { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .detail { grid-template-columns: 1fr; }
  .inspect { grid-template-columns: 1fr; grid-template-rows: 48vh 1fr; }
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .user-chip .who { display: none; }
  .topbar .crumb { display: none; }
  .page { padding: 16px; }
  .creds { width: calc(100vw - 36px); }
}

/* ------------------------------------------------ print (report to PDF) */
@media print {
  @page { size: A4; margin: 12mm; }
  html, body, #app { height: auto; background: #fff; }
  .topbar, .rep-actions, .toast, .creds, .creds-fab { display: none !important; }
  .page { overflow: visible; padding: 0; }
  .stat, .panel { box-shadow: none; border: 1px solid var(--line); }
  .chk tr, .repair { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
