/* ════════════════════════════════════════════════════════════════
   FarDU ITM — Component library v2
   Minimalist, token-based. tokens.css'dan keyin yuklanadi.
   ════════════════════════════════════════════════════════════════ */

/* ─── Base typography ────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.u-h1, h1.u-h1 {
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 var(--s-3);
}
.u-h2, h2.u-h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-2);
}
.u-h3, h3.u-h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-tight);
  font-weight: 600;
  margin: 0 0 var(--s-2);
}
.u-lead { font-size: var(--fs-lead); color: var(--c-text-2); }
.u-caption { font-size: var(--fs-caption); color: var(--c-text-3); }
.u-mono { font-family: var(--font-mono); font-size: 0.92em; }
.u-tabular { font-variant-numeric: tabular-nums; }

/* Akademik-redaktorlik — display sarlavhalar va mono yorliqlar */
.u-h1, h1.u-h1, .u-h2, h2.u-h2, .u-h3, h3.u-h3,
.page-head__title, .card-title, .stat-card__value,
.empty-state__title, .modal__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
}
.nav-section-label, .sidebar-section-title {
  font-family: var(--font-mono);
}

.u-muted   { color: var(--c-text-2); }
.u-muted-2 { color: var(--c-text-3); }

/* ─── Container ─────────────────────────────────────────────── */

.u-container        { max-width: 1120px; margin: 0 auto; padding: var(--s-5) var(--s-4); }
.u-container--narrow{ max-width: 720px;  margin: 0 auto; padding: var(--s-5) var(--s-4); }
.u-container--wide  { max-width: 1280px; margin: 0 auto; padding: var(--s-5) var(--s-4); }

/* ─── Page header ───────────────────────────────────────────── */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
}
.page-head__title {
  font-size: var(--fs-h1);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  margin: 0;
}
.page-head__sub {
  margin: var(--s-1) 0 0;
  color: var(--c-text-2);
  font-size: var(--fs-body);
}
.page-head__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ─── Button ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 9px 18px;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--c-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
}
.btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.btn:hover { text-decoration: none; }

