/* ============================================================ tokenlar */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-art: none;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --hover: #eef3f8;
  --line: #dcdfe4;
  --line-strong: #c4c8cf;
  --text: #1a1a1a;
  --text-2: #3b4059;
  --muted: #6b7180;
  --accent: #1e75a8;
  --accent-hover: #17628f;
  --accent-soft: #e5f0f7;
  --accent-ink: #ffffff;
  --link: #0a66d6;
  --title: #0a66d6;
  --danger: #d0445e;
  --danger-soft: #fbe9ed;
  --ok: #21a14a;
  --ok-soft: #e6f5ea;
  --warn: #9a6200;
  --warn-soft: #fff4dc;
  --series-1: #1e75a8;
  --grid: #eceef1;
  --shadow: none;
  --shadow-lg: 0 8px 24px rgba(20, 30, 50, .18);
  /* asosiy tugma — MoySklad «Сохранить» kabi yashil */
  --btn-bg: linear-gradient(180deg, #c7e049, #acc516); --btn-bg-hover: linear-gradient(180deg, #bcd63c, #9db70f);
  --btn-border: #9db40f; --btn-ink: #ffffff;
  --btn2-bg: linear-gradient(180deg, #fafafa, #ececec); --btn2-bg-hover: linear-gradient(180deg, #f2f2f2, #e2e2e2);
  --btn2-border: #c4c8cf; --btn2-ink: #1a1a1a;
  /* yon menyu — MoySklad yuqori menyusi kabi ko'k */
  --side-bg: linear-gradient(180deg, #2378ab, #1c6a9a); --side-ink: #ffffff; --side-ink-2: rgba(255, 255, 255, .82);
  --side-hover: rgba(255, 255, 255, .12); --side-on: rgba(255, 255, 255, .22); --side-line: rgba(255, 255, 255, .18);
  --radius: 4px;
  --radius-sm: 3px;
  --side-w: 262px;

  --s-new: #1d63c9;       --s-new-bg: #e8f0fd;
  --s-approval: #a3480a;  --s-approval-bg: #fdeee2;
  --s-approved: #5b6b00;  --s-approved-bg: #f2f6dc;
  --s-assigned: #9a6200;  --s-assigned-bg: #fff4dc;
  --s-purchased: #6f3fc0; --s-purchased-bg: #f2ebfd;
  --s-delivered: #007a6b; --s-delivered-bg: #e1f5f2;
  --s-accepted: #1f7a3a;  --s-accepted-bg: #e7f6ec;
  --s-problem: #c62828;   --s-problem-bg: #fdecec;
  --s-rejected: #6b7280;  --s-rejected-bg: #eef0f3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1828; --surface: #12223a; --surface-2: #162a46; --hover: #1b3352; --line: #233a5a; --line-strong: #31507a;
    --bg-art: none; --title: #7db8ff; --shadow: none;
  --btn-bg: linear-gradient(180deg, #9cc22a, #7fa312); --btn-bg-hover: linear-gradient(180deg, #a8cc35, #8bb01a); --btn-border: #6f8f0e; --btn-ink: #ffffff;
  --btn2-bg: linear-gradient(180deg, #24364f, #1d2d43); --btn2-bg-hover: linear-gradient(180deg, #2b4060, #233650); --btn2-border: #3a5478; --btn2-ink: #eaf1fb;
  --side-bg: linear-gradient(180deg, #16405f, #10314b); --side-ink: #ffffff; --side-ink-2: rgba(255, 255, 255, .8);
  --side-hover: rgba(255, 255, 255, .1); --side-on: rgba(255, 255, 255, .18); --side-line: rgba(255, 255, 255, .14);
    --text: #eaf1fb; --text-2: #bccadb; --muted: #8fa1b8; --accent: #4ea3dd; --accent-hover: #6ab3e6;
    --accent-soft: #15344d; --accent-ink: #ffffff; --link: #74a9ff; --danger: #ff7a7a; --danger-soft: #3a1a1a;
    --ok: #6fd08a; --ok-soft: #173222; --warn: #ffc261; --warn-soft: #382a10; --series-1: #3987e5; --grid: #252b33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    --s-new: #8ab4ff;       --s-new-bg: #1a2a45;
    --s-approval: #ffab70;  --s-approval-bg: #3b2414;
    --s-approved: #cfe06a;  --s-approved-bg: #2b3112;
    --s-assigned: #ffc261;  --s-assigned-bg: #382a10;
    --s-purchased: #c4a2ff; --s-purchased-bg: #2c2140;
    --s-delivered: #5fd3c2; --s-delivered-bg: #123331;
    --s-accepted: #6fd08a;  --s-accepted-bg: #173222;
    --s-problem: #ff8a8a;   --s-problem-bg: #3a1a1a;
    --s-rejected: #a3acb9;  --s-rejected-bg: #262c34;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1828; --surface: #12223a; --surface-2: #162a46; --hover: #1b3352; --line: #233a5a; --line-strong: #31507a;
  --bg-art: none; --title: #7db8ff; --shadow: none;
  --btn-bg: linear-gradient(180deg, #9cc22a, #7fa312); --btn-bg-hover: linear-gradient(180deg, #a8cc35, #8bb01a); --btn-border: #6f8f0e; --btn-ink: #ffffff;
  --btn2-bg: linear-gradient(180deg, #24364f, #1d2d43); --btn2-bg-hover: linear-gradient(180deg, #2b4060, #233650); --btn2-border: #3a5478; --btn2-ink: #eaf1fb;
  --side-bg: linear-gradient(180deg, #16405f, #10314b); --side-ink: #ffffff; --side-ink-2: rgba(255, 255, 255, .8);
  --side-hover: rgba(255, 255, 255, .1); --side-on: rgba(255, 255, 255, .18); --side-line: rgba(255, 255, 255, .14);
  --text: #eaf1fb; --text-2: #bccadb; --muted: #8fa1b8; --accent: #4ea3dd; --accent-hover: #6ab3e6;
  --accent-soft: #15344d; --accent-ink: #ffffff; --link: #74a9ff; --danger: #ff7a7a; --danger-soft: #3a1a1a;
  --ok: #6fd08a; --ok-soft: #173222; --warn: #ffc261; --warn-soft: #382a10; --series-1: #3987e5; --grid: #252b33;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
  --s-new: #8ab4ff;       --s-new-bg: #1a2a45;
  --s-approval: #ffab70;  --s-approval-bg: #3b2414;
  --s-approved: #cfe06a;  --s-approved-bg: #2b3112;
  --s-assigned: #ffc261;  --s-assigned-bg: #382a10;
  --s-purchased: #c4a2ff; --s-purchased-bg: #2c2140;
  --s-delivered: #5fd3c2; --s-delivered-bg: #123331;
  --s-accepted: #6fd08a;  --s-accepted-bg: #173222;
  --s-problem: #ff8a8a;   --s-problem-bg: #3a1a1a;
  --s-rejected: #a3acb9;  --s-rejected-bg: #262c34;
}

/* ============================================================ asos */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text);
  background-color: var(--bg); background-image: var(--bg-art); background-attachment: fixed;
  font: 16px/1.5 Arial, "Helvetica Neue", Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 28px; line-height: 1.2; margin: 0; font-weight: 400; }
h2 { font-size: 19px; margin: 0; }
h3 { font-size: 16px; margin: 0 0 8px; color: var(--text-2); }
p { margin: 0 0 10px; }
code { background: var(--hover); padding: 1px 5px; border-radius: 5px; font-size: 14px; }
.ic { flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.nowrap { white-space: nowrap; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.hide { display: none !important; }

/* ============================================================ joylashuv */
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side-bg); color: var(--side-ink);
  border-right: 0; display: flex; flex-direction: column; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: var(--side-ink); font-weight: 700; font-size: 18px; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { width: 32px; height: 32px; border-radius: 6px; background: #ffffff; color: var(--accent); display: grid; place-items: center; overflow: hidden; flex: none; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.brand small { display: block; font-weight: 400; color: var(--side-ink-2); font-size: 12.5px; line-height: 1.2; }
.nav { flex: 1; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--side-ink-2); font-weight: 400; font-size: 16.5px;
}
.nav a:hover { background: var(--side-hover); color: var(--side-ink); text-decoration: none; }
.nav a.on { background: var(--side-on); color: var(--side-ink); font-weight: 700; }
.side-foot { border-top: 1px solid var(--side-line); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 4px 6px; border-radius: var(--radius-sm); min-width: 0; }
.me:hover { background: var(--side-hover); text-decoration: none; }
.me > div { min-width: 0; flex: 1; }
.me .icon-btn, .side .icon-btn { margin-left: auto; color: var(--side-ink-2); }
.side .icon-btn:hover { background: var(--side-hover); color: var(--side-ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .22); color: #ffffff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.me b { display: block; font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me span { font-size: 13px; color: var(--side-ink-2); }
.seg { display: flex; background: rgba(255, 255, 255, .14); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button, .seg a { flex: 1; background: transparent; color: var(--side-ink-2); border: 0; padding: 5px 0; border-radius: 6px; cursor: pointer;
  display: grid; place-items: center; font-size: 13.5px; font-weight: 700; letter-spacing: .02em; text-decoration: none; min-height: 30px; }
.seg button:hover, .seg a:hover { color: var(--side-ink); text-decoration: none; }
.seg button.on, .seg a.on { background: #ffffff; color: #1e5f88; }

.main { margin-left: var(--side-w); min-height: 100vh; }
.mtop { display: none; }
.content { max-width: 1280px; margin: 0 auto; padding: 24px 28px 56px; }
.scrim { display: none; }

@media (max-width: 900px) {
  .side { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
  .main { margin-left: 0; }
  .mtop {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20;
    background: var(--side-bg); color: var(--side-ink); border-bottom: 0; padding: 8px 12px; min-height: 56px;
  }
  .mtop .brand { padding: 0; font-size: 17px; }
  .mtop .icon-btn { color: var(--side-ink); }
  .mtop .icon-btn:hover { background: var(--side-hover); color: var(--side-ink); }
  .mtop .brand-logo { width: 28px; height: 28px; }
  .content { padding: 16px 16px 48px; }
}

/* ============================================================ sarlavha, kartalar */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-h { padding: 16px 18px 12px; margin: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2, .card > h2 { color: var(--title); font-weight: 400; }
.card-h .sub { color: var(--muted); font-size: 14px; }
.card.accent { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.split { grid-template-columns: minmax(0, 2.1fr) minmax(290px, 1fr); align-items: start; }
@media (max-width: 1080px) { .split { grid-template-columns: minmax(0, 1fr); } }
.grid > .card, .grid > div > .card:last-child { margin-bottom: 0; }

/* stat plitkalari */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); box-shadow: var(--shadow); display: block; min-width: 0; }
a.stat:hover { border-color: var(--line-strong); text-decoration: none; }
.stat .k { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; font-weight: 500; }
.stat .v { font-size: 30px; font-weight: 700; line-height: 1.25; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stat .v.sm { font-size: 23px; }
.stat .d { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.stat.hl { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: currentColor; }
.up { color: var(--danger); } .down { color: var(--ok); }

/* ============================================================ xabarlar */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.flash.err { background: var(--danger-soft); color: var(--danger); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.flash .ic { margin-top: 2px; }
.flash a { color: inherit; text-decoration: underline; }

/* ============================================================ jadvallar */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text-2); font-weight: 400; background: var(--surface-2); white-space: nowrap; }
.card:not(.flush) th:first-child, .card:not(.flush) td:first-child { padding-left: 0; }
.card:not(.flush) th:last-child, .card:not(.flush) td:last-child { padding-right: 0; }
.card:not(.flush) th { background: transparent; }
.card.flush th:first-child, .card.flush td:first-child { padding-left: 18px; }
.card.flush th:last-child, .card.flush td:last-child { padding-right: 18px; }
tbody tr:last-child td { border-bottom: 0; }
td a { text-decoration: underline; text-underline-offset: 2px; }
tfoot td { border-top: 1px solid var(--line-strong); border-bottom: 0; font-weight: 700; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--hover); }
td .sub { color: var(--muted); font-size: 13.5px; }
tr.off td { opacity: .55; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ic { color: var(--line-strong); display: block; margin: 0 auto 8px; }

/* holat belgisi */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.s-new { color: var(--s-new); background: var(--s-new-bg); }
.s-approval { color: var(--s-approval); background: var(--s-approval-bg); }
.s-approved { color: var(--s-approved); background: var(--s-approved-bg); }
.s-assigned { color: var(--s-assigned); background: var(--s-assigned-bg); }
.s-purchased { color: var(--s-purchased); background: var(--s-purchased-bg); }
.s-delivered { color: var(--s-delivered); background: var(--s-delivered-bg); }
.s-accepted { color: var(--s-accepted); background: var(--s-accepted-bg); }
.s-problem { color: var(--s-problem); background: var(--s-problem-bg); }
.s-rejected { color: var(--s-rejected); background: var(--s-rejected-bg); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; background: var(--hover); color: var(--text-2); white-space: nowrap; }
.tag.in { background: var(--ok-soft); color: var(--ok); }
.tag.out { background: var(--danger-soft); color: var(--danger); }
.amt-in { color: var(--ok); font-weight: 600; }
.amt-out { font-weight: 600; }
.neg { color: var(--danger); }

/* ============================================================ formalar */
input, select, textarea, button { font: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 8px 11px; max-width: 100%; min-height: 38px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { width: 100%; min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); vertical-align: middle; }
input[type=file] { max-width: 100%; color: var(--text-2); font-size: 14px; }
label, .label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; min-width: 0; }
.field > input, .field > select, .field > textarea { width: 100%; }
.hint { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 170px; }
.row > .field.grow { flex: 3 1 260px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 500; color: var(--text); margin: 0; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-ink); border: 1px solid var(--btn-border); font-weight: 700;
  padding: 8px 15px; border-radius: var(--radius-sm); white-space: nowrap; min-height: 38px; text-decoration: none;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}
.btn:hover { background: var(--btn-bg-hover); text-decoration: none; }
.btn.ghost { background: var(--btn2-bg); color: var(--btn2-ink); border-color: var(--btn2-border); font-weight: 400; text-shadow: none; }
.btn.ghost:hover { background: var(--btn2-bg-hover); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn.ok:hover, .btn.danger:hover { filter: brightness(1.08); }
.btn.sm { padding: 5px 11px; min-height: 32px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn { background: transparent; border: 0; color: var(--text-2); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters .search { position: relative; flex: 1 1 220px; max-width: 320px; }
.filters .search input { width: 100%; }
.filters .search input:not([type=checkbox]):not([type=radio]):not([type=file]) { padding-left: 40px; }  /* umumiy maydon qoidasidan kuchliroq */
.filters .search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--text-2); font-size: 14px; font-weight: 500; background: var(--surface); white-space: nowrap; }
.chip:hover { background: var(--hover); text-decoration: none; }
.chip.on { background: var(--accent); color: #ffffff; border-color: var(--accent); }
details.more > summary { cursor: pointer; color: var(--link); font-weight: 500; list-style: none; display: flex; align-items: center; gap: 6px; padding: 4px 0; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; color: var(--muted); }
details.more[open] > summary::before { content: "▾"; }
details.more + details.more { margin-top: 6px; }
details.more > form, details.more > div { margin-top: 10px; }

/* materiallar qatorlari */
.items-edit td { padding: 6px 4px; }
.items-edit input { width: 100%; min-width: 64px; }
.items-edit input.name { min-width: 150px; }
.items-edit input.q { min-width: 70px; max-width: 110px; }
.items-edit input.u { min-width: 76px; max-width: 110px; }
.items-edit input.p { min-width: 90px; max-width: 140px; }

/* narx + valyuta */
.price-in { display: flex; min-width: 0; }
.price-in input { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.price-in select.cur { flex: none; width: auto; border-left: 0 !important; border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important;
  padding: 8px 6px !important; background: var(--surface-2) !important; font-weight: 600; color: var(--text-2) !important; }
.items-edit .price-in { min-width: 140px; max-width: 190px; }
.items-edit .price-in input.p { max-width: none; }
.rate-box { margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.rate-box label { margin-bottom: 6px; }
input[data-money] { font-variant-numeric: tabular-nums; }

/* ============================================================ zayavka sahifasi */
.steps { display: flex; margin: 0 0 18px; overflow-x: auto; padding-bottom: 2px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.step .n { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--surface); }
.step + .step::before { content: ""; width: 28px; height: 2px; background: var(--line-strong); margin: 0 8px; }
.step.done { color: var(--text-2); }
.step.done .n { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.step.done + .step::before { background: var(--ok); }
.step.cur { color: var(--text); font-weight: 700; }
.step.cur .n { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.kv dt { color: var(--muted); font-size: 14px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: -4px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-sizing: border-box; }
.timeline .t { font-weight: 600; }
.photos { display: flex; gap: 12px; flex-wrap: wrap; }
.photos a { display: block; color: inherit; }
.photos img { width: 150px; height: 150px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface-2); display: block; }
.photos .cap { font-size: 13px; color: var(--muted); margin-top: 4px; }
/* zayavka blanki — rasm yonida kichik ko'rinish (sahifa 800px -> 150px) */
.photos .doc-thumb .frame { width: 150px; height: 150px; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }
.photos .doc-thumb iframe { width: 800px; height: 800px; border: 0; transform: scale(.1875); transform-origin: 0 0; pointer-events: none; }
.photos .doc-thumb:hover .frame { border-color: var(--accent); }
.action-card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

/* ============================================================ grafiklar */
.chart { --h: 200px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; }
.chart .y { height: var(--h); display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; color: var(--muted); text-align: right; }
.chart .y span { line-height: 1; white-space: nowrap; transform: translateY(-50%); }
.chart .y span:first-child { transform: none; }
.chart .y span:last-child { transform: translateY(-100%); }
.chart .plot { position: relative; height: var(--h); display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line-strong); }
.chart .plot::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, var(--grid) 0 1px, transparent 1px calc(var(--h) / 4)); }
.chart .bar { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; border-radius: 4px; }
.chart .bar i { display: block; width: 100%; max-width: 28px; background: var(--series-1); border-radius: 4px 4px 0 0; transition: filter .1s; }
.chart .bar:hover, .chart .bar:focus-visible { background: color-mix(in srgb, var(--series-1) 8%, transparent); }
.chart .bar:hover i, .chart .bar:focus-visible i { filter: brightness(1.15); }
.chart .x { grid-column: 2; display: flex; gap: 2px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart .x span { flex: 1 1 0; text-align: center; white-space: nowrap; min-width: 0; overflow: visible; }
.chart-empty { height: 200px; display: grid; place-items: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 32%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 14px; }
.hbar .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.hbar .t { height: 10px; background: var(--hover); border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar .t i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hbar .v { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
#tip {
  position: fixed; z-index: 100; pointer-events: none; background: var(--text); color: var(--surface);
  padding: 7px 10px; border-radius: 8px; font-size: 13.5px; box-shadow: var(--shadow-lg); line-height: 1.35;
  opacity: 0; transition: opacity .08s; white-space: nowrap;
}
#tip b { display: block; font-size: 15px; }
#tip span { opacity: .75; }

/* ============================================================ sahifalash */
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; padding: 14px; flex-wrap: wrap; border-top: 1px solid var(--line); }

/* ============================================================ kirish */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth .card { width: 100%; max-width: 400px; padding: 30px; box-shadow: var(--shadow-lg); }
.auth .brand { padding: 0 0 20px; justify-content: center; font-size: 20px; }
.auth .brand-logo { width: 40px; height: 40px; }

/* ============================================================ mobil */
@media (max-width: 640px) {
  .page-head { margin-bottom: 14px; }
  h1 { font-size: 24px; }
  .card { padding: 14px; }
  .card.flush th:first-child, .card.flush td:first-child { padding-left: 14px; }
  .card.flush th:last-child, .card.flush td:last-child { padding-right: 14px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 10px; }
  .stat .v { font-size: 24px; }
  .chart { --h: 160px; }
  .filters .search { max-width: none; }
}
@media print {
  .side, .mtop, .noprint { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; color: #000; }
}
