/* Asosiy panel komponentlari (tokenlar va qobiq — shell.css'da). */
/* ---------- Tugmalar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent; background: transparent; font-weight: 700; line-height: 1.2;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ok { background: var(--ok); color: #fff; }
:root[data-theme="dark"] .btn-ok { color: #08261C; }
.btn-ok:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn-danger { color: #2B0C09; }
.btn-danger:hover { background: var(--bad-hover); }
.btn-danger-ghost { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: transparent; }
.btn-danger-ghost:hover { background: var(--bad-soft); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .8125rem; border-radius: 8px; }
.btn-lg { min-height: 50px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn kbd { margin-left: 2px; background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .3); color: inherit; }
.btn-secondary kbd, .btn-ghost kbd { background: var(--surface-3); border-color: var(--line-strong); color: var(--ink-2); }
.btn-label { display: inline-flex; align-items: center; gap: 8px; }
.spinner {
  display: none; width: 1.1em; height: 1.1em; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.is-busy { pointer-events: none; }
.is-busy .spinner { display: inline-block; }
.is-busy .btn-label { visibility: hidden; }
.btn.is-busy { position: relative; }
.btn.is-busy .spinner { position: absolute; }
@keyframes spin { to { transform: rotate(360deg); } }
/* ---------- Chiplar ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: .75rem; font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--ink-2);
}
.chip .i { width: 14px; height: 14px; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-warn, .chip-gold { background: var(--gold-soft); color: var(--gold-ink); }
.chip-teal { background: var(--teal-soft); color: var(--teal-ink); }
.chip-brand { background: var(--brand-soft); color: var(--brand); }
.chip-mute { background: var(--surface-3); color: var(--ink-2); }

/* ---------- Kartalar, sarlavha ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.card-title { font: 600 1.0625rem/1.3 var(--serif); letter-spacing: .005em; }
.card-sub { color: var(--ink-3); font-size: .8125rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font: 600 1.75rem/1.2 var(--serif); letter-spacing: -.005em; }
.page-sub { color: var(--ink-2); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: .8125rem; margin-bottom: 6px; }
.crumbs a { color: var(--ink-2); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; padding: 16px 20px 20px; }
.dl dt { color: var(--ink-3); font-size: .8125rem; padding-top: 1px; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- Flash, toast ---------- */
.flash {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 16px;
  border: 1px solid var(--line); background: var(--surface); animation: rise .2s var(--ease);
}
.flash-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ink); }
.flash-ok > .i:first-child { color: var(--ok); }
.flash-error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.flash-error > .i:first-child { color: var(--bad); }
.flash-info { background: var(--brand-soft); }
.flash-text { flex: 1; font-weight: 600; min-width: 0; }
.flash-undo { margin: 0; }
.btn-flash { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--ink); color: var(--bg); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); animation: rise .2s var(--ease); font-weight: 600;
}
.toast .btn { color: inherit; border-color: color-mix(in srgb, var(--bg) 40%, transparent); min-height: 34px; }
.toast-error { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .toast-error { color: #2B0C09; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Filtr varaqlari ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; transition: background .15s, border-color .15s;
}
.tab:hover { text-decoration: none; border-color: var(--line-strong); color: var(--ink); }
.tab[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.tab-n { font-size: .75rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.tab[aria-current="true"] .tab-n { background: rgba(255, 255, 255, .22); color: inherit; }
:root[data-theme="dark"] .tab[aria-current="true"] .tab-n { background: rgba(14, 19, 48, .25); }

/* ---------- Navbat ro'yxati ---------- */
.qlist { display: flex; flex-direction: column; gap: 8px; }
.qrow {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 20px; align-items: center; gap: 16px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.qrow:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.qrow-ico {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand);
}
.qrow-ico .i { width: 22px; height: 22px; }
.qrow-ico.is-bad { background: var(--bad-soft); color: var(--bad); }
.qrow-ico.is-warn { background: var(--gold-soft); color: var(--gold-ink); }
.qrow-ico.is-ok { background: var(--ok-soft); color: var(--ok); }
.qrow-title { font-weight: 700; display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.qrow-title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qrow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--ink-2); font-size: .8125rem; margin-top: 2px; }
.qrow-meta > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.qrow-meta .i { width: 14px; height: 14px; color: var(--ink-3); }
.qrow-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.qrow-go { color: var(--ink-3); }
.id-tag { color: var(--ink-3); font-weight: 600; font-size: .8125rem; }
@media (max-width: 720px) {
  .qrow { grid-template-columns: 40px minmax(0, 1fr) 16px; gap: 12px; padding: 12px; }
  .qrow-ico { width: 40px; height: 40px; }
  .qrow-chips { grid-column: 2 / 3; grid-row: 2; justify-content: flex-start; }
  .qrow-go { grid-row: 1; grid-column: 3; }
}
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.pager-btns { display: flex; gap: 8px; }

/* ---------- Bo'sh holat, skelet ---------- */
.empty { text-align: center; padding: 56px 24px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r); }
.empty-ico { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); margin-bottom: 16px; }
.empty-ico .i { width: 30px; height: 30px; }
.empty-title { font: 600 1.25rem/1.3 var(--serif); }
.empty-text { color: var(--ink-2); margin: 6px auto 0; max-width: 44ch; }
.empty-actions { display: flex; gap: 8px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Formalar ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 700; font-size: .8125rem; color: var(--ink-2); }
.req::after { content: " *"; color: var(--bad); }
.field .hint { color: var(--ink-3); font-size: .8125rem; }
.field .err { color: var(--bad); font-size: .8125rem; font-weight: 600; }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { padding: 10px 12px; min-height: 96px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[disabled], select[disabled] { opacity: .6; cursor: not-allowed; }
.input-affix { position: relative; }
.input-affix input[type="password"], .input-affix input[type="text"] { padding-right: 48px; }
.input-affix .icon-btn { position: absolute; right: 4px; top: 4px; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { flex: 0 1 220px; }
.toolbar .field-grow { flex: 1 1 260px; }
.searchbox { position: relative; }
.searchbox .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.searchbox input[type="search"] { padding-left: 38px; }

/* Qidiriladigan select (combobox) */
.cb { position: relative; }
.cb .cb-input { padding-right: 36px; }
.cb-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}
.cb-opt { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; min-height: 40px; justify-content: center; }
.cb-opt .sub { color: var(--ink-3); font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-opt > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-opt[aria-selected="true"], .cb-opt:hover { background: var(--brand-soft); }
.cb-empty { padding: 12px; color: var(--ink-3); text-align: center; }
.cb-caret { position: absolute; right: 10px; top: 13px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }

/* ---------- Dialog ---------- */
.dialog {
  border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--ink); width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
}
.dialog-sm { width: min(440px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(10, 15, 39, .55); backdrop-filter: blur(2px); }
.dialog[open] { animation: rise .18s var(--ease); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; margin: 0; }
.dialog-title { font: 600 1.25rem/1.3 var(--serif); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 560px) {
  .dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; }
  .dialog-actions .btn { flex: 1; }
}
.kbd-list { margin: 0; display: grid; gap: 10px; }
.kbd-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; }
.kbd-list dt, .kbd-list dd { margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-weight: 600; transition: background .15s, border-color .15s;
}
.preset:hover { background: var(--surface-2); }
.preset[aria-pressed="true"] { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.preset-claim[aria-pressed="true"] { background: var(--bad-soft); }
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; min-height: 52px; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input { margin-top: 4px; accent-color: var(--brand); width: 18px; height: 18px; }
.choice strong { display: block; }
.choice span { color: var(--ink-2); font-size: .8125rem; }

/* ---------- Dashboard ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 28px 32px; border-radius: 18px; color: #fff; margin-bottom: 20px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(47, 166, 184, .55), transparent 55%),
    linear-gradient(135deg, #24368C 0%, #1B2A73 100%);
  box-shadow: var(--shadow);
}
:root[data-theme="dark"] .hero { background: radial-gradient(90% 140% at 100% 0%, rgba(47, 166, 184, .35), transparent 55%), linear-gradient(135deg, #25358A 0%, #151F5A 100%); }
.hero::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 260px; height: 260px; opacity: .1; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='white' stroke-width='1.5'%3E%3Crect x='22' y='22' width='56' height='56'/%3E%3Crect x='22' y='22' width='56' height='56' transform='rotate(45 50 50)'/%3E%3Ccircle cx='50' cy='50' r='19'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hero-eyebrow { font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .78); font-weight: 700; }
.hero-title { font: 600 1.75rem/1.25 var(--serif); margin-top: 4px; }
.hero-text { color: rgba(255, 255, 255, .86); margin-top: 6px; max-width: 52ch; }
.btn-gold { background: var(--gold); color: #2D2100; }
.btn-gold:hover { filter: brightness(1.06); }
.hero .btn-gold { background: var(--gold); color: #2D2100; position: relative; z-index: 1; }
.hero .btn-gold:hover { filter: brightness(1.06); }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); position: relative; }
a.tile:hover { text-decoration: none; border-color: var(--line-strong); transform: translateY(-1px); }
a.tile { transition: transform .15s var(--ease), border-color .15s; }
.tile-label { color: var(--ink-2); font-weight: 600; font-size: .8125rem; display: flex; align-items: center; gap: 8px; }
.tile-label .i { color: var(--ink-3); width: 16px; height: 16px; }
.tile-value { font: 600 2.25rem/1.1 var(--serif); letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; }
.tile-value small { font-size: 1.125rem; color: var(--ink-3); margin-left: 2px; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-2); font-size: .8125rem; min-height: 28px; }
.tile .spark { color: var(--c-auto); }
.delta-up { color: var(--ok); font-weight: 700; }
.delta-down { color: var(--ink-2); font-weight: 700; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.chart-wrap { padding: 8px 12px 16px 12px; position: relative; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font: 500 11px var(--font); }
.chart .seg { stroke: var(--surface); stroke-width: 2; paint-order: stroke; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0 20px 4px; color: var(--ink-2); font-size: .8125rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip {
  position: fixed; z-index: 80; pointer-events: none; padding: 8px 10px; border-radius: 8px; background: var(--ink); color: var(--bg);
  font-size: .8125rem; font-weight: 600; max-width: 260px; box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}
.bars { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px 20px; margin: 0; list-style: none; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: .875rem; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.bar-row .val { color: var(--ink-2); font-weight: 700; }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--c-auto); min-width: 4px; }
.bar-fill.is-ok { background: var(--ok); } .bar-fill.is-warn { background: var(--c-pending); } .bar-fill.is-bad { background: var(--c-rejected); } .bar-fill.is-mute { background: var(--ink-3); }
.feed { list-style: none; margin: 0; padding: 8px 8px 12px; }
.feed li > a, .feed li > div { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.feed li > a:hover { background: var(--surface-2); text-decoration: none; }
.feed-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); color: var(--ink-2); }
.feed-ico .i { width: 18px; height: 18px; }
.feed-ico.is-ok { background: var(--ok-soft); color: var(--ok); } .feed-ico.is-bad { background: var(--bad-soft); color: var(--bad); } .feed-ico.is-teal { background: var(--teal-soft); color: var(--teal-ink); } .feed-ico.is-brand { background: var(--brand-soft); color: var(--brand); }
.feed-text { min-width: 0; }
.feed-text strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-text span { color: var(--ink-3); font-size: .8125rem; }
.feed-time { color: var(--ink-3); font-size: .75rem; white-space: nowrap; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .tiles { gap: 10px; } .tile { padding: 14px; } .tile-value { font-size: 1.75rem; } .hero { padding: 22px 20px; } .hero-title { font-size: 1.375rem; }
}

/* ---------- Ko'rib chiqish (detail) ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.review-media { position: sticky; top: calc(var(--topbar-h) + 16px); }
.review-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.viewer { position: relative; overflow: hidden; border-radius: var(--r); background: #0C1023; border: 1px solid var(--line); height: clamp(360px, calc(100dvh - 300px), 820px); }
.viewer-stage { position: absolute; inset: 0; touch-action: none; cursor: grab; display: grid; place-items: center; user-select: none; -webkit-user-select: none; }
.viewer-stage.is-drag { cursor: grabbing; }
.viewer-img { max-width: 100%; max-height: 100%; transform-origin: center; will-change: transform; transition: transform .12s var(--ease); -webkit-user-drag: none; }
.viewer-stage.is-drag .viewer-img, .viewer-stage.is-pinch .viewer-img { transition: none; }
.viewer-skel { position: absolute; inset: 0; background: linear-gradient(90deg, #12183A 25%, #1B2250 50%, #12183A 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.viewer-msg { position: absolute; inset: 0; display: none; place-items: center; text-align: center; color: #D5D9F0; padding: 24px; gap: 12px; align-content: center; }
.viewer.is-error .viewer-msg { display: grid; }
.viewer.is-error .viewer-stage, .viewer.is-error .viewer-tools { display: none; }
.viewer-tools { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 2px; padding: 4px; border-radius: 12px; background: rgba(12, 16, 35, .78); backdrop-filter: blur(8px); }
.viewer-tools .icon-btn { color: #E9ECFA; width: 40px; height: 40px; }
.viewer-tools .icon-btn:hover { background: rgba(255, 255, 255, .14); }
.viewer-hint { position: absolute; left: 12px; top: 12px; font-size: .75rem; color: #C9CEEA; background: rgba(12, 16, 35, .6); padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.viewer-pdf { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer-none { height: 260px; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: var(--r); }

.verdict { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.verdict-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.verdict ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.verdict li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.verdict li .i { margin-top: 2px; color: var(--ink-3); }
.verdict.is-bad li { background: var(--bad-soft); } .verdict.is-bad li .i { color: var(--bad); }
.verdict.is-warn li { background: var(--gold-soft); } .verdict.is-warn li .i { color: var(--gold-ink); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--gold-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); }
.banner .i { color: var(--gold-ink); margin-top: 3px; }
.banner-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); } .banner-ok .i { color: var(--ok); }
.banner-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); } .banner-bad .i { color: var(--bad); }
.banner ul { margin: 4px 0 0; padding-left: 18px; }

/* Jadval muharriri */
.sched-wrap { padding: 4px 8px 12px; }
.sched { width: 100%; border-collapse: separate; border-spacing: 0; }
.sched th { text-align: left; font-size: .75rem; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.sched td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sched tr:last-child td { border-bottom: 0; }
.sched .p-name { font-weight: 700; white-space: nowrap; text-align: left; font-size: .9375rem; color: var(--ink); text-transform: none; letter-spacing: 0; padding: 8px; border-bottom: 1px solid var(--line); }
.sched tr:last-child .p-name { border-bottom: 0; }
.sched .p-kirish { color: var(--ink-3); font-weight: 600; }
.sched .cur { color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.sched .cur small { color: var(--ink-3); font-weight: 500; }
.sched th.grp { text-align: center; border-bottom: 0; padding-bottom: 0; }
.sched-group { background: var(--surface-2); }
.c-new { position: relative; min-width: 0; }
.time-input {
  width: 112px; max-width: 100%; min-height: 40px; padding: 0 8px; text-align: center; font-weight: 700; font-size: 1rem; letter-spacing: .02em;
  border-color: transparent; background: transparent; border-radius: 8px; font-variant-numeric: tabular-nums;
}
.time-input:read-only { cursor: default; }
.is-editing .time-input { border-color: var(--line-strong); background: var(--surface); }
.is-editing .time-input:hover { border-color: var(--ink-3); }
.is-editing .time-input:read-only { cursor: text; }
.c-new .time-input { }
.c-new.is-changed .time-input { background: var(--gold-soft); color: var(--gold-ink); }
.c-new.is-new .time-input { background: var(--teal-soft); color: var(--teal-ink); }
.c-new.is-bad .time-input { background: var(--bad-soft); color: var(--bad); }
.c-new.is-same .time-input { color: var(--ink); }
.diff-note { display: block; font-size: .75rem; font-weight: 600; color: var(--ink-3); margin: 2px 0 0 2px; min-height: 1.2em; }
.c-new.is-changed .diff-note { color: var(--gold-ink); } .c-new.is-new .diff-note { color: var(--teal-ink); } .c-new.is-bad .diff-note { color: var(--bad); }
.time-input::-webkit-calendar-picker-indicator { display: none; }
.sched-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.sched-foot .field { flex-direction: row; align-items: center; gap: 10px; }
.sched-foot input[type="date"] { width: 170px; }
.legend-diff { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink-3); font-size: .75rem; padding: 0 20px 12px; }
.legend-diff i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.add-row-btn { margin: 0 12px 12px; }

.actionbar {
  position: sticky; bottom: 0; z-index: 20; margin: 24px -32px -56px; padding: 12px 32px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.actionbar-nav { display: flex; align-items: center; gap: 8px; }
.actionbar-pos { color: var(--ink-2); font-weight: 700; font-size: .8125rem; min-width: 64px; text-align: center; }
.actionbar-main { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 1023px) { .actionbar { margin: 20px -16px -48px; padding-left: 16px; padding-right: 16px; } }
@media (max-width: 900px) {
  .review { grid-template-columns: minmax(0, 1fr); }
  .review-media { position: static; }
  .viewer { height: 56vh; min-height: 300px; }
}
@media (max-width: 640px) {
  .actionbar { flex-direction: column-reverse; align-items: stretch; }
  .actionbar-main { display: grid; grid-template-columns: 1fr 1.5fr; }
  .actionbar { gap: 8px; padding-top: 10px; }
  .actionbar-nav { justify-content: space-between; }
  .actionbar .kbd-hint { display: none; }
  .sched thead { display: none; }
  .sched, .sched tbody, .sched tr, .sched td { display: block; }
  .sched tr { padding: 12px 8px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .sched tr:last-child { border-bottom: 0; }
  .sched td { border: 0; padding: 2px 0; }
  .sched th.p-name { display: block; border: 0; padding: 2px 0; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
  .sched td.p-kirish { text-align: right; }
  .sched td.p-kirish::before { display: inline !important; margin-right: 6px; }
  .sched td.cur { grid-column: 1 / -1; font-size: .8125rem; }
  .sched td[data-label]::before { content: attr(data-label); display: block; font-size: .6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
  .sched td.c-new { }
  .time-input { width: 100%; text-align: left; }
}
@media (hover: none) { .kbd-hint { display: none; } }

/* ---------- Jadvallar (masjid/foydalanuvchi) ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num, .table th.num { text-align: right; }
.table .name { font-weight: 700; }
.table .sub { color: var(--ink-3); font-size: .8125rem; }
.table td.actions { text-align: right; white-space: nowrap; }
.cell-clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: 2px 0; text-align: left !important; }
  .table td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: .75rem; font-weight: 700; }
  .table td.actions { padding-top: 8px; }
  .cell-clip { max-width: none; white-space: normal; }
}
.list-plain { list-style: none; margin: 0; padding: 8px 8px 12px; }
.list-plain li > a, .list-plain li > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); min-height: 48px; }
.list-plain li > a:hover { background: var(--surface-2); text-decoration: none; }
.list-plain .main { min-width: 0; }
.list-plain .main strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.list-plain .main span { color: var(--ink-3); font-size: .8125rem; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }
.mosque-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mini-stat { padding: 14px 16px; }
.mini-stat .k { color: var(--ink-3); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.mini-stat .v { font: 600 1.375rem/1.2 var(--serif); margin-top: 2px; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }

/* Statistika */
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.seg-ctrl { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-3); gap: 2px; }
.seg-ctrl a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; color: var(--ink-2); font-weight: 700; font-size: .8125rem; }
.seg-ctrl a:hover { text-decoration: none; color: var(--ink); }
.seg-ctrl a[aria-current="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
details.data-table { margin: 0 20px 16px; }
details.data-table summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: .8125rem; min-height: 36px; display: flex; align-items: center; }
.stack-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; margin: 0 20px 12px; }
.stack-bar > i { display: block; min-width: 4px; }

/* ---------- Kirish sahifasi ---------- */
.auth-body { background: var(--bg); }
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side {
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: #fff;
  background:
    radial-gradient(80% 60% at 100% 100%, rgba(47, 166, 184, .5), transparent 60%),
    linear-gradient(160deg, #24368C, #172366);
  position: relative; overflow: hidden;
}
.auth-side::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 560px; height: 560px; transform: translate(-50%, -40%); opacity: .08;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='white' stroke-width='1'%3E%3Crect x='22' y='22' width='56' height='56'/%3E%3Crect x='22' y='22' width='56' height='56' transform='rotate(45 50 50)'/%3E%3Ccircle cx='50' cy='50' r='19'/%3E%3Ccircle cx='50' cy='50' r='30'/%3E%3C/svg%3E") center / contain no-repeat;
}
.auth-quote { font: 500 1.5rem/1.4 var(--serif); max-width: 20ch; position: relative; z-index: 1; }
.auth-card { align-self: center; justify-self: center; width: min(420px, calc(100% - 32px)); padding: 32px 0; display: flex; flex-direction: column; gap: 16px; }
.auth-title { font: 600 2rem/1.2 var(--serif); }
@media (max-width: 800px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-side { padding: 24px; flex-direction: row; align-items: center; gap: 16px; }
  .auth-side .brand-mark-lg { width: 44px; height: 44px; }
  .auth-quote { font-size: 1rem; max-width: none; }
  .auth-card { align-self: start; padding-top: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print { .sidebar, .topbar, .actionbar { display: none; } }

.ai { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; }