.btn--primary { background: var(--c-text); color: var(--c-text-inv); border-color: var(--c-text); }
.btn--primary:hover { background: #1A2942; border-color: #1A2942; }
[data-theme="dark"] .btn--primary:hover, :root:not([data-theme="light"]) .btn--primary:hover { background: #E4E0D6; color: #0F1D2E; border-color: #E4E0D6; }

.btn--accent  { background: var(--c-accent); color: var(--c-text-inv); }
.btn--accent:hover { background: var(--c-accent-hover); }

.btn--ghost   { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn--ghost:hover { background: var(--c-surface-2); border-color: var(--c-border-2); }

.btn--subtle  { background: var(--c-surface-2); color: var(--c-text); }
.btn--subtle:hover { background: var(--c-surface-3); }

.btn--danger  { background: var(--c-danger); color: var(--c-text-inv); }
.btn--danger:hover { filter: brightness(0.92); }

.btn--danger-ghost { background: transparent; color: var(--c-danger); border-color: var(--c-border); }
.btn--danger-ghost:hover { background: var(--c-danger-soft); border-color: var(--c-danger); }

.btn--success { background: var(--c-success); color: var(--c-text-inv); }
.btn--success:hover { filter: brightness(0.92); }

.btn--warn { background: var(--c-warning); color: var(--c-text-inv); }
.btn--warn:hover { filter: brightness(0.92); }

.btn--link { background: transparent; padding: 0; color: var(--c-accent); }
.btn--link:hover { text-decoration: underline; text-underline-offset: 2px; }

.btn--sm { padding: 5px 10px; font-size: 13px; }
.btn--lg { padding: 11px 18px; font-size: var(--fs-lead); }
.btn--full { width: 100%; }

.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ─── Card ──────────────────────────────────────────────────── */

.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card--compact   { padding: var(--s-4); }
.card--flush     { padding: 0; overflow: hidden; }
.card--ghost     { background: transparent; border-color: var(--c-border); }
.card--soft      { background: var(--c-surface-2); border-color: transparent; }
.card--highlight { border-color: color-mix(in srgb, var(--c-accent) 40%, transparent); background: var(--c-accent-soft); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--c-border);
}
.card-title { font-size: var(--fs-lead); font-weight: 600; margin: 0; }
.card-body   { padding: var(--s-5); }
.card-footer {
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  display: flex; gap: var(--s-2); justify-content: flex-end;
}

/* ─── Form ──────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--s-3); }
.field-label {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-accent);
}
.field-hint  { font-size: var(--fs-caption); color: var(--c-text-3); margin-top: 2px; }
.field-error { font-size: var(--fs-caption); color: var(--c-danger); margin-top: 2px; }

.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-3); }
.input--error, .select--error, .textarea--error { border-color: var(--c-danger); }
.input--error:focus, .select--error:focus, .textarea--error:focus {
  box-shadow: 0 0 0 3px var(--c-danger-soft);
}
.textarea { min-height: 88px; resize: vertical; }

.form-row { display: grid; gap: var(--s-3); grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* ─── Table ─────────────────────────────────────────────────── */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body);
}
.table th, .table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--c-border);
}
.table th {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--c-text-3);
  font-size: 10.5px;
  background: var(--c-surface-2);
}
.table tbody tr:hover { background: var(--c-surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table--compact th, .table--compact td { padding: 7px 12px; font-size: 13px; }
.table--no-borders th, .table--no-borders td { border-bottom: 0; }

.table-wrap { overflow-x: auto; }

/* ─── Badge ─────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  border-radius: var(--r-full);
  background: var(--c-surface-2);
  color: var(--c-text-2);
  white-space: nowrap;
}
.badge--accent  { background: var(--c-accent-soft);  color: var(--c-accent); }
.badge--success { background: var(--c-success-soft); color: var(--c-success); }
.badge--warning { background: var(--c-warning-soft); color: var(--c-warning); }
.badge--danger  { background: var(--c-danger-soft);  color: var(--c-danger); }
.badge--dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

/* ─── Banner / Alert ────────────────────────────────────────── */

.banner {
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-text-3);
  border-radius: var(--r);
  background: var(--c-surface);
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  margin-bottom: var(--s-4);
}
.banner__icon { flex-shrink: 0; line-height: 1; font-size: 16px; }
.banner__body { flex: 1; min-width: 0; }
.banner__title { font-weight: 600; margin: 0 0 2px; font-size: var(--fs-body); }
.banner__text  { font-size: 13px; color: var(--c-text-2); margin: 0; }
.banner__actions { margin-top: var(--s-2); display: flex; gap: var(--s-2); }

.banner--info    { border-left-color: var(--c-accent);  background: var(--c-accent-soft); }
.banner--success { border-left-color: var(--c-success); background: var(--c-success-soft); }
.banner--warning { border-left-color: var(--c-warning); background: var(--c-warning-soft); }
.banner--danger  { border-left-color: var(--c-danger);  background: var(--c-danger-soft); }

/* ─── Empty state ───────────────────────────────────────────── */

.empty-state {
  padding: var(--s-7) var(--s-5);
  text-align: center;
  color: var(--c-text-2);
}
.empty-state__title {
  font-size: var(--fs-lead);
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 var(--s-2);
}
.empty-state__body {
  font-size: 13px;
  max-width: 380px;
  margin: 0 auto var(--s-4);
  color: var(--c-text-2);
}

/* ─── KPI / Stat card ───────────────────────────────────────── */

.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-fast), background var(--t-fast);
}
a.stat-card:hover { border-color: var(--c-border-2); background: var(--c-surface-2); }
a.stat-card:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-color: var(--c-accent-border);
}
.stat-card__label {
  font-size: 13px;
  color: var(--c-text-2);
}
.stat-card__value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--c-text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-card__delta { font-size: 12px; color: var(--c-text-3); }
.stat-card__delta--up   { color: var(--c-success); }
.stat-card__delta--down { color: var(--c-danger); }

