/* ── POS terminal — «warm paper» editorial · monoblok uchun ────────────────── */
#app { height: 100vh; display: flex; flex-direction: column; background: var(--paper); overflow: hidden; }
.boot { height: 100vh; display: grid; place-items: center; }

/* ── Login ── */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--paper-edge); padding: 20px; }
.login-card { width: min(440px, 94vw); background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 34px; }
.login .logo { text-align: center; font-family: var(--font-label); letter-spacing: .3em; color: var(--ink); font-weight: 700; text-transform: uppercase; font-size: 16px; }
.login h2 { text-align: center; margin: 8px 0 22px; font-size: 15px; font-weight: 500; color: var(--muted); }
.pin-display { display: flex; justify-content: center; gap: 14px; margin: 20px 0; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--paper-2); border: 1.5px solid var(--line-2); transition: all .12s; }
.pin-dot.on { background: var(--ink); border-color: var(--ink); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.pinpad button { padding: 20px; font-family: var(--font-num); font-size: 32px; background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); transition: background .1s, transform .05s; }
.pinpad button:active { background: var(--paper-2); transform: scale(.97); }
.pinpad button.primary { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── Header ── */
.topbar { display: flex; align-items: center; gap: 20px; padding: 0 26px; height: 78px; background: var(--ink); color: var(--cream); flex-shrink: 0; }
.tp-badge { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--radius); font-family: var(--font-label); font-weight: 700; font-size: 22px; color: #fff; }
.brand-block .b-title { font-family: var(--font-label); font-size: 15px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.brand-block .b-sub { font-size: 13px; color: var(--muted-2); margin-top: 2px; }
.point-pick { display: flex; gap: 8px; margin-left: 14px; }
.point-pick .pt { height: 46px; padding: 0 22px; background: transparent; color: var(--muted-2); border: 1.5px solid var(--ink-2); font-family: var(--font-label); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; border-radius: var(--radius); }
.point-pick .pt.on { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.online { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-label); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--online); }
.online .dot { background: var(--online); width: 9px; height: 9px; box-shadow: 0 0 0 3px rgba(46,160,67,.22); animation: onlinePulse 2s infinite; }
@keyframes onlinePulse { 0%,100% { box-shadow: 0 0 0 3px rgba(46,160,67,.22); } 50% { box-shadow: 0 0 0 5px rgba(46,160,67,.10); } }
.topbar .clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; }
.topbar .user { text-align: right; }
.topbar .user .u-name { font-size: 14px; font-weight: 600; }
.topbar .user .u-role { font-size: 12px; color: var(--muted-2); }

