/* ==========================================================================
   tahsinERP boshqaruv paneli — dizayn tizimi
   Uslub: Linear / Vercel / Stripe dashboard (chap sidebar, yumshoq kartalar),
   kirish ekranlari — "xavfsiz kirish terminali" (HUD).
   CSP: faqat 'self' — tashqi shrift/ikonka yo'q, ikonlar Pages/Shared/_Icons.cshtml da.
   ========================================================================== */

:root {
    --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;

    --bg: #f4f6fb; --surface: #fff; --surface-2: #f8fafc; --surface-3: #eef2f7;
    --text: #0f172a; --text-2: #334155; --muted: #64748b;
    --line: #e6eaf1; --line-2: #d6dce6;
    --accent: #3b5bfd; --accent-2: #2f49e0; --accent-soft: #eef1ff; --accent-ring: rgba(59, 91, 253, .22);
    --ok: #0f8a4a; --ok-soft: #e8f7ef; --ok-line: #b5e3c9;
    --warn: #b25e00; --warn-soft: #fff5e6; --warn-line: #f3d29f;
    --bad: #c62a1f; --bad-soft: #fff0ee; --bad-line: #f6bdb6;
    --info: #3b5bfd; --info-soft: #eef1ff; --info-line: #c3cdfd;

    --sb-bg: #0a0f1d; --sb-bg-2: #111830; --sb-text: #9aa6bf; --sb-text-hi: #fff; --sb-line: rgba(255, 255, 255, .07);

    --radius: 12px; --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px -4px rgba(15, 23, 42, .08);
    --shadow-lg: 0 12px 40px -12px rgba(15, 23, 42, .25);
    --sb-w: 252px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #070b14; --surface: #0e1421; --surface-2: #121a2a; --surface-3: #18223560;
        --text: #e6ebf5; --text-2: #c3cbdb; --muted: #8592ab;
        --line: #1c2537; --line-2: #2a3550;
        --accent: #6d84ff; --accent-2: #8396ff; --accent-soft: #1a2348; --accent-ring: rgba(109, 132, 255, .3);
        --ok: #3ccf86; --ok-soft: #0c2a1c; --ok-line: #175c3a;
        --warn: #f2a93b; --warn-soft: #2d1f08; --warn-line: #6b4a14;
        --bad: #ff6b5e; --bad-soft: #2f0f0d; --bad-line: #6e2620;
        --info: #8396ff; --info-soft: #161f45; --info-line: #2f3d86;
        --sb-bg: #060912; --sb-bg-2: #0c1224;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px -6px rgba(0, 0, 0, .5);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #070b14; --surface: #0e1421; --surface-2: #121a2a; --surface-3: #18223560;
    --text: #e6ebf5; --text-2: #c3cbdb; --muted: #8592ab;
    --line: #1c2537; --line-2: #2a3550;
    --accent: #6d84ff; --accent-2: #8396ff; --accent-soft: #1a2348; --accent-ring: rgba(109, 132, 255, .3);
    --ok: #3ccf86; --ok-soft: #0c2a1c; --ok-line: #175c3a;
    --warn: #f2a93b; --warn-soft: #2d1f08; --warn-line: #6b4a14;
    --bad: #ff6b5e; --bad-soft: #2f0f0d; --bad-line: #6e2620;
    --info: #8396ff; --info-soft: #161f45; --info-line: #2f3d86;
    --sb-bg: #060912; --sb-bg-2: #0c1224;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px -6px rgba(0, 0, 0, .5);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
}