/* ─── Navigation primitives ─────────────────────────────────── */

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px 10px;
  border-radius: var(--r);
  color: var(--c-text-2);
  text-decoration: none;
  font-size: 13px;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-link:hover { background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.nav-link--active { background: var(--c-accent-soft); color: var(--c-accent); font-weight: 500; }
.nav-link__icon { width: 16px; height: 16px; flex-shrink: 0; }

.nav-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  padding: var(--s-4) 10px var(--s-1);
}

/* ─── Tabs (pill style) ─────────────────────────────────────── */

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--c-surface-2);
  border-radius: var(--r);
}
.tabs__item {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.tabs__item:hover { color: var(--c-text); }
.tabs__item--active {
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-floating);
}

/* ─── Stepper (status timeline) ─────────────────────────────── */

.stepper { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.step {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.step__dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--c-surface-3);
  color: var(--c-text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.step--active .step__dot   { background: var(--c-accent);  color: #fff; box-shadow: 0 0 0 4px var(--c-accent-soft); }
.step--complete .step__dot { background: var(--c-success); color: #fff; }
.step__label { font-size: 12px; color: var(--c-text-2); }
.step--active .step__label { color: var(--c-text); font-weight: 500; }
.step__bar {
  width: 18px; height: 2px; background: var(--c-surface-3);
  flex-shrink: 0;
}
.step--complete + .step .step__bar { background: var(--c-success); }

/* ─── Divider ───────────────────────────────────────────────── */

.divider {
  border: 0;
  border-top: 1px solid var(--c-border);
  margin: var(--s-5) 0;
}

/* ─── Avatar ────────────────────────────────────────────────── */

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-accent-soft);
  color: var(--c-accent);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ─── Progress bar ──────────────────────────────────────────── */

.progress {
  height: 6px;
  background: var(--c-surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress__fill {
  height: 100%;
  background: var(--c-accent);
  border-radius: var(--r-full);
  transition: width var(--t-base);
}
.progress--success .progress__fill { background: var(--c-success); }

/* ─── Utility (kichik helper'lar) ───────────────────────────── */

.u-flex { display: flex; }
.u-flex-col { display: flex; flex-direction: column; }
.u-items-center { align-items: center; }
.u-items-start  { align-items: flex-start; }
.u-items-end    { align-items: flex-end; }
.u-justify-between { justify-content: space-between; }
.u-justify-end { justify-content: flex-end; }
.u-flex-wrap { flex-wrap: wrap; }
.u-flex-1 { flex: 1; }
.u-gap-1 { gap: var(--s-1); }
.u-gap-2 { gap: var(--s-2); }
.u-gap-3 { gap: var(--s-3); }
.u-gap-4 { gap: var(--s-4); }
.u-gap-5 { gap: var(--s-5); }

.u-grid { display: grid; }
.u-grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s-4); }
.u-grid-auto-sm { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s-3); }

.u-mt-0 { margin-top: 0; }
.u-mt-2 { margin-top: var(--s-2); }
.u-mt-3 { margin-top: var(--s-3); }
.u-mt-4 { margin-top: var(--s-4); }
.u-mt-5 { margin-top: var(--s-5); }
.u-mt-6 { margin-top: var(--s-6); }
.u-mb-0 { margin-bottom: 0; }
.u-mb-2 { margin-bottom: var(--s-2); }
.u-mb-3 { margin-bottom: var(--s-3); }
.u-mb-4 { margin-bottom: var(--s-4); }
.u-mb-5 { margin-bottom: var(--s-5); }

.u-text-center { text-align: center; }
.u-text-right  { text-align: right; }

.u-hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ─── Theme toggle (kun/tun rejim) ─────────────────────────── */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--c-surface);
  color: var(--c-text-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
  position: relative;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--c-surface-2);
  border-color: var(--c-border-2);
  color: var(--c-text);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity var(--t-base), transform var(--t-base);
}
/* Sun ko'rinadi (light rejimda — tun rejimga o'tish uchun) */
.theme-toggle .icon-sun { opacity: 1; transform: rotate(0); }
.theme-toggle .icon-moon { opacity: 0; transform: rotate(-90deg); }

