/* NUVIZAN Data — asosiy uslublar. Ranglar /theme.css dagi o'zgaruvchilardan olinadi (admin → Dizayn). */
:root {
  --on-primary: #fff;
  --hero-a: var(--primary);
  --hero-b: color-mix(in srgb, var(--primary) 70%, #000);
  --soft: color-mix(in srgb, var(--primary) 7%, var(--surface));
  --soft-2: color-mix(in srgb, var(--primary) 12%, var(--surface));
  --ok: #1f8a5b; --danger: #c43d4b; --warn: #b7791f;
  --shadow: 0 1px 2px rgb(10 20 50 / .05), 0 4px 16px rgb(10 20 50 / .06);
  --shadow-lg: 0 10px 40px rgb(10 20 50 / .14);
  --container: 1200px;
  --r-sm: calc(var(--radius) * .6);
  /* Yagona dizayn tizimi tokenlari — barcha sahifalar shulardan foydalanadi */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --fs-xs: .75rem; --fs-sm: .85rem; --fs-md: .94rem; --fs-lg: 1.08rem;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
  --surface-2: color-mix(in srgb, var(--text) 3%, var(--surface));
  --border-strong: color-mix(in srgb, var(--text) 16%, var(--border));
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --on-primary: #0a1020;
    --hero-a: color-mix(in srgb, var(--primary) 20%, var(--bg));
    --hero-b: var(--bg);
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
    --ok: #3fbf87; --danger: #f06b7a; --warn: #e3a94c;
  }
}
:root[data-theme="dark"] {
  --on-primary: #0a1020;
  --hero-a: color-mix(in srgb, var(--primary) 20%, var(--bg));
  --hero-b: var(--bg);
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 4px 16px rgb(0 0 0 / .25);
  --ok: #3fbf87; --danger: #f06b7a; --warn: #e3a94c;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 2.4vw + .8rem, 2.3rem); font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 650; }
h4 { font-size: .92rem; font-weight: 650; margin-top: 1.2em; }
p { margin: 0 0 1em; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .86em; }
code { background: var(--soft); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }
.page { padding-top: 32px; padding-bottom: 64px; }
.narrow { max-width: 520px; }
.section { margin-top: 40px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.error { color: var(--danger); }
.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); padding: 10px 12px; border-radius: var(--r-sm); }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.row { display: flex; align-items: center; flex-wrap: wrap; }
.row.gap { gap: 8px; } .row.between { justify-content: space-between; gap: 12px; } .row.end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; } .stack-lg { display: grid; gap: 20px; }
.mt { margin-top: 28px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }
.boot-loader { height: 3px; width: 30%; margin: 0 auto; background: var(--accent); animation: boot 1s ease-in-out infinite alternate; }
@keyframes boot { to { transform: translateX(120%); } }

