/* Inson nashriyoti — umumiy uslublar. Ranglar va o'lchamlar: docs/DESIGN.md */

/* ---------- Shriftlar (serverning o'zida) ---------- */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-mono-cyrillic-400.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-mono-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ---------- Tokenlar ---------- */
:root {
  --ground: #F5F6F8;
  --surface: #FFFFFF;
  --border: #E3E6EB;
  --border-field: #D5D9E0;
  --divider: #EEF0F3;
  --text: #1B2230;
  --text-secondary: #454E5E;
  --text-muted: #5B6474;
  --side: #24476F;
  --side-active: #3A6396;
  --side-text: #DCE5F0;
  --side-muted: #C2D0E2;
  --side-divider: #3A5A84;
  --accent: #2862A8;
  --accent-hover: #1C4A80;
  --accent-soft: #EEF4FB;
  --accent-soft-2: #E6EEF8;
  --accent-soft-border: #C9DAEE;
  --progress-now: #F0B44C;
  --return: #C2410C;
  --note: #FFF8EC;

  --green-bg: #E3F2EC; --green-fg: #0B533D;
  --amber-bg: #FFF1DB; --amber-fg: #8A4B00;
  --red-bg: #FDE8E6; --red-fg: #A11A10;
  --blue-bg: #E6EEFB; --blue-fg: #1747A6;
  --gray-bg: #EEF0F3; --gray-fg: #454E5E;

  --segment-bg: #E7EAEE;
  --switch-off: #C3C9D2;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius-card: 14px;
  --radius-control: 10px;
  --mobile-nav-h: 84px;
}

/* ---------- Asos ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 500 15px/1.5 var(--font);
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-muted); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Joylashuv ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--side); color: #EEF3F9;
  padding: 24px 16px; display: flex; flex-direction: column; gap: 28px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none;
}
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--side-muted); }
.organization-switch { padding: 0 14px 10px; }
.organization-switch select {
  width: 100%; min-height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08); color: #fff; font: 600 14px var(--font, inherit);
}
.organization-switch option { color: #1B2230; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px;
  border-radius: 10px; color: var(--side-text); font-weight: 600; font-size: 14px; text-decoration: none;
}
.side-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.side-link[aria-current="page"] { background: var(--side-active); color: #fff; font-weight: 700; }
.side-link .label { flex: 1; }
.side-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--progress-now);
  color: var(--side); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.side-user {
  margin-top: auto; border-top: 1px solid var(--side-divider); padding: 20px 8px 0;
  display: flex; align-items: center; gap: 12px;
}
.side-user .avatar { background: var(--side-divider); color: #EEF3F9; }
.side-user-name { font-weight: 700; font-size: 14px; }
.side-user-role { font-size: 12px; color: var(--side-muted); }
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 0; background: transparent; color: inherit; cursor: pointer;
}
.side-user .icon-btn { color: var(--side-text); }
.side-user .icon-btn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.main { flex: 1; min-width: 0; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.page-title { font-size: 28px; font-weight: 800; }
.page-sub { margin-top: 4px; font-size: 14px; color: var(--text-muted); }

.mobile-top, .mobile-nav { display: none; }

/* ---------- Komponentlar ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.card-pad { padding: 22px; }
.sec { font-size: 17px; font-weight: 800; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 0 18px; border-radius: var(--radius-control); border: 1px solid var(--border-field);
  background: var(--surface); color: var(--text); font: 700 14px var(--font); text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: #B7C0CB; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-return { background: var(--return); border-color: var(--return); color: #fff; }
.btn-return:hover { color: #fff; filter: brightness(.92); }
.btn-sm { min-height: 36px; padding: 0 14px; }
.btn-block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  font: 700 12px var(--font); white-space: nowrap;
}
.b-green { background: var(--green-bg); color: var(--green-fg); }
.b-amber { background: var(--amber-bg); color: var(--amber-fg); }
.b-red { background: var(--red-bg); color: var(--red-fg); }
.b-blue { background: var(--blue-bg); color: var(--blue-fg); }
.b-gray { background: var(--gray-bg); color: var(--gray-fg); }
.b-ink { background: var(--side); color: #fff; }
/* Huquqlar: muddati o'tgan shartnoma (to'q qizil). */
.b-dark-red { background: var(--red-fg); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px;
  background: var(--gray-bg); color: var(--gray-fg); font: 700 13px var(--font); text-decoration: none;
}
.chip:hover { color: var(--text); }
.chip[aria-current="true"] { background: var(--side); color: #fff; }

.avatar {
  width: 36px; height: 36px; border-radius: 999px; background: var(--accent-soft-2); color: var(--accent-hover);
  font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}

label, .lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field, .form input[type="text"], .form input[type="tel"] {
  width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-field);
  border-radius: var(--radius-control); background: var(--surface); font: 500 14px var(--font); color: var(--text);
}
.field:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.field-code { font: 600 18px var(--font); letter-spacing: .3em; min-height: 48px; }
.form-row { display: flex; flex-direction: column; }
.errors, .errorlist { margin: 6px 0 0; padding: 0; list-style: none; color: var(--red-fg); font-size: 13px; font-weight: 600; }
.help { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.checks { display: flex; flex-direction: column; }
.checks label, .chk {
  display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0; font-size: 14px; font-weight: 500;
}
.checks input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.checks ul, .checks li { list-style: none; margin: 0; padding: 0; }

.segment { display: inline-flex; gap: 2px; padding: 3px; background: var(--segment-bg); border-radius: 10px; }
.segment button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-secondary); font: 600 13px var(--font); cursor: pointer;
}
.segment button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(20, 32, 27, .12); }