/* Dark rejimda — moon ko'rinadi (light rejimga o'tish uchun) */
:root:not([data-theme="light"]) .theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg);
}
:root:not([data-theme="light"]) .theme-toggle .icon-moon,
[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0);
}

/* Auto rejimni qo'llab-quvvatlash uchun media query */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { opacity: 0; transform: rotate(90deg); }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { opacity: 1; transform: rotate(0); }
}

/* ─── Skip link (a11y) ──────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -40px; left: 8px;
  background: var(--c-text);
  color: var(--c-text-inv);
  padding: 8px 14px;
  border-radius: var(--r);
  text-decoration: none;
  z-index: var(--z-toast);
  transition: top var(--t-fast);
}
.skip-link:focus { top: 8px; }

/* ─── Disclosure (details/summary) ─────────────────────────── */

.disclosure {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: var(--s-3) var(--s-4);
  margin: var(--s-2) 0;
  transition: border-color var(--t-fast);
}
.disclosure:hover { border-color: var(--c-border-2); }
.disclosure[open] { border-color: var(--c-border-2); }
.disclosure > summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--c-text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after {
  content: '+';
  font-size: 18px;
  color: var(--c-text-3);
  font-weight: 400;
  line-height: 1;
}
.disclosure[open] > summary::after { content: '−'; }
.disclosure-body {
  margin-top: var(--s-3);
  color: var(--c-text-2);
  font-size: 13px;
  line-height: 1.6;
}

/* ─── Callout (info box) ────────────────────────────────────── */

.callout {
  padding: var(--s-4);
  background: var(--c-accent-soft);
  border: 1px solid var(--c-accent-border);
  border-radius: var(--r-lg);
  color: var(--c-text);
  margin: var(--s-5) 0;
}
.callout--warning { background: var(--c-warning-soft); }
.callout--danger  { background: var(--c-danger-soft); }


/* ─── Confirm dialog (native <dialog> element) ──────────────── */

.confirm-dialog {
  border: none;
  border-radius: var(--r-lg);
  padding: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  background: var(--c-surface);
  color: var(--c-text);
  max-width: 380px;
  width: calc(100% - 2rem);
}
.confirm-dialog::backdrop {
  background: rgba(0,0,0,.45);
}
.confirm-dialog__body {
  padding: var(--s-5) var(--s-5) var(--s-4);
}
.confirm-dialog__title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 var(--s-2);
}
.confirm-dialog__text {
  font-size: 14px;
  color: var(--c-text-2);
  margin: 0;
}
.confirm-dialog__footer {
  display: flex;
  gap: var(--s-2);
  justify-content: flex-end;
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--c-border);
  background: var(--c-surface-2);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}


/* ─── Responsive ────────────────────────────────────────────── */

@media (max-width: 768px) {
  .u-container, .u-container--narrow, .u-container--wide { padding: var(--s-4) var(--s-3); }
  .page-head__title { font-size: 22px; }
  .u-grid-auto { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 480px) {
  .page-head { gap: var(--s-3); }
  .page-head__title { font-size: 20px; }
  .page-head__sub { font-size: 13px; }
  .page-head__actions { width: 100%; }
  .page-head__actions .btn { flex: 1; text-align: center; }
  .u-grid-auto { grid-template-columns: 1fr 1fr; }
  .card { border-radius: var(--r); }
  .stat-card { padding: var(--s-3); }
  .banner { border-radius: var(--r-sm); }
}

/* ─── Unified Sidebar (P6) ────────────────────────────────── */

.unified-sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  font-family: var(--font-sans);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-4);
  border-bottom: 1px solid var(--c-border);
}

.sidebar-brand__emblem {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-brand__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.2;
}

