/* =====================================================================
   IPAKYOLIMEROSI — Boshqaruv paneli
   Uslub: rasmiy, arxiv/muzey ruhida — to'q ko'k (lojuvard), oltin va fil suyagi rang,
   girih naqshlari. Shriftlar portal bilan bir xil: Playfair Display + Plus Jakarta Sans.
   ===================================================================== */
@font-face { font-family: "Playfair Display"; font-weight: 400 700; font-display: swap; src: url("fonts/playfair-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Playfair Display"; font-weight: 400 700; font-display: swap; src: url("fonts/playfair-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: "Playfair Display"; font-weight: 400 700; font-display: swap; src: url("fonts/playfair-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 200 800; font-display: swap; src: url("fonts/jakarta-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 200 800; font-display: swap; src: url("fonts/jakarta-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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-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-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: "Vazirmatn"; font-weight: 100 900; font-display: swap; src: url("fonts/vazirmatn-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

:root {
  --navy: #0e2136;
  --navy-2: #15304c;
  --navy-3: #1d3d5f;
  --lapis: #1f4f82;
  --gold: #c9a24d;
  --gold-2: #b08a38;
  --gold-soft: #f5ecd6;
  --ivory: #f6f3ec;
  --paper: #ffffff;
  --ink: #1b2533;
  --ink-2: #3c4758;
  --muted: #6d7686;
  --line: #e7e0d2;
  --line-2: #efe9dd;
  --teal: #0f766e;
  --teal-soft: #e3f3f1;
  --red: #b42318;
  --red-soft: #fdecea;
  --amber: #b45309;
  --amber-soft: #fdf3e2;
  --blue-soft: #e8eff8;

  --font-display: "Playfair Display", "Manrope", "Vazirmatn", Georgia, serif;
  --font-body: "Plus Jakarta Sans", "Manrope", "Vazirmatn", "Segoe UI", system-ui, -apple-system, "Noto Sans", Arial, sans-serif;
  --font-cjk: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(14, 33, 54, .05), 0 8px 24px -12px rgba(14, 33, 54, .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sidebar: 272px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--ivory); -webkit-font-smoothing: antialiased; }
a { color: var(--lapis); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; color: var(--navy); letter-spacing: -.005em; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ic { flex-shrink: 0; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.serif { font-family: var(--font-display); }
.upper { text-transform: uppercase; letter-spacing: .08em; }
[lang="zh"], [lang="ja"] { font-family: var(--font-cjk), var(--font-body); }

/* ------------------------------------------------ Shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; color: #d9e1ec;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23c9a24d' stroke-opacity='.07'%3E%3Crect x='16' y='16' width='32' height='32'/%3E%3Crect x='16' y='16' width='32' height='32' transform='rotate(45 32 32)'/%3E%3Cpath d='M0 32h16M48 32h16M32 0v16M32 48v16'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--navy) 0%, #0b1a2b 100%);
  display: flex; flex-direction: column; border-right: 1px solid rgba(201, 162, 77, .25);
}
.brand { display: flex; gap: 12px; align-items: center; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, .07); color: #fff; }
.brand:hover { text-decoration: none; }
.brand__mark { color: var(--gold); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(201, 162, 77, .08); box-shadow: inset 0 0 0 1px rgba(201, 162, 77, .45); flex-shrink: 0; }
.brand__mark img { width: 30px; height: 30px; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.brand__sub { font-size: 10.5px; color: #9fb0c5; letter-spacing: .08em; text-transform: uppercase; line-height: 1.35; margin-top: 2px; }
.nav { padding: 14px 12px 20px; flex: 1; }
.nav__group { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: #7f93ab; padding: 16px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: #cfd8e4; font-weight: 500; transition: background .2s var(--ease), color .2s; position: relative; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.is-active { background: linear-gradient(90deg, rgba(201, 162, 77, .2), rgba(201, 162, 77, .04)); color: #fff; }
.nav a.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav a.is-active .ic { color: var(--gold); }
.nav__badge { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 99px; background: rgba(201, 162, 77, .18); color: var(--gold); }
.me { margin: 12px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); display: flex; align-items: center; gap: 10px; }
.me__avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.me__name { color: #fff; font-weight: 600; font-size: 13px; line-height: 1.2; }
.me__role { font-size: 11px; color: #9fb0c5; }
.me form { margin-left: auto; }
.me button { background: none; border: 0; color: #9fb0c5; cursor: pointer; padding: 6px; border-radius: 8px; }
.me button:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 32px; background: rgba(246, 243, 236, .88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs strong { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; width: 300px; color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.topbar__search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 77, .15); }
.topbar__search input { border: 0; outline: none; background: none; width: 100%; color: var(--ink); }
.btn.burger { display: none; }
.content { padding: 28px 32px 64px; max-width: 1480px; width: 100%; }

/* ------------------------------------------------ Page head */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; max-width: 70ch; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-2); font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--gold); }

/* ------------------------------------------------ Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 9px 16px; font-weight: 600; font-size: 13.5px; border: 1px solid transparent; cursor: pointer; transition: all .2s var(--ease); white-space: nowrap; text-decoration: none !important; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-3); box-shadow: 0 6px 18px -8px rgba(14, 33, 54, .6); }
.btn--gold { background: var(--gold); color: var(--navy); }
.btn--gold:hover { background: #d4b060; box-shadow: 0 6px 18px -8px rgba(176, 138, 56, .7); }
.btn--ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--gold); color: var(--navy); }
.btn--danger { background: var(--paper); border-color: #f1c7c2; color: var(--red); }
.btn--danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn--sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn--icon { padding: 7px; }
.btn--block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------ Cards */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card__head h2 { font-size: 18px; }
.card__body { padding: 20px; }
.card + .card { margin-top: 18px; }
.grid > .card, .grid > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

/* ------------------------------------------------ KPI */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; color: inherit; display: block; }
a.kpi:hover { transform: translateY(-3px); text-decoration: none; box-shadow: 0 16px 32px -18px rgba(14, 33, 54, .35); }
.kpi__icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold-2); margin-bottom: 14px; }
.kpi__value { font-family: var(--font-display); font-size: 30px; line-height: 1; color: var(--navy); }
.kpi__label { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 80px; height: 80px; border-radius: 50%; border: 1px solid var(--line-2); }

/* ------------------------------------------------ Hero (dashboard) */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 28px 32px; color: #fff; margin-bottom: 22px;
  background: radial-gradient(120% 140% at 100% 0%, rgba(201, 162, 77, .35), transparent 50%), linear-gradient(120deg, var(--navy) 0%, var(--navy-3) 100%); }