.switch {
  position: relative; width: 52px; height: 30px; border: 0; border-radius: 999px; padding: 0;
  background: var(--switch-off); cursor: pointer; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s;
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 25px; }

table { border-collapse: collapse; width: 100%; }
th {
  text-align: left; font: 700 12px var(--font); color: var(--text-muted); padding: 12px 16px;
  border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
td { padding: 14px 16px; border-bottom: 1px solid var(--divider); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
/* position: relative — ichidagi .sr-only (absolute) konteynerdan chiqib sahifani kengaytirmasin. */
.table-wrap { overflow-x: auto; position: relative; }
.person { display: flex; align-items: center; gap: 12px; font-weight: 700; }

.settings-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 18px 0; border-bottom: 1px solid var(--divider);
}
.settings-row:last-child { border-bottom: 0; }
.settings-row-title { font-weight: 700; font-size: 15px; }
.stage-list { margin: 10px 0; padding: 0; list-style: none; }
.stage-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.stage-list li .grow { flex: 1 1 160px; min-width: 0; }
.settings-row-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.note { background: var(--note); border-radius: 12px; padding: 14px 16px; }
.copy-box {
  display: flex; gap: 8px; align-items: stretch;
}
.copy-box input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; }

.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.message { padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; }
.message.success { background: var(--green-bg); color: var(--green-fg); }
.message.error { background: var(--red-bg); color: var(--red-fg); }
.message.info, .message.warning { background: var(--blue-bg); color: var(--blue-fg); }

.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--ground); }
.error-card { max-width: 520px; padding: 36px 32px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.error-code { font: 800 14px var(--mono, monospace); color: var(--text-muted); letter-spacing: .08em; }
.empty { padding: 48px 24px; text-align: center; color: var(--text-muted); }
.empty-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 6px; }

.cards-mobile { display: none; }
.show-mobile-inline { display: none; }
.show-mobile { display: none; }
.task-mobile { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; }