.sidebar-brand__sub {
  font-size: 11px;
  color: var(--c-text-2);
  line-height: 1.3;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-3) 0;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  padding: var(--s-4) var(--s-4) var(--s-1);
  margin: 0;
}

.sidebar-section-title:not(:first-child) {
  margin-top: var(--s-2);
  padding-top: var(--s-4);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  color: var(--c-text-2);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: background var(--t-fast), color var(--t-fast);
}

.sidebar-link:hover {
  background: var(--c-surface-2);
  color: var(--c-text);
  text-decoration: none;
}

.sidebar-link--active {
  background: var(--c-accent-soft);
  color: var(--c-accent);
  border-left-color: var(--c-accent);
  font-weight: 500;
}

.sidebar-link__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.sidebar-link__label {
  flex: 1;
  min-width: 0;
}

/* Kutilayotgan ishlar soni — tasdiqlash havolalarida */
.sidebar-badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: var(--c-accent);
  border-radius: var(--r-full);
}

.sidebar-footer {
  border-top: 1px solid var(--c-border);
  padding: var(--s-3) 0 var(--s-4);
}

.sidebar-footer .sidebar-link {
  padding: var(--s-2) var(--s-4);
}

.sidebar-locale {
  display: flex;
  gap: var(--s-1);
  padding: var(--s-2) var(--s-4) 0;
}

.sidebar-locale__opt {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-3);
  text-decoration: none;
  padding: var(--s-1) 0;
  border-radius: var(--r-xs);
  border: 1px solid var(--c-border);
  transition: background var(--t-fast);
}

.sidebar-locale__opt:hover {
  background: var(--c-surface-2);
  text-decoration: none;
}

.sidebar-locale__opt.is-active {
  background: var(--c-accent);
  color: var(--c-text-inv);
  border-color: var(--c-accent);
}

/* Mobile: off-canvas drawer */
.mobile-menu-btn { display: none; }
@media (max-width: 768px) {
  .unified-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    z-index: 800;
    transition: left var(--t);
  }
  .unified-sidebar.is-open {
    left: 0;
    box-shadow: var(--shadow-lg);
  }
  /* Hamburger — rol kabinetlarida sidebar'ni ochadi */
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 820;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--ink, #1a1f2e);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md, 0 2px 8px rgba(0,0,0,.25));
  }
}

/* ─────────────────────────────────────────────────────────────────
   Ilmiy rahbar — interaktiv tasdiqlash ekranlari (supervisor-approvals.js)
   ───────────────────────────────────────────────────────────────── */