/* ---------- Logo ---------- */
.logo-mark { display: inline-block; width: 20px; height: 26px; background: var(--logo) center / contain no-repeat; flex-shrink: 0; }
.logo-mark.lg { width: 40px; height: 52px; margin-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-name { font-size: 1.02rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 62px; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav > a { color: var(--muted); padding: 8px 12px; border-radius: var(--r-sm); font-weight: 500; }
.main-nav > a:hover, .main-nav > a.active { color: var(--text); background: var(--soft); text-decoration: none; }
.nav-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; }
.lang-switch button { border: 0; background: none; color: var(--muted); font: inherit; font-size: .78rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; cursor: pointer; }
.lang-switch button.active { background: var(--primary); color: var(--on-primary); }
.icon-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 34px; height: 34px; border-radius: 999px; cursor: pointer; font-size: 1rem; display: inline-grid; place-items: center; }
.menu-btn { display: none; margin-left: auto; }
@media (max-width: 1020px) {
  .menu-btn { display: inline-grid; }
  .main-nav { display: none; position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px 16px; box-shadow: var(--shadow-lg); }
  .nav-open .main-nav { display: flex; }
  .nav-tools { margin: 8px 0 0; flex-wrap: wrap; }
}

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .9rem; line-height: 1; padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.ghost { background: transparent; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.sm { padding: 7px 11px; font-size: .82rem; }
.btn.lg { padding: 14px 22px; font-size: 1rem; }
.input { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input.sm { padding: 6px 8px; font-size: .85rem; }
.input.lg { padding: 14px 16px; font-size: 1rem; }
textarea.input { resize: vertical; min-height: 60px; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
.field { display: grid; gap: 6px; font-size: .88rem; font-weight: 500; }
.field > span { color: var(--text); }
.field small { font-weight: 400; }
.field.inline { display: inline-grid; min-width: 150px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; margin: 6px 0; cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--primary); }
.grid-2, .grid-3 { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.i18n-group { display: grid; gap: 10px; }
@media (min-width: 900px) { .i18n-group { grid-template-columns: repeat(3, 1fr); } }
.lang-tag { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; }

/* ---------- Cards, badges, chips ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--soft-2); color: var(--text); white-space: nowrap; }
.badge.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); font-weight: 500; }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.danger, .badge.vis-private { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.badge.vis-password { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.badge.vis-internal { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.pill { font-size: .7rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chips legend { width: 100%; margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .85rem; cursor: pointer; color: var(--text); }
.chip input { accent-color: var(--primary); margin: 0; }
.chip.link:hover { border-color: var(--primary); text-decoration: none; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.ja-sub { color: var(--muted); font-size: .95rem; margin: -4px 0 10px; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff; padding: 72px 0 56px;
  background:
    radial-gradient(900px 380px at 88% 115%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 62%),
    radial-gradient(700px 300px at 10% -20%, rgb(255 255 255 / .10), transparent 60%),
    linear-gradient(165deg, var(--hero-a), var(--hero-b)); }
.hero::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 340px; height: 430px; background: url('/brand/sail-icon-white.svg') center / contain no-repeat; opacity: .07; pointer-events: none; }
.hero.plain { background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); }
.hero.plain::after { display: none; }
.hero-inner { position: relative; z-index: 1; max-width: 900px; }
.hero h1 { font-size: clamp(1.9rem, 3.6vw + .6rem, 3.1rem); font-weight: 750; letter-spacing: -.02em; margin-bottom: 24px; text-wrap: balance; }
.eyebrow.on-hero { color: color-mix(in srgb, var(--accent) 70%, #fff); }
.hero.plain .eyebrow.on-hero { color: var(--accent); }
.hero-search { display: flex; gap: 8px; max-width: 680px; }
.hero-search .input { border-color: transparent; box-shadow: var(--shadow-lg); }
.hero-stats { display: flex; gap: 40px; margin: 36px 0 0; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column-reverse; }
.hero-stats dt { font-size: .85rem; opacity: .75; }
.hero-stats dd { margin: 0; font-size: 1.8rem; font-weight: 750; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .hero { padding: 48px 0 40px; } .hero-search { flex-direction: column; } .hero-stats { gap: 24px; } }

/* ---------- Home ---------- */
.facet-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.facet-row .facet-sep { margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--border); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.link-arrow { font-weight: 600; font-size: .9rem; }
.grid.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.ds-card { display: flex; flex-direction: column; gap: 6px; color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
.ds-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ds-card h3 { margin: 4px 0 2px; }
.ds-card p { margin: 0; font-size: .9rem; }
.ds-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ds-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); }
.source-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.source-pill { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.source-pill:hover { border-color: var(--primary); text-decoration: none; }
.source-pill > span:first-child { font-size: 1.4rem; }
.source-pill strong { display: block; font-size: .9rem; line-height: 1.3; }
.source-pill small { display: block; line-height: 1.3; }

/* ---------- Catalog ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.search-inline { flex: 1; max-width: 460px; }
.catalog { display: grid; gap: 28px; }
@media (min-width: 900px) { .catalog { grid-template-columns: 240px 1fr; } }
.filters { display: grid; gap: 22px; align-content: start; }
.facet h4 { margin: 0 0 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.facet-opt { display: flex; justify-content: space-between; width: 100%; text-align: left; border: 0; background: none; font: inherit; font-size: .9rem; color: var(--text); padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer; }
.facet-opt span { color: var(--muted); font-size: .8rem; }
.facet-opt:hover { background: var(--soft); }
.facet-opt.active { background: var(--soft-2); font-weight: 600; }
@media (max-width: 899px) { .filters { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }

/* ---------- Dataset page ---------- */
.crumbs { color: var(--muted); margin-bottom: 14px; display: flex; gap: 6px; }
.ds-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.ds-head h1 { margin: 10px 0 6px; }
.lead { font-size: 1.04rem; color: var(--muted); max-width: 780px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ds-layout { display: grid; gap: 24px; }
@media (min-width: 1000px) { .ds-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.ds-side { display: grid; gap: 16px; align-content: start; }
.ds-side h4 { margin-top: 0; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: .88rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.dl-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.col-list { list-style: none; margin: 0; padding: 0; font-size: .85rem; max-height: 280px; overflow: auto; }
.col-list li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.col-list li:last-child { border: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: -1px; overflow-x: auto; }
.tab { border: 1px solid transparent; border-bottom: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; color: var(--muted); padding: 10px 16px; cursor: pointer; border-radius: var(--r-sm) var(--r-sm) 0 0; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface); border-color: var(--border); position: relative; }
.tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--surface); }
.tab-panel { border-top-left-radius: 0; min-height: 300px; }
.lock-card { text-align: center; padding: 36px 28px; }
.lock-card form { text-align: left; margin-top: 20px; }
.lock-icon { font-size: 2.4rem; margin-bottom: 10px; }

/* ---------- Tables ---------- */
.table-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.table-tools .input { max-width: 320px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.data-table thead th { position: sticky; top: 0; background: var(--soft); font-weight: 600; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.data-table th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: baseline; }
.data-table th button:focus-visible { outline: 2px solid var(--accent); }
.data-table th .unit { font-weight: 400; opacity: .7; }
.data-table th .dir { color: var(--accent); }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table td.txt { min-width: 140px; max-width: 360px; }
.data-table tbody tr:hover { background: var(--soft); }
.data-table.compact th, .data-table.compact td { padding: 6px 8px; }
.schema-table td { min-width: 110px; }
.is-loading { opacity: .6; transition: opacity .2s; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }

/* ---------- Chart & map ---------- */
.chart-controls, .map-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 16px; }
.chart-controls .chips { flex-basis: 100%; }
.chart-box { position: relative; height: 440px; }
.map-box { height: 520px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); }
.legend { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.legend-dot { display: inline-block; border-radius: 50%; background: color-mix(in srgb, var(--accent) 60%, transparent); border: 1.5px solid var(--primary); }
.legend-dot.sm { width: 8px; height: 8px; } .legend-dot.lg { width: 16px; height: 16px; }
.map-popup { font-family: var(--font); font-size: 12px; min-width: 180px; }
.map-popup strong { display: block; font-size: 13px; margin-bottom: 4px; }
.map-popup table { border-collapse: collapse; }
.map-popup th { text-align: left; color: #667; font-weight: 500; padding: 1px 8px 1px 0; }
.leaflet-container { font-family: var(--font); background: var(--soft); }
@media (max-width: 640px) { .chart-box { height: 340px; } .map-box { height: 400px; } }

/* ---------- Prose / docs ---------- */
.prose { max-width: 780px; }
.prose h2 { margin-top: 1.8em; padding-top: .4em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 1em 0 1.6em; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--soft); font-weight: 600; }
.docs { display: grid; gap: 32px; }
@media (min-width: 980px) { .docs { grid-template-columns: 200px minmax(0, 1fr); } }
.docs-nav { position: sticky; top: 86px; align-self: start; display: grid; gap: 2px; }
.docs-nav a { color: var(--muted); padding: 6px 10px; border-radius: var(--r-sm); font-size: .9rem; }
.docs-nav a:hover { background: var(--soft); color: var(--text); text-decoration: none; }
@media (max-width: 979px) { .docs-nav { position: static; display: flex; flex-wrap: wrap; } }
.code { position: relative; margin: .6em 0 1.2em; }
.code pre { margin: 0; background: color-mix(in srgb, var(--text) 92%, var(--primary)); color: #e6ebf5; padding: 14px 16px; border-radius: var(--r-sm); overflow-x: auto; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.55; white-space: pre; }
:root[data-theme="dark"] .code pre { background: #050914; border: 1px solid var(--border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .code pre { background: #050914; border: 1px solid var(--border); } }
.copy-btn { position: absolute; top: 6px; right: 6px; border: 1px solid rgb(255 255 255 / .18); background: rgb(255 255 255 / .08); color: #fff; border-radius: 6px; padding: 3px 8px; cursor: pointer; font-size: .8rem; }
.copy-btn:hover { background: rgb(255 255 255 / .18); }
.api-snippets h4:first-child { margin-top: 0; }

/* ---------- Stats ---------- */
.stats-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.stat-card { border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; background: var(--soft); }
.stat-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; font-size: .9rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 6px; font-size: .84rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Source cards ---------- */
.source-card h3 { margin-top: 8px; }
.source-card p:last-of-type { font-size: .92rem; }

/* ---------- Login ---------- */
.login-card { padding: 36px 32px; text-align: center; }
.login-card form { text-align: left; }

/* ---------- Admin ---------- */
.admin { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - 62px); }
@media (min-width: 900px) { .admin { grid-template-columns: 240px minmax(0, 1fr); } }
.admin-nav { background: var(--surface); border-right: 1px solid var(--border); padding: 20px 12px; }
.admin-nav nav { display: grid; gap: 2px; }
.admin-nav a { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 9px 12px; border-radius: var(--r-sm); font-weight: 500; font-size: .92rem; }
.admin-nav a > span[aria-hidden] { width: 18px; text-align: center; }
.admin-nav a:hover { background: var(--soft); color: var(--text); text-decoration: none; }
.admin-nav a.active { background: var(--soft-2); color: var(--text); font-weight: 650; }
.admin-user { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 12px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
@media (max-width: 899px) {
  .admin-nav { border-right: 0; border-bottom: 1px solid var(--border); padding: 12px; }
  .admin-nav nav { display: flex; overflow-x: auto; }
  .admin-nav a { white-space: nowrap; }
  .admin-user { display: none; }
}
.admin-main { padding: 28px 16px 64px; display: grid; gap: 18px; align-content: start; min-width: 0; }
@media (min-width: 720px) { .admin-main { padding: 32px 36px 72px; } }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.admin-head h1 { margin: 4px 0 0; font-size: 1.6rem; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi span { color: var(--muted); font-size: .84rem; }
.kpi strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.two-col { display: grid; gap: 16px; }
@media (min-width: 1000px) { .two-col { grid-template-columns: 1fr 1.6fr; } }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 7px 0; border-bottom: 1px solid var(--border); }
.plain li:last-child { border: 0; }
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
details.card[open] > summary::before { transform: rotate(90deg); }
details.card[open] > summary { margin-bottom: 16px; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone h3 { color: var(--danger); }
.narrow-card { max-width: 520px; }
.color-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.color-field { display: flex; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; }
.color-field input { width: 42px; height: 42px; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 8px; }
.color-field span { display: grid; font-size: .85rem; }
.color-field code { background: none; padding: 0; color: var(--muted); }

/* ---------- Modal ---------- */
.modal { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 24px; width: min(640px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.modal::backdrop { background: rgb(5 10 25 / .55); backdrop-filter: blur(3px); }
.modal .code pre { white-space: pre-wrap; word-break: break-all; }

/* ---------- Toast ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; max-width: calc(100vw - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--r-sm); box-shadow: var(--shadow-lg); font-size: .9rem; animation: tin .2s ease-out; transition: opacity .4s, transform .4s; }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Empty / footer ---------- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state.small { padding: 30px; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 20px; padding-top: 28px; padding-bottom: 28px; }
.footer-inner p { margin: 8px 0 0; max-width: 380px; }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--muted); }
.admin ~ .site-footer, body:has(.admin) .site-footer { margin-top: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Grid elementlari ichidagi keng jadvallar sahifani kengaytirib yubormasligi uchun */
.admin-main > *, .stack > *, .stack-lg > *, .ds-layout > *, .catalog > *, .docs > * { min-width: 0; }
.card { min-width: 0; }
@media (max-width: 640px) { .ds-head { flex-direction: column; } }

/* =====================================================================
   Grafiklar, jadval muharriri, notebook, SQL konsol
   ===================================================================== */
.min0 { min-width: 0; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.wrap { flex-wrap: wrap; } .row.gap-sm { gap: 4px; }
.grid-4 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
kbd { font-family: ui-monospace, Menlo, monospace; font-size: .78em; padding: 1px 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); }
pre.code { margin: .6em 0 1em; background: color-mix(in srgb, var(--text) 92%, var(--primary)); color: #e6ebf5; padding: 12px 14px; border-radius: var(--r-sm); overflow-x: auto; white-space: pre; }
pre.code code { background: none; padding: 0; color: inherit; }
.w-xs { width: 74px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; cursor: pointer; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--border); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex-shrink: 0; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(14px); }
.toggles { display: flex; flex-wrap: wrap; gap: 12px 20px; margin: 4px 0 12px; }
.tabs.sm .tab { padding: 7px 12px; font-size: .84rem; }

/* ---- Grafik kartalari ---- */
.chart-grid { display: grid; gap: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.chart-grid > .chart-card { grid-column: span 3; }
.chart-grid > .chart-card.w-full { grid-column: 1 / -1; }
.chart-grid > .chart-card.w-third { grid-column: span 2; }
@media (max-width: 900px) { .chart-grid > .chart-card, .chart-grid > .chart-card.w-third { grid-column: 1 / -1; } }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 16px 12px; min-width: 0; }
.tab-panel .chart-card { box-shadow: none; }
.chart-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.chart-card-head h3 { margin: 0; font-size: 1rem; }
.chart-card-head .btn { opacity: .55; }
.chart-card:hover .chart-card-head .btn { opacity: 1; }
.chart-canvas { position: relative; width: 100%; }
.chart-empty { padding: 40px 10px; }
.chart-note { margin: 8px 0 0; }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { border: 1px solid var(--border); border-left: 4px solid var(--kpi); border-radius: var(--r-sm); padding: 14px 16px; display: grid; gap: 2px; background: color-mix(in srgb, var(--kpi) 5%, var(--surface)); }
.kpi-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.kpi-value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi-sub { font-size: .74rem; color: var(--muted); }
.explore { margin-top: 20px; border-top: 1px dashed var(--border); padding-top: 14px; }
.explore summary { cursor: pointer; list-style: none; padding: 6px 0; }
.explore summary::-webkit-details-marker { display: none; }
.explore[open] summary { margin-bottom: 12px; }
.type-filter { margin-bottom: 20px; }
.chip-btn { font: inherit; font-size: .85rem; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.chip-btn.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.gallery-section { margin-bottom: 36px; }
.gallery-section h2 { font-size: 1.15rem; margin: 0 0 12px; }

/* ---- Grafik konstruktori ---- */
.chart-editor { display: grid; gap: 18px; }
@media (min-width: 1100px) { .chart-editor { grid-template-columns: minmax(340px, 5fr) minmax(0, 6fr); align-items: start; } .ce-preview { position: sticky; top: 140px; } }
.chart-editor.compact { gap: 14px; }
.ce-settings { display: grid; gap: 12px; min-width: 0; }
.ce-body { display: grid; gap: 12px; padding-top: 4px; }
.ce-preview-label { margin-bottom: 6px; }
.ce-title { font-size: 1rem; margin: 0 0 8px; }
.type-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
.type-opt { display: grid; justify-items: center; gap: 4px; padding: 8px 4px 6px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); color: var(--muted); font: inherit; font-size: .7rem; line-height: 1.2; cursor: pointer; text-align: center; transition: border-color .12s, color .12s, background .12s; }
.type-opt svg { width: 30px; height: 22px; }
.type-opt:hover { color: var(--text); border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.type-opt.active { color: var(--primary); border-color: var(--primary); background: var(--soft); font-weight: 650; }
.type-picker.mini { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.palette-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.pal { display: inline-flex; align-items: center; gap: 2px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; font: inherit; font-size: .74rem; color: var(--muted); }
.pal i { width: 10px; height: 18px; border-radius: 2px; display: inline-block; }
.pal span { margin-left: 6px; }
.pal.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); color: var(--text); }
.color-in { width: 36px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.filter-row { display: grid; grid-template-columns: 1.3fr .8fr 1.3fr; gap: 6px; }
.chart-list { display: grid; gap: 10px; }
.cl-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cl-item.open { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: var(--shadow); }
.cl-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; }
.cl-toggle { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 4px; border-radius: 6px; }
.cl-toggle:focus-visible { outline: 2px solid var(--accent); }
.cl-icon { color: var(--primary); display: inline-flex; } .cl-icon svg { width: 28px; height: 20px; }
.cl-body { border-top: 1px solid var(--border); padding: 16px; }
.add-chart { display: grid; gap: 8px; padding: 14px; border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-mini { padding: 8px 2px; }

/* ---- Jadval uslublari va katak formatlari ---- */
.data-table.ts-striped tbody tr:nth-child(even) { background: color-mix(in srgb, var(--primary) 4%, transparent); }
.data-table.ts-bordered th, .data-table.ts-bordered td { border: 1px solid var(--border); }
.data-table.ts-minimal thead th { background: transparent; border-bottom: 2px solid var(--text); color: var(--text); }
.data-table.ts-minimal td { border-bottom-color: color-mix(in srgb, var(--border) 60%, transparent); }
.data-table.ts-dark thead th { background: var(--primary); color: var(--on-primary); }
.data-table.ts-dark thead th .dir { color: inherit; }
.data-table.td-compact th, .data-table.td-compact td { padding: 5px 8px; font-size: .82rem; }
.data-table.td-comfy th, .data-table.td-comfy td { padding: 13px 16px; }
.data-table.sticky-first th:first-child, .data-table.sticky-first td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--border); }
.data-table.sticky-first thead th:first-child { z-index: 2; background: var(--soft); }
.data-table.ts-dark.sticky-first thead th:first-child { background: var(--primary); }
.data-table .al-left { text-align: left; } .data-table .al-center { text-align: center; } .data-table .al-right { text-align: right; }
.data-table td.bold { font-weight: 700; }
.data-table td.heat { background: color-mix(in srgb, var(--hc) var(--heat), transparent); }
.cell-bar { display: block; position: relative; min-width: 110px; padding: 1px 6px; border-radius: 4px; text-align: right; }
.cell-bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: color-mix(in srgb, var(--c) 28%, transparent); border-radius: 4px; }
.cell-bar span { position: relative; }
.cell-progress { display: flex; align-items: center; gap: 8px; min-width: 130px; }
.cell-progress i { flex: 1; height: 6px; border-radius: 99px; background: var(--soft-2); position: relative; overflow: hidden; }
.cell-progress i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c); border-radius: 99px; }
.cell-progress span { min-width: 48px; text-align: right; }
.cell-delta.up { color: var(--ok); } .cell-delta.down { color: var(--danger); } .cell-delta.flat { color: var(--muted); }
.cell-delta { font-weight: 600; }
.cell-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap; }

/* ---- Admin dataset muharriri ---- */
.sticky-head { position: sticky; top: 62px; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 10px 0; margin: -10px 0 0; align-items: center; }
.ds-ident { padding: 16px 20px; }
.ident-grid { display: grid; gap: 12px; }
@media (min-width: 900px) { .ident-grid { grid-template-columns: repeat(3, 1fr) 1.2fr; } }
.editor-tabs { margin-bottom: -15px; position: relative; z-index: 1; }
.tab-pane { border-top-left-radius: 0; }
.tpl-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tpl-card { display: grid; gap: 6px; align-content: start; color: var(--text); transition: border-color .15s, transform .15s; }
.tpl-card:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.tpl-icon { font-size: 1.6rem; line-height: 1; }
.tpl-meta { color: var(--accent); font-weight: 600; margin-top: 4px; }
.col-cfg td { vertical-align: middle; }

/* ---- Excel uslubidagi jadval ---- */
.grid-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.grid-toolbar .input.sm { width: 200px; }
.grid-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--r-sm); }
.sheet { border-collapse: separate; border-spacing: 0; font-size: .84rem; font-variant-numeric: tabular-nums; min-width: 100%; }
.sheet th, .sheet td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 0; }
.sheet thead th { position: sticky; top: 0; z-index: 2; background: var(--soft); text-align: left; }
.sheet thead th button { all: unset; display: grid; gap: 1px; padding: 6px 10px; cursor: pointer; min-width: 110px; box-sizing: border-box; width: 100%; }
.sheet thead th button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sheet thead th.sel { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.sheet thead th.num button { text-align: right; }
.sheet .cname { font-weight: 650; font-size: .82rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.sheet .ctype { font-size: .68rem; color: var(--muted); font-family: ui-monospace, Menlo, monospace; white-space: nowrap; }
.sheet th.add button { min-width: 36px; text-align: center; font-size: 1.1rem; color: var(--muted); }
.sheet .rn { position: sticky; left: 0; z-index: 1; background: var(--soft); font-size: .72rem; color: var(--muted); min-width: 56px; }
.sheet thead .rn { z-index: 3; text-align: center; }
.sheet .rn label { display: flex; align-items: center; gap: 6px; padding: 0 8px; cursor: pointer; height: 100%; }
.sheet tr.rsel td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sheet .gc { all: unset; box-sizing: border-box; display: block; width: 100%; min-width: 110px; padding: 6px 10px; font: inherit; color: var(--text); }
.sheet .gc.num { text-align: right; }
.sheet .gc:focus { box-shadow: inset 0 0 0 2px var(--primary); background: var(--surface); }
.sheet .gc.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.sheet td.geo { padding: 4px 10px; }
.col-panel { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 10px; margin-bottom: 10px; }
.col-panel-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.paste-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; }
.paste-zone ol { margin: 0; padding-left: 20px; }
.import-panel { border: 1px solid var(--primary); border-radius: var(--r-sm); padding: 12px; display: grid; gap: 10px; margin-bottom: 10px; background: var(--soft); }
.import-preview { max-height: 200px; background: var(--surface); }
.import-preview tr.hdr td { font-weight: 700; background: var(--soft-2); }

/* ---- Notebook ---- */
.nb { display: grid; gap: 14px; }
.nb-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; position: sticky; top: 62px; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); padding: 10px 0; }
.nb-title { font: inherit; font-size: 1.35rem; font-weight: 700; border: 1px solid transparent; background: none; color: var(--text); padding: 4px 8px; border-radius: var(--r-sm); min-width: 14ch; flex: 1 1 260px; max-width: 560px; }
.nb-title:hover, .nb-title:focus { border-color: var(--border); outline: none; background: var(--surface); }
.nb-head > .row:first-child { flex: 1 1 420px; flex-wrap: wrap; }
.nb-head > .row:last-child { flex-wrap: wrap; }
.kernel { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.kernel i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.kernel.idle i { background: var(--ok); } .kernel.busy i { background: var(--warn); animation: pulse 1s infinite; } .kernel.loading i { background: var(--accent); animation: pulse 1s infinite; } .kernel.dead i { background: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
.nb-cells { display: grid; gap: 4px; }
.cell { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 8px; border: 1px solid transparent; border-radius: var(--radius); padding: 8px 10px 8px 0; transition: border-color .12s, background .12s; }
.cell:hover { border-color: var(--border); }
.cell.active { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); background: color-mix(in srgb, var(--primary) 2%, transparent); }
.cell-gutter { display: grid; justify-items: center; align-content: start; gap: 6px; padding-top: 6px; }
.cell-count { font-family: ui-monospace, Menlo, monospace; font-size: .74rem; color: var(--muted); }
.cell-run { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--primary); cursor: pointer; display: grid; place-items: center; font-size: .8rem; }
.cell-run:hover { background: var(--primary); color: var(--on-primary); }
.cell.running .cell-run { animation: pulse 1s infinite; }
.cell-type { font-size: .62rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.cell-type.sql { color: var(--accent); } .cell-type.md { color: #2A9D8F; }
.cell-main { min-width: 0; display: grid; gap: 6px; }
.cell-tools { position: absolute; top: 6px; right: 8px; display: none; gap: 2px; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; box-shadow: var(--shadow); }
.cell:hover .cell-tools, .cell.active .cell-tools { display: flex; }
.cell-tools button { all: unset; cursor: pointer; padding: 3px 7px; border-radius: 4px; font-size: .78rem; color: var(--muted); }
.cell-tools button:hover { background: var(--soft); color: var(--text); }
.cell-editor { border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.cell-editor .CodeMirror { height: auto; min-height: 40px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.55; background: transparent; color: var(--text); }
.cell-editor .CodeMirror-scroll { min-height: 40px; max-height: 520px; }
.cell-editor .CodeMirror-gutters { background: var(--soft); border-right: 1px solid var(--border); }
.cell-editor .CodeMirror-linenumber { color: var(--muted); font-size: .72rem; }
.cell-editor .CodeMirror-cursor { border-left-color: var(--text); }
.cell-editor .CodeMirror-selected, .cell-editor .CodeMirror-focused .CodeMirror-selected { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.cm-s-nvz .cm-keyword { color: #7C5CDB; font-weight: 600; } .cm-s-nvz .cm-string { color: #2A9D8F; } .cm-s-nvz .cm-number { color: #D64560; }
.cm-s-nvz .cm-comment { color: var(--muted); font-style: italic; } .cm-s-nvz .cm-builtin, .cm-s-nvz .cm-variable-2 { color: #3A86D4; } .cm-s-nvz .cm-def { color: var(--accent); font-weight: 600; }
.cm-s-nvz .cm-operator { color: var(--muted); } .cm-s-nvz .cm-atom { color: #B8901F; }
.cell-editor textarea.fallback { width: 100%; min-height: 80px; border: 0; padding: 10px; font-family: ui-monospace, Menlo, monospace; font-size: .86rem; background: transparent; color: var(--text); resize: vertical; }
.cell-md { padding: 4px 8px; cursor: text; min-height: 28px; }
.cell-md:empty::before { content: 'Matn katagi — ikki marta bosing'; color: var(--muted); }
.cell-out { display: grid; gap: 6px; min-width: 0; }
.out-stream { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow: auto; padding: 6px 10px; background: var(--soft); border-radius: var(--r-sm); }
.out-stream.err { background: color-mix(in srgb, var(--danger) 9%, transparent); color: var(--danger); }
.out-df { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.out-df .table-wrap { max-height: 420px; overflow: auto; }
.out-df .data-table { font-size: .8rem; }
.out-df .data-table th, .out-df .data-table td { padding: 5px 9px; }
.out-df .data-table .idx { color: var(--muted); background: var(--soft); font-weight: 600; }
.out-df-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--border); background: var(--soft); font-size: .78rem; color: var(--muted); }
.out-img { max-width: 100%; background: #fff; border-radius: var(--r-sm); }
.out-chart { max-width: 900px; }
.nb-add { display: flex; gap: 6px; justify-content: center; padding: 2px 0; opacity: 0; transition: opacity .12s; }
.nb-add:hover, .nb-add:focus-within, .nb-cells:empty + .nb-add { opacity: 1; }
.nb-add button { font-size: .74rem; padding: 3px 10px; }
.nb-side { display: grid; gap: 14px; align-content: start; }
.nb-layout { display: grid; gap: 20px; }
@media (min-width: 1200px) { .nb-layout { grid-template-columns: minmax(0, 1fr) 280px; } .nb-side { position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow: auto; } }
.nb-catalog { display: grid; gap: 2px; font-size: .84rem; }
.nb-catalog button { all: unset; cursor: pointer; padding: 5px 8px; border-radius: 6px; display: grid; gap: 1px; min-width: 0; box-sizing: border-box; }
.nb-catalog button:hover { background: var(--soft); }
.nb-catalog code { font-size: .7rem; background: none; padding: 0; color: var(--muted); word-break: break-all; }
.nb-vars { font-size: .8rem; display: grid; gap: 4px; }
.nb-vars div { display: flex; justify-content: space-between; gap: 8px; }
.nb-list { display: grid; gap: 10px; }
.nb-list a.card { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--text); padding: 14px 18px; }
.nb-list a.card:hover { border-color: var(--primary); text-decoration: none; }
.shortcuts { font-size: .8rem; display: grid; gap: 4px; }
.shortcuts div { display: flex; justify-content: space-between; gap: 10px; }
/* CodeMirror popup (@ va / menyulari) */
.CodeMirror-hints { position: absolute; z-index: 300; list-style: none; margin: 0; padding: 4px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); font-size: .82rem; max-height: 320px; overflow-y: auto; min-width: 280px; max-width: 460px; }
.CodeMirror-hint { margin: 0; padding: 6px 10px; border-radius: 6px; white-space: normal; color: var(--text); cursor: pointer; }
li.CodeMirror-hint-active { background: var(--primary); color: var(--on-primary); }
.hint-row { display: grid; gap: 1px; }
.hint-row small { opacity: .7; font-size: .72rem; font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.hint-row .hk { float: right; font-size: .66rem; opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 8px; }
/* ---- SQL konsol ---- */
.sql-layout { display: grid; gap: 18px; }
@media (min-width: 1100px) { .sql-layout { grid-template-columns: 260px minmax(0, 1fr); } .sql-side { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; } }
.sql-side details { border-bottom: 1px solid var(--border); padding: 6px 0; }
.sql-side summary { cursor: pointer; font-weight: 600; font-size: .85rem; display: flex; justify-content: space-between; gap: 6px; }
.sql-side ul { list-style: none; margin: 6px 0 4px; padding: 0 0 0 10px; display: grid; gap: 2px; }
.sql-side li button { all: unset; cursor: pointer; font-family: ui-monospace, Menlo, monospace; font-size: .76rem; display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 2px 4px; border-radius: 4px; }
.sql-side li button:hover { background: var(--soft); }
.sql-side li em { color: var(--muted); font-style: normal; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.save-dlg form { display: grid; gap: 12px; }
.endpoint-box { display: grid; gap: 8px; border: 1px solid var(--ok); background: color-mix(in srgb, var(--ok) 7%, var(--surface)); border-radius: var(--r-sm); padding: 12px; }
.endpoint-box > * { min-width: 0; }
.endpoint-box pre.code { white-space: pre-wrap; word-break: break-all; }
/* Tor ekranlarda notebook va SQL konsol sahifadan toshmasin */
.admin-main, .nb, .nb-layout > *, .nb-cells, .cell-main, .sql-layout > * { min-width: 0; }
.nb { max-width: 100%; }
.cell-md, .cell-md code { overflow-wrap: anywhere; }

/* ===== Studio: Notebook va SQL — alohida to'liq ekranli sahifalar ===== */
body.studio { overflow: hidden; }
body.studio #header, body.studio #footer { display: none; }
body.studio #main { height: 100vh; height: 100dvh; }
.studio { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); background: var(--bg); }
.studio-bar { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); min-width: 0; }
.studio-bar .nb-title { font-size: 1.05rem; flex: 1 1 200px; min-width: 6ch; max-width: 420px; }
.studio-logo { display: inline-grid; place-items: center; padding: 2px 4px; }
.studio-title { font-size: 1.02rem; white-space: nowrap; }
.studio-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.studio-actions::-webkit-scrollbar { display: none; }
.studio-toggle { display: none; }
.studio-body { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 0; }
.studio-side { border-right: 1px solid var(--border); background: var(--surface); overflow: auto; padding: 10px 12px 24px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.studio-main { overflow: auto; padding: 14px 18px 120px; min-width: 0; }
.studio-main .nb-cells { max-width: 1180px; margin: 0 auto; }
.side-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; background: var(--soft); border-radius: var(--r-sm); padding: 3px; position: sticky; top: -10px; z-index: 2; }
.side-tabs button { all: unset; cursor: pointer; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; font-weight: 600; padding: 6px 4px; border-radius: 6px; color: var(--muted); }
.side-tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.side-panel { display: grid; gap: 8px; align-content: start; min-width: 0; }
.side-panel h4 { margin: 8px 0 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.input.sm { padding: 6px 10px; font-size: .84rem; }
@media (max-width: 900px) {
  .studio-toggle { display: inline-grid; }
  .studio-body { grid-template-columns: minmax(0, 1fr); }
  .studio-side { position: fixed; z-index: 60; top: 51px; bottom: 0; left: 0; width: min(320px, 88vw); transform: translateX(-102%); transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  .studio-side.open { transform: none; }
  .studio-main { padding: 10px 8px 120px; }
  .studio-bar { padding: 8px 10px; gap: 6px; }
  .studio-bar [data-saved], .hide-sm { display: none; }
  .studio-bar .kernel span { display: none; }
  .cell { grid-template-columns: 40px minmax(0, 1fr); }
}
/* Kutubxonalar paneli */
.lib-info { background: var(--soft); border-radius: var(--r-sm); padding: 10px 12px; }
.lib-info p { margin: 6px 0 0; }
.lib-list { display: grid; gap: 2px; }
.lib { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: .84rem; }
.lib-acts { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.lib-acts label { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); cursor: pointer; }
.pkg-list { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: .76rem; color: var(--muted); }
.out-plotly { width: 100%; min-height: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); }
/* SQL studio */
.sql-split { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sql-editor-pane { height: 38%; min-height: 90px; flex-shrink: 0; overflow: hidden; background: var(--surface); }
.sql-ed { height: 100%; }
.sql-ed .CodeMirror { height: 100%; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.55; background: transparent; color: var(--text); }
.sql-ed .CodeMirror-gutters { background: var(--soft); border-right: 1px solid var(--border); }
.sql-ed .CodeMirror-linenumber { color: var(--muted); font-size: .72rem; }
.sql-ed .CodeMirror-cursor { border-left-color: var(--text); }
.sql-ed .CodeMirror-selected, .sql-ed .CodeMirror-focused .CodeMirror-selected { background: color-mix(in srgb, var(--primary) 18%, transparent); }
.sql-resizer { height: 7px; flex-shrink: 0; cursor: row-resize; background: var(--soft); border-block: 1px solid var(--border); touch-action: none; }
.sql-resizer:hover { background: color-mix(in srgb, var(--primary) 25%, var(--soft)); }
.sql-result-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sql-result-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface); }
.sql-result { flex: 1; overflow: auto; padding: 0; min-height: 0; }
.sql-result .table-wrap { overflow: visible; }
.sql-result .data-table { font-size: .82rem; }
.sql-result .data-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.sql-result .data-table th, .sql-result .data-table td { padding: 5px 10px; }
.sql-result > pre, .sql-result > p, .sql-result > .out-chart { margin: 12px; }
.sql-tables details { border-bottom: 1px solid var(--border); padding: 6px 0; }
.sql-tables summary { cursor: pointer; font-size: .84rem; }
.sql-tables summary code { font-weight: 600; background: none; padding: 0; cursor: copy; }
.sql-tables ul { list-style: none; margin: 6px 0; padding: 0 0 0 10px; display: grid; gap: 1px; }
.sql-tables li button { all: unset; cursor: pointer; font-size: .78rem; display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 2px 6px; border-radius: 4px; box-sizing: border-box; }
.sql-tables li button:hover { background: var(--soft); }
.sql-tables li code { background: none; padding: 0; }
@media (max-width: 900px) { .sql-editor-pane { height: 34%; } .studio-actions select { display: none; } }

/* ===== Muharrir: avtoto'ldirish, imzo, xatolar (VS Code uslubida) ===== */
.CodeMirror-hint.ac-row { display: grid; grid-template-columns: 20px minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 8px; padding: 4px 8px; white-space: nowrap; }
.ac-ic { width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; font-size: .7rem; font-weight: 700; font-family: ui-monospace, Menlo, monospace; background: var(--soft-2); color: var(--muted); }
.ac-fn { color: #7C5CDB; background: color-mix(in srgb, #7C5CDB 14%, transparent); }
.ac-mod, .ac-cls { color: #B8901F; background: color-mix(in srgb, #B8901F 14%, transparent); }
.ac-var, .ac-prop { color: #3A86D4; background: color-mix(in srgb, #3A86D4 14%, transparent); }
.ac-kw { color: #D64560; background: color-mix(in srgb, #D64560 12%, transparent); }
.ac-col, .ac-tbl, .ac-path { color: #2A9D8F; background: color-mix(in srgb, #2A9D8F 14%, transparent); }
.ac-snip { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ac-n { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .82rem; overflow: hidden; text-overflow: ellipsis; }
.ac-n b { color: var(--primary); }
.ac-d { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; text-align: right; }
li.CodeMirror-hint-active .ac-d, li.CodeMirror-hint-active .ac-n b { color: inherit; }
li.CodeMirror-hint-active .ac-ic { background: rgba(255,255,255,.2); color: inherit; }
.cm-sig { position: fixed; z-index: 310; max-width: min(560px, 92vw); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-lg); padding: 6px 10px; font-size: .8rem; pointer-events: none; }
.cm-sig code { background: none; padding: 0; font-size: .8rem; white-space: pre-wrap; word-break: break-word; }
.cm-sig code b { color: var(--primary); text-decoration: underline; }
.cm-sig-doc { margin-top: 4px; color: var(--muted); font-size: .74rem; white-space: pre-wrap; max-height: 120px; overflow: hidden; }
.cm-lint-error { text-decoration: underline wavy var(--danger); text-decoration-skip-ink: none; text-underline-offset: 3px; }
.cm-lint-warn { text-decoration: underline wavy var(--warn); text-decoration-skip-ink: none; text-underline-offset: 3px; }
.cm-diag { display: grid; border-top: 1px solid var(--border); background: var(--soft); }
.cm-diag .diag { all: unset; cursor: pointer; font-size: .74rem; padding: 3px 10px; color: var(--warn); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-diag .diag.error { color: var(--danger); }
.cm-diag .diag:hover { background: var(--soft-2); }
.cm-s-nvz .cm-matchhighlight { background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 2px; }
.cm-s-nvz .CodeMirror-activeline-background { background: transparent; }
.cm-s-nvz.CodeMirror-focused .CodeMirror-activeline-background { background: color-mix(in srgb, var(--primary) 6%, transparent); }
.cm-s-nvz span.CodeMirror-matchingbracket, .cm-s-nvz .CodeMirror-matchingbracket { color: inherit !important; background: color-mix(in srgb, var(--primary) 18%, transparent); outline: 1px solid color-mix(in srgb, var(--primary) 40%, transparent); }
.CodeMirror-foldgutter-open, .CodeMirror-foldgutter-folded { color: var(--muted); cursor: pointer; }
.CodeMirror-dialog { background: var(--soft); color: var(--text); font-size: .82rem; }
.CodeMirror-dialog input { color: var(--text); font-family: ui-monospace, Menlo, monospace; }
.CodeMirror-search-match { background: color-mix(in srgb, var(--warn) 30%, transparent); }
.cm-s-nvz .cm-meta { color: #B8901F; } .cm-s-nvz .cm-variable-3, .cm-s-nvz .cm-type { color: #2A9D8F; } .cm-s-nvz .cm-property { color: var(--text); }
.cm-s-nvz .cm-header { color: var(--primary); font-weight: 700; } .cm-s-nvz .cm-link { color: #3A86D4; text-decoration: underline; } .cm-s-nvz .cm-quote { color: var(--muted); }
.cm-s-nvz .cm-strong { font-weight: 700; } .cm-s-nvz .cm-em { font-style: italic; } .cm-s-nvz .cm-error { color: var(--danger); }
/* Kulrang taklif (inline suggestion) */
.cm-ghost { color: var(--muted); opacity: .6; font-style: normal; pointer-events: none; white-space: pre; }

/* =====================================================================
   NUVIZAN UI — yagona dizayn tizimi
   Qoidalar: ranglar faqat tokenlardan (--primary, --surface, --ok …),
   bo'shliqlar --s-* shkalasidan, burchaklar --radius / --r-sm, soyalar --shadow*.
   Har bir komponent ochiq/qorong'i rejimda, mobil va desktopda bir xil ishlaydi.
   Namuna: admin → UI kit (/admin/ui)
   ===================================================================== */

/* ---- Fokus va umumiy holatlar ---- */
.btn:focus-visible, .input:focus-visible, .seg button:focus-visible, .seg-tabs a:focus-visible, .tabs-mini button:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.block { width: 100%; padding-top: 12px; padding-bottom: 12px; }
.btn.icon { padding: 8px; width: 34px; height: 34px; }
.error { color: var(--danger); }
.ext { white-space: nowrap; }
.input:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.field small.error { color: var(--danger); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.card .data-table thead th:first-child { border-top-left-radius: var(--r-sm); }
.card .data-table thead th:last-child { border-top-right-radius: var(--r-sm); }

/* ---- Karta sarlavhasi va bo'limlar ---- */
.card > h2:first-child, .card > h3:first-child, .card > h4:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.card-head h2, .card-head h3, .card-head h4 { margin: 0; }
.card-foot { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.page-head .eyebrow, .admin-head .eyebrow { margin: 0 0 var(--s-1); }
.section-title { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s-2); }

/* ---- Ogohlantirishlar (alert, note, quote) ---- */
.alert { --tone: var(--primary); display: block; padding: var(--s-3) var(--s-4); border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--border)); border-left: 3px solid var(--tone); border-radius: var(--r-sm); background: color-mix(in srgb, var(--tone) 7%, var(--surface)); color: var(--text); font-size: var(--fs-md); line-height: 1.5; margin: 0; }
.alert.warn { --tone: var(--warn); color: var(--text); padding: var(--s-3) var(--s-4); }
.alert.ok { --tone: var(--ok); }
.alert.danger { --tone: var(--danger); }
.alert.small { font-size: var(--fs-sm); }
a.alert { transition: border-color .15s, background .15s; }
a.alert:hover { text-decoration: none; background: color-mix(in srgb, var(--tone) 12%, var(--surface)); }
.note { padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); background: var(--soft); color: var(--muted); border: 1px dashed var(--border-strong); }
.quote { padding: var(--s-3) var(--s-4); border-left: 3px solid var(--border-strong); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; white-space: pre-wrap; }
.empty-inline { text-align: center; padding: var(--s-6) var(--s-4); border: 1px dashed var(--border-strong); border-radius: var(--r-sm); margin: var(--s-3) 0 0; }

/* ---- Segment boshqaruvi: .seg (tugmalar), .seg-tabs (havolalar), .tabs-mini — bitta uslub ---- */
.seg, .seg-tabs, .tabs-mini { display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: calc(var(--r-sm) + 3px); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button, .seg-tabs a, .tabs-mini button { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.seg button { padding: 4px 10px; font-size: .78rem; }
.seg button:hover, .seg-tabs a:hover, .tabs-mini button:hover { color: var(--text); text-decoration: none; }
.seg button.active, .seg-tabs a.active, .tabs-mini button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(10 20 50 / .08), 0 0 0 1px var(--border); }
.seg-tabs { align-self: flex-start; }
.tabs-mini { margin-bottom: var(--s-3); }
.count { display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--soft-2); color: var(--muted); font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.count.hot { background: var(--warn); color: #fff; }

/* ---- Avatar, foydalanuvchi chipi, muhit belgisi ---- */
.avatar { display: inline-grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); font-weight: 700; font-size: .85rem; border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border)); }
.avatar.sm { width: 24px; height: 24px; font-size: .7rem; }
.avatar.lg { width: 48px; height: 48px; font-size: 1.1rem; }
.who { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.user-chip { display: inline-flex; align-items: center; gap: var(--s-2); padding: 2px 12px 2px 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: var(--fs-sm); font-weight: 600; max-width: 220px; }
.user-chip .avatar { width: 28px; height: 28px; font-size: .75rem; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* ---- Admin yon menyusi: guruhlar va profil ---- */
.admin-nav { display: flex; flex-direction: column; gap: var(--s-2); }
.admin-nav .nav-group { display: block; padding: var(--s-4) 12px var(--s-1); font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: .8; }
.admin-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--primary); }
a.admin-user { display: flex; align-items: center; justify-content: flex-start; gap: var(--s-3); padding: var(--s-2) 10px; margin: 0 0 var(--s-1); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); }
a.admin-user:hover { text-decoration: none; border-color: var(--border-strong); }
a.admin-user > .min0 { flex: 1; }
a.admin-user strong, a.admin-user small { display: block; line-height: 1.3; }
a.admin-user strong { font-size: var(--fs-md); }
@media (max-width: 899px) {
  .admin-nav .nav-group { display: none; }
  .admin-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--primary); }
}

/* ---- Kirish / ro'yxatdan o'tish ---- */
.auth-page { display: grid; place-items: center; padding: var(--s-10) 16px 64px; min-height: calc(100vh - var(--header-h) - 120px);
  background: radial-gradient(700px 320px at 50% 0%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 70%); }
.auth-card { width: min(420px, 100%); padding: var(--s-8) 28px; text-align: center; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.55rem; margin-bottom: var(--s-2); }
.auth-card .eyebrow { margin-bottom: var(--s-1); }
.auth-card form { text-align: left; margin: var(--s-6) 0 var(--s-5); }
.auth-card > p:last-child { margin-bottom: 0; }
.auth-split { display: grid; gap: var(--s-10); align-items: start; }
@media (min-width: 980px) { .auth-split { grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 64px; padding-top: var(--s-6); } }
.auth-intro h1 { font-size: clamp(1.7rem, 2.6vw + .7rem, 2.5rem); letter-spacing: -.02em; text-wrap: balance; }
.auth-form { padding: 28px; box-shadow: var(--shadow-lg); }
.auth-form h2 { margin-top: 0; }
.feature-list { list-style: none; padding: 0; margin: var(--s-6) 0; display: grid; gap: var(--s-4); }
.feature-list li { display: grid; grid-template-columns: 28px 1fr; column-gap: var(--s-3); }
.feature-list li::before { content: '✓'; grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); font-size: .8rem; font-weight: 800; }
.feature-list strong { font-size: var(--fs-md); }
.feature-list span { color: var(--muted); font-size: var(--fs-sm); }

/* ---- Hamkor kabineti ---- */
.account-grid { display: grid; gap: var(--s-5); align-items: start; }
@media (min-width: 1040px) { .account-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.account-grid > * { min-width: 0; }
.usage-head { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-2); }
.usage-head strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.usage-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: var(--s-2); border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(to top, transparent 0 29px, color-mix(in srgb, var(--border) 60%, transparent) 29px 30px); }
.ub { flex: 1; height: var(--h); min-height: 2px; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--primary) 70%, transparent); transition: background .15s; }
.ub:hover { background: var(--accent); }
.usage-axis { display: flex; justify-content: space-between; margin: 6px 0 var(--s-3); }

/* ---- Studio paneli sayt sarlavhasi bilan bir xil ---- */
.studio-bar { min-height: 52px; backdrop-filter: saturate(1.4) blur(12px); }
.studio-title { font-size: var(--fs-md); }

/* ---- UI kit sahifasi ---- */
.swatches { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.swatch { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); font-size: var(--fs-sm); }
.swatch i { display: block; height: 56px; background: var(--c); border-bottom: 1px solid var(--border); }
.swatch span { display: grid; padding: var(--s-2) 10px; }
.swatch code { background: none; padding: 0; color: var(--muted); font-size: .75rem; }
.ui-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.type-scale > * { margin: 0 0 var(--s-2); }
.spacing-scale { display: grid; gap: 6px; }
.spacing-scale div { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-sm); }
.spacing-scale i { display: block; height: 10px; width: var(--w); background: var(--accent); border-radius: 2px; }
@media (min-width: 900px) { .admin-nav { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; scrollbar-width: thin; } }
.seg, .seg-tabs, .tabs-mini { justify-self: start; }
.field { align-content: start; }
select.input { padding-right: 32px; }
.brand-name, .lang-switch button, .nav-tools .btn { white-space: nowrap; }
