/* ── DAN ZAVOD — Ish o'rni (operatsion oynalar) ────────────────────────────── */
#app { max-width: 620px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.boot { flex: 1; display: grid; place-items: center; }

/* ── Login ── */
.login { flex: 1; display: grid; place-items: center; padding: 20px; }
.login-card { background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 28px 24px; width: 100%; max-width: 360px; }
.login-card .logo { font-family: var(--font-label); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-align: center; }
.login-card .logo small { display: block; font-size: 11px; letter-spacing: .14em; color: var(--muted); margin-top: 4px; text-transform: uppercase; font-weight: 600; }
.login-card h2 { text-align: center; font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 12px; font-family: var(--font-label); }
.pin-display { display: flex; gap: 12px; justify-content: center; margin: 16px 0; }
.pin-dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-2); }
.pin-dot.on { background: var(--ink); border-color: var(--ink); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.pinpad button { padding: 16px; font-size: 20px; font-weight: 600; background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius); }
.pinpad button:hover { background: var(--paper-2); }
.pinpad button:active { transform: scale(.97); }

/* ── App shell ── */
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 12px 16px; background: var(--white); border-bottom: 1.5px solid var(--ink); }
.appbar .title { font-weight: 700; font-size: 16px; line-height: 1.15; }
.appbar .title small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.appbar-actions { display: flex; align-items: center; gap: 8px; }
.ab-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); border: 1.5px solid var(--line-2); color: var(--ink); background: var(--white); }
.ab-btn:hover { background: var(--paper-2); }
.av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 700; cursor: pointer; }

.view { flex: 1; padding: 16px; padding-bottom: 88px; }
.view > * { animation: fade .3s ease; }

/* ── Tabbar (pastki) ── */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 620px;
  display: flex; background: var(--white); border-top: 1.5px solid var(--ink); z-index: 20; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 10px;
  color: var(--muted); background: none; font-size: 11px; font-weight: 600; position: relative; }
.tabbar button .ic { display: flex; }
.tabbar button.on { color: var(--ink); }
.tabbar button.on::before { content: ''; position: absolute; top: 0; left: 20%; right: 20%; height: 2.5px; background: var(--ink); }
.tabbar .badge-n { position: absolute; top: 4px; right: 50%; margin-right: -22px; background: var(--terra); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }

/* ── Segment tabs ── */
.seg-tabs { display: flex; gap: 6px; background: var(--paper-2); padding: 4px; border-radius: var(--radius); margin-bottom: 16px; }
.seg-tabs button { flex: 1; padding: 9px 8px; border-radius: 3px; font-weight: 600; font-size: 13px; color: var(--muted); background: none; }
.seg-tabs button.on { background: var(--white); color: var(--ink); border: 1px solid var(--line-2); }

/* ── KPI ── */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.kpi { background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 14px; }
.kpi.accent { border-color: var(--ink); }
.kpi .lbl { font-family: var(--font-label); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 4px; }
.kpi .sub { font-size: 12px; color: var(--muted); }

/* ── Form ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
h3.sec { font-family: var(--font-label); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 18px 0 10px; display: flex; align-items: center; gap: 7px; }

/* ── Gate (darvoza) kartasi ── */
.gate-card { border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--white); padding: 14px; margin-bottom: 12px; }
.gate-card.in { border-left: 5px solid var(--sage); }
.gate-card.out { border-left: 5px solid var(--blue); }
.gate-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.gate-plate { font-weight: 700; font-size: 17px; }
.gate-meta { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.gate-meta b { font-weight: 700; }
.gate-lab { margin-top: 8px; padding: 8px 10px; background: var(--paper-2); border-radius: var(--radius); font-size: 12px; line-height: 1.5; }
.gate-lab .warn { color: var(--terra); font-weight: 700; }
.gate-actions { display: flex; gap: 8px; margin-top: 12px; }
.gate-actions .btn { flex: 1; }
.gate-wait { margin-top: 10px; text-align: center; font-size: 13px; color: var(--ochre); font-weight: 600; }

/* ── Ro'yxat qatori ── */
.op-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px dotted var(--line); }
.op-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius); background: var(--paper-2); color: var(--ink); flex: none; }
.op-main { flex: 1; min-width: 0; }
.op-t { font-weight: 600; font-size: 14px; }
.op-s { font-size: 12px; color: var(--muted); margin-top: 1px; }
.op-r { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Stock table ── */
.stock-grid { width: 100%; border-collapse: collapse; }
.stock-grid th { text-align: left; font-family: var(--font-label); font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 8px 8px; border-bottom: 1.5px solid var(--ink); }
.stock-grid td { padding: 11px 8px; border-bottom: 1px dotted var(--line); font-size: 14px; }
.stock-grid .num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ic { display: flex; justify-content: center; color: var(--line-2); margin-bottom: 10px; }

/* ── Modal (sheet) ── */
.modal-back { position: fixed; inset: 0; background: rgba(20,24,30,.4); display: grid; place-items: end center; z-index: 100; animation: fade .2s; }
.modal { background: var(--white); border-top-left-radius: 14px; border-top-right-radius: 14px; width: 100%; max-width: 620px;
  max-height: 92vh; overflow-y: auto; padding: 18px 16px 26px; animation: up .25s ease; }
@keyframes up { from { transform: translateY(30px); } }
.modal .pull { font-weight: 700; font-size: 16px; }

/* ── Kompyuter (keng ekran): to'liq desktop rejim ─────────────────────────── */
@media (min-width: 1000px) {
  #app { max-width: 1160px; display: flex; flex-direction: column; }
  .appbar { order: 0; padding: 14px 28px; }
  .tabbar { order: 1; position: static; left: auto; transform: none; max-width: none; width: auto;
    justify-content: flex-start; gap: 2px; padding: 0 14px; border-top: none; border-bottom: 1.5px solid var(--ink); }
  .tabbar button { flex: 0 0 auto; flex-direction: row; gap: 9px; padding: 13px 22px; font-size: 13px; }
  .tabbar button.on::before { top: auto; bottom: -1.5px; left: 10px; right: 10px; height: 3px; }
  .tabbar .badge-n { position: static; margin: 0 0 0 6px; }
  .view { order: 2; padding: 26px 28px 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
    align-items: start; align-content: start; }
  .view > * { min-width: 0; margin: 0; }
  .view > .seg-tabs, .view > button, .view > #home-body, .view > #gate-list { grid-column: 1 / -1; }
  #gate-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  #gate-list > h3.sec { grid-column: 1 / -1; margin: 0; }
  #gate-list .gate-card { margin-bottom: 0; }
  #home-body .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .login-card { max-width: 420px; }
  .modal-back { place-items: center; }
  .modal { max-width: 700px; border-radius: 10px; max-height: 88vh; }
}