/* ---------- Kirish sahifasi ---------- */
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; }
.auth-hero {
  flex: 1 1 420px; background: var(--side); color: #EEF3F9; padding: 56px;
  display: flex; flex-direction: column; gap: 40px;
}
.auth-hero .brand-mark { width: 40px; height: 40px; font-size: 18px; }
.auth-hero .brand-name { font-size: 18px; }
.auth-hero-body { margin-top: auto; display: flex; flex-direction: column; gap: 28px; max-width: 460px; }
.auth-hero h2 { font-size: 36px; line-height: 1.2; font-weight: 700; color: #fff; }
.auth-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.auth-steps li { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--side-text); }
.auth-steps span {
  width: 28px; height: 28px; border-radius: 999px; border: 1px solid #4D72A3; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #EEF3F9; flex: none;
}
.auth-panel { flex: 999 1 560px; min-width: 0; padding: 40px; display: flex; flex-direction: column; }
.auth-top { display: flex; justify-content: flex-end; }
.auth-form { margin: auto; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 28px; padding: 40px 0; }
.auth-form h1 { font-size: 30px; font-weight: 800; }
.auth-form .lead { margin-top: 10px; font-size: 15px; line-height: 1.55; color: var(--text-muted); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 13px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.code-row { display: flex; gap: 10px; }
.code-row .field { flex: 1; min-width: 0; }
.code-row .btn { min-height: 48px; padding: 0 20px; }
.telegram-widget { min-height: 52px; display: flex; justify-content: center; }

/* ---------- Loyiha va topshiriq sahifalari ---------- */
textarea.field { min-height: 110px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
input[type="file"].field { padding-top: 10px; }
.back-link { font-size: 14px; font-weight: 700; text-decoration: none; }
.step {
  width: 28px; height: 28px; border-radius: 999px; background: var(--side); color: #fff; font-weight: 800;
  font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.step-head { display: flex; align-items: center; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; margin: 0; border: 1px solid var(--border-field);
  border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt input, .chk input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; padding: 28px;
  border: 1.5px dashed #B7C0CB; border-radius: 12px; background: #FAFBFC; text-align: center; cursor: pointer;
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone-title { font-weight: 700; font-size: 15px; }
.file-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.file-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 12px; background: #FAFBFC;
}
.file-row[draggable="true"] { cursor: grab; background: var(--surface); }
.file-row .file-main { flex: 1 1 220px; min-width: 0; }
.file-name { font-family: var(--mono); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.file-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.queue-item {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; color: var(--text); text-decoration: none;
}
.queue-item:hover { color: var(--text); border-color: #B7C0CB; }
.queue-item[aria-current="true"] { border: 2px solid var(--accent); padding: 13px 15px; }
.split-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kicker { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.h2 { font-size: 20px; font-weight: 800; margin-top: 4px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; font-size: 14px; }
.facts dt { font-size: 12px; color: var(--text-muted); font-weight: 700; }
.facts dd { margin: 2px 0 0; font-weight: 700; }
/* Huquqlar: shartnoma shartlari (nom — qiymat). */
.terms { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 14px; }
.terms dt { font-size: 12px; color: var(--text-muted); font-weight: 700; padding-top: 2px; }
.terms dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.quote { padding: 14px 16px; border-radius: 12px; background: #F3F6FB; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.quote-label { font-size: 12px; font-weight: 800; color: var(--blue-fg); margin-bottom: 4px; text-transform: uppercase; }
.version-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--divider); }
.version-row:last-child { border-bottom: 0; }
.version-row .grow { flex: 1; min-width: 0; }
.return-note { font-size: 13px; margin-top: 6px; padding: 8px 10px; background: var(--note); border-radius: 8px; white-space: pre-line; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 48px; margin: 0; border-radius: 12px;
  padding: 0 12px; white-space: nowrap;
  border: 1.5px solid var(--border-field); background: var(--surface); font: 800 15px var(--font); cursor: pointer;
}
.choice:has(input:checked).ok { border-color: #0F6B4F; background: var(--green-bg); color: var(--green-fg); }
.choice:has(input:checked).back { border-color: var(--return); background: #FFF1E8; color: #9A3412; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.date-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--divider); }
.comment:last-child { border-bottom: 0; }
.comment-head { font-size: 12px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.comment-text { font-size: 14px; margin-top: 4px; white-space: pre-line; }
.notice { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--divider); font-size: 14px; }
.notice:last-child { border-bottom: 0; }
.notice.unread .notice-text { font-weight: 700; }
.task-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions-end { justify-content: flex-end; }
.hidden { display: none !important; }
.parts-table td { padding: 10px 12px; vertical-align: top; }
.parts-table .field { min-height: 40px; }

/* Bosqichlar zanjiri, jarayon chizig'i, jurnal (Loyiha, Loyihalar, Bosh sahifa) */
.chain { margin: 0; padding: 0; list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.chain li { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.chain-bar { height: 6px; border-radius: 3px; background: var(--border); }
.chain-done .chain-bar { background: var(--accent); }
.chain-now .chain-bar { background: #F0B44C; }
.chain-n { font-size: 12px; font-weight: 800; color: var(--text-muted); }
.chain-name { font-size: 13px; font-weight: 700; line-height: 1.3; }
.chain-todo .chain-name { color: var(--text-muted); }
.chain-skip .chain-bar { background: repeating-linear-gradient(90deg, var(--border) 0 6px, transparent 6px 10px); }
.chain-skip .chain-name { color: var(--text-muted); text-decoration: line-through; }
.chain-note { font-size: 12px; }
/* Jadvaldagi uzun fayl nomi: bir qatorda, oxiri "…" (to'liq nomi — title). */
.file-cell { max-width: 240px; }
.file-cell a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { display: flex; align-items: center; gap: 10px; }
.segs { display: flex; gap: 3px; }
.segs span { width: 10px; height: 8px; border-radius: 2px; background: var(--border); }
.segs .done { background: var(--accent); }
.segs .now { background: #F0B44C; }
.segs .skip { background: repeating-linear-gradient(90deg, var(--border) 0 3px, transparent 3px 5px); }
.journal { margin: 0; padding: 0; list-style: none; }
.journal li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.journal li:last-child { border-bottom: 0; }
.dot { width: 8px; height: 8px; border-radius: 999px; margin-top: 7px; flex: none; background: var(--text-muted); }
.dot-blue { background: #1D5FD1; }
.dot-green { background: #0F6B4F; }
.dot-red { background: #C2410C; }
.dot-amber { background: #C98A1B; }
.dot-accent { background: var(--accent); }
.journal-note { font-size: 13px; margin-top: 4px; padding: 8px 10px; background: #FFF8EC; border-radius: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 20px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); }
.stat-label { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.stat-value { font-size: 32px; font-weight: 800; line-height: 1.1; }
.stat-accent { border-color: var(--accent); }
.stat-accent .stat-label { color: #1C4A80; }
.stat-late .stat-label { color: var(--red-fg); }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-amber .stat-label { color: var(--amber-fg); }
.report-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.report-filters .form-row { flex: 1 1 160px; min-width: 0; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.report-filters .btn { flex: none; }
.ratio { display: flex; align-items: center; gap: 10px; }
.ratio-bar { width: 90px; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.ratio-bar span { display: block; height: 100%; background: var(--red-fg); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 14px; }
td.num, th.num { text-align: right; }
.archive { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.tree { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.tree .node { display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.tree .node:hover { background: var(--ground); }
.tree .node[aria-current] { background: #E6EEF8; font-weight: 700; }
.tree .node[aria-current="page"] { color: #1C4A80; }
.tree .node-sub { padding-left: 28px; font-size: 13px; }
.tree .node-sub2 { padding-left: 44px; font-size: 13px; }
.stage-admin { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.stage-admin .stage-skipped, .stage-admin .stage-cancelled { opacity: .7; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.stage-actions details { flex: 0 1 auto; }
.stage-actions details[open] { flex: 1 1 100%; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }
.stage-form { margin-top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; gap: 10px; }
.stage-form .form-row { gap: 4px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.deadline { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.deadline:last-child { border-bottom: 0; }
.queue-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #FAFBFC; }
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.filters form { display: flex; flex-wrap: wrap; gap: 10px; }
.filters form .field { width: auto; flex: 0 1 auto; }

/* ---------- Telefon ---------- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .layout { display: block; }
  .main { padding: 20px 16px calc(var(--mobile-nav-h) + 24px); gap: 18px; }
  .page-title { font-size: 22px; }
  .chain { grid-auto-columns: minmax(84px, 1fr); overflow-x: auto; padding-bottom: 6px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .archive { grid-template-columns: minmax(0, 1fr); }
  .stat-value { font-size: 26px; }
  .sec { font-size: 16px; }
  .btn { min-height: 48px; border-radius: 12px; }
  .btn-sm { min-height: 40px; }
  .field, .form input[type="text"], .form input[type="tel"] { min-height: 48px; }

  .mobile-top {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 10;
    min-height: 56px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
  }
  .mobile-top.is-home { background: var(--side); color: #fff; border-bottom: 0; }
  .mobile-top-title { flex: 1; font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mobile-top .icon-btn { margin-left: -10px; color: inherit; }

  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--mobile-nav-h);
    padding: 6px 6px 18px; background: var(--surface); border-top: 1px solid var(--border);
  }
  .mobile-nav a {
    flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; min-height: 56px; border-radius: 12px; color: var(--text-muted); font-weight: 600; font-size: 11.5px;
    text-decoration: none;
  }
  .mobile-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }

  .hide-mobile { display: none; }
  .grid-2, .grid-3, .facts { grid-template-columns: minmax(0, 1fr); }
  .queue { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { flex: 1 1 auto; }
  .cards-mobile { display: flex; flex-direction: column; gap: 12px; }
  .show-mobile-inline { display: inline; }
  .show-mobile { display: block; }
  /* Versiya: holat belgisi fayl nomi ostiga — nom tor ustunga siqilmasin. */
  .version-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; }
  .version-row > .grow { grid-column: 2; grid-row: 1; }
  .version-row > span:nth-of-type(2) { grid-column: 2; grid-row: 2; justify-self: start; }
  .version-row > .btn { grid-column: 3; grid-row: 1; }

  .auth-hero { flex-basis: 100%; padding: 24px 20px 28px; gap: 20px; }
  .auth-hero h2 { font-size: 22px; }
  .auth-steps { display: none; }
  .auth-panel { padding: 16px 20px 32px; }
  .auth-top { position: absolute; top: 18px; right: 16px; }
  .auth-form { padding: 8px 0; gap: 22px; }
  .auth-form h1 { font-size: 24px; }
}

/* Maxfiylik siyosati (ommaviy sahifa) */
.privacy { max-width: 720px; margin: 0 auto; padding: 40px 16px 64px; line-height: 1.6; }
.privacy h1 { font-size: 28px; font-weight: 800; margin: 16px 0 8px; }
.privacy h2 { font-size: 18px; font-weight: 700; margin: 28px 0 8px; }
.privacy ul { padding-left: 20px; }
.privacy li + li { margin-top: 6px; }
.offline { text-align: center; padding-top: 96px; }
.offline .brand-mark { margin: 0 auto 16px; width: 48px; height: 48px; font-size: 22px; }
