/* ═══════════════ Module screens (load after app.css) ═══════════════ */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1 1 160px; min-width: 0; }
.inp, .sel {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: 1rem; outline: none; font-family: inherit;
}
.inp:focus, .sel:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.inp.big { font-size: 1.3rem; font-weight: 700; text-align: right; }
.inp[readonly] { background: var(--surface-2); }
.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box .inp { padding-left: 36px; }
.fld { margin-bottom: 12px; }
.fld > label { display: block; font-size: .78rem; font-weight: 700; color: var(--label); margin-bottom: 5px; }
.fld .hint { font-size: .74rem; color: var(--text-muted); margin-top: 4px; }
.fld .warn { font-size: .8rem; color: var(--err-cl); margin-top: 5px; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

.btn-sm-mm { min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 700; font-size: .86rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-sm-mm.pri { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-sm-mm.ok  { background: var(--success); border-color: var(--success); color: #fff; }
.btn-sm-mm.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn-sm-mm:disabled { opacity: .6; }
.btn-row { display: flex; gap: 8px; margin-top: 14px; }
.btn-row > * { flex: 1; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 13px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* date bar */
.datebar { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px; margin-bottom: 12px; }
.datebar button { width: 42px; height: 42px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 1.1rem; cursor: pointer; flex: 0 0 auto; }
.datebar input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-weight: 700; font-size: 1rem; text-align: center; font-family: inherit; }
.datebar .lock { font-size: .72rem; color: var(--err-cl); font-weight: 700; padding: 0 4px; white-space: nowrap; }

/* picture tiles */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.itile { position: relative; background: var(--surface); border: 2px solid transparent; border-radius: 14px; padding: 7px 6px 9px;
  text-align: center; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.08); transition: transform .08s; color: var(--text); font-family: inherit; }
.itile:active { transform: scale(.96); }
.itile .pic { width: 100%; aspect-ratio: 1; border-radius: 10px; background: var(--surface-2); display: flex; align-items: center;
  justify-content: center; overflow: hidden; color: var(--text-muted); font-size: 2rem; }
.itile .pic img { width: 100%; height: 100%; object-fit: cover; }
.itile .n1 { font-weight: 700; font-size: .86rem; line-height: 1.25; margin-top: 6px; }
.itile .n1 .nm-en { display: block; font-size: .7rem; font-weight: 500; color: var(--text-muted); line-height: 1.2; }
[data-names="en"] .itile .n1 .nm-en { font-size: .86rem; font-weight: 700; color: var(--text); }
.itile .tag { display: block; font-size: .72rem; font-weight: 700; color: var(--success); margin-top: 3px; }
.itile.done { border-color: var(--success); }
.itile.bad { border-color: var(--danger); }
.itile.bad .tag { color: var(--danger); }
.itile .vc { position: absolute; top: 5px; left: 5px; font-size: .62rem; font-weight: 800; background: var(--primary); color: #fff; border-radius: 6px; padding: 1px 6px; }
.itile.off { opacity: .5; }

/* list rows */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.row-i { display: flex; align-items: center; gap: 11px; padding: 11px 13px; cursor: pointer; }
.row-i + .row-i { border-top: 1px solid var(--border); }
.row-i .thumb { width: 46px; height: 46px; border-radius: 10px; background: var(--surface-2); flex: 0 0 auto; overflow: hidden;
  display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.3rem; }
.row-i .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-i .mid { flex: 1; min-width: 0; }
.row-i .mid b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-i .mid b .nm-en { font-weight: 500; font-size: .8rem; color: var(--text-muted); margin-left: 5px; }
.row-i .mid small { display: block; font-size: .76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-i .end { text-align: right; flex: 0 0 auto; }
.row-i .end b { display: block; font-size: .95rem; }
.row-i .end small { font-size: .74rem; color: var(--text-muted); }
.empty { text-align: center; color: var(--text-muted); padding: 34px 12px; font-size: .9rem; }
.empty i { display: block; font-size: 2.2rem; margin-bottom: 8px; opacity: .6; }

.badge-mm { display: inline-block; font-size: .66rem; font-weight: 800; letter-spacing: .3px; border-radius: 6px; padding: 2px 7px; vertical-align: 1px; }
.badge-mm.p { background: #fff3cd; color: #8a6100; }
.badge-mm.a { background: var(--ok-bg); color: var(--ok-cl); }
.badge-mm.r { background: var(--err-bg); color: var(--err-cl); }
.badge-mm.off { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
[data-theme="dark"] .badge-mm.p { background: #3d3210; color: #f5d27a; }

/* sticky summary + floating add button */
.sumbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #1e2533; color: #fff;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sumbar small { opacity: .75; display: block; font-size: .7rem; }
.sumbar b { font-size: 1.05rem; }
.sumbar .r { text-align: right; }
.fab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 26; width: 56px; height: 56px; border-radius: 18px;
  border: 0; background: var(--primary); color: #fff; font-size: 1.6rem; box-shadow: 0 8px 22px rgba(0,0,0,.3); cursor: pointer; }
.fab.solo { bottom: calc(20px + env(safe-area-inset-bottom)); }

/* sheet header with picture */
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sheet-head .thumb { width: 58px; height: 58px; border-radius: 12px; background: var(--surface-2); overflow: hidden; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 1.7rem; color: var(--text-muted); }
.sheet-head .thumb img { width: 100%; height: 100%; object-fit: cover; }
.sheet-head .t { flex: 1; min-width: 0; }
.sheet-head .t b { display: block; font-size: 1.1rem; }
.sheet-head .t b .nm-en { display: block; font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.sheet-head .t small { color: var(--text-muted); font-size: .8rem; }
.sheet-head .x { width: 38px; height: 38px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 1.1rem; cursor: pointer; flex: 0 0 auto; }
.calc { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: .86rem; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.calc b { text-align: right; }
.calc .gp { color: var(--success); }
.calc .neg { color: var(--danger); }

/* transliteration chips */
.chips-ml { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }
.chip-ml { border: 1.5px solid var(--primary); background: var(--primary-light); color: var(--primary); border-radius: 10px; padding: 5px 11px; font-size: 1rem; cursor: pointer; }
.chip-ml.on { background: var(--primary); color: #fff; }
[data-theme="dark"] .chip-ml { background: color-mix(in srgb, var(--primary) 30%, var(--surface)); color: #fff; }
.chip-src, .chip-hint { font-size: .72rem; color: var(--text-muted); }

/* photo boxes */
.photo-box { position: relative; border: 2px dashed var(--border); border-radius: 12px; aspect-ratio: 4/3; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--text-muted); cursor: pointer; overflow: hidden; background: var(--surface-2); text-align: center; font-size: .8rem; font-weight: 600; }
.photo-box i { font-size: 1.8rem; margin-bottom: 3px; }
.photo-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-box.ok { border-style: solid; border-color: var(--success); }
.photo-box.sq { aspect-ratio: 1; max-width: 160px; }
.thumbs { display: flex; gap: 6px; margin-top: 6px; }
.thumbs button { padding: 0; border: 0; background: none; cursor: zoom-in; }
.thumbs img { width: 64px; height: 48px; object-fit: cover; border-radius: 7px; background: var(--surface-2); display: block; }

/* live camera */
.cam { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; }
.cam video { flex: 1; width: 100%; object-fit: cover; min-height: 0; }
.cam .bar { display: flex; justify-content: space-around; align-items: center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); background: #000; }
.cam .shoot { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); cursor: pointer; }
.cam .side { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 1.3rem; cursor: pointer; }
.cam .lbl { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; color: #fff; font-weight: 700; text-shadow: 0 1px 4px #000; }
.viewer { position: fixed; inset: 0; z-index: 85; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.viewer img { max-width: 100%; max-height: 100%; }

/* report */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 11px 13px; border-top: 3px solid var(--kc, var(--primary)); }
.kpi small { display: block; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.kpi b { display: block; font-size: 1.18rem; margin-top: 3px; }
.kpi span { font-size: .76rem; color: var(--text-muted); }
.dmg-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.dmg-box > div { display: flex; justify-content: space-between; padding: 10px 14px; font-size: .9rem; }
.dmg-box > div + div { border-top: 1px solid var(--border); }
.dmg-box .eff.good b { color: var(--success); }
.dmg-box .eff.bad b { color: var(--danger); }
.card-mm { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.card-mm h6 { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--primary-text); margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.tabulator { font-size: .82rem; border-radius: 10px; }
[data-theme="dark"] .tabulator, [data-theme="dark"] .tabulator .tabulator-header, [data-theme="dark"] .tabulator .tabulator-header .tabulator-col,
[data-theme="dark"] .tabulator-row, [data-theme="dark"] .tabulator .tabulator-footer, [data-theme="dark"] .tabulator .tabulator-tableholder { background: var(--surface); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .tabulator-row.tabulator-row-even { background: var(--surface-2); }
[data-theme="dark"] .tabulator .tabulator-header .tabulator-col { background: var(--surface-2); }
[data-theme="dark"] .tabulator-row .tabulator-cell { border-color: var(--border); }
[data-theme="dark"] .tabulator .tabulator-footer .tabulator-calcs-holder,
[data-theme="dark"] .tabulator .tabulator-footer .tabulator-calcs-holder .tabulator-row { background: var(--surface-2) !important; color: var(--text); }
.temp-pass { font-family: Consolas, monospace; font-size: 1.45rem; font-weight: 800; letter-spacing: 1px; text-align: center; padding: 14px;
  background: var(--surface-2); border: 2px dashed var(--primary); border-radius: 12px; margin: 10px 0; user-select: all; }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; }
