/* ── Dan Business (mobil) — «warm paper» editorial (namuna asosida) ─────────── */
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--paper); position: relative; padding-bottom: 76px; }
.boot { height: 100vh; display: grid; place-items: center; }
@media (min-width: 481px) { body { background: var(--paper-edge); } #app { border-left: 1.5px solid var(--line-2); border-right: 1.5px solid var(--line-2); } }

/* ── Login ── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--paper-edge); }
.login-card { width: 100%; background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 30px; }
.login .logo { text-align: center; font-family: var(--font-label); letter-spacing: .28em; color: var(--ink); font-weight: 700; text-transform: uppercase; font-size: 16px; }
.login .logo small { display: block; letter-spacing: .06em; color: var(--muted); font-size: 11px; margin-top: 6px; font-style: normal; font-family: var(--font); text-transform: none; }
.login h2 { text-align: center; margin: 16px 0 18px; font-size: 14px; color: var(--muted); font-weight: 500; font-style: normal; }
.pin-display { display: flex; justify-content: center; gap: 14px; margin: 16px 0; }
.pin-dot { width: 15px; height: 15px; 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: 10px; }
.pinpad button { padding: 16px; font-family: var(--font-num); font-size: 28px; background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); }
.pinpad button:active { background: var(--paper-2); transform: scale(.97); }

/* ── Header (dark ink) ── */
.appbar { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--cream);
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; }
.appbar .title { font-family: var(--font-label); font-size: 17px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.appbar .title small { display: block; font-family: var(--font); font-size: 11px; color: var(--muted-2); font-weight: 400; letter-spacing: 0; text-transform: none; font-style: normal; margin-top: 2px; }
.appbar .av { width: 38px; height: 38px; border-radius: 50%; background: var(--ink-2); display: grid; place-items: center; color: var(--cream); font-family: var(--font-label); font-weight: 700; }
.appbar-actions { display: flex; align-items: center; gap: 10px; }
.ab-btn { display: flex; color: var(--muted-2); padding: 6px; }
.ab-btn:hover { color: var(--cream); }
.appbar .lang-toggle { border-color: var(--ink-2); }
.appbar .lang-toggle button { background: transparent; color: var(--muted-2); }
.appbar .lang-toggle button.on { background: var(--cream); color: var(--ink); }

/* AI — minimal metrikalar */
.ai-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.ai-metric { background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 11px 6px; text-align: center; }
.ai-metric.bad { border-color: var(--terra); }
.ai-metric .m-v { font-family: var(--font-num); font-size: 18px; font-weight: 700; }
.ai-metric.bad .m-v { color: var(--terra); }
.ai-metric .m-l { font-family: var(--font-label); font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }

/* AI — toza finding kartalari */
.finding .f-row { display: flex; align-items: center; gap: 10px; }
.f-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.f-t { flex: 1; font-family: var(--font-label); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; line-height: 1.25; }
.f-metric { font-family: var(--font-num); font-size: 22px; font-weight: 700; }
.f-ev { margin-top: 8px; }
.f-ev summary { font-family: var(--font-label); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); cursor: pointer; }
.ev-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.ev-i { font-size: 12px; background: var(--paper-2); border: 1px solid var(--line); padding: 6px 9px; border-radius: var(--radius); }

/* Ombor legend ikoni */
.stock-legend .leg-ic { display: flex; margin-bottom: 2px; }

