:root {
  --ink: #14202b; --ink-2: #3a4753; --muted: #6b7782; --line: #dfe3e7; --bg: #eef1f3; --card: #ffffff;
  --accent: #f2a900; --accent-ink: #14202b; --teal: #1f7a8c; --ok: #2e7d4f; --warn: #b26a00; --bad: #c0392b;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,32,43,.06), 0 4px 14px rgba(20,32,43,.06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { min-height: 100vh; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--teal); }
.boot { padding: 40px; text-align: center; color: var(--muted); }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #fff; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px; }
.top-row { display: flex; align-items: center; gap: 10px; max-width: 760px; margin: 0 auto; }
.top h1 { font-size: 17px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }
.top .sub { font-size: 12px; opacity: .7; font-weight: 500; display: block; }
.icon-btn { background: rgba(255,255,255,.1); border: 0; color: #fff; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:active { background: rgba(255,255,255,.2); }
.icon-btn svg { width: 20px; height: 20px; }
.datebar { display: flex; align-items: center; gap: 8px; max-width: 760px; margin: 10px auto 0; }
.datebar .date-label { flex: 1; text-align: center; background: rgba(255,255,255,.08); border-radius: 10px; padding: 7px 8px; position: relative; }
.datebar .date-label b { display: block; font-size: 15px; }
.datebar .date-label small { opacity: .7; font-size: 12px; }
.datebar input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

main { max-width: 760px; margin: 0 auto; padding: 14px 12px calc(110px + var(--safe-b)); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card-h h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; margin: 0; flex: 1; color: var(--ink-2); }
.card-h .count { background: var(--bg); border-radius: 20px; font-size: 12px; padding: 2px 8px; color: var(--muted); font-weight: 600; }
.card-b { padding: 12px 14px; }
.empty { color: var(--muted); font-size: 14px; padding: 4px 0; }
.card-b.empty { padding: 12px 14px; }
.small { font-size: 13px; color: var(--muted); }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.kv div small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.kv div span { font-weight: 600; font-size: 15px; }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: var(--bg); color: var(--ink-2); }
.chip.ok { background: #e3f3e9; color: var(--ok); }
.chip.warn { background: #fff1d6; color: var(--warn); }
.chip.bad { background: #fbe4e1; color: var(--bad); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 11px; padding: 11px 16px; font-weight: 700; cursor: pointer; background: var(--ink); color: #fff; min-height: 44px; text-decoration: none; }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: var(--bg); color: var(--ink); }
.btn.danger { background: #fbe4e1; color: var(--bad); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.input, select.input, textarea.input { width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 12px; font-size: 16px; min-height: 44px; outline: none; }
.input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31,122,140,.15); }
textarea.input { min-height: 96px; resize: vertical; line-height: 1.4; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1.5px solid var(--line); background: #fff; border-radius: 20px; padding: 7px 12px; font-size: 14px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg.cats button.on[data-v=problem] { background: var(--warn); border-color: var(--warn); }
.seg.cats button.on[data-v=safety] { background: var(--teal); border-color: var(--teal); }
.seg.cats button.on[data-v=incident] { background: var(--bad); border-color: var(--bad); }
.err { color: var(--bad); font-size: 14px; margin: 6px 0 10px; min-height: 1px; }

/* entries */
.entry { border-top: 1px solid var(--line); padding: 12px 14px; }
.entry:first-child { border-top: 0; }
.entry-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.entry-top b { font-size: 15px; }
.entry-top .meta { font-size: 12px; color: var(--muted); }
.entry-top .spacer { flex: 1; }
.entry p { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.45; font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: zoom-in; background: var(--bg); }
.link-btn { background: none; border: 0; color: var(--teal); font-weight: 700; font-size: 13px; cursor: pointer; padding: 4px 2px; }
.link-btn.red { color: var(--bad); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: right; }
table.t tfoot td { font-weight: 800; border-top: 2px solid var(--ink); }

.weather-view { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wx { background: var(--bg); border-radius: 10px; padding: 10px; }
.wx small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.wx span { font-size: 16px; font-weight: 700; }

/* fab */
.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + var(--safe-b)); z-index: 30; box-shadow: 0 8px 24px rgba(20,32,43,.3); padding: 14px 22px; border-radius: 30px; font-size: 16px; }

/* sheets */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,32,43,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { background: var(--card); width: 100%; max-width: 640px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 8px 16px calc(20px + var(--safe-b)); animation: up .2s ease; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet h3 { margin: 0 0 14px; font-size: 19px; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.menu-list button { display: flex; width: 100%; align-items: center; gap: 12px; background: none; border: 0; padding: 14px 4px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; }
.menu-list button:last-child { border-bottom: 0; }

.photo-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-pick .ph { position: relative; }
.photo-pick .ph img { width: 76px; height: 76px; object-fit: cover; border-radius: 9px; display: block; }
.photo-pick .ph button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-weight: 800; cursor: pointer; line-height: 1; }
.photo-add { width: 76px; height: 76px; border: 2px dashed var(--line); border-radius: 9px; display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 12px; text-align: center; font-weight: 700; }
.photo-add input { display: none; }

.sigpad { border: 1.5px dashed var(--muted); border-radius: 10px; background: #fff; width: 100%; height: 160px; touch-action: none; display: block; }
.signed-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.signed-box img { height: 70px; background: #fff; border-bottom: 1px solid var(--ink); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item b { display: block; font-size: 15px; }
.list-item .chev { color: var(--muted); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #14202b 0%, #1f3443 60%, #1f7a8c 140%); }
.login { background: #fff; border-radius: 18px; padding: 26px 22px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.login .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login .logo img { width: 44px; height: 44px; }
.login h2 { margin: 0; font-size: 22px; }
.login p { color: var(--muted); margin: 2px 0 0; font-size: 14px; }

#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 90; display: grid; place-items: center; }
.lightbox img { max-width: 100vw; max-height: 100vh; }

/* ---------- print / PDF view ---------- */
.print-tools { max-width: 800px; margin: 12px auto; display: flex; gap: 10px; padding: 0 12px; }
.sheet-page { background: #fff; max-width: 800px; margin: 0 auto 30px; padding: 26px 28px; color: #000; font-size: 12.5px; box-shadow: var(--shadow); }
.sp-head { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 3px solid #14202b; padding-bottom: 8px; margin-bottom: 12px; gap: 12px; }
.sp-head h1 { margin: 0; font-size: 24px; letter-spacing: 1px; }
.sp-head h1 small { display: block; font-size: 13px; letter-spacing: 3px; font-weight: 600; color: #444; }
.sp-head .right { text-align: right; font-size: 12px; }
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.box { border: 1.2px solid #14202b; break-inside: avoid; margin-bottom: 10px; }
.sp-grid .box { margin-bottom: 0; }
.box h4 { margin: 0; background: #14202b; color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; padding: 5px 8px; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.box .bx { padding: 6px 8px; }
.box table { width: 100%; border-collapse: collapse; }
.box td, .box th { border-bottom: 1px solid #ccc; padding: 4px 6px; text-align: left; vertical-align: top; font-size: 12px; }
.box th { font-size: 10px; text-transform: uppercase; color: #444; }
.box tr:last-child td { border-bottom: 0; }
.box .lbl { color: #555; width: 45%; }
.days { display: flex; gap: 8px; }
.days span { width: 22px; height: 22px; border: 1px solid #999; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.days span.on { background: #14202b; color: #fff; border-color: #14202b; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.sp-entry { padding: 5px 0; border-bottom: 1px solid #ddd; }
.sp-entry:last-child { border-bottom: 0; }
.sp-entry b { font-size: 12px; }
.sp-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sp-photos figure { margin: 0; break-inside: avoid; }
.sp-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.sp-photos figcaption { font-size: 9.5px; color: #444; margin-top: 2px; }
.sp-sign { display: grid; grid-template-columns: 1fr 1fr; border: 1.2px solid #14202b; break-inside: avoid; }
.sp-sign div { padding: 6px 8px; min-height: 64px; }
.sp-sign div + div { border-left: 1.2px solid #14202b; }
.sp-sign small { display: block; font-size: 10px; text-transform: uppercase; color: #555; }
.sp-sign img { height: 48px; }
.muted-p { color: #777; }

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; }
  .top, .print-tools, .fab, #toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .sheet-page { box-shadow: none; margin: 0; padding: 0; max-width: none; }
}

/* ---------- project tabs ---------- */
.ptabs { display: flex; gap: 4px; max-width: 760px; margin: 10px auto 0; background: rgba(255,255,255,.08); border-radius: 11px; padding: 3px; }
.ptabs a { flex: 1; text-align: center; color: rgba(255,255,255,.75); text-decoration: none; font-weight: 700; font-size: 14px; padding: 8px 4px; border-radius: 9px; }
.ptabs a.on { background: #fff; color: var(--ink); }
.tx-warn { color: var(--warn); font-weight: 700; }
.tx-bad { color: var(--bad); font-weight: 700; }
h4.sec { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 18px 4px 8px; }

/* ---------- deliveries list ---------- */
.dcard { display: block; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 14px; margin-bottom: 10px; text-decoration: none; color: inherit; }
.dcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dcard-t { font-weight: 700; font-size: 16px; margin: 4px 0 2px; }
.bar { height: 7px; background: var(--bg); border-radius: 4px; overflow: hidden; margin: 9px 0 6px; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 4px; transition: width .2s; }
.bar.big { height: 10px; }
.banner-issues { display: block; background: #fbe4e1; color: var(--bad); font-weight: 700; padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; text-decoration: none; font-size: 14px; }

/* ---------- import ---------- */
.src-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.src { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 12px; }
.src-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; word-break: break-all; }
.lst { border-top: 1px solid var(--line); padding: 9px 0 4px; margin-top: 8px; }
.lst-h { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.lst-h input, .att input { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.att { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
details summary { cursor: pointer; padding: 6px 0; color: var(--teal); font-weight: 700; }
table.rev td { padding: 4px 3px; }
.cell { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px 7px; font-size: 14px; font-family: ui-monospace, Menlo, Consolas, monospace; min-width: 0; }
.cell.qty { width: 64px; text-align: right; }
.xprev { background: var(--bg); border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 14px; }
.xprev:empty { display: none; }
.mrow { display: grid; grid-template-columns: 1.4fr .6fr; gap: 6px; margin-bottom: 10px; }
.mrow input:last-child { grid-column: 1 / -1; }
.save-sum { text-align: center; font-weight: 700; margin: 6px 0 8px; color: var(--ink-2); }
#saveBar { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 75%, transparent); padding: 10px 0 calc(10px + var(--safe-b)); }

/* ---------- checklist ---------- */
.dmain { padding-bottom: calc(96px + var(--safe-b)); }
.dhead { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.done-banner { background: #e3f3e9; color: var(--ok); border-radius: 10px; padding: 9px 11px; margin-top: 10px; font-size: 14px; }
.dtools { position: sticky; top: var(--hdr-h, 0px); z-index: 10; background: var(--bg); padding: 4px 0 8px; }
.fchips { display: flex; gap: 6px; overflow-x: auto; padding-top: 8px; scrollbar-width: none; }
.fchips::-webkit-scrollbar { display: none; }
.fchip { flex: none; border: 1.5px solid var(--line); background: #fff; border-radius: 20px; padding: 7px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.fchip b { margin-left: 3px; opacity: .7; }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.grp { background: var(--bg); font-size: 11px; font-weight: 800; letter-spacing: .4px; color: var(--muted); padding: 6px 14px; text-transform: uppercase; word-break: break-all; }
.ditem { padding: 11px 14px 12px; border-top: 1px solid var(--line); border-left: 4px solid transparent; }
.ditem.st-arrived { border-left-color: var(--ok); background: #f6fbf8; }
.ditem.st-notfound { border-left-color: var(--warn); background: #fffaf0; }
.ditem.st-damaged { border-left-color: var(--bad); background: #fdf5f4; }
.di-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.di-ref { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; font-size: 15px; word-break: break-all; }
.di-qty { font-weight: 800; font-size: 17px; white-space: nowrap; }
.di-sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.di-comp { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.di-acts { display: grid; grid-template-columns: 1fr 1fr 1fr 46px; gap: 6px; margin-top: 9px; }
.sbtn { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; min-height: 42px; font-weight: 700; font-size: 13px; cursor: pointer; padding: 4px 2px; color: var(--ink-2); }
.sbtn.a.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.sbtn.n.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.sbtn.d.on { background: var(--bad); border-color: var(--bad); color: #fff; }
.sbtn.cam { font-size: 18px; }
.qtybtn { margin-top: 8px; background: #fff; border: 1.5px dashed var(--line); border-radius: 9px; padding: 6px 10px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.qtybtn.short { border-color: var(--warn); color: var(--warn); background: #fff6e6; font-weight: 700; }
.di-extra { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.di-extra img { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.di-note { font-size: 13px; color: var(--ink-2); font-style: italic; }
.di-by { font-size: 11px; color: var(--muted); margin-top: 5px; text-align: right; }
.di-done { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.doc a { flex: 1; min-width: 0; font-weight: 700; text-decoration: none; word-break: break-all; }
.dbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 8px; justify-content: center; padding: 10px 12px calc(10px + var(--safe-b)); background: rgba(238,241,243,.95); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.dbar .btn { flex: 1; max-width: 360px; }
.dbar .btn.accent { flex: 0 0 auto; padding: 11px 22px; }
.stepper { display: grid; grid-template-columns: 56px 1fr 56px; gap: 8px; }
.stepper .input { text-align: center; font-size: 22px; font-weight: 800; }
.stepper .btn { font-size: 24px; }
.warnbox { background: #fff1d6; color: var(--warn); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.issue.resolved { opacity: .65; }
.thumbs img { width: 64px; height: 64px; }
.sheet-page table.cl td, .sheet-page table.cl th { font-size: 10.5px; padding: 3px 4px; }
@media print { .dbar, .ptabs { display: none !important; } }

.src-h .link-btn { white-space: nowrap; }
.rep .box .lbl { width: 24% !important; }
.box.cl-box { break-inside: auto; }
.box.cl-box tr { break-inside: avoid; }
.dcard-t, .dcard > .small:first-of-type { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.box .bx.big-bx { min-height: 80px; }
@media print { html, body, main { background: #fff !important; } .sp-photos { grid-template-columns: repeat(5, 1fr); } .sp-sign div { min-height: 54px; } .sheet-page .box { margin-bottom: 8px; } }

.resolved-line { background: #e3f3e9; color: var(--ok); border-radius: 8px; padding: 6px 9px; font-size: 13px; margin-top: 8px; }
.iss-text { margin: 8px 0 4px; white-space: pre-wrap; line-height: 1.45; font-size: 15px; }
.issue .di-top a { text-decoration: none; font-weight: 700; }
.tthumbs { display: flex; gap: 4px; margin-top: 3px; }
.tthumb { width: 46px; height: 64px; object-fit: cover; object-position: top; border: 1px solid #999; background: #f3f3f3; }
.tickets { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tickets figure { margin: 0; break-inside: avoid; }
.tickets img { width: 100%; max-height: 420px; object-fit: contain; object-position: top; border: 1px solid #999; background: #f6f6f6; min-height: 120px; display: block; }
.tickets figcaption { font-size: 10px; color: #444; margin-top: 3px; word-break: break-all; }
.ticket-box { break-inside: avoid; }
.di-done .spacer { flex: 1; }

/* ---------- lightbox + mark-up ---------- */
.lightbox { flex-direction: column; }
.lightbox img { max-height: calc(100vh - 90px); }
.lb-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 12px 12px calc(12px + var(--safe-b)); background: rgba(0,0,0,.6); }
.lb-b { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.lb-tag { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 12px); left: 12px; background: #f2a900; color: #14202b; font-weight: 800; font-size: 12px; padding: 4px 10px; border-radius: 6px; letter-spacing: 1px; }
.photo-pick .ph .mkb { position: absolute; left: -6px; bottom: -6px; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); display: grid; place-items: center; font-size: 14px; cursor: pointer; }
.mk { position: fixed; inset: 0; z-index: 100; background: #0d1218; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; }
.mk-top { display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px; color: #fff; }
.mk-t { flex: 1; text-align: center; font-weight: 700; }
.mk-b { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.mk-b.save { background: #f2a900; color: #14202b; }
.mk-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px; }
.mk-stage canvas { max-width: 100%; max-height: 100%; touch-action: none; display: block; }
.mk-bar { padding: 8px 10px calc(10px + var(--safe-b)); background: #161d25; }
.mk-tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.mk-tool { background: rgba(255,255,255,.08); color: #fff; border: 2px solid transparent; border-radius: 10px; padding: 6px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.mk-tool span { font-size: 20px; line-height: 1.1; font-weight: 800; }
.mk-tool small { font-size: 11px; opacity: .8; }
.mk-tool.on { border-color: #f2a900; background: rgba(242,169,0,.18); }
.mk-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.mk-cols { display: flex; gap: 10px; flex: 1; }
.mk-col { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); cursor: pointer; }
.mk-col.on { border-color: #f2a900; transform: scale(1.12); }
.mk-text { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 12px 12px calc(12px + var(--safe-b)); background: #161d25; }
.mk-text input { flex: 1; font-size: 16px; border-radius: 10px; border: 0; padding: 10px 12px; }
.mk-text[hidden] { display: none; }
div.f { display: block; margin-bottom: 12px; }
div.f > span { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }

/* ---------- bottom bar + home tiles ---------- */
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: #fff; border-top: 1px solid var(--line); padding: 5px 4px calc(6px + var(--safe-b)); box-shadow: 0 -2px 12px rgba(20,32,43,.06); }
.bnav a, .bnav button { flex: 1; position: relative; text-align: center; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700; background: none; border: 0; padding: 2px 0; cursor: pointer; font-family: inherit; }
.bnav b { display: block; font-size: 20px; line-height: 30px; margin: 0 auto 1px; width: 56px; border-radius: 15px; }
.bnav .on { color: var(--ink); }
.bnav .on b { background: var(--accent); }
.nbadge { position: absolute; top: 0; left: calc(50% + 10px); background: var(--bad); color: #fff; border-radius: 9px; font-size: 10px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 4px; }
body.bn main { padding-bottom: calc(150px + var(--safe-b)); }
body.bn .fab { bottom: calc(78px + var(--safe-b)); }
body.bn .dbar { bottom: calc(62px + var(--safe-b)); border-bottom: 1px solid var(--line); }
body.bn .dmain { padding-bottom: calc(170px + var(--safe-b)); }
body.bn #toast { bottom: calc(150px + var(--safe-b)); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 13px; text-decoration: none; color: inherit; min-height: 118px; display: flex; flex-direction: column; }
.tile .t-h { font-weight: 800; font-size: 14px; }
.tile b { font-size: 34px; line-height: 1.15; margin-top: 6px; }
.tile small { color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: auto; padding-top: 4px; }
.tile.warn { background: #fff1d6; } .tile.warn b { color: var(--warn); }
.tile.ok b { color: var(--ok); }
.tile.info b { color: var(--teal); }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
@media print { .bnav { display: none !important; } }

.sp-res { color: #2e7d4f; font-size: 11px; font-weight: 700; }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 10px; }
.kpi { border: 1.2px solid #14202b; padding: 6px 6px 5px; text-align: center; break-inside: avoid; }
.kpi b { display: block; font-size: 17px; }
.kpi span { font-size: 9.5px; color: #444; text-transform: uppercase; letter-spacing: .3px; }
.muted-row td { color: #999; }
.wk .box td, .wk .box th { font-size: 11px; }
.wk-foot { font-size: 10px; color: #777; text-align: right; margin-top: 6px; }
.print-tools a.btn { flex: 0 0 auto; }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(3, 1fr); } }

.day-row { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.day-row:first-child { border-top: 0; }
.day-row .list-item { border-top: 0; flex: 1; min-width: 0; }
.day-row .tick { display: flex; align-items: center; padding-left: 14px; }
.day-row .tick input { width: 24px; height: 24px; }
.nbadge.static { position: static; display: inline-block; margin-left: 6px; }
@media print { .sheet-page { break-after: page; } .sheet-page:last-child { break-after: auto; } }

.filt { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.filt-l { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); width: 48px; padding-top: 16px; flex: none; }
.fchips.wrap { flex-wrap: wrap; overflow: visible; }
.fchip.tickc i { font-style: normal; margin-right: 5px; }
.fchip.ghostc { border-style: dashed; color: var(--muted); }
