/* DetalCut — ofis sahifasi (index.html) uslubi. Ranglar va asoslar umumiy.css'da.
   O'lchamlar (mm) mono shriftda — chizmadagidek; asosiy matn tizim shrifti. */

:root {
  --top-h: 52px;
  --edge: #9a4f06;            /* kromka belgisi */
  --hover: #f5f7fb;
  --focus: 0 0 0 3px rgba(31, 95, 209, .22);
  --tbl-head: #eef1f5;
}

html, body { height: 100%; }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
#app { height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
.sp { flex: 1; }
.mono, .dim { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fill { fill: currentColor; stroke: none; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------------------------------------------------------------- yuqori panel */
.top { flex: none; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 16px 0 18px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.brand .logo { width: 28px; height: 28px; }
.brand-n { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.ver { font: 600 11px/1 var(--mono); padding: 4px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 14px; }
.crumb::before { content: ""; width: 1px; height: 20px; background: var(--line); margin: 0 6px 0 8px; }
.crumb:empty::before { display: none; }
.crumb a { color: var(--ink-2); }
.crumb a:hover { color: var(--accent); }
.crumb .cur { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.who { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.who b { color: var(--ink-2); font-weight: 600; }

#main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; min-height: 0; overflow: auto; }

/* ---------------------------------------------------------------- tugmalar, maydonlar */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink);
  font-weight: 550; font-size: 13.5px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn:hover { background: var(--hover); border-color: #b7bfcc; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #1a52b6; border-color: #1a52b6; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { background: #0f774f; border-color: #0f774f; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger:hover { background: #a92c22; }
.btn.warn { background: #fff7e8; border-color: #f0c36d; color: #8a4f00; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); color: var(--ink); }
.btn.icon { width: 34px; padding: 0; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.icon.sm { width: 28px; padding: 0; }
.btn.on { background: var(--accent-soft); border-color: #b8cdf3; color: var(--accent); }

.inp { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  outline: none; min-width: 0; transition: border-color .12s, box-shadow .12s; }
.inp:hover { border-color: #b7bfcc; }
.inp:focus { border-color: var(--accent); box-shadow: var(--focus); }
.inp.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.inp.sm { height: 28px; padding: 0 7px; font-size: 13px; }
.inp.bad { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
select.inp { padding-right: 26px; appearance: none; cursor: pointer;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7385' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 13px; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

.sw { position: relative; display: inline-flex; width: 34px; height: 20px; flex: none; vertical-align: middle; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.sw span { position: absolute; inset: 0; border-radius: 10px; background: #cbd2dd; transition: background .15s; }
.sw span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .25); transition: transform .15s; }
.sw input:checked + span { background: var(--accent); }
.sw input:checked + span::after { transform: translateX(14px); }
.sw input:focus-visible + span { box-shadow: var(--focus); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 6px; color: var(--ink-2); cursor: pointer; font-weight: 500; white-space: nowrap; }
.seg button:hover { background: var(--line-2); }
.seg button.on { background: var(--accent); color: #fff; }

.help { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; padding: 0;
  border-radius: 50%; border: 1px solid #c3c9d4; background: var(--panel); color: var(--muted);
  font: 700 10.5px/1 var(--font); cursor: help; vertical-align: middle; flex: none; margin-left: 4px; }
.help:hover { border-color: var(--accent); color: var(--accent); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 11px;
  font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-qoralama { background: #eceff3; color: #5b6475; }
.st-tayyor { background: var(--accent-soft); color: var(--accent); }
.st-arrada { background: var(--warn-soft); color: var(--warn); }
.st-tugadi { background: var(--ok-soft); color: var(--ok); }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.badge.warn { background: #fff3d1; color: #8a5300; box-shadow: inset 0 0 0 1px #f1cf7a; }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }

.bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--ok); transition: width .3s; }
.bar.acc > i { background: var(--accent); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 20px; color: var(--muted); text-align: center; }
.empty .ic { width: 40px; height: 40px; stroke-width: 1.5; color: #a6aebb; }
.empty b { color: var(--ink-2); font-size: 15px; }
.loading { display: flex; align-items: center; justify-content: center; flex: 1; color: var(--muted); gap: 10px; padding: 40px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- jadval */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--tbl-head); text-align: left; font-weight: 600; font-size: 12px;
  color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl th.n, .tbl td.n { text-align: right; }
.tbl th.c, .tbl td.c { text-align: center; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl td.dim, .tbl td .dim { font-size: 12.5px; white-space: nowrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card > .tbl th:first-child { border-top-left-radius: var(--r-lg); }
.card > .tbl th:last-child { border-top-right-radius: var(--r-lg); }
.card > .tbl tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------- kroylar ro'yxati */
.page { max-width: 1440px; margin: 0 auto; padding: 22px 24px 40px; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0 8px 0 0; letter-spacing: -.01em; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { height: 30px; padding: 0 11px; border-radius: 15px; border: 1px solid transparent; background: none; color: var(--ink-2);
  cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { background: var(--line-2); }
.chip.on { background: var(--panel); border-color: var(--line); color: var(--ink); box-shadow: var(--shadow); }
.chip small { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.search { position: relative; display: inline-flex; align-items: center; }
.search .ic { position: absolute; left: 9px; color: var(--muted); pointer-events: none; }
.search .inp { padding-left: 31px; width: 220px; }
#dmat { max-width: 340px; }
.plist td { padding-top: 11px; padding-bottom: 11px; }
.plist tbody tr { cursor: pointer; }
.plist .pn { font-weight: 600; color: var(--ink); font-size: 14px; }
.plist .pp { color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }
.plist .prog { width: 170px; }
.plist .prog .bar { width: 100%; margin-bottom: 4px; }
.plist .prog span { font-size: 12px; color: var(--muted); }
.plist .dt { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.plist .act { width: 84px; text-align: right; white-space: nowrap; }
.plist .act .btn { opacity: .55; }
.plist tr:hover .act .btn { opacity: 1; }

/* listlar lentasi — har list bitta kichik to'rtburchak, to'ldirish darajasi bilan (imzo element) */
.ribbon { display: inline-flex; align-items: flex-end; gap: 2px; vertical-align: middle; }
.ribbon i { width: 9px; height: 13px; border: 1px solid #b58a4f; border-radius: 1.5px; background: var(--sheet);
  position: relative; overflow: hidden; flex: none; }
.ribbon i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--f, 0%); background: var(--part); }
.ribbon em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 3px; }

/* ---------------------------------------------------------------- muharrir */
.ed { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ed-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 18px 8px; background: var(--panel); flex-wrap: wrap; }
.ed-name { font-size: 18px; font-weight: 650; letter-spacing: -.01em; border: 1px solid transparent; background: none; border-radius: 7px;
  height: 36px; padding: 0 8px; margin-left: -8px; min-width: 120px; width: 28ch; max-width: 38vw; outline: none; text-overflow: ellipsis; }
.ed-name:hover { border-color: var(--line); }
.ed-name:focus { border-color: var(--accent); box-shadow: var(--focus); }
.save { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.save .ic { width: 14px; height: 14px; }
.save.ok { color: var(--ok); }
.save.err { color: var(--bad); font-weight: 600; }
.ed-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stale-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #8a5300; background: #fff3d1;
  padding: 0 9px; height: 24px; border-radius: 12px; box-shadow: inset 0 0 0 1px #f1cf7a; font-weight: 600; cursor: pointer; border: 0; }
.stale-chip .ic { width: 13px; height: 13px; }

.tabs { flex: none; display: flex; gap: 2px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { position: relative; height: 42px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-weight: 550;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 13.5px; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); }
.tab.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--accent); }
.tab .cnt { font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tab.on .cnt { background: var(--accent-soft); color: var(--accent); }
.tab .dot { width: 7px; height: 7px; border-radius: 50%; background: #e0a10b; }
.tab .dot.bad { background: var(--bad); }

.ed-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pane.scroll { overflow: auto; display: block; }
.pane-in { padding: 18px 18px 40px; }
.tools { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 18px; flex-wrap: wrap; }
.tools-sum { color: var(--muted); font-size: 13px; display: flex; gap: 14px; align-items: center; }
.tools-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pane-scroll { flex: 0 1 auto; min-height: 0; overflow: auto; margin: 0 18px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pane-scroll .tbl th:first-child { border-top-left-radius: var(--r-lg); }
.pane-scroll .tbl th:last-child { border-top-right-radius: var(--r-lg); }

/* mahsulotlar */
.drop { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1.5px dashed #b5bfd0; border-radius: var(--r-lg);
  background: var(--panel); color: var(--ink-2); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: #f6f9ff; }
.drop .dz-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.drop .dz-ic .ic { width: 20px; height: 20px; }
.drop b { color: var(--ink); font-size: 14px; display: block; }
.drop small { color: var(--muted); font-size: 12.5px; }
.drop.big { flex-direction: column; justify-content: center; padding: 56px 20px; text-align: center; gap: 12px; }
.drop.big .dz-ic { width: 56px; height: 56px; border-radius: 14px; }
.drop.big .dz-ic .ic { width: 26px; height: 26px; }
.drop.big b { font-size: 16px; }
.uplist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.uplist:empty { display: none; }
.up { display: grid; grid-template-columns: 18px minmax(120px, 1fr) 70px 160px minmax(130px, auto) auto; align-items: center; gap: 10px;
  padding: 8px 10px 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); font-size: 13px; }
.up .ic { color: var(--muted); }
.up.ok .ic { color: var(--ok); }
.up.err { border-color: #efb7b1; background: #fffafa; }
.up.err .ic { color: var(--bad); }
.up-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.up-s { color: var(--muted); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.up-st { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 2px; }
.up.err .up-st { color: var(--bad); font-weight: 550; grid-column: 4 / 6; }
.up.err .up-bar { display: none; }
.up.ok .up-st { color: var(--ok); }
.up-bar { height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.up.parse .up-bar i { width: 40% !important; animation: indet 1.1s ease-in-out infinite; }
@keyframes indet { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.psum { display: flex; align-items: center; gap: 16px; margin: 18px 2px 10px; color: var(--muted); font-size: 13px; }
.psum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.pc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s; }
.pc:hover { border-color: #b4bccb; box-shadow: var(--shadow); }
.pc-img { position: relative; height: 172px; background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--line-2); overflow: hidden; }
.pc-img img { position: absolute; left: 8px; top: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; }
.pc-img > .ic { width: 44px; height: 44px; stroke-width: 1.4; color: #b7bfcc; }
.pc-flag { position: absolute; top: 8px; right: 8px; height: 22px; min-width: 22px; padding: 0 6px; border-radius: 11px; display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700; cursor: help; background: #eef1f6; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.pc-flag.w { background: #fff3d1; color: #8a5300; box-shadow: inset 0 0 0 1px #f1cf7a; }
.pc-flag .ic { width: 13px; height: 13px; }
.pc-qty { position: absolute; left: 8px; top: 8px; font: 700 12px/1 var(--mono); padding: 5px 7px; border-radius: 6px; background: var(--ink); color: #fff; }
.pc-b { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.pc-name { font-weight: 650; font-size: 14px; border: 1px solid transparent; border-radius: 6px; padding: 3px 6px; margin: 0 -6px; background: none; outline: none; width: calc(100% + 12px); text-overflow: ellipsis; }
.pc-name:hover { border-color: var(--line); }
.pc-name:focus { border-color: var(--accent); box-shadow: var(--focus); }
.pc-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; flex-wrap: wrap; min-height: 18px; }
.pc-meta b { color: var(--ink-2); font-weight: 600; }
.pc-ft { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.pc-ft .sp { flex: 1; }
.pc.miss .pc-img { background: var(--bad-soft); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); height: 34px; }
.qty button { width: 32px; height: 100%; border: 0; background: none; cursor: pointer; font-size: 17px; color: var(--ink-2); display: grid; place-items: center; }
.qty button:hover { background: var(--line-2); color: var(--ink); }
.qty input { width: 52px; height: 100%; border: 0; border-left: 1px solid var(--line-2); border-right: 1px solid var(--line-2); text-align: center;
  font: 650 14px var(--mono); outline: none; background: none; }
.qty input:focus { background: var(--accent-soft); }

/* detallar */
.det td { white-space: nowrap; padding-top: 5px; padding-bottom: 5px; }
.det td.nm { white-space: normal; min-width: 140px; }
.det td.pr { max-width: 180px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.det td.ck { width: 34px; padding-right: 0; }
.det tr.off td { color: #9aa2b1; }
.det tr.off td.nm { text-decoration: line-through; }
.det tr.moff td { color: #9aa2b1; }
.det tr.grp td { background: #f6f7fa; border-bottom: 1px solid var(--line); padding-top: 8px; padding-bottom: 8px; position: sticky; top: 33px; z-index: 1; }
.det tr.grp:hover td { background: #f6f7fa; }
.grp-h { display: flex; align-items: center; gap: 12px; white-space: normal; }
.grp-h b { font-size: 13px; }
.grp-h span { color: var(--muted); font-size: 12px; }
.det .cut-diff { color: var(--accent); font-weight: 600; }
.det .des-weak { color: var(--muted); }
.det .cnt b { font-family: var(--mono); font-size: 13px; }
.det .cnt span { color: var(--muted); font-size: 12px; font-family: var(--mono); }
input.ck { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.edg { display: inline-flex; align-items: center; gap: 6px; }
.edg svg { width: 30px; height: 19px; flex: none; }
.edg small { font: 11.5px var(--mono); color: var(--ink-2); }
.grain { width: 18px; height: 18px; color: var(--ink-2); }
.grain.free { color: #b4bccb; }
.shape-f { display: inline-flex; align-items: center; gap: 4px; color: #7a4a00; font-size: 12px; font-weight: 600; }
.shape-f .ic { width: 15px; height: 15px; }

/* materiallar */
.mat td { white-space: nowrap; }
.mat td.mn { white-space: normal; min-width: 220px; font-weight: 550; }
.mat tr.moff td:not(.on-c) { opacity: .45; }
.mat .sheet { display: inline-flex; align-items: center; gap: 5px; }
.mat .sheet .inp { width: 68px; }
.mat .sheet .x { color: var(--muted); }
.mat .sheet select.inp { width: 30px; padding: 0; background-position: center; color: transparent; }
.mat .sheet select.inp option { color: var(--ink); }
.mat .trim-in { width: 60px; }
.mat .chk { display: inline-flex; align-items: center; gap: 6px; }
.mat .chk .btn { height: 24px; padding: 0 8px; font-size: 12px; }

/* sozlamalar */
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; max-width: 1100px; }
.sbox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 18px 8px; }
.sbox h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 6px; font-weight: 650; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; border-top: 1px solid var(--line-2); }
.sbox h3 + .srow { border-top: 0; }
.srow label.l { display: flex; align-items: center; color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.srow .v { display: flex; align-items: center; gap: 6px; }
.srow .v .inp { width: 84px; }
.srow .v .u { color: var(--muted); font-size: 12.5px; min-width: 18px; }
.sets-ft { margin-top: 16px; }

/* natija */
.res-top { display: flex; flex-direction: column; gap: 12px; }
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r-lg); font-size: 13.5px; }
.banner .ic { width: 18px; height: 18px; margin-top: 1px; }
.banner.warn { background: #fff7e3; box-shadow: inset 0 0 0 1px #f1d38a; color: #6e4300; }
.banner.bad { background: var(--bad-soft); box-shadow: inset 0 0 0 1px #f0b8b2; color: #8e2018; }
.banner .bt { flex: 1; }
.banner .bt b { display: block; margin-bottom: 2px; }
.banner ul { margin: 6px 0 0; padding-left: 18px; }
.banner li { margin: 2px 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 11px 14px 12px; min-width: 0; }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 23px; font-weight: 650; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .v small { font-size: 13px; font-weight: 550; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.kpi .bar { margin-top: 7px; }
.mtabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; padding: 2px; margin-top: 18px; }
.mtab { display: flex; flex-direction: column; gap: 5px; text-align: left; padding: 9px 12px 10px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; min-width: 0; }
.mtab:hover { border-color: #b4bccb; }
.mtab.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mtab .mt-n { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtab .mt-s { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.mtab .mt-s b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mtab.bad { border-color: #efb7b1; }
.mhead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 2px 12px; color: var(--muted); font-size: 13px; }
.mhead h2 { font-size: 16px; color: var(--ink); margin: 0; letter-spacing: -.01em; }
.mhead .dim { color: var(--ink-2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; }
.kc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 10px 11px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, box-shadow .15s; text-align: left; font: inherit; color: inherit; }
.kc:hover { border-color: #9fb0cc; box-shadow: 0 4px 14px rgba(16, 24, 40, .08); }
.kc-h { display: flex; align-items: center; gap: 8px; }
.kc-no { font: 700 15px var(--mono); letter-spacing: -.02em; }
.kc-cnt { font: 700 12px/1 var(--mono); padding: 4px 6px; border-radius: 5px; background: var(--ink); color: #fff; }
.kc-f { margin-left: auto; font: 600 12.5px var(--mono); color: var(--ink-2); }
.kc-sk { background: var(--panel-2); border-radius: 6px; padding: 4px; }
.kc-sk svg { width: 100%; height: auto; display: block; }
.kc-ft { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.kc-ft .bar { flex: 1; }
.kc.done { border-color: #9ad3b9; }
.kc.done .kc-sk { opacity: .7; }
.kc .done-b { color: var(--ok); font-weight: 650; display: inline-flex; align-items: center; gap: 3px; }
.kc .done-b .ic { width: 13px; height: 13px; }

/* karta oynasi (katta xarita) */
/* yuqori panel (brend + versiya) ko'rinib turadi */
.cv { position: fixed; top: var(--top-h); left: 0; right: 0; bottom: 0; z-index: 120; background: var(--bg); display: flex; flex-direction: column; }
.cv-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 9px 14px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cv-t { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cv-t b { font: 700 18px var(--mono); letter-spacing: -.02em; }
.cv-t span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 400px; }
.cv-map { min-width: 0; min-height: 0; padding: 16px; display: flex; align-items: center; justify-content: center; }
.cv-map svg { width: 100%; height: 100%; display: block; }
.cv-map g.p { cursor: pointer; }
.cv-side { min-height: 0; overflow: auto; background: var(--panel); border-left: 1px solid var(--line); }
.cv-side .tbl td { padding: 6px 9px; }
.cv-side .tbl tr.sel td { background: #fff1de; }
.cv-side .tbl tr.done td { color: var(--muted); }
.cv-side .tbl tr { cursor: pointer; }
.cv-sum { padding: 10px 12px; display: flex; gap: 14px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.cv-sum b { color: var(--ink); }
.cv .seg button { height: 26px; padding: 0 9px; font-family: var(--mono); font-size: 12.5px; }
.cv-copy { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }

/* kroy jarayoni oynasi */
.run-list { display: flex; flex-direction: column; gap: 2px; margin: -4px 0; }
.run-row { display: grid; grid-template-columns: 18px minmax(160px, 1fr) 150px 92px; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.run-row:last-child { border-bottom: 0; }
.run-row .rn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-row .rs { text-align: right; font-family: var(--mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.run-row .ic { color: var(--muted); }
.run-row.ok .ic { color: var(--ok); }
.run-row.err .ic { color: var(--bad); }
.run-row.run .ic { color: var(--accent); }
.run-err { margin-top: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--bad-soft); color: #8e2018; font-size: 13px; white-space: pre-line; }
.run-time { font: 600 13px var(--mono); color: var(--muted); margin-left: auto; padding-right: 6px; }

/* foydalanuvchilar */
.users .tbl td { padding: 9px 10px; }
.uadd { display: flex; gap: 8px; margin-top: 14px; align-items: center; }
.uadd .inp { flex: 1; }
.uerr { color: var(--bad); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---------------------------------------------------------------- kirish */
.login { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(1200px 600px at 50% -10%, #e6edfb 0%, var(--bg) 60%); }
.login-card { width: 340px; max-width: 100%; display: flex; flex-direction: column; gap: 12px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px 22px; box-shadow: 0 18px 50px rgba(16, 24, 40, .1); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.login-brand .logo { width: 34px; height: 34px; }
.login-brand b { font-size: 20px; letter-spacing: -.01em; }
.login-card .inp { height: 42px; font-size: 15px; }
.login-card .btn { height: 42px; font-size: 15px; }
.login-err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---------------------------------------------------------------- oynalar, xabarlar, tooltip */
.mback { position: fixed; inset: 0; z-index: 200; background: rgba(20, 26, 38, .42); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border-radius: 14px; box-shadow: 0 24px 60px rgba(16, 24, 40, .28); width: min(460px, 100%);
  max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.modal.wide { width: min(640px, 100%); }
.mh { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line-2); }
.mh .mt { flex: 1; font-weight: 650; font-size: 15px; }
.mb { padding: 16px 18px; overflow: auto; }
.mb .mq { margin: 0; color: var(--ink-2); line-height: 1.5; white-space: pre-line; }
.mb .inp.wide { width: 100%; height: 38px; }
.mf { flex: none; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-2); }

#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 600; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: #fff;
  font-size: 13.5px; box-shadow: 0 10px 30px rgba(16, 24, 40, .25); transform: translateY(8px); opacity: 0; transition: .2s; max-width: 440px; pointer-events: auto; }
.toast.in { transform: none; opacity: 1; }
.toast .ic { color: #7ee2b2; }
.toast.warn .ic { color: #ffcf6e; }
.toast.bad { background: #8e2018; }
.toast.bad .ic { color: #ffc2bb; }

#tip { position: fixed; z-index: 1000; max-width: 380px; padding: 8px 11px; border-radius: 8px; background: #1b2230; color: #f1f3f7;
  font-size: 12.5px; line-height: 1.5; white-space: pre-line; pointer-events: none; box-shadow: 0 8px 24px rgba(16, 24, 40, .22); }
#tip b { color: #fff; }
#tip .tl { color: #aab3c3; }
#tip .dim { color: #ffd59a; }

#dropOv { position: fixed; inset: 8px; z-index: 400; border: 3px dashed var(--accent); border-radius: 18px; background: rgba(229, 237, 251, .78);
  display: flex; align-items: center; justify-content: center; pointer-events: none; }
#dropOv div { display: flex; align-items: center; gap: 12px; color: var(--accent); font-size: 22px; }
#dropOv svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#print { display: none; }

/* ---------------------------------------------------------------- planshet / tor ekran */
@media (max-width: 1180px) {
  .det .col-shape, .det .col-th { display: none; }
  .cv-body { grid-template-columns: minmax(0, 1fr) 330px; }
  .who span { display: none; }
}
@media (max-width: 900px) {
  .page { padding: 16px 14px 32px; }
  .plist .col-upd, .plist .col-pn { display: none; }
  .det .col-pos, .det .col-ready { display: none; }
  .cv-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 40%; }
  .cv-side { border-left: 0; border-top: 1px solid var(--line); }
  .ed-name { max-width: 60vw; }
  .up { grid-template-columns: 18px minmax(100px, 1fr) 90px auto; }
  .up .up-s, .up .up-bar { display: none; }
  .crumb .cur { max-width: 30vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------- chop (A4 hisobot) */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; color: #111; font: 9.5pt/1.35 var(--font); max-width: 190mm; margin: 0 auto;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .pr-sec { break-after: page; }
  .pr-sec:last-child { break-after: auto; }
  .pr-top { display: flex; align-items: center; gap: 8px; padding-bottom: 6px; border-bottom: 1.5px solid #111; margin-bottom: 10px; font-size: 8.5pt; color: #444; }
  .pr-top .logo { width: 16px; height: 16px; }
  .pr-top b { color: #111; font-size: 10pt; }
  .pr-top .r { margin-left: auto; }
  .pr h1 { font-size: 17pt; margin: 4px 0 2px; letter-spacing: -.01em; }
  .pr h2 { font-size: 10.5pt; margin: 14px 0 5px; text-transform: uppercase; letter-spacing: .05em; color: #333; }
  .pr .meta { color: #444; font-size: 9pt; }
  .pr-kpis { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid #999; border-radius: 4px; margin: 10px 0 2px; }
  .pr-kpis div { padding: 5px 7px; border-left: 1px solid #ccc; }
  .pr-kpis div:first-child { border-left: 0; }
  .pr-kpis small { display: block; font-size: 7.5pt; color: #555; }
  .pr-kpis b { font-size: 12pt; font-variant-numeric: tabular-nums; }
  .pr-tbl { width: 100%; border-collapse: collapse; font-size: 8.5pt; font-variant-numeric: tabular-nums; }
  .pr-tbl th { text-align: left; font-weight: 700; border-bottom: 1.2px solid #111; padding: 3px 4px; background: #eef0f3; }
  .pr-tbl td { border-bottom: .5px solid #bbb; padding: 2.5px 4px; vertical-align: top; }
  .pr-tbl .n { text-align: right; white-space: nowrap; }
  .pr-tbl .m { font-family: var(--mono); white-space: nowrap; }
  .pr-tbl tr { break-inside: avoid; }
  .pr-bad { border: 1px solid #c2362b; color: #8e2018; padding: 6px 8px; border-radius: 4px; margin-top: 10px; }
  .pr-ch { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
  .pr-ch .no { font: 700 16pt var(--mono); letter-spacing: -.02em; }
  .pr-ch .cnt { font: 700 11pt var(--mono); border: 1.5px solid #111; padding: 0 5px; border-radius: 3px; }
  .pr-ch .mn { font-weight: 600; font-size: 10pt; }
  .pr-ch .r { margin-left: auto; color: #444; font-size: 9pt; }
  .pr-map { break-inside: avoid; margin-bottom: 8px; }
  .pr-map svg { width: 100%; height: auto; max-height: var(--map-h, 128mm); display: block; }
}