/* ---------- Asos ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-ring); }

h1 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; margin: 0 0 20px; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; margin: 26px 0 12px; }
h3 { font-size: 14px; font-weight: 650; margin: 0 0 12px; color: var(--text); }
.card > h2:first-child, .card > h1:first-child { margin-top: 0; }
p { margin: 0 0 12px; }

/* ---------- Ilova qobig'i: sidebar + kontent ---------- */
body.app { display: block; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--sb-w); z-index: 40;
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, var(--sb-bg-2), var(--sb-bg) 40%);
    border-right: 1px solid var(--sb-line); color: var(--sb-text);
}
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: var(--sb-text-hi); }
.sb-brand:hover { text-decoration: none; color: #fff; }
.logo-img { width: 36px; height: 36px; border-radius: 50%; flex: none; box-shadow: 0 6px 18px -4px rgba(37, 99, 235, .6); }
.sb-brand-t { font-size: 16px; font-weight: 500; letter-spacing: -.01em; line-height: 1.1; }
.sb-brand-t b { font-weight: 800; }
.sb-brand-t small { display: block; font-size: 11px; color: var(--sb-text); font-weight: 500; margin-top: 3px; letter-spacing: .02em; }
.sb-tenant { display: flex; gap: 8px; align-items: center; margin: 0 12px 6px; padding: 9px 10px; border-radius: 9px; background: rgba(255, 255, 255, .04); border: 1px solid var(--sb-line); color: #dfe5f3; font-size: 12.5px; }
.sb-tenant span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-nav { flex: 1; overflow-y: auto; padding: 4px 10px 12px; scrollbar-width: thin; scrollbar-color: #283250 transparent; }
.sb-group { padding: 16px 10px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #5d6884; }
.sb-nav a {
    position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin: 1px 0;
    border-radius: 8px; color: var(--sb-text); font-weight: 500; transition: background .15s, color .15s;
}
.sb-nav a svg.i { opacity: .8; }
.sb-nav a:hover { background: rgba(255, 255, 255, .05); color: #e7ecf7; text-decoration: none; }
.sb-nav a.active { background: rgba(91, 124, 255, .16); color: var(--sb-text-hi); }
.sb-nav a.active svg.i { opacity: 1; color: #8ea2ff; }
.sb-nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #7088ff; box-shadow: 0 0 12px #7088ff; }
.sb-count { margin-left: auto; min-width: 20px; padding: 0 6px; height: 20px; line-height: 20px; border-radius: 10px; background: #3b5bfd; color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.sb-user { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px 12px 14px; border-top: 1px solid var(--sb-line); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #7c5cff, #3b5bfd); }
.sb-user-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; color: #e7ecf7; }
.sb-user-t:hover { text-decoration: none; color: #fff; }
.sb-user-t b { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-t small { color: var(--sb-text); font-size: 11.5px; }
.sb-user .icon-btn { color: var(--sb-text); border-color: transparent; background: transparent; }
.sb-user .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .07); }

.shell { margin-left: var(--sb-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 28px;
    background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumbs span::after { content: "/"; margin-left: 8px; color: var(--line-2); }
.crumbs b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.tb-secure { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; color: var(--ok); background: var(--ok-soft); border: 1px solid var(--ok-line); }
.tb-secure svg.i { width: 15px; height: 15px; }
/* Til tanlagichi (_LangSwitch): UZ / ЎЗ / RU */
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.lang-switch a { padding: 6px 9px; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1; }
.lang-switch a + a { border-left: 1px solid var(--line); }
.lang-switch a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.lang-switch a.active { color: var(--accent); background: var(--accent-soft); }
.auth-top .lang-switch { background: transparent; border-color: rgba(255, 255, 255, .18); }
.auth-top .lang-switch a { color: var(--a-text, #cbd5e1); }
.auth-top .lang-switch a + a { border-left-color: rgba(255, 255, 255, .18); }
.auth-top .lang-switch a.active { color: #fff; background: rgba(255, 255, 255, .12); }
.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--line); background: var(--surface); color: var(--text-2); transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-2); text-decoration: none; }
.nav-toggle { display: none; }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: inline; }
:root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .only-dark { display: inline; }
    :root:not([data-theme="light"]) .only-light { display: none; }
}
.sb-backdrop { display: none; }

main { width: 100%; max-width: 1360px; margin: 0 auto; padding: 28px; }
body.portal main { max-width: 1040px; }

/* ---------- Kartalar, KPI ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
    position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 18px 15px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.stat::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--accent), transparent 80%); opacity: .8; }
.stat:nth-child(2)::after { background: linear-gradient(90deg, #8b5cf6, transparent 80%); }
.stat:nth-child(3)::after { background: linear-gradient(90deg, var(--warn), transparent 80%); }
.stat:nth-child(4)::after { background: linear-gradient(90deg, var(--bad), transparent 80%); }
.stat:nth-child(5)::after { background: linear-gradient(90deg, #14b8a6, transparent 80%); }
.stat .l { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.stat .l svg.i { width: 16px; height: 16px; }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -.025em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .hint { margin-top: 4px; }
.stat-ic { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--accent); background: var(--accent-soft); }
.stat-ic.violet { color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 14%, transparent); }
.stat-ic.warn { color: var(--warn); background: var(--warn-soft); }
.stat-ic.bad { color: var(--bad); background: var(--bad-soft); }
.stat-ic.teal { color: #14b8a6; background: color-mix(in srgb, #14b8a6 14%, transparent); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols > .card { margin-bottom: 18px; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-sm); }
.tile-v { font-size: 21px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-v small { font-size: 12px; font-weight: 500; color: var(--muted); }
.tile-l { font-size: 12px; color: var(--muted); }

/* ---------- Server holati (Servers/_HealthCard) ---------- */
.health-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 14px; }
.health-head h2 { margin: 0; }
.health h3 { font-size: 13px; font-weight: 650; margin: 4px 0 10px; color: var(--text-2); }
.health .tiles { margin-bottom: 14px; }
.health .scroll { margin-bottom: 8px; box-shadow: none; }
.health .scroll table { margin: 0; width: 100%; }
.health td { vertical-align: top; }
meter { display: block; width: 100%; height: 6px; margin: 8px 0 6px; border: 0; border-radius: 999px; background: var(--surface-3); -webkit-appearance: none; appearance: none; }
meter::-webkit-meter-bar { height: 6px; border: 0; border-radius: 999px; background: var(--surface-3); }
meter::-webkit-meter-optimum-value { border-radius: 999px; background: var(--ok); }
meter::-webkit-meter-suboptimum-value { border-radius: 999px; background: var(--warn); }
meter::-webkit-meter-even-less-good-value { border-radius: 999px; background: var(--bad); }
meter::-moz-meter-bar { border-radius: 999px; background: var(--ok); }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warn); }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--bad); }
.lvl-warn { color: var(--warn); font-weight: 600; }
.lvl-bad { color: var(--bad); font-weight: 600; }

/* ---------- Jadvallar ---------- */
table {
    width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.card table, .scroll table { border: 0; border-radius: 0; box-shadow: none; margin-bottom: 0; }
.card table { margin: 0 -20px; width: calc(100% + 40px); }
.card table + * { margin-top: 14px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--surface-2); font-weight: 600; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.card th { border-top: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
tbody tr, table tr { transition: background .12s; }
tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
td a { font-weight: 550; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.reversed td { color: var(--muted); text-decoration: line-through; }
td code { white-space: nowrap; word-break: normal; }
table.lines td:first-child { width: 55%; }
.card > table:last-child { margin-bottom: -20px; }

/* ---------- Belgilar, xabarlar ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.badge.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
.badge.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
.badge.info { color: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.badge.muted { color: var(--muted); border-color: var(--line); background: var(--surface-2); }
.flash, .warnbox, .validation-summary-errors {
    position: relative; padding: 12px 16px 12px 44px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-weight: 500;
}
.flash::before, .warnbox::before, .validation-summary-errors::before {
    content: "!"; position: absolute; left: 14px; top: 12px; width: 20px; height: 20px; border-radius: 50%;
    display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--surface); background: currentColor;
}
.flash.ok::before { content: "✓"; }
.flash::before, .warnbox::before, .validation-summary-errors::before { color: inherit; background: none; border: 1.5px solid currentColor; }
.flash.ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.flash.bad, .validation-summary-errors { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
.validation-summary-errors ul { margin: 0; padding-left: 0; list-style: none; }
.validation-summary-valid { display: none; }
.field-validation-error { color: var(--bad); font-size: 12px; }
.warnbox { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.flash.info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.flash.info::before { content: "i"; }
.idle-warn {
    position: fixed; right: 20px; bottom: 20px; z-index: 60; display: grid; gap: 6px; width: min(340px, calc(100vw - 32px));
    padding: 16px 18px; border-radius: var(--radius); background: var(--surface); color: var(--text);
    border: 1px solid var(--warn-line); box-shadow: var(--shadow-lg); animation: idle-in .2s ease-out;
}
.idle-warn b { color: var(--warn); }
.idle-warn span { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.idle-warn button { justify-self: start; margin-top: 4px; }
@keyframes idle-in { from { opacity: 0; transform: translateY(8px); } }
.warnbox.bad { border-color: var(--bad-line); background: var(--bad-soft); color: var(--bad); }

/* ---------- Formalar ---------- */
form.stack { display: grid; gap: 14px; max-width: 680px; }
form.stack.card { max-width: 760px; }
form.inline { display: inline; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text-2); }
label.check { display: flex; gap: 9px; align-items: center; font-weight: 500; margin-bottom: 0; }
fieldset.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 14px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
fieldset.modules legend { padding: 0 6px; font-weight: 600; font-size: 13px; color: var(--text-2); }
fieldset.modules .hint, fieldset.modules .field-validation-error { grid-column: 1 / -1; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--accent); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=tel], input:not([type]), select, textarea {
    width: 100%; height: 38px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font: inherit; color: var(--text);
    background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 80px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line-2)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
.hint { color: var(--muted); font-size: 12.5px; }
textarea.key { min-height: 130px; font-family: var(--mono); font-size: 12px; }

button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .1), inset 0 1px 0 rgba(255, 255, 255, .15); transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
button:hover, .btn:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--surface); color: var(--text); border-color: var(--line-2); box-shadow: var(--shadow-sm); }
button.secondary:hover, .btn.secondary:hover { background: var(--surface-2); color: var(--text); border-color: color-mix(in srgb, var(--accent) 35%, var(--line-2)); }
button.danger, .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.danger:hover, .btn.danger:hover { background: color-mix(in srgb, var(--bad) 85%, #000); }
button.link { height: auto; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; box-shadow: none; font-weight: 500; }
button.link:hover { background: none; text-decoration: underline; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar {
    display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 18px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.toolbar > * { width: auto; }
.toolbar label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.toolbar input[type=text] { min-width: 260px; }

/* ---------- Sahifalash (_Pager) ---------- */
.pager { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin: -6px 0 18px; padding: 10px 2px; color: var(--muted); font-size: 13px; }
.pager-size { display: flex; align-items: center; gap: 8px; margin: 0; }
.pager-size label { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.pager-size select { width: auto; height: 32px; padding: 4px 30px 4px 10px; background-position: calc(100% - 15px) 13px, calc(100% - 10px) 13px; }
.pager-info { font-variant-numeric: tabular-nums; }
.pager-pages { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pager-pages a, .pager-pages span {
    display: inline-grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius-sm);
    font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); border: 1px solid transparent;
}
.pager-pages a { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow-sm); }
.pager-pages a:hover { text-decoration: none; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.pager-pages .cur { color: #fff; background: var(--accent); border-color: var(--accent); }
.pager-pages .off { color: var(--line-2); }
.pager-pages .gap { min-width: 20px; padding: 0; color: var(--muted); }
@media (max-width: 600px) { .pager-pages { margin-left: 0; width: 100%; justify-content: center; } }

/* ---------- Turli ---------- */
dl.props { display: grid; grid-template-columns: 210px 1fr; gap: 0; margin: 0; }
dl.props dt, dl.props dd { padding: 9px 0; border-bottom: 1px dashed var(--line); }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; font-weight: 500; }
dl.props dt:last-of-type, dl.props dd:last-of-type { border-bottom: 0; }
code, .mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
code { padding: 1px 6px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--line); color: var(--text-2); }
.secret { background: var(--warn-soft); border: 1px dashed var(--warn-line); color: var(--text); padding: 12px 14px; border-radius: 10px; }
.qr { width: 220px; height: 220px; image-rendering: pixelated; border-radius: 10px; background: #fff; padding: 8px; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.empty::before { content: "∅"; display: block; font-size: 22px; opacity: .4; margin-bottom: 2px; }
pre.log { background: #060a12; color: #cbd5e1; padding: 14px; border-radius: 10px; border: 1px solid #1c2537; max-height: 600px; overflow: auto; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.chart { width: 100%; max-width: 900px; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.bars { display: flex; align-items: end; gap: 8px; height: 140px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; height: 100%; font-size: 11px; color: var(--muted); }
.bars .bar i { display: block; width: 100%; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, transparent)); border-radius: 5px 5px 0 0; min-height: 2px; }
svg .bar-rect { fill: url(#bar-grad); }
svg .bar-val { fill: var(--text-2); font-weight: 600; }
svg .bar-lbl { fill: var(--muted); }
svg .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
main svg text { font-family: var(--font); }
table.cohort td.heat-0 { background: color-mix(in srgb, var(--bad) 14%, transparent); }
table.cohort td.heat-1 { background: color-mix(in srgb, var(--warn) 14%, transparent); }
table.cohort td.heat-2 { background: color-mix(in srgb, var(--ok) 10%, transparent); }
table.cohort td.heat-3, table.cohort td.heat-4 { background: color-mix(in srgb, var(--ok) 22%, transparent); }
.tenant-line { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.scroll table { min-width: 560px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.plans label.plan { position: relative; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; font-weight: 400; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.plans label.plan:hover { border-color: var(--accent); }
.plans label.plan:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.plans label.plan strong { display: block; font-size: 16px; margin-bottom: 2px; }
.spaced { margin-top: 12px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head .hint { margin: 0; }
.page-head-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.section-h { display: flex; align-items: center; gap: 10px; }
.section-h svg.i { color: var(--muted); }

/* ---------- Mobil ---------- */
@media (max-width: 960px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
    body.nav-open .sidebar { transform: none; }
    body.nav-open .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(2, 6, 16, .55); backdrop-filter: blur(2px); }
    .shell { margin-left: 0; }
    .nav-toggle { display: inline-grid; }
    .topbar { padding: 0 16px; }
    main { padding: 20px 16px; }
}
@media (max-width: 600px) {
    .tb-secure { display: none; }
    h1 { font-size: 21px; }
    dl.props { grid-template-columns: 1fr; }
    dl.props dt { border-bottom: 0; padding-bottom: 0; }
    .row { grid-template-columns: 1fr; }
    .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 14px; }
    .stat .v { font-size: 21px; }
    .stat-ic { display: none; }
    .card { padding: 16px; }
    .card table { margin: 0 -16px; width: calc(100% + 32px); }
    .toolbar input[type=text] { min-width: 0; }
    th, td { padding: 9px 10px; }
}

/* ==========================================================================
   KIRISH EKRANI — tahsinerp.uz bosh sahifasi uslubida (qorong'i fon, oq karta)
   ========================================================================== */
body.auth {
    --a-pri: #2563eb; --a-ink: #0b1324; --a-ink-2: #273149; --a-muted: #5b6478; --a-line: #e5e8f0;
    --a-grad: linear-gradient(100deg, #60a5fa 0%, #22d3ee 50%, #34d399 100%);
    min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; color: #e2e8f5; color-scheme: dark;
    background: radial-gradient(1100px 600px at 80% -10%, #13306e 0%, transparent 60%), linear-gradient(180deg, #060c1d 0%, #0b1530 100%);
}
body.auth h1, body.auth h2 { font-family: "Manrope", var(--font); }
.auth-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.auth-bg .orb { position: absolute; border-radius: 50%; filter: blur(80px); animation: a-drift 18s ease-in-out infinite alternate; }
.auth-bg .o1 { width: 520px; height: 520px; background: #1d4ed8; top: -160px; left: -140px; opacity: .35; }
.auth-bg .o2 { width: 420px; height: 420px; background: #0891b2; bottom: -80px; right: -120px; opacity: .28; animation-delay: -6s; }
.auth-bg .o3 { width: 340px; height: 340px; background: #059669; bottom: -140px; left: 35%; opacity: .16; animation-delay: -12s; }
@keyframes a-drift { to { transform: translate3d(40px, 30px, 0) scale(1.08); } }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 80% 70% at 40% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse 80% 70% at 40% 40%, #000 30%, transparent 75%); }

.auth-top, .auth-wrap, .auth-foot { position: relative; z-index: 2; }
.auth-top { display: flex; align-items: center; gap: 18px; width: 100%; max-width: 1200px; margin: 0 auto; padding: 18px 24px; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: #fff; font: 800 21px/1 "Manrope", var(--font); letter-spacing: -.02em; }
.auth-brand img { border-radius: 50%; }
.auth-brand b { color: #60a5fa; font-weight: 800; }
.auth-brand:hover { color: #fff; text-decoration: none; }
.auth-zone { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: #93c5fd; background: rgba(96, 165, 250, .1); border: 1px solid rgba(96, 165, 250, .25); }
.auth-home { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: rgba(226, 232, 245, .8) !important; font-weight: 500; font-size: 14px; padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); }
.auth-home:hover { color: #fff !important; background: rgba(255, 255, 255, .1); text-decoration: none; }
.auth-home .i-back { width: 16px; height: 16px; transform: rotate(180deg); }

.auth-wrap { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); gap: 72px; align-items: center; width: 100%; max-width: 1200px; margin: 0 auto; padding: 40px 24px 56px; }
.auth-logo { position: relative; width: 132px; height: 132px; margin-bottom: 30px; }
.auth-logo img { position: relative; z-index: 1; border-radius: 50%; box-shadow: 0 20px 60px rgba(37, 99, 235, .45), 0 0 0 1px rgba(255, 255, 255, .08); }
.auth-logo .ring { position: absolute; inset: -14px; border-radius: 50%; border: 1px solid rgba(96, 165, 250, .3); }
.auth-logo .r2 { inset: -30px; border-color: rgba(34, 211, 238, .2); border-style: dashed; animation: a-spin 40s linear infinite; }
@keyframes a-spin { to { transform: rotate(360deg); } }
.auth-eyebrow { display: inline-flex; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #93c5fd; background: rgba(96, 165, 250, .1); border: 1px solid rgba(96, 165, 250, .25); padding: 6px 12px; border-radius: 999px; }
.auth-intro h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.035em; margin: 20px 0 16px; color: #fff; font-weight: 800; max-width: 560px; }
.auth-intro .grad { background: var(--a-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-intro > p { color: rgba(226, 232, 245, .75); font-size: 17px; line-height: 1.6; max-width: 520px; }
.auth-feats { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 12px; }
.auth-feats li { display: flex; align-items: center; gap: 10px; color: rgba(226, 232, 245, .85); font-size: 15px; }
.auth-feats svg.i { width: 18px; height: 18px; color: #10b981; stroke-width: 2.6; }

/* Oq karta — landing'dagi demo formasi kabi */
.auth-wrap > main { width: 100%; max-width: 460px; justify-self: end; padding: 0; margin: 0; }
.auth .card, .auth-wrap > main > .card {
    position: relative; max-width: none; margin: 0; padding: 34px 34px 28px; border-radius: 24px; border: 0;
    background: #fff; color: var(--a-ink); box-shadow: 0 30px 80px rgba(2, 8, 30, .45);
}
.auth .card h1 { font-size: 26px; font-weight: 800; color: var(--a-ink); margin: 14px 0 6px; letter-spacing: -.025em; }
.auth .card p { color: var(--a-muted); }
.auth .card p strong { color: var(--a-ink); }
.hud-head { display: flex; align-items: center; }
.hud-head span:first-child { display: inline-flex; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--a-pri); background: rgba(37, 99, 235, .08); border: 1px solid rgba(37, 99, 235, .15); padding: 5px 11px; border-radius: 999px; }
.hud-head span + span { display: none; }
.hud-sub { color: var(--a-muted) !important; font-size: 15px; margin-bottom: 22px !important; }
.auth .steps { list-style: none; display: flex; gap: 8px; margin: 0 0 24px; padding: 0; counter-reset: st; }
.auth .steps li { flex: 1; counter-increment: st; font-size: 12.5px; font-weight: 600; color: #9aa3b5; padding-top: 10px; border-top: 3px solid var(--a-line); border-radius: 2px; }
.auth .steps li::before { content: counter(st) ". "; }
.auth .steps li.done { color: #059669; border-top-color: #10b981; }
.auth .steps li.on { color: var(--a-pri); border-top-color: var(--a-pri); }

.auth form.stack { max-width: none; gap: 16px; }
.auth label { display: block; color: var(--a-ink-2); font-size: 13.5px; font-weight: 600; margin-bottom: 7px; letter-spacing: 0; text-transform: none; }
.auth input[type=text], .auth input[type=email], .auth input[type=password], .auth input:not([type]) {
    width: 100%; height: 50px; padding: 0 14px; border-radius: 12px; color: var(--a-ink); font-size: 15.5px;
    background: #fbfcfe; border: 1px solid #d6dbe6; box-shadow: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth input:hover { border-color: #b9c3d6; }
.auth input:focus { border-color: var(--a-pri); background: #fff; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); outline: none; }
.auth input::placeholder { color: #9aa3b5; }
.auth input:-webkit-autofill { -webkit-text-fill-color: var(--a-ink); -webkit-box-shadow: 0 0 0 40px #f2f6ff inset; caret-color: var(--a-ink); }
.auth input[autocomplete="one-time-code"] { height: 60px; text-align: center; font: 700 26px/1 var(--mono); letter-spacing: .55em; padding-left: calc(14px + .55em); }
.auth .field-ic { position: relative; }
.auth .field-ic svg.i { position: absolute; left: 15px; top: 15px; width: 20px; height: 20px; color: #9aa3b5; pointer-events: none; transition: color .15s; }
.auth .field-ic input { padding-left: 46px; }
.auth .field-ic:focus-within svg.i { color: var(--a-pri); }
.auth button[type=submit]:not(.secondary):not(.link) {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; margin-top: 4px; border-radius: 14px; border: 0;
    font: 600 16px/1 var(--font); letter-spacing: 0; text-transform: none; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 55%, #0ea5e9 130%); box-shadow: 0 8px 24px rgba(37, 99, 235, .35), inset 0 1px 0 rgba(255, 255, 255, .2);
    transition: transform .2s, box-shadow .2s;
}
.auth button[type=submit]:not(.secondary):not(.link):hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(37, 99, 235, .45), inset 0 1px 0 rgba(255, 255, 255, .25); }
.auth button[type=submit] svg.i { width: 18px; height: 18px; transition: transform .2s; }
.auth button[type=submit]:hover svg.i { transform: translateX(3px); }
.auth button.secondary, .auth .btn.secondary { width: 100%; height: 48px; color: var(--a-ink); background: #fff; border: 1px solid var(--a-line); border-radius: 12px; box-shadow: none; }
.auth button.secondary:hover, .auth .btn.secondary:hover { color: var(--a-pri); border-color: var(--a-pri); background: #fff; }
.auth .btn:not(.secondary) { width: 100%; height: 50px; border-radius: 12px; }
.auth .hint { color: #8a93a6; font-size: 13px; }
.auth .card a { color: var(--a-pri); }
.auth .secret { background: #f4f6fb; border: 1px dashed #c7d2fe; color: var(--a-ink); text-align: center; letter-spacing: .08em; border-radius: 12px; }
.auth .qr { display: block; margin: 0 auto; border-radius: 12px; box-shadow: 0 0 0 1px var(--a-line), 0 10px 30px rgba(11, 19, 36, .1); }
.auth .flash, .auth .validation-summary-errors { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 12px; }
.auth .flash.ok { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.auth .flash.info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.auth-wrap > main > .flash { margin-bottom: 14px; }
.auth-sep { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; color: #9aa3b5; font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--a-line); }
.auth-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--a-line); font-size: 12.5px; color: #8a93a6; }

.auth-foot { display: flex; justify-content: space-between; gap: 16px; width: 100%; max-width: 1200px; margin: 0 auto; padding: 20px 24px; border-top: 1px solid rgba(148, 163, 184, .14); color: rgba(203, 213, 225, .6); font-size: 13px; }
.auth-foot span { display: inline-flex; align-items: center; gap: 8px; }
.auth-foot svg.i { width: 15px; height: 15px; }
.auth-foot a { color: rgba(226, 232, 245, .85); text-decoration: underline; text-decoration-color: rgba(148, 163, 184, .4); text-underline-offset: 3px; }
.auth-foot a:hover { color: #fff; }

@media (max-width: 960px) {
    .auth-wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 16px 16px 40px; justify-items: center; }
    .auth-intro { display: flex; flex-direction: column; align-items: center; text-align: center; }
    .auth-intro > p, .auth-feats, .auth-eyebrow { display: none; }
    .auth-logo { width: 84px; height: 84px; margin: 12px 0 0; }
    .auth-logo img { width: 84px; height: 84px; }
    .auth-logo .r2 { inset: -22px; }
    .auth-intro h2 { font-size: 24px; margin: 22px 0 0; }
    .auth-wrap > main { justify-self: center; }
    .auth-top { padding: 14px 16px; gap: 10px; }
    .auth-zone { display: none; }
    .auth-foot { padding: 16px; flex-direction: column; gap: 6px; text-align: center; align-items: center; }
}
@media (max-width: 480px) {
    .auth .card { padding: 26px 20px 22px; border-radius: 20px; }
    .auth-brand { font-size: 19px; }
    .auth-brand img { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Iqtisodiyot (Pages/Economics) */
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 18px; border-bottom: 1px solid var(--line); }
.subnav a { padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; text-decoration: none; margin-bottom: -1px; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.var-good { color: var(--ok); font-weight: 600; }
.var-bad { color: var(--bad); font-weight: 600; }
table.econ td, table.econ th { padding-top: 6px; padding-bottom: 6px; }
table.econ tr.sub td { background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
table.econ tr.total td { font-weight: 700; border-top: 2px solid var(--line-2); }
table.econ tr.key td { font-weight: 700; background: var(--accent-soft); }
table.econ td.lbl { white-space: nowrap; }
table.econ .basis { color: var(--muted); font-size: 12px; }
table.edit input, table.edit select { padding: 5px 7px; font-size: 13px; min-width: 0; }
table.edit input.w-num { width: 90px; } table.edit input.w-sm { width: 70px; } table.edit input.w-money { width: 130px; }
table.edit select.w-feat { width: 52px; padding: 4px; }
progress.be { width: 100%; height: 12px; accent-color: var(--ok); }
svg .trend-rev { fill: var(--accent); }
svg .trend-exp { fill: var(--warn); opacity: .8; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.legend.rev { background: var(--accent); } .legend.exp { background: var(--warn); }
table.edit td.match { white-space: nowrap; }
table.edit td.match label.check { display: inline-flex; gap: 3px; margin-right: 8px; font-size: 12px; }

/* Murojaatlar (bot yozishmasi) */
.tk-thread { display: flex; flex-direction: column; gap: 10px; }
.tk-msg { max-width: 78%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); white-space: pre-wrap; word-break: break-word; }
.tk-msg.staff { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.tk-msg .tk-meta { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); white-space: normal; }
.tk-subject { max-width: 420px; }
.tk-filters input[type=search] { min-width: 240px; }