/* Moshina bosqichlari — animatsiyali stepper */
.sf-dir { text-align: center; font-family: var(--font-label); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 14px 0 2px; }
.stage-flow { display: flex; align-items: stretch; gap: 6px; margin: 8px 0 18px; }
.sf-step { flex: 1; border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 12px 6px; text-align: center; opacity: 0; transform: translateY(10px); animation: sfIn .45s cubic-bezier(.2,.7,.3,1) forwards; }
.sf-step.done { border-color: var(--ink); background: var(--ink); color: var(--cream); }
.sf-n { width: 20px; height: 20px; margin: 0 auto 6px; border-radius: 50%; background: var(--paper-2); color: var(--muted); font-size: 11px; font-weight: 700; display: grid; place-items: center; font-family: var(--font-num); }
.sf-step.done .sf-n { background: var(--cream); color: var(--ink); }
.sf-lbl { font-family: var(--font-label); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sf-step.done .sf-lbl { color: var(--muted-2); }
.sf-val { font-family: var(--font-num); font-size: 20px; font-weight: 700; margin-top: 3px; }
.sf-u { font-size: 10px; color: var(--muted); }
.sf-step.done .sf-u { color: var(--muted-2); }
.sf-arrow { display: flex; align-items: center; color: var(--muted-2); opacity: 0; animation: sfIn .45s ease forwards; }
@keyframes sfIn { to { opacity: 1; transform: none; } }

/* Bosiladigan dalil qatori */
.ev-i.click { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; transition: border-color .12s, background .12s; }
.ev-i.click:hover { border-color: var(--ink); background: var(--white); }
.ev-i.click .grow { flex: 1; }
.ev-go { color: var(--muted-2); display: flex; flex-shrink: 0; }

/* Batafsil tekshiruv (investigatsiya) ro'yxati */
.inv-hint { font-size: 12px; color: var(--muted); margin: 2px 0 12px; }
.inv-row { border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; cursor: pointer; transition: border-color .12s; }
.inv-row:hover { border-color: var(--ink); }
.inv-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.inv-time { font-family: var(--font-num); font-weight: 700; font-size: 15px; }
.inv-dir { font-family: var(--font-label); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 3px; }
.inv-top .badge, .inv-top span:last-child { margin-left: auto; }
.inv-mid { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.inv-op { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-2); }
.inv-vals { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.inv-col { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 4px; text-align: center; }
.inv-col.hl { border-color: var(--terra); background: var(--red-soft); }
.ic-l { font-family: var(--font-label); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ic-v { font-family: var(--font-num); font-size: 15px; font-weight: 700; margin-top: 2px; }
.inv-col.hl .ic-v { color: var(--terra); }

/* Qo'llanma / Инструкция */
.guide-modal { max-width: 560px; }
.guide-lead { font-size: 13px; color: var(--muted); margin-bottom: 6px; line-height: 1.5; }
.guide-body { display: flex; flex-direction: column; }
.guide-sec { padding: 14px 0; border-bottom: 1px dotted var(--line); }
.guide-h { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.guide-ic { display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--ink); border-radius: var(--radius); color: var(--ink); flex-shrink: 0; }
.guide-t { font-family: var(--font-label); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .03em; }
.guide-d { font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.guide-tips { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.guide-tip { display: flex; gap: 7px; align-items: flex-start; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.gt-ic { color: var(--terra); display: flex; margin-top: 2px; flex-shrink: 0; }
.guide-foot { padding-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.guide-foot .guide-tip { color: var(--ink-2); }
.guide-foot .gt-ic { color: var(--muted); }

.view { padding: 16px; }
.view h3.sec { font-family: var(--font-label); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.view h3.sec:first-child { margin-top: 4px; }

/* ── KPI cards ── */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 15px; }
.kpi .lbl { font-family: var(--font-label); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .v { font-family: var(--font-num); font-size: 30px; margin-top: 8px; line-height: 1; }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 4px; font-style: normal; }
.kpi.accent { background: var(--ink); border-color: var(--ink); }
.kpi.accent .lbl { color: var(--muted-2); } .kpi.accent .v { color: var(--cream); } .kpi.accent .sub { color: var(--muted-2); }
.kpi.green .v { color: var(--sage); }
.kpi.gold .v { color: var(--blue); }

/* chart card */
.chart-card { background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 16px; margin-top: 12px; }
.chart-card .ct { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.chart-card .ct .t { font-family: var(--font-label); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.legend { display: flex; gap: 12px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ── AI ── */
.ai-hero { background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 20px; display: flex; gap: 18px; align-items: center; }
.ai-hero .donut { width: 108px; flex-shrink: 0; }
.ai-hero .txt h4 { font-family: var(--font-label); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; color: var(--ink); }
.ai-hero .txt p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; font-style: normal; }
.health-Yaxshi { color: var(--sage); } .health-warn { color: var(--ochre); } .health-bad { color: var(--terra-bright); }

.finding { background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; border-left: 4px solid var(--line-2); }
.finding.high { border-left-color: var(--terra); }
.finding.warn { border-left-color: var(--ochre); }
.finding.info { border-left-color: var(--blue); }
.finding .fh { display: flex; gap: 8px; align-items: flex-start; }
.finding .fh .t { font-family: var(--font-label); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; flex: 1; line-height: 1.35; }
.finding .detail { font-size: 13px; color: var(--ink-2); margin-top: 8px; line-height: 1.55; }
.finding .ev { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.finding .ev div { font-size: 12px; color: var(--ink); background: var(--paper-2); border: 1px solid var(--line); padding: 6px 9px; border-radius: var(--radius); }
.finding .rec { margin-top: 10px; font-size: 12.5px; color: var(--terra); display: flex; gap: 6px; font-style: normal; }

.ai-summary { background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 16px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; font-family: var(--font); color: var(--ink-2); }

/* ── Tabs ── */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: var(--white); border-top: 1.5px solid var(--ink); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 30; }
.tabbar button { padding: 9px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted-2); font-family: var(--font-label); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.tabbar button .ic { display: flex; line-height: 1; }
.tabbar button.on { color: var(--ink); }
.tabbar button.on .ic { color: var(--ink); }
.tabbar button .badge-n { position: absolute; margin-left: 16px; margin-top: -4px; background: var(--terra); color: #fff; font-size: 9px; padding: 1px 5px; border-radius: 10px; font-family: var(--font); }

/* ── lists ── */
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius); margin-bottom: 8px; }
.list-item .l-ic { width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; font-size: 19px; flex-shrink: 0; background: var(--paper-2); border: 1px solid var(--line); }
.list-item .l-main { flex: 1; min-width: 0; }
.list-item .l-main .l-t { font-weight: 600; font-size: 14px; }
.list-item .l-main .l-s { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.list-item .l-r { text-align: right; font-family: var(--font-num); font-size: 18px; }

.alert-item { border-left: 4px solid var(--ochre); }
.alert-item.high { border-left-color: var(--terra); }
.alert-item .l-ic { background: var(--paper-2); }

.bal-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px 0; border-bottom: 1px dotted var(--line); align-items: center; }
.bal-row:last-child { border: none; }
.bal-bar { height: 6px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; margin-top: 5px; }
.bal-bar i { display: block; height: 100%; }

.seg-tabs { display: flex; gap: 6px; background: var(--white); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 5px; margin-bottom: 14px; overflow-x: auto; }
.seg-tabs button { flex: 1; padding: 9px 12px; border-radius: var(--radius); font-family: var(--font-label); font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.seg-tabs button.on { background: var(--ink); color: var(--cream); }

.search-box { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: 10px 13px; margin-bottom: 12px; }
.search-box input { background: none; border: none; outline: none; flex: 1; }

/* modal (sheet) */
.modal-back { position: fixed; inset: 0; background: rgba(28,31,46,.55); display: grid; place-items: end center; z-index: 500; }
.modal { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: var(--paper); border-top: 1.5px solid var(--ink); border-radius: var(--radius) var(--radius) 0 0; padding: 22px; animation: sheet .25s ease; }
@keyframes sheet { from { transform: translateY(30px); opacity: .6; } }
.photos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.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; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; margin-top: 3px; }
.pull { font-family: var(--font-label); color: var(--ink); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px dotted var(--line); gap: 12px; }
.kv .k, .kv span:first-child { font-size: 13px; color: var(--muted); }
.kv .v, .kv b { font-weight: 700; text-align: right; }

/* ── Dashboard vizuallari ── */
.flow-card { background: var(--ink); color: var(--cream); border-radius: var(--radius); padding: 18px 20px; }
.flow-title { font-family: var(--font-label); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); margin-bottom: 14px; }
.flow-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 0; background: none; color: var(--cream); text-align: left; }
.flow-row + .flow-row { border-top: 1px dotted var(--ink-2); }
.flow-row .f-ic { display: flex; flex-shrink: 0; }
.flow-row .f-main { flex: 1; min-width: 0; }
.flow-row .f-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.flow-row .f-lbl { font-family: var(--font-label); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.flow-row .f-val { font-family: var(--font-num); font-size: 26px; line-height: 1; }
.flow-row .f-bar { height: 8px; background: var(--ink-2); border-radius: 2px; overflow: hidden; }
.flow-row .f-bar i { display: block; height: 100%; border-radius: 2px; transition: width .5s ease; }
.flow-row .f-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; font-size: 11px; color: var(--muted-2); }
.flow-row .f-go { color: var(--muted-2); display: flex; }
.flow-row:active { opacity: .85; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.viz-card { padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.viz-card.click { cursor: pointer; }
.viz-card.click:active { background: var(--paper-2); }
.viz-title { font-family: var(--font-label); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 6px; align-self: flex-start; }
.viz-title svg { color: var(--muted); }
.viz-sub { font-size: 12px; color: var(--muted); }
.big-stat { font-family: var(--font-num); font-size: 52px; line-height: 1.1; }
.go-link { font-family: var(--font-label); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--terra); display: flex; align-items: center; gap: 4px; margin-top: auto; }

.stock-legend { display: flex; justify-content: space-between; margin-top: 12px; gap: 6px; }
.stock-legend .leg { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.stock-legend .leg .dot { width: 10px; height: 10px; border-radius: 2px; }
.stock-legend .leg-l { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-legend .leg-v { font-family: var(--font-num); font-size: 16px; font-weight: 700; }
.stock-legend .leg-note { font-size: 10px; color: var(--terra); font-weight: 600; }

.silo-row { display: grid; grid-template-columns: 110px 1fr 38px; align-items: center; gap: 8px; padding: 4px 0; }
.silo-name { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.silo-track { height: 8px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 2px; overflow: hidden; }
.silo-track i { display: block; height: 100%; }
.silo-pct { font-family: var(--font-num); font-size: 13px; text-align: right; }

.chart-sub { font-size: 11px; color: var(--muted); margin: -6px 0 10px; }
.list-total { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 4px 12px; color: var(--muted); font-size: 13px; }
.list-total b { font-family: var(--font-num); font-size: 22px; color: var(--ink); }

/* ── Kompyuter (keng ekran): to'liq desktop rejim ─────────────────────────── */
@media (min-width: 1024px) {
  #app { max-width: 1180px; padding-bottom: 40px; display: flex; flex-direction: column; }
  .appbar { order: 0; padding: 16px 28px; }
  .tabbar { order: 1; position: static; left: auto; transform: none; max-width: none; width: auto;
    display: flex; justify-content: flex-start; gap: 2px; padding: 0 16px;
    background: var(--white); border-top: none; border-bottom: 1.5px solid var(--ink); }
  .tabbar button { flex: 0 0 auto; flex-direction: row; gap: 8px; padding: 14px 20px; font-size: 12px; position: relative; }
  .tabbar button.on::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1.5px; height: 3px; background: var(--ink); }
  .tabbar button .badge-n { position: static; margin: 0 0 0 6px; }
  .view { order: 2; padding: 26px 28px 50px; }
  .login-card { max-width: 440px; margin: 0 auto; }
  #dash, #ai-body, #rep-body, #al-body, #jr-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; align-content: start; }
  #dash > .flow-card, #dash > .two-col, #dash > h3.sec, #dash > button,
  #ai-body > h3.sec, #ai-body > button,
  #rep-body > .chart-card, #rep-body > h3.sec, #rep-body > button, #rep-body > .kpi-grid,
  #al-body > div[style], #jr-list > .muted { grid-column: 1 / -1; }
  #dash .list-item, #rep-body .list-item, #al-body .list-item, #jr-list .list-item, #ai-body .finding { margin-bottom: 0; }
  .view h3.sec { margin: 10px 0 0; }
  .modal-back { place-items: center; }
  .modal { max-width: 760px; border-radius: 10px; max-height: 88vh; }
}