/* Tasdiqlash kartochkasi */
.appr-card { margin-bottom: var(--s-3); }
.appr-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--c-border);
}
.appr-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; }
.appr-card--done {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

/* Toast bildirishnomalari */
.appr-toast-region {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: var(--z-toast, 9999);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}
.appr-toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-overlay, 0 8px 24px rgba(0, 0, 0, 0.16));
  font-size: 13px;
  color: var(--c-text);
  animation: apprToastIn 0.18s ease;
}
.appr-toast--success { border-left: 3px solid var(--c-success, #4A5D3A); }
.appr-toast--error { border-left: 3px solid var(--c-danger, #762A3A); }
.appr-toast__dot {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.appr-toast--success .appr-toast__dot { background: var(--c-success, #4A5D3A); }
.appr-toast--error .appr-toast__dot { background: var(--c-danger, #762A3A); }
@keyframes apprToastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: none; }
}

/* Tasdiq dialogi */
.appr-dialog {
  border: none;
  border-radius: var(--r-lg);
  padding: 0;
  max-width: 380px;
  width: 90%;
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}
.appr-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.appr-dialog__body { padding: 20px 20px 8px; }
.appr-dialog__title { font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.appr-dialog__text { font-size: 13px; color: var(--c-text-2); margin: 0; }
.appr-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
}

/* ════════════════════════════════════════════════════════════════
   EDITORIAL FOUNDATION LAYER — Bosqich 1
   ────────────────────────────────────────────────────────────────
   Akademik-redaktorlik UI/UX poydevori: tipografik shkala, sahifa
   sarlavhasi namunasi, bo'lim sarlavhasi, feature-grid, tasdiqlash
   zanjiri, 2-ustun detal layout. Yangi klasslar — eski kod buzilmaydi.
   ════════════════════════════════════════════════════════════════ */

/* ─── Tipografik shkala ─────────────────────────────────────── */
.display-1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 400;
  color: var(--c-text);
  margin: 0;
}
.display-1 em { font-style: italic; font-weight: 300; color: var(--c-accent); }

.display-2 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.14;
  letter-spacing: -0.012em;
  font-weight: 500;
  color: var(--c-text);
  margin: 0;
}
.display-2 em { font-style: italic; font-weight: 400; color: var(--c-accent); }

.heading-3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.008em;
  font-weight: 500;
  color: var(--c-text);
  margin: 0;
}

.lead {
  font-size: 1.0625rem;
  line-height: 1.62;
  color: var(--c-text-2);
  max-width: 44em;
  margin: 0;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c-accent);
  font-weight: 500;
}

.text-emphasis { color: var(--c-accent); font-style: italic; }

/* ─── Sahifa sarlavhasi namunasi (page-intro) ───────────────── */
.page-intro {
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--c-border);
}
.page-intro__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-5);
  flex-wrap: wrap;
}
.page-intro__eyebrow { margin-bottom: var(--s-2); }
.page-intro__title { margin: 0; }
.page-intro__lead { margin-top: var(--s-3); }
.page-intro__actions {
  display: flex;
  gap: var(--s-2);
  flex-wrap: wrap;
  flex-shrink: 0;
  padding-top: 2px;
}
.page-intro__crumb {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 0.8rem;
  color: var(--c-text-3);
  margin-bottom: var(--s-3);
  flex-wrap: wrap;
}
.page-intro__crumb a { color: var(--c-text-3); transition: color var(--t-fast); }
.page-intro__crumb a:hover { color: var(--c-text); }
.page-intro__crumb .sep { color: var(--c-border-2); }
.page-intro__crumb .current { color: var(--c-text); font-weight: 500; }

/* ─── Bo'lim sarlavhasi — "bob" namunasi ────────────────────── */
.section-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-6);
  align-items: end;
  margin: var(--s-8) 0 var(--s-5);
}
.section-header:first-child { margin-top: 0; }
.section-header__num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2.5rem;
  line-height: 1;
  font-weight: 300;
  color: var(--c-accent);
}
.section-header__num .rule {
  display: block;
  width: 56px;
  height: 1px;
  background: var(--c-border-2);
  margin-top: var(--s-3);
}
.section-header__title { margin: 0; }
.section-header__intro {
  margin-top: var(--s-2);
  font-size: 0.95rem;
  color: var(--c-text-2);
  line-height: 1.6;
  max-width: 44em;
}
@media (max-width: 640px) {
  .section-header { grid-template-columns: 1fr; gap: var(--s-3); }
  .section-header__num { font-size: 2rem; }
  .section-header__num .rule { display: none; }
}