.content { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 26px; }
.content.noscroll { overflow: hidden; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-family: var(--font-label); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.back-btn:hover { color: var(--ink); }

/* ── Home — butun ekranni to'ldiradi, balansli ── */
.home-fit { height: 100%; display: grid; grid-template-columns: 1.5fr 1fr; grid-template-rows: minmax(0, 1fr); gap: 20px; }
.home-col-l, .home-col-r { display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.hero-main { flex: 0 0 auto; background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 32px 36px; display: flex; flex-direction: column; gap: 22px; }
.hero-main h1 { font-family: var(--font-label); font-size: 28px; font-weight: 700; color: var(--cream); letter-spacing: 0; line-height: 1.15; }
.hero-main .pt-name { color: var(--muted-2); margin-top: 8px; font-size: 14px; }
.hero-main .btn.lg { align-self: flex-start; padding: 18px 32px; font-size: 17px; }
.tiles { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 14px; }
.tile { background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; transition: background .12s, border-color .12s, transform .1s; }
.tile:active { transform: scale(.98); }
.tile:hover { background: var(--paper-2); border-color: var(--ink); }
.tile .ic { display: flex; justify-content: center; margin-bottom: 18px; color: var(--ink); }
.tile .t { font-family: var(--font-label); font-size: 18px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.tile .s { font-size: 14px; color: var(--muted); margin-top: 8px; }

.stat-card { flex-shrink: 0; }
.stat-line { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px dotted var(--line); }
.stat-line:last-child { border: none; }
.stat-line .k { color: var(--muted); font-size: 14px; }
.stat-line .v { font-family: var(--font-num); font-size: 24px; }
.recent-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.recent-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.recent-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
.recent-row .r-ic { display: flex; }
.recent-row .r-plate { font-weight: 600; font-size: 14px; }
.recent-row .r-sub { font-size: 12px; color: var(--muted); }
.recent-row .r-net { font-family: var(--font-num); font-size: 18px; }

/* ── Weigh — balansli, katta touch-maydonlar ── */
.weigh-screen { height: 100%; display: flex; flex-direction: column; }
.weigh-topline { flex-shrink: 0; display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.weigh-topline h2 { font-family: var(--font-label); font-size: 16px; letter-spacing: .04em; text-transform: uppercase; }
.weigh-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.55fr 380px; gap: 20px; grid-template-rows: minmax(0, 1fr); }
.weigh-left, .weigh-right { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }

/* step rail */
.step-rail { flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.step { border: 1.5px solid var(--line-2); background: var(--white); color: var(--muted); padding: 14px 20px; display: flex; align-items: center; gap: 16px; border-radius: var(--radius); }
.step.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.step.done { background: var(--sage); color: #fff; border-color: var(--sage); }
.step .n { font-family: var(--font-num); font-size: 32px; line-height: 1; }
.step .st-lbl { font-family: var(--font-label); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.step .st-sub { font-size: 13px; opacity: .8; }

/* weight card */
.weight-card { flex: 1 1 auto; min-height: 170px; background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 20px 32px; display: flex; flex-direction: column; }
.wc-top { flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wc-label { font-family: var(--font-label); font-size: 12px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; color: var(--muted-2); }
.stable-pill { display: inline-flex; align-items: center; gap: 9px; padding: 9px 18px; border-radius: 999px; background: var(--sage); color: #fff; font-family: var(--font-label); font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.stable-pill.unstable { background: var(--terra); }
.stable-pill .dot { background: #fff; width: 10px; height: 10px; }
.wc-big { flex: 1; display: flex; align-items: center; justify-content: center; gap: 20px; min-height: 0; }
.wc-big .n { font-family: var(--font-num); font-size: min(10vw, 24vh, 260px); line-height: .8; letter-spacing: -0.01em; }
.wc-big .n.unstable { color: var(--ochre); }
.wc-big .u { font-family: var(--font-label); font-size: 32px; color: var(--muted); align-self: flex-end; padding-bottom: 20px; }
.wc-note { flex-shrink: 0; font-size: 13px; color: var(--muted); text-align: center; }

/* capture buttons */
.cap-row { flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cap-btn { background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 18px; display: flex; align-items: center; justify-content: center; gap: 10px; font-family: var(--font-label); font-size: 15px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; transition: background .1s; }
.cap-btn:hover:not(:disabled) { background: var(--paper-2); }
.cap-btn:disabled { opacity: .4; }
.cap-btn.accent { background: var(--blue); color: #fff; border-color: var(--blue); }
.cap-btn svg { flex-shrink: 0; }

/* manual numpad (foto) */
.manual-display { flex-shrink: 0; background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 14px 22px; display: flex; align-items: baseline; justify-content: space-between; }
.manual-display .ml { font-family: var(--font-label); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.manual-display .mv { font-family: var(--font-num); font-size: 48px; line-height: 1; }
.stage-tabs { flex-shrink: 0; display: flex; gap: 10px; }
.stage-tabs button { flex: 1; padding: 12px; border: 1.5px solid var(--line-2); border-radius: var(--radius); font-family: var(--font-label); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--muted); background: var(--white); }
.stage-tabs button.on { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.numpad { flex: 0 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 50px; gap: 8px; }
/* Foto rejim (numpad bor): og'irlik displeyi ixcham, forma to'liq sig'sin */
.weigh-left:has(.numpad) .weight-card { flex: 0 1 auto; }
.weigh-left:has(.numpad) .wc-big .n { font-size: min(7vw, 14vh, 120px); }
.weigh-left:has(.numpad) .wc-big { padding: 4px 0; }
.numpad button { background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); font-family: var(--font-num); font-size: 26px; font-weight: 700; transition: background .08s; }
.numpad button:active { background: var(--paper-2); transform: scale(.98); }

/* form — katta touch maydonlar, panelni to'ldiradi */
.form-card { flex: 1 1 auto; min-height: 0; overflow-y: auto; background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 18px 22px; }
.form-card .card-title { margin-bottom: 14px; }
.form-body { display: flex; flex-direction: column; gap: 11px; }
.seg { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.seg button { padding: 15px; border: 1.5px solid var(--line-2); border-radius: var(--radius); font-family: var(--font-label); font-weight: 600; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; background: var(--white); }
.seg button.on { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.seg button.on.in { background: var(--sage); border-color: var(--sage); color: #fff; }
.seg button.on.out { background: var(--blue); border-color: var(--blue); color: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-card .field { gap: 5px; }
.form-card .field label { font-family: var(--font-label); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.form-card input.inp, .form-card select.inp { padding: 11px 14px; font-size: 15px; }

/* cameras */
.section-head { flex-shrink: 0; font-family: var(--font-label); font-size: 12px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; color: var(--blue); border-bottom: 2px solid var(--blue); padding-bottom: 9px; }
.section-head.terra { color: var(--terra); border-color: var(--terra); }
.cam-grid { flex-shrink: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.cam { aspect-ratio: 16/10; background: var(--ink-2); border-radius: var(--radius); position: relative; display: grid; place-items: center; overflow: hidden; }
.cam img { width: 100%; height: 100%; object-fit: cover; }
.cam .cam-name { font-family: var(--font-label); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cam .live { position: absolute; top: 9px; left: 11px; display: flex; align-items: center; gap: 6px; font-family: var(--font-label); font-size: 8px; letter-spacing: .15em; color: var(--muted-2); }
.cam .live .dot { width: 8px; height: 8px; background: var(--terra-bright); }
.cam .cno { position: absolute; bottom: 9px; right: 11px; font-family: var(--font-label); font-size: 8px; letter-spacing: .12em; color: var(--muted); }

/* tip + checklist */
.tip-box { flex-shrink: 0; background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 18px 20px; display: flex; gap: 18px; align-items: flex-start; }
.tip-box .bang { font-family: var(--font-num); font-size: 40px; line-height: .8; }
.tip-box.ochre .bang { color: var(--ochre); } .tip-box.ochre .tl { color: var(--ochre); }
.tip-box.terra .bang { color: var(--terra-bright); } .tip-box.terra .tl { color: var(--terra-bright); }
.tip-box .tl { font-family: var(--font-label); font-size: 11px; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.tip-box .tt { font-size: 14px; line-height: 1.5; margin-top: 6px; }
.weigh-screen #checklist-host { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.checklist { flex: 1; min-height: 0; overflow-y: auto; background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 14px 20px; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dotted var(--line); }
.check-item:last-child { border: none; }
.check-item .mk { width: 26px; height: 26px; border-radius: var(--radius); display: grid; place-items: center; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; }
.check-item .mk.ok { background: var(--sage); }
.check-item .mk.warn { background: var(--ochre); }
.check-item .mk.idle { background: var(--line-2); color: var(--muted); }
.check-item .cl { font-size: 15px; font-weight: 600; }
.check-item .cn { margin-left: auto; font-size: 13px; color: var(--muted); text-align: right; }

.save-btn { flex-shrink: 0; width: 100%; padding: 20px; background: var(--ink); color: #fff; border-radius: var(--radius); font-family: var(--font-label); font-size: 18px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: filter .1s; }
.save-btn.blue { background: var(--ink); }
.save-btn:hover { filter: brightness(1.08); }
.save-btn:active { transform: scale(.99); }
.save-btn .sub { font-family: var(--font); font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .85; }

/* sim (kompakt) */
.sim-panel { flex-shrink: 0; border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 9px 14px; background: var(--paper-2); display: flex; align-items: center; gap: 12px; }
.sim-panel .h { font-family: var(--font-label); font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; flex-shrink: 0; }
.sim-panel .btn { padding: 8px 13px; font-size: 12px; }

/* footer */
.pos-footer { height: 42px; border-top: 1px dotted var(--line-2); display: flex; align-items: center; justify-content: space-between; padding: 0 26px; flex-shrink: 0; }
.pos-footer span { font-family: var(--font-label); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(28,31,46,.55); display: grid; place-items: center; z-index: 500; padding: 20px; }
.modal { width: min(580px, 94vw); max-height: 90vh; overflow-y: auto; background: var(--paper); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 28px; }
.result-net { text-align: center; margin: 12px 0 18px; }
.result-net .lbl { font-family: var(--font-label); font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.result-net .v { font-family: var(--font-num); font-size: 60px; color: var(--sage); line-height: 1; margin-top: 6px; }
.flag-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.flag { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: var(--radius); background: var(--white); border: 1.5px solid var(--terra); color: var(--terra); font-size: 13px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px dotted var(--line); gap: 12px; }
.kv .k { font-size: 13px; color: var(--muted); }
.kv .v { font-weight: 700; text-align: right; }

/* journal */
.jrow { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius); margin-bottom: 8px; }
.jrow:hover { border-color: var(--ink); }
.jrow .seq { font-family: var(--font-num); color: var(--muted); font-size: 18px; }
.jrow .net { font-family: var(--font-num); font-size: 20px; }
.jrow .plate { font-weight: 700; }
.dir-in { color: var(--sage); } .dir-out { color: var(--blue); } .dir-internal { color: var(--teal); }
.dir-tag { font-family: var(--font-label); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }

.photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.photos-grid img { width: 100%; border-radius: var(--radius); border: 1.5px solid var(--line-2); }
.photos-grid .cap { font-family: var(--font-label); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); text-align: center; margin-top: 4px; }

.cam-flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 9998; }
.cam-flash.go { animation: flash .35s ease; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: .85; } 100% { opacity: 0; } }

/* ── Mobil / tor ekran (telefon-planshet): ustunlar tik, sahifa skroll ── */
@media (max-width: 840px) {
  #app { height: auto; min-height: 100vh; overflow: visible; }
  .content, .content.noscroll { overflow: visible; padding: 14px; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; row-gap: 8px; }
  .topbar .clock { display: none; }
  .brand-block .b-sub { display: none; }
  .point-pick { order: 10; width: 100%; margin-left: 0; }
  .point-pick .pt { flex: 1; padding: 0 6px; height: 42px; font-size: 11px; }
  .topbar .user { margin-left: auto; }
  .home-fit { display: flex; flex-direction: column; height: auto; gap: 14px; }
  .tiles { grid-template-rows: none; grid-auto-rows: minmax(128px, auto); }
  .hero-main { padding: 22px; }
  .hero-main h1 { font-size: 22px; }
  .hero-main .btn.lg { align-self: stretch; }
  .recent-list { max-height: 320px; }
  .weigh-screen { height: auto; }
  .weigh-grid { display: flex; flex-direction: column; height: auto; }
  .weigh-left, .weigh-right { height: auto; overflow: visible; }
  .weight-card { min-height: 150px; padding: 16px 18px; }
  .wc-big .n { font-size: clamp(46px, 17vw, 96px); }
  .weigh-left:has(.numpad) .wc-big .n { font-size: clamp(38px, 13vw, 72px); }


  .sim-panel { flex-wrap: wrap; row-gap: 8px; }  .weigh-topline { flex-wrap: wrap; row-gap: 8px; }
  .weigh-topline h2 { font-size: 14px; }  .step-rail { grid-template-columns: 1fr; gap: 8px; }
  .step { padding: 10px 14px; }
  .form-grid { grid-template-columns: 1fr; }
}