.hero h1 { color: #fff; font-size: 28px; }
.hero p { color: #c6d2e1; margin-top: 6px; }
.hero__star { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); color: rgba(201, 162, 77, .55); }
.hero__meta { display: flex; gap: 24px; margin-top: 18px; flex-wrap: wrap; }
.hero__meta strong { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 500; color: var(--gold); }
.hero__meta span { font-size: 12px; color: #a9b8ca; }

/* ------------------------------------------------ Tables */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.toolbar .input, .toolbar .select { width: auto; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search-box .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box .input { padding-left: 36px; width: 100%; }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 10px; background: #fbf9f4; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fcfaf5; }
.thumb { max-width: none; flex-shrink: 0; width: 52px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--line-2); border: 1px solid var(--line); }
.thumb--empty { display: grid; place-items: center; color: #b8b0a0; }
.row-title { font-weight: 600; color: var(--ink); display: block; }
.row-title:hover { color: var(--lapis); }
.row-sub { display: block; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .ic { color: var(--gold); margin: 0 auto 10px; display: block; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--muted); }

/* ------------------------------------------------ Badges & language dots */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge--ok { background: var(--teal-soft); color: var(--teal); }
.badge--draft { background: #eef0f3; color: #556070; }
.badge--warn { background: var(--amber-soft); color: var(--amber); }
.badge--err { background: var(--red-soft); color: var(--red); }
.badge--gold { background: var(--gold-soft); color: var(--gold-2); }
.badge--blue { background: var(--blue-soft); color: var(--lapis); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.langs { display: flex; gap: 3px; align-items: center; flex-wrap: nowrap; }
.lang-dot { width: 22px; height: 20px; border-radius: 5px; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; text-transform: uppercase; border: 1px solid transparent; }
.lang-dot.ok { background: var(--teal-soft); color: var(--teal); }
.lang-dot.part { background: var(--amber-soft); color: var(--amber); }
.lang-dot.miss { background: var(--red-soft); color: var(--red); border-color: #f4c9c4; }
.lang-dot.none { background: #f1efe9; color: #a8a295; }
.langs__sep { width: 1px; height: 16px; background: var(--line); margin: 0 3px; }
.langs__opt { font-size: 11px; color: var(--muted); margin-left: 4px; white-space: nowrap; }

/* ------------------------------------------------ Forms */
.label { display: block; font-weight: 600; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.label .req { color: var(--red); margin-left: 2px; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 12px; transition: border-color .2s, box-shadow .2s; color: var(--ink); }
.input:hover, .select:hover, .textarea:hover { border-color: #d6cdb9; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 162, 77, .18); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.select { appearance: none; padding-right: 34px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236d7686' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; }
.field { margin-bottom: 16px; }
.field__help { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.field__error { font-size: 12px; color: var(--red); margin-top: 5px; display: flex; gap: 5px; align-items: center; }
.has-error .input, .has-error .textarea, .has-error .select { border-color: #e59b93; background: #fffafa; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field-grid .wide { grid-column: 1 / -1; }
.counter { float: right; font-size: 11px; color: var(--muted); font-weight: 500; }
.counter.over { color: var(--red); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 500; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__ui { width: 38px; height: 22px; border-radius: 99px; background: #d9d3c6; position: relative; transition: background .2s; flex-shrink: 0; }
.switch__ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked + .switch__ui { background: var(--teal); }
.switch input:checked + .switch__ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--gold); outline-offset: 2px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* upload */
.upload { border: 1.5px dashed #d8cfbb; border-radius: 12px; background: #fcfaf5; padding: 14px; transition: border-color .2s, background .2s; }
.upload.is-drag { border-color: var(--gold); background: var(--gold-soft); }
.upload__preview { border-radius: 10px; overflow: hidden; background: #efe9dd; aspect-ratio: 16 / 9; display: grid; place-items: center; color: #b8b0a0; margin-bottom: 10px; position: relative; }
.upload__preview img { width: 100%; height: 100%; object-fit: cover; }
.upload__row { display: flex; gap: 8px; align-items: center; }
.upload__row .input { flex: 1; font-size: 12.5px; }
.upload input[type=file] { display: none; }
.file-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); font-size: 12.5px; margin-bottom: 8px; overflow: hidden; }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------ Editor layout */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.editor__side { position: sticky; top: 84px; display: grid; gap: 18px; }
.editor__side .card + .card { margin-top: 0; }

/* language tabs */
.lt-progress { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); background: #fbf9f4; }
.lt-progress__bar { flex: 1; height: 8px; border-radius: 99px; background: #ebe4d6; overflow: hidden; }
.lt-progress__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--teal)); border-radius: inherit; transition: width .4s var(--ease); }
.lt-progress__text { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.lt-tabs { display: flex; gap: 6px; padding: 12px 16px 0; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.lt-group { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); align-self: center; padding: 0 6px 10px; white-space: nowrap; font-weight: 700; }
.lt-group--req { color: var(--red); }
.lt-tab { display: flex; align-items: center; gap: 7px; padding: 8px 12px 10px; border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 13px; white-space: nowrap; transition: color .2s, border-color .2s; margin-bottom: -1px; }
.lt-tab:hover { color: var(--ink); }
.lt-tab.is-active { color: var(--navy); border-bottom-color: var(--gold); }
.lt-tab__code { font-size: 10px; padding: 2px 5px; border-radius: 4px; background: #efe9dd; color: var(--ink-2); text-transform: uppercase; }
.lt-tab__state { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; }
.lt-tab[data-state=ok] .lt-tab__state { background: var(--teal); color: #fff; }
.lt-tab[data-state=missing] .lt-tab__state { background: var(--red-soft); color: var(--red); box-shadow: inset 0 0 0 1px #f0b8b1; }
.lt-tab[data-state=partial] .lt-tab__state { background: var(--amber-soft); color: var(--amber); }
.lt-tab[data-state=empty] .lt-tab__state { background: #eeeae1; }
.lt-tab.has-error { color: var(--red); }
.lt-panel { display: none; padding: 20px; animation: fade .25s var(--ease); }
.lt-panel.is-active { display: block; }
.lt-panel__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.lt-panel__lang { display: flex; align-items: center; gap: 10px; }
.lt-panel__flag { font-size: 22px; }
.ref { font-size: 12px; color: var(--muted); background: #fbf9f4; border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; padding: 7px 10px; margin-bottom: 6px; max-height: 88px; overflow: auto; white-space: pre-wrap; }
.ref b { color: var(--gold-2); font-weight: 700; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; margin-right: 6px; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.checklist { display: grid; gap: 6px; }
.checklist li { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 8px; border-radius: 8px; cursor: pointer; transition: background .15s; }
.checklist li:hover { background: #fbf9f4; }
.checklist .lang-dot { flex-shrink: 0; }
.checklist .state { margin-left: auto; font-size: 11.5px; color: var(--muted); }
ul.plain { list-style: none; margin: 0; padding: 0; }

.savebar { display: grid; gap: 8px; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12.5px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; text-align: right; font-weight: 500; }

/* ------------------------------------------------ Alerts / toast */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: 13.5px; }
.alert--err { background: var(--red-soft); color: #7a1a12; border: 1px solid #f4c9c4; }
.alert--warn { background: var(--amber-soft); color: #7c3d06; border: 1px solid #f3dcb4; }
.alert--info { background: var(--blue-soft); color: #1b3d63; border: 1px solid #cddcee; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: 0 18px 40px -16px rgba(14, 33, 54, .6); animation: toastIn .4s var(--ease); max-width: 420px; }
.toast--error { background: var(--red); }
.toast .ic { color: var(--gold); }
.toast--error .ic { color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ------------------------------------------------ Coverage matrix */
.matrix { width: 100%; border-collapse: separate; border-spacing: 3px; }
.matrix th { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px; }
.matrix th.req { color: var(--red); }
.matrix td.m { font-size: 12.5px; font-weight: 600; white-space: nowrap; padding-right: 10px; }
.matrix td.c { text-align: center; font-size: 11px; font-weight: 700; border-radius: 6px; height: 30px; min-width: 38px; }
.lvl-0 { background: #fbe4e1; color: var(--red); }
.lvl-1 { background: #fcefd9; color: var(--amber); }
.lvl-2 { background: #f3efc9; color: #7a6a0c; }
.lvl-3 { background: #d9efe9; color: var(--teal); }
.lvl-4 { background: var(--teal); color: #fff; }
.lang-bars { display: grid; gap: 12px; }
.lang-bar { display: grid; grid-template-columns: 150px 1fr 48px; gap: 12px; align-items: center; font-size: 13px; }
.lang-bar__track { height: 8px; border-radius: 99px; background: #efe9dd; overflow: hidden; }
.lang-bar__track span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.lang-bar.req .lang-bar__track span { background: linear-gradient(90deg, var(--lapis), var(--teal)); }
.lang-bar__pct { text-align: right; font-weight: 700; }

.feed { display: grid; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.feed li:last-child { border-bottom: 0; }
.feed__icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--gold-soft); color: var(--gold-2); }
.feed__icon.create { background: var(--teal-soft); color: var(--teal); }
.feed__icon.delete { background: var(--red-soft); color: var(--red); }

/* ------------------------------------------------ Modal */
.modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(14, 33, 54, .45); backdrop-filter: blur(3px); padding: 20px; }
.modal.is-open { display: grid; animation: fade .2s; }
.modal__box { background: var(--paper); border-radius: 16px; width: min(440px, 100%); padding: 24px; box-shadow: 0 30px 60px -20px rgba(14, 33, 54, .5); }
.modal__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; margin-bottom: 14px; }
.modal__box h3 { font-size: 20px; margin-bottom: 6px; }

/* ------------------------------------------------ Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--ivory); }
.auth__art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(180deg, rgba(14, 33, 54, .35) 0%, rgba(14, 33, 54, .92) 100%), url("img/login.webp") center / cover; }
.auth__art h1 { color: #fff; font-size: 42px; max-width: 16ch; line-height: 1.1; }
.auth__art p { color: #d3dce8; max-width: 46ch; margin-top: 14px; font-size: 15px; }
.auth__pattern { position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23c9a24d' stroke-opacity='.12'%3E%3Crect x='16' y='16' width='32' height='32'/%3E%3Crect x='16' y='16' width='32' height='32' transform='rotate(45 32 32)'/%3E%3C/g%3E%3C/svg%3E"); }
.auth__form { display: grid; place-items: center; padding: 40px 24px; }
.auth__box { width: min(400px, 100%); }
.auth__box h2 { font-size: 30px; margin: 22px 0 6px; }
.auth__langs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.auth__langs span { font-size: 11px; padding: 3px 8px; border-radius: 99px; border: 1px solid rgba(201, 162, 77, .5); color: #f1e2bd; }
.pw { position: relative; }
.pw button { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; }

/* ------------------------------------------------ Hisobotlar, reyting, munosabatlar */
.reports-layout { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.rbar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.rbar__track { flex: 1; height: 6px; border-radius: 99px; background: #efe9dd; overflow: hidden; }
.rbar__track span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.stars { color: var(--gold); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: #d9d2c3; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 70px; }
.spark span { flex: 1; min-width: 2px; background: var(--gold); border-radius: 2px 2px 0 0; opacity: .85; }
.feedback-text { white-space: pre-wrap; max-width: 520px; }

/* ------------------------------------------------ Responsive */
@media (max-width: 1200px) {
  .grid-6, .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor__side { position: static; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar); z-index: 60; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .nav-open .sidebar { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .3); }
  .btn.burger { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .topbar__search { width: auto; flex: 1; max-width: 240px; }
  .content { padding: 20px 16px 48px; }
  .grid-2, .grid-3, .reports-layout { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth__art { min-height: 240px; padding: 28px; }
  .auth__art h1 { font-size: 30px; }
  .field-grid { grid-template-columns: 1fr; }
  .lang-bar { grid-template-columns: 110px 1fr 40px; }
}
@media (max-width: 560px) {
  .grid-6, .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar__search { display: none; }
  .crumbs a, .crumbs span { display: none; }
  .hero__star { display: none; }
  .hero { padding: 24px 20px; }
  h1 { font-size: 24px; }
}

/* ------------------------------------------------ UI language switcher */
.ui-lang { position: relative; }
.ui-lang summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-weight: 700; font-size: 12.5px; color: var(--navy); user-select: none; }
.ui-lang summary::-webkit-details-marker { display: none; }
.ui-lang summary:hover, .ui-lang[open] summary { border-color: var(--gold); }
.ui-lang__menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); z-index: 50; width: 210px; margin: 0; padding: 6px; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(14, 33, 54, .35); max-height: 70vh; overflow: auto; }
.ui-lang__menu a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 13px; }
.ui-lang__menu a:hover { background: #fbf9f4; text-decoration: none; }
.ui-lang__menu a.is-active { background: var(--gold-soft); color: var(--navy); font-weight: 700; }
.auth__form { position: relative; }
.auth__top { position: absolute; top: 20px; inset-inline-end: 24px; }
.dash-bottom { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 900px) { .dash-bottom { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------ RTL (arab, fors) */
[dir="rtl"] body { font-family: "Vazirmatn", var(--font-body); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: "Vazirmatn", var(--font-display); font-weight: 700; }
[dir="rtl"] .sidebar { border-right: 0; border-left: 1px solid rgba(201, 162, 77, .25); }
[dir="rtl"] .nav a.is-active::before { left: auto; right: -12px; border-radius: 3px 0 0 3px; }
[dir="rtl"] .nav a.is-active { background: linear-gradient(270deg, rgba(201, 162, 77, .2), rgba(201, 162, 77, .04)); }
[dir="rtl"] .me form { margin-left: 0; margin-right: auto; }
[dir="rtl"] .topbar__search { margin-left: 0; margin-right: auto; }
[dir="rtl"] .search-box .ic { left: auto; right: 12px; }
[dir="rtl"] .search-box .input { padding-left: 12px; padding-right: 36px; }
[dir="rtl"] .select { background-position: left 12px center; padding-right: 12px; padding-left: 34px; }
[dir="rtl"] .table th, [dir="rtl"] .table td { text-align: right; }
[dir="rtl"] .counter { float: left; }
[dir="rtl"] .ref { border-left: 0; border-right: 3px solid var(--gold); border-radius: 8px 0 0 8px; }
[dir="rtl"] .switch__ui::after { left: auto; right: 3px; }
[dir="rtl"] .switch input:checked + .switch__ui::after { transform: translateX(-16px); }
[dir="rtl"] .meta-list dd { text-align: left; }
[dir="rtl"] .lang-bar__pct { text-align: left; }
[dir="rtl"] .hero__star { right: auto; left: 28px; }
[dir="rtl"] .kpi::after { right: auto; left: -18px; }
[dir="rtl"] .toast { right: auto; left: 24px; }
[dir="rtl"] .pw button { right: auto; left: 8px; }
[dir="rtl"] .eyebrow::before { order: 0; }
@media (max-width: 900px) {
  [dir="rtl"] .sidebar { left: auto; right: 0; transform: translateX(100%); }
  [dir="rtl"] .nav-open .sidebar { transform: none; }
}

/* ---------- Sayt matnlari / sozlamalar ---------- */
.texts { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 400px; }
.texts__nav { border-inline-end: 1px solid var(--line-2); padding: 12px; display: grid; gap: 2px; align-content: start; position: sticky; top: 0; max-height: calc(100vh - 40px); overflow-y: auto; }
.texts__nav a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 13.5px; }
.texts__nav a:hover { background: #f6f2e9; text-decoration: none; }
.texts__nav a.is-active { background: var(--gold-soft); color: var(--gold-2); font-weight: 700; }
.texts__main { padding: 8px 20px 0; min-width: 0; }
.texts__main:only-child { grid-column: 1 / -1; }
.text-row { padding: 14px 0; border-bottom: 1px solid var(--line-2); display: grid; gap: 6px; }
.text-row.is-changed { background: linear-gradient(90deg, rgba(201, 162, 77, .07), transparent 60%); margin-inline: -20px; padding-inline: 20px; }
.text-row__key { display: flex; align-items: center; gap: 8px; }
.text-row__key code { font-size: 12px; color: var(--lapis); background: var(--blue-soft); padding: 2px 7px; border-radius: 6px; }
.text-row__default { font-size: 13px; margin: 0; }
.text-row__ref { margin: 0; }
.sticky-save { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; margin: 0 -20px; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
form > .sticky-save.card { margin: 0; border-radius: 14px; }
.upload__preview--contain { aspect-ratio: 3 / 1; background: #0e2136; }
.upload__preview.upload__preview--contain img { object-fit: contain !important; padding: 12px; box-sizing: border-box; }
@media (max-width: 900px) { .texts { grid-template-columns: 1fr; } .texts__nav { position: static; max-height: none; border-inline-end: 0; border-bottom: 1px solid var(--line-2); grid-auto-flow: column; overflow-x: auto; } .texts__nav a { white-space: nowrap; } }

/* ---------- Xavfsizlik (profil) ---------- */
.profile-grid { max-width: 1040px; align-items: start; gap: 18px; }
.steps { margin: 0 0 12px; padding-inline-start: 18px; display: grid; gap: 4px; }
.totp { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.totp__qr { width: 168px; height: 168px; background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: 4px; }
.totp__qr svg { width: 100%; height: 100%; display: block; }
.totp__key { display: inline-block; font-size: 15px; letter-spacing: .08em; padding: 8px 12px; border-radius: 8px; background: var(--blue-soft); color: var(--lapis); word-break: break-all; }
.pw-meter { height: 5px; border-radius: 3px; background: var(--line-2); margin-top: 8px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; background: var(--red); }
.pw-meter span[data-level="fair"] { background: var(--amber); }
.pw-meter span[data-level="strong"] { background: var(--teal); }
.security-state { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------------- Xavfsizlik: reCAPTCHA, sessiya taymeri ---------------- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.card__head h2 { display: flex; align-items: center; gap: 8px; }
.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--paper); transition: border-color .2s, background .2s; }
.choice:has(input:checked) { border-color: var(--teal); background: var(--teal-soft); }
.choice input { margin-top: 3px; accent-color: var(--teal); }
.choice > span { display: grid; gap: 2px; }
.rc-test { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; margin-top: 6px; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; background: #fbf9f4; }
.rc-test__widget:empty, .rc-test [data-rc-status]:empty { display: none; }
.rc-test__widget, .rc-test [data-rc-status] { grid-column: 1 / -1; margin: 0; }
.rc-test [data-rc-status].is-ok { color: var(--teal); font-weight: 600; }
.rc-test [data-rc-status].is-err { color: var(--red); }
.recaptcha-box { min-height: 78px; }
.session-now { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; padding: 12px 14px; background: #fbf9f4; border: 1px solid var(--line-2); border-radius: 12px; }
.session-now > div { display: grid; gap: 2px; }
.session-timer { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap; transition: color .2s, background .2s, border-color .2s; }
.session-timer:hover { color: var(--ink); }
.session-timer.is-warn { color: var(--amber); background: var(--amber-soft); border-color: #f3dcb4; }
.session-timer.is-critical { color: var(--red); background: var(--red-soft); border-color: #f4c9c4; animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .6; } }
.modal__icon--warn { background: var(--amber-soft); color: var(--amber); }
.session-count { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--ink); margin-top: 8px; }
@media (max-width: 900px) {
  .choice-row, .session-now { grid-template-columns: minmax(0, 1fr); }
  .session-timer { padding: 6px 9px; }
}
@media (prefers-reduced-motion: reduce) { .session-timer.is-critical { animation: none; } }