/* ─── Feature grid — editorial hairline kartochkalar ────────── */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--c-border);
  border-left: 1px solid var(--c-border);
  border-radius: var(--r);
  overflow: hidden;
}
.feature {
  padding: var(--s-6) var(--s-5);
  border-right: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  transition: background var(--t-base);
  display: block;
  color: inherit;
  text-decoration: none;
}
a.feature:hover { background: var(--c-surface-2); text-decoration: none; }
.feature__num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--c-text-3);
  margin-bottom: var(--s-4);
}
.feature__icon {
  width: 36px; height: 36px;
  margin-bottom: var(--s-4);
  color: var(--c-text);
}
.feature h3, .feature__title {
  margin: 0 0 var(--s-2);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.008em;
  color: var(--c-text);
  line-height: 1.3;
}
.feature p, .feature__desc {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--c-text-2);
}
@media (max-width: 860px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

/* ─── Tasdiqlash zanjiri ────────────────────────────────────── */
.approval-chain {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}
.approval-step {
  padding: 5px 12px;
  background: var(--c-surface-2);
  color: var(--c-text-2);
  border-radius: var(--r-full);
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 500;
}
.approval-step--active {
  background: var(--c-accent);
  color: var(--c-text-inv);
  font-weight: 600;
}
.approval-step--done {
  background: var(--c-text);
  color: var(--c-text-inv);
}
.approval-arrow { color: var(--c-border-2); font-size: 0.85rem; }

/* ─── 2-ustun detal layout (kontent + meta) ─────────────────── */
.detail-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  align-items: start;
}
@media (min-width: 1100px) {
  .detail-cols { grid-template-columns: minmax(0, 1fr) 328px; }
}
.detail-cols__meta {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}
@media (min-width: 1100px) {
  .detail-cols__meta { position: sticky; top: 72px; }
}
.meta-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.meta-card__title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-text-3);
  margin: 0 0 var(--s-3);
}
.meta-row {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-2) 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--c-border);
}
.meta-row:last-child { border-bottom: 0; }
.meta-row__label { color: var(--c-text-3); }
.meta-row__value { color: var(--c-text); font-weight: 500; text-align: right; }

/* ─── Editorial divider ─────────────────────────────────────── */
.rule-gold {
  border: 0;
  border-top: 2px solid var(--c-accent);
  width: 56px;
  margin: var(--s-5) 0;
}

/* ─── Tugma variantlarini izchil qilish ─────────────────────────
   components.css'dagi `.btn` bazasi main.css'dagi `.btn-primary`
   fonini bekor qilardi (yuklash tartibi). Bu blok oxirda turib
   single-hyphen variantlarni kafolatlaydi — barcha admin sahifa. */
.btn-primary {
  background: var(--c-text);
  color: var(--c-text-inv);
  border-color: var(--c-text);
}
.btn-primary:hover {
  background: #1A2942; border-color: #1A2942; color: #FBFAF7;
}
[data-theme="dark"] .btn-primary:hover,
:root:not([data-theme="light"]) .btn-primary:hover {
  background: #E4E0D6; color: #0F1D2E; border-color: #E4E0D6;
}
.btn-gold {
  background: var(--c-accent); color: var(--c-text-inv);
  border-color: var(--c-accent);
}
.btn-gold:hover { background: var(--c-accent-hover); border-color: var(--c-accent-hover); }
.btn-secondary {
  background: transparent; color: var(--c-text);
  border-color: var(--c-border-2);
}
.btn-secondary:hover { background: var(--c-surface-2); border-color: var(--c-text); }
.btn-danger {
  background: var(--c-danger); color: #FBFAF7; border-color: var(--c-danger);
}
.btn-danger:hover { background: #5D1F2C; border-color: #5D1F2C; color: #FBFAF7; }
.btn-success {
  background: var(--c-success); color: #FBFAF7; border-color: var(--c-success);
}
.btn-success:hover { background: #3A4A2E; border-color: #3A4A2E; color: #FBFAF7; }
.btn-ghost {
  background: transparent; color: var(--c-text-2); border-color: transparent;
}
.btn-ghost:hover { background: var(--c-surface-2); color: var(--c-text); }

/* ─── Layout yordamchilari ──────────────────────────────────── */
/* O'qish-og'ir sahifalar uchun markazlashgan tor ustun */
.content-narrow { max-width: 1120px; margin-inline: auto; }
.content-reading { max-width: 760px; margin-inline: auto; }

/* Editorial karta — hairline, yumshoq */
.ed-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.ed-card--pad-lg { padding: var(--s-6); }

/* Bo'lim oralig'i ritmi */
.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

/* Editorial card grid */
.ed-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.ed-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ed-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .ed-grid--2, .ed-grid--3 { grid-template-columns: 1fr; }
}
