/* ==========================================================================
   PREMIUM kartochkalar — gradient, glow, hover, sidebar.
   Saidmurod talabi: admin panelidagi kartochkalar va sidebar
   "premium" ko'rinishda bo'lishi kerak.
   Yangi kompilyatsiya talab qilmaydi — alohida fayl, base.html'da ulanadi.
   ========================================================================== */

:root {
    --premium-red: #e4002b;
    --premium-red-dark: #b00020;
    --premium-slate: #0f172a;
    --premium-slate-light: #1e293b;
    --premium-gold: #f59e0b;
}

/* ── 1. Premium kartochka (asosiy klass) ─────────────────────────────── */

.premium-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.97) 0%, rgba(248,250,252,0.97) 100%);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.25s ease;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--premium-red), var(--premium-red-dark));
    transition: width 0.25s ease;
    z-index: 1;
}

.premium-card:hover {
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08),
                0 8px 15px -6px rgba(15, 23, 42, 0.04);
    transform: translateY(-2px);
    border-color: rgba(15, 23, 42, 0.10);
}

.premium-card:hover::before {
    width: 6px;
    box-shadow: 0 0 12px rgba(228, 0, 43, 0.35);
}

/* ── 2. Kartochka ichida chap yuqorida ikon ───────────────────────────── */

.premium-card-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 15px;
    color: var(--premium-red);
    background: linear-gradient(135deg, rgba(228, 0, 43, 0.10), rgba(228, 0, 43, 0.04));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
    z-index: 0;
}

.premium-card-icon.blue   { color: #2563eb; background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(59,130,246,0.04)); }
/* ⚠️ 2026-09-26 (ikonka kontrasti o'lchandi): `.amber` ilgari `#d97706`
   (amber-600) edi → karta fonida (`#faf5ec`) **2.93** ✗ (WCAG 1.4.11 chegara 3.0).
   `#b45309` (amber-700) = **4.62** ✓ — matn uchun ham 4.5 dan o'tadi.
   Sabab: yumshoq amber fon (`rgba(245,158,11,0.10)`) ustida amber-600 yetarli
   kontrast bermaydi. Boshqa ranglar (blue/green/slate/violet) allaqachon o'tadi. */
.premium-card-icon.amber  { color: #b45309; background: linear-gradient(135deg, rgba(245,158,11,0.10), rgba(245,158,11,0.04)); }
.premium-card-icon.green  { color: #059669; background: linear-gradient(135deg, rgba(16,185,129,0.10), rgba(16,185,129,0.04)); }
.premium-card-icon.slate  { color: #475569; background: linear-gradient(135deg, rgba(100,116,139,0.10), rgba(100,116,139,0.04)); }
.premium-card-icon.violet { color: #7c3aed; background: linear-gradient(135deg, rgba(139,92,246,0.10), rgba(139,92,246,0.04)); }

/* ── 3. Chap chegara rangi (alert/muhim) ─────────────────────────────── */

.premium-card-alert-red::before   { background: linear-gradient(180deg, #e4002b, #b00020); }
.premium-card-alert-red:hover::before   { box-shadow: 0 0 14px rgba(228, 0, 43, 0.4); }

.premium-card-alert-amber::before { background: linear-gradient(180deg, #f59e0b, #d97706); }
.premium-card-alert-amber:hover::before { box-shadow: 0 0 14px rgba(245, 158, 11, 0.4); }

.premium-card-alert-blue::before  { background: linear-gradient(180deg, #3b82f6, #2563eb); }
.premium-card-alert-blue:hover::before  { box-shadow: 0 0 14px rgba(59, 130, 246, 0.4); }

/* ── 4. Sidebar gradient ─────────────────────────────────────────────── */

.dashboard-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #131c2e 60%, #1e293b 100%) !important;
}

.dashboard-sidebar .sidebar-header {
    /* ⚠️ 2026-09-23 (egasi so'rovi): sarlavha juda katta joy egallardi.
       O'LCHOV (brauzer, 900px balandlik): avval blok 82px + chekinish 40px
       = 122px; nav'ga 590px qolardi. Endi blok ~52px + chekinish 22px
       = ~74px → nav'ga ~48px KO'PROQ joy. */
    background: linear-gradient(135deg, rgba(228, 0, 43, 0.12) 0%, rgba(228, 0, 43, 0.02) 50%, transparent 100%);
    border-radius: 14px;
    padding: 9px 14px;
    margin: 8px 10px 14px;
    border: 1px solid rgba(228, 0, 43, 0.08);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    position: relative;
    overflow: hidden;
}

.dashboard-sidebar .sidebar-header::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(228,0,43,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.dashboard-sidebar .profile-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
    /* 2026-09-22: pastdagi alohida override bilan birlashtirildi (bitta selektor, kamroq !important) */
    border-radius: 10px !important;
    padding: 6px 8px !important;
}

/* ── 5. Premium progress bar (skill uchun) ──────────────────────────── */

.premium-bar {
    height: 6px;
    background: rgba(15, 23, 42, 0.06);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.premium-bar > div {
    height: 100%;
    background: linear-gradient(90deg, var(--premium-red), var(--premium-gold));
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.premium-bar > div::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: premium-shimmer 2.5s infinite;
}

@keyframes premium-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── 6. Premium matn ──────────────────────────────────────────────────── */

.premium-stat {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1;
    color: var(--premium-slate);
}

.premium-stat-sm {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.025em;
    line-height: 1;
}

/* ⚠️ 2026-09-22: 10px edi -> 11px. Butun platformada eng kichik matn 11px
   (`text-micro`), aks holda `wb_deep_audit.py` nuqson deb belgilaydi. */
.premium-label {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
}

.premium-sub {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
}

/* ── 7. Premium badge ────────────────────────────────────────────────── */

.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    /* ⚠️ 2026-09-22: 9px edi — eng ko'p uchraydigan mayda matn manbasi edi
       (bitta sahifada 160 ta element). Endi 11px. */
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ⚠️ WCAG 4.5:1 kontrast. Avval #b91c1c/047857/b45309 edi — 4.03-4.47 (yetsmasm).
  Yangi: #991b1b/065f46/92400e — 5.69-5.99 ✓ (CSS hisoblangan). */
.premium-badge.red   { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; }
.premium-badge.blue  { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.premium-badge.green { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; }
.premium-badge.amber { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; }
.premium-badge.slate { background: linear-gradient(135deg, #f1f5f9, #e2e8f0); color: #475569; }

/* ── 8. Premium jadval ────────────────────────────────────────────────── */

.premium-table {
    width: 100%;
    text-align: left;
}

.premium-table thead tr {
    background: linear-gradient(180deg, rgba(15,23,42,0.02), rgba(15,23,42,0.04));
    border-top: 1px solid rgba(15,23,42,0.06);
    border-bottom: 1px solid rgba(15,23,42,0.06);
}

.premium-table th {
    padding: 10px 12px;
    /* ⚠️ 2026-09-22: 10px edi -> 11px (platforma pol o'lchami). */
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
}

.premium-table tbody tr {
    border-bottom: 1px solid rgba(15,23,42,0.04);
    transition: background 0.15s ease;
}

.premium-table tbody tr:hover {
    background: linear-gradient(90deg, rgba(228,0,43,0.04), transparent);
}

.premium-table tbody tr:last-child { border-bottom: 0; }

.premium-table td {
    padding: 12px;
    font-size: 13px;
}

/* ── 9. Premium CTA (tugma) ──────────────────────────────────────────── */

.premium-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* ⚠️ 2026-09-26 (layout o'lchovi, §97): ANIQ balandlik SHART.
       Ilgari faqat `padding` bor edi → balandlik shrift qatoridan hisoblanib
       ~38px chiqardi, `.premium-input` esa 36px. Bir qatorda tursa (masalan
       Sozlamalar sahifasidagi «tanaffus» formasi) 2px "tish" ko'rinardi ✗
       (o'lchandi: input h=36 top=718 | button h=38 top=715).
       Tailwind `h-10` bu yerni TUZATMADI: `.premium-input`/`.premium-cta`
       (0,1,0) va `.h-10` (0,1,0) bir xil spetsifiklikda, lekin `premium.css`
       Tailwind to'plamidan KEYIN yuklanadi → komponent klass yutadi.
       Shuning uchun balandlik shu yerda — komponentning O'ZIDA. */
    height: 36px;
    box-sizing: border-box;
    padding: 0 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1f2937, #0f172a);
    color: white;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 12px rgba(15,23,42,0.25);
    transition: all 0.25s ease;
    border: 1px solid rgba(255,255,255,0.05);
}

.premium-cta:hover {
    background: linear-gradient(135deg, #374151, #1f2937);
    box-shadow: 0 6px 18px rgba(15,23,42,0.35);
    transform: translateY(-1px);
}

.premium-cta.red {
    background: linear-gradient(135deg, var(--premium-red), var(--premium-red-dark));
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.30);
}

.premium-cta.red:hover {
    background: linear-gradient(135deg, #ff1f4d, #d4002e);
    box-shadow: 0 6px 18px rgba(228, 0, 43, 0.45);
}

/* ── 10. Skeleton / loading ──────────────────────────────────────────── */

@keyframes premium-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.premium-pulse {
    animation: premium-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── 11. Animatsiya (slide-in) ───────────────────────────────────────── */

@keyframes premium-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.premium-card {
    animation: premium-fade-up 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.premium-card:nth-child(1) { animation-delay: 0.00s; }
.premium-card:nth-child(2) { animation-delay: 0.05s; }
.premium-card:nth-child(3) { animation-delay: 0.10s; }
.premium-card:nth-child(4) { animation-delay: 0.15s; }
.premium-card:nth-child(5) { animation-delay: 0.20s; }
.premium-card:nth-child(6) { animation-delay: 0.25s; }

/* ── 12. Accessibility — kamaytirilgan harakat ──────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .premium-card,
    .premium-card:hover,
    .premium-cta:hover,
    .premium-bar > div {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}
/* ── 13. Premium statlar grid — 1440+ da 6 bir qator ─────────────── */
/* ⚠️ Tailwind'da `xl:grid-cols-5` klassi yo'q (faqat xl:grid-cols-3 bor) — bu
   holatda `xl:grid-cols-6` 1440 viewportda SIG'MAYDI (sidebar 256 + main 1133 da
   6 × 190 = 1140 + gap 60 = 1200 > 1133). YECHIM: statik klasslar:
   · < 640 px: 2 (telefon)
   · 640-1024: 3 (planshet)
   · 1024-1280: 5 (kichik desktop) — sidebar 256 + main ~768 da 5 sig'adi
   · 1280-1440: 5 (1440) — sig'adi
   · ≥ 1440: 6 (to'liq qator, bo'sh joy yo'q)
*/
/* Responsive auto-fit: viewport kengligiga qarab 2-7 kartochka.
   ⚠️ 2026-09-21: 1440 sidebar 256 + main 1133 da 7 × 150 + 6 × 12 = 1122 ≤ 1133 ✓.
   Eng kichik ekranda (320) 2 ta kartochka (1 qator), planshet (768) 5, desktop (1024+) 7.
   2026-09-22: umumiy grid xossalari birlashtirildi (takror 6 qator → 3 qator). */
.premium-stats, .premium-stats-5 {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}
.premium-stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* ── 14. Premium hisobot grid — responsive auto-fit ─────────────── */
/* Hisobot sahifasida 5 ta premium-card. 1440+ da bir qator.
   minmax(180px, 1fr) — 1440 da 5 × 220 + 4 × 12 = 1148 → sig'adi. */
.premium-stats-5 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* ── 15. Premium FILTR — bir qator, ixcham (hisobot sahifasi) ───────── */
/* 2026-09-21: 6 ta maydon + 2 ta tugma + sanog'ich → BIR qator.
   Kichik ekranda (1024-) 3-4 ustun, telefon (640-) 2 ustun. */
.premium-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}
@media (min-width: 640px) {
    .premium-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .premium-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1366px) {
    /* 6 ta maydon + tugmalar: to'liq bir qator.
       ⚠️ 2026-09-22: oxirgi `auto` sanog'ich uchun edi — u olib tashlandi
       (jadval sarlavhasida allaqachon bor edi, ya'ni TAKRORLANARDI). */
    .premium-filter {
        grid-template-columns: 1fr 1.4fr 1fr 1fr 0.8fr 0.8fr auto;
    }
}

/* Kichik va ixcham input/select */
/* ⚠️ 2026-09-22 (o'lchandi): balandlik aniq berilmagan edi va `select` 33px,
   `input[type=text]` 35px, `input[type=date]` 37px chiqardi. Filtr qatori
   pastga tekislangani uchun (align-items: end) LABEL'lar ham har xil
   balandlikda turardi (top: 225/223/221) — qator "tishli" ko'rinardi ✗.
   Endi hammasi 36px. */
.premium-input {
    width: 100%;
    margin-top: 4px;
    height: 36px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 10px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.premium-input::placeholder { color: #64748b; font-weight: 500; }
.premium-input:focus {
    outline: none;
    border-color: #004b87;
    box-shadow: 0 0 0 3px rgba(0, 75, 135, 0.08);
}
/* ⚠️ WCAG 2.4.7: klaviatura fokusi uchun `outline: none` xavfsiz emas —
   :focus-visible alternativ ko'rsatilishi kerak. */
.premium-input:focus-visible {
    outline: 2px solid #004b87 !important;
    outline-offset: 1px;
}

/* Tugmalar (filtrlash / tozalash) — kvadrat, ikonkali */
.premium-filter-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}
.premium-filter-actions .premium-cta {
    /* Tugmalar maydonlar bilan BIR XIL balandlikda bo'lsin (36px) — aks holda
       pastga tekislanganda kichikroq ko'rinib, qator notekis tuyuladi. */
    height: 36px;
    padding: 0 11px;
    min-width: 38px;
    justify-content: center;
}

/* "Tozalash" — shaffofroq (ghost) */
.premium-cta-ghost {
    background: rgba(15, 23, 42, 0.04) !important;
    color: #475569 !important;
    box-shadow: none !important;
    border: 1px solid rgba(15, 23, 42, 0.10) !important;
}
.premium-cta-ghost:hover {
    background: rgba(15, 23, 42, 0.09) !important;
    color: #0f172a !important;
}

/* ⚠️ 2026-09-22: `.premium-filter-count` qoidasi OLIB TASHLANDI.
   Sanog'ich filtr qatorida TAKRORLANARDI — jadval sarlavhasida ham
   ("{{ total }} ta") bor edi. Shablondan ham, CSS'dan ham o'chirildi. */

/* ── 16. Sidebar — premium va optimal (2026-09-21) ───────────────────── */
/* Mavjud `style.css` stillarini USTIGA yozmaymiz — faqat premium qatlam:
   ixchamroq padding, hover'da siljish (translateX), ikonka animatsiyasi. */

/* Havolalar — ixchamroq va yumshoqroq */
.dashboard-sidebar .nav-item {
    padding: 10px 14px !important;
    border-radius: 12px !important;
    font-size: 12.5px !important;
    transition: color 0.2s, background-color 0.2s, box-shadow 0.2s,
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover: o'ngga kichik siljish + glow (premium harakat) */
.dashboard-sidebar .nav-item:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: #fff !important;
    transform: translateX(3px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18),
                inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Ikonka: hover'da kattalashadi va rangga kiradi */
.dashboard-sidebar .nav-item:hover i {
    transform: scale(1.18) rotate(6deg);
    color: #e4002b;
}

/* Faol havola — brend gradient + yorqin soyali */
.dashboard-sidebar .nav-item-active {
    background: linear-gradient(135deg, #e4002b 0%, #b00020 100%) !important;
    box-shadow: 0 8px 22px rgba(228, 0, 43, 0.35) !important;
    transform: translateX(3px);
}

/* Bo'lim sarlavhalari (Mock Library / Faoliyat / Ma'lumotlar)
   ⚠️ 2026-09-22: 9px edi — o'lchandi (`wb_deep_audit.py`) va 11px dan kichik
   matn butun platformada nuqson deb belgilandi. Eng kichik ruxsat etilgan
   o'lcham — 11px (`text-micro`). */
.dashboard-sidebar nav > div > p {
    font-size: 11px !important;
    letter-spacing: 0.22em;
    opacity: 0.85;
}

/* Track toggle (Mock / CEFR) — yumshoqroq */
.admin-track-toggle {
    border-radius: 14px !important;
    padding: 5px !important;
    margin: 0 14px 18px 14px !important;
}
.admin-track-btn {
    border-radius: 11px !important;
    padding: 8px !important;
}

/* Profil kartasi — ixcham va premium (asosiy qoida yuqorida, :119 bilan birlashgan) */
.dashboard-sidebar .profile-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(228, 0, 43, 0.4) !important;
}

/* Sidebar scrollbar — ingichka va yumshoq */
.dashboard-sidebar .custom-scrollbar::-webkit-scrollbar { width: 5px; }
.dashboard-sidebar .custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.dashboard-sidebar .custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 3px;
}
.dashboard-sidebar .custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.24);
}

/* ── 17. Chrome autofill — parol maydonlari (BUTUN SAYT) ────────────────── */
/* Nega (o'lchandi 2026-09-22, keyin kengaytirildi 2026-09-23 — egasi so'rovi):
   talaba parolini brauzer saqlab qo'ygan bo'lsa Chrome maydonni **sariq-ko'k**
   fonda to'ldiradi va dizayn "buzuq" ko'rinadi ✗. Avval qoida faqat profil
   paneliga (`.profile-security-form`) bog'langan edi; endi egasi "login parol
   tizimga kirgandan keyin hech qayerda ko'rinmasin" dedi — shuning uchun
   **hamma parol maydonlariga** qo'llanadi.
   ⚠️ `input[type="password"]` ni nishonga olamiz (matn maydonlariga tegmaymiz) —
   shunda admin formalari va boshqa sahifalar ham himoyalanadi ✓.
   ⚠️ Login sahifasidagi maydon ham qamrab olinadi, lekin u yerda foydalanuvchi
   parolni ATAYLAB kiritadi — faqat fon rangi tozalanadi, kiritishga xalaqit
   bermaydi ✓. */
input[type="password"]:-webkit-autofill,
input[type="password"]:-webkit-autofill:hover,
input[type="password"]:-webkit-autofill:focus,
input[type="password"]:-webkit-autofill:active {
    -webkit-text-fill-color: #1e293b;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    box-shadow: 0 0 0 1000px #ffffff inset;
    transition: background-color 9999s ease-in-out 0s;
}
/* Eski (profil paneliga bog'langan) qoida — mos keluvchanlik uchun qoldirildi. */
.profile-security-form input:-webkit-autofill,
.profile-security-form input:-webkit-autofill:hover,
.profile-security-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: #1e293b;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
    box-shadow: 0 0 0 1000px #ffffff inset;
    transition: background-color 9999s ease-in-out 0s;
}

/* ── 9. Sidebar yopilish/ochilish animatsiyasi — TEZLASHTIRILDI ───────────
 *
 * ⚠️ 2026-09-25 (WB, T-11). Egasi shikoyati: "yon panel partni ochganda
 * yo'qolishi sekin amalga oshirilmoqda".
 *
 * O'LCHANDI (haqiqiy brauzer, CDP, kadr-kadr):
 *   yopilish: fadeStart 56 ms → display:none 189 ms  = 133 ms
 *   ochilish: ko'rinadi 23 ms
 *   hisoblangan: will-change:"auto", contain:"none", transition:"all"
 *
 * Ya'ni brauzer animatsiyani GPU'ga ko'tarmaydi, har kadrda layout
 * qayta hisoblanadi va `ease-in` (yopilish) oxirida SEKINLASHADI —
 * shu sababli 150 ms uzun his qilinadi.
 *
 * YECHIM (uch qatlam):
 *   1) `will-change: transform, opacity` — brauzer qatlamini OLDINDAN
 *      tayyorlaydi; animatsiya compositor'da ketadi (layout yo'q).
 *   2) `contain: layout style paint` — sidebar ichidagi o'zgarish
 *      tashqariga ta'sir qilmaydi; qayta hisoblash doirasi tor.
 *   3) `transition: opacity 75ms, transform 75ms` — 133 ms → ~75 ms
 *      (deyarli ikki barobar tez). `ease-out` — darhol tez boshlanadi
 *      va silliq tugaydi (sekinlashib ko'rinmaydi).
 *
 * `!important` — Alpine `x-transition` klasslari (`duration-150`,
 * `ease-in`) `transition`/`transition-duration` ni inline `style` bilan
 * yozadi; komponentlar tartibidan qat'i nazar g'olib bo'lishi uchun kerak.
 */
.dashboard-sidebar {
    will-change: transform, opacity;
    contain: layout style paint;
    transition: opacity 75ms ease-out, transform 75ms ease-out !important;
    transition-duration: 75ms !important;
    transition-timing-function: ease-out !important;
    backface-visibility: hidden;
}

/* Alpine `x-show` yopayotganda `x-transition:leave` klasslarini qo'shadi.
 * Ularning `duration-150`/`ease-in` qiymatini ham qisqartiramiz. */
.dashboard-sidebar.x-transition-leave,
.dashboard-sidebar[x-transition\:leave] {
    transition-duration: 75ms !important;
    transition-timing-function: ease-out !important;
}

/* Foydalanuvchi "kam harakat" rejimini yoqqan bo'lsa — animatsiya umuman yo'q
 * (WCAG 2.3.3; tizim sozlamasiga hurmat). */
@media (prefers-reduced-motion: reduce) {
    .dashboard-sidebar,
    .dashboard-sidebar.x-transition-leave {
        transition-duration: 0.01ms !important;
        will-change: auto;
    }
}

/* ══ 18. SOZLAMALAR SAHIFASI — ixcham premium tuzilma ═════════════════════
   Egasi talabi (2026-09-27): «hozirgi katta va xunuk ko'rinishni yo'q qilib,
   premium va zamonaviy dizaynga keltirish; bo'lim ixcham, toza va vizual
   jihatdan uyg'un bo'lishi, elementlar o'lchamlari mutanosib bo'lishi hamda
   turli ekran o'lchamlarida mos ko'rinish berishi».

   O'LCHANDI (o'zgarishdan OLDIN, haqiqiy Chrome):
     · 1440×900: kartochka 840px, o'ngda 316px BO'SH · 1920 da 796px bo'sh
     · kontent balandligi 1563px (390px ekranda 2313px)
     · bir qatordagi tugmalar 36px va 42px — «tishli» ko'rinardi

   Ranglar kontrasti (oq fon ustida, WCAG AA 4.5):
     #0f172a 17.9 · #334155 10.4 · #475569 7.5 · #64748b 4.76 ✓
     ⚠️ #94a3b8 (2.5) MATN uchun ISHLATILMAYDI — faqat bezak uchun.
   ======================================================================= */

/* ── Sahifa sarlavhasi ── */
.set-head { margin-bottom: 14px; }
.set-head__title {
    font-size: 19px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #0f172a;
}
.set-head__sub {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #64748b;
}

/* ── To'r (responsive): tor ekranda 1 ustun, kengda 2 ustun ── */
.set-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
@media (min-width: 1280px) {
    .set-grid--2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ── Kartochka ── */
.set-card {
    background: #ffffff;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                0 10px 26px -20px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}
.set-card__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}
.set-card__icon {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}
.set-card__icon--red    { color: #e4002b; background: linear-gradient(135deg, rgba(228,0,43,0.12), rgba(228,0,43,0.05)); }
.set-card__icon--violet { color: #6d28d9; background: linear-gradient(135deg, rgba(139,92,246,0.14), rgba(139,92,246,0.05)); }
.set-card__icon--blue   { color: #1d4ed8; background: linear-gradient(135deg, rgba(59,130,246,0.13), rgba(59,130,246,0.05)); }
.set-card__title {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #0f172a;
}
.set-card__sub {
    margin-top: 1px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    color: #64748b;
}

/* ── Sozlama qatori (ixcham) ── */
.set-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    transition: background-color 0.15s ease;
}
.set-row + .set-row { border-top: 1px solid #f1f5f9; }
.set-row:hover { background: #fafcff; }
.set-row__text { flex: 1 1 auto; min-width: 0; }
.set-row__title {
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.3;
    color: #0f172a;
}
/* ⚠️ 2026-09-27 (WB, o'lchandi): `<label>` varianti 16px baland edi — WCAG
   2.5.8 bo'yicha bosish maydoni **≥ 24×24** bo'lishi kerak (loyiha qoidasi,
   `BOARD.md` Z7). Faqat LABEL'ga tegishli: bir xil sinf `<div>`/`<p>` da ham
   ishlatiladi (`_toggle_row.html`, `settings.html`) va ular bosish elementi
   emas — shuning uchun selektor `label.` bilan cheklandi.
   Manba: `wb_deep_audit.py` — `label.set-row__title.block` h=16. */
label.set-row__title {
    min-height: 24px;
    display: flex;
    align-items: center;
}
.set-row__desc {
    margin-top: 2px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.45;
    color: #64748b;
}
.set-row__ctrl {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 9px;
}

/* ⚠️ 2026-09-27 (WB, o'lchandi): `.premium-input` da `margin-top: 4px` bor —
   u USTMA-UST formalar uchun (label ustida, maydon ostida). Lekin bu yerda
   maydon TUGMA BILAN BIR QATORDA turadi (`_settings_form.html` — «tanaffus»
   formasi) va 4px yuqori margin input'ni tugmaga nisbatan **2px pastga**
   suradi (o'lchandi: input top=458, button top=456) — ya'ni qator «tishli»
   ko'rinadi. Faqat shu kontekstda margin bekor qilinadi. */
.set-row__ctrl .premium-input {
    margin-top: 0;
}

/* ── Kalit (toggle) — og'ir quti YO'Q ── */
.set-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex: 0 0 auto;
}
.set-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
}
.set-switch__track {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}
.set-switch__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28);
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.set-switch input:checked + .set-switch__track { background: #004b87; }
.set-switch input:checked + .set-switch__track::after { transform: translateX(18px); }
.set-switch--red input:checked + .set-switch__track { background: #e4002b; }
.set-switch input:focus-visible + .set-switch__track {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}
.set-switch__state {
    /* ⚠️ 2026-09-27 (WB, o'lchandi): `min-width: 52px` edi, lekin matn undan
       uzun bo'lsa (`ENABLED` 60px, `DISABLED` 65px) ustun KENGAYIB ketardi va
       `.set-row__ctrl` ham kengayar, natijada switch HAR QATORDA boshqa x'da
       turardi (o'lchandi: switchX = 714, 710, 710, 714 → 4px farq). Qatorlar
       «tishli» ko'rinardi. Endi kenglik QAT'IY — switch hamma qatorda bir xil
       x'da turadi. Matn ham qisqartirildi («Yoniq»/«O'chiq»). */
    width: 58px;
    text-align: right;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
}
.set-switch__state--on-blue { color: #004b87; }
.set-switch__state--on-red { color: #b00020; }

/* ── Maydon (label + input + izoh) ── */
.set-field { padding: 12px 16px; }
.set-field + .set-field { border-top: 1px solid #f1f5f9; }
.set-label {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}
/* ⚠️ 2026-09-27 (WB, o'lchandi): `<label>` 19px baland edi → WCAG 2.5.8
   bosish maydoni ≥ 24px (o'lchandi: `wb_deep_audit.py`, 2 element).
   `display:flex` matnni vertikal markazga qo'yadi — ko'rinish o'zgarmaydi,
   faqat maydon kattalashadi (before/after skrinshot bilan tasdiqlandi). */
label.set-label {
    min-height: 24px;
    display: flex;
    align-items: center;
}
.set-help {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
    color: #64748b;
}
.set-help code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    /* ⚠️ 2026-09-27 (WB, o'lchandi): 10.5px → 11px (loyiha minimumi). */
    font-size: 11px;
    background: #f1f5f9;
    color: #334155;
    padding: 1px 4px;
    border-radius: 4px;
}

/* ── Holat chizig'i (AI) ── */
.set-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 9px;
    padding: 10px 16px;
    border-bottom: 1px solid #eef2f7;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.set-status__label {
    /* ⚠️ 2026-09-27 (WB, o'lchandi): 10px → 11px (loyiha minimumi).
       Manba: `wb_deep_audit.py` — `/admin/settings/` 5 kenglikda nuqsonli edi. */
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #64748b;
}
.set-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #0f172a;
}
.set-chip--violet { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }
.set-chip--blue   { color: #1e40af; border-color: #bfdbfe; background: #eff6ff; }
.set-chip--amber  { color: #b45309; border-color: #fde68a; background: #fffbeb; }

/* ── Provayder tanlovi (ixcham kartochkalar) ── */
.set-opts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}
@media (min-width: 640px) {
    .set-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.set-opt {
    position: relative;
    display: flex;
    gap: 9px;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 11px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease,
                box-shadow 0.16s ease;
}
.set-opt:hover { border-color: #c4b5fd; background: #fdfdff; }
.set-opt:has(input:checked) {
    border-color: #7c3aed;
    background: #f7f5ff;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.10);
}
.set-opt:has(input:focus-visible) {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}
.set-opt__icon { flex: 0 0 auto; color: #6d28d9; font-size: 12px; margin-top: 2px; }
.set-opt__name { font-size: 12.5px; font-weight: 900; color: #0f172a; line-height: 1.25; }
.set-opt__hint { margin-top: 2px; font-size: 11px; font-weight: 500; line-height: 1.4; color: #64748b; }

/* Ajratuvchi (mustaqil forma `set-row` bo'lib turganda) */
.set-sep { border-top: 1px solid #f1f5f9; }
/* Son maydoni (tanaffus soniyalari) */
.set-num { width: 72px; text-align: center; }

/* ── Amal qatori (tugmalar) ── */
.set-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eef2f7;
    background: linear-gradient(0deg, #fbfdff 0%, #ffffff 100%);
}
.set-actions__note {
    flex: 1 1 220px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
    color: #64748b;
}
/* ⚠️ Balandlik `premium-cta` bilan AYNAN bir xil bo'lishi shart (o'lchandi:
   o'zgarishdan oldin bir qatorda 36px va 42px «tish» hosil qilardi). */
.set-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    box-sizing: border-box;
    padding: 0 14px;
    border-radius: 10px;
    border: 1.5px solid transparent;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease,
                color 0.16s ease, box-shadow 0.16s ease;
}
.set-btn--ghost { border-color: #7c3aed; color: #6d28d9; background: #ffffff; }
.set-btn--ghost:hover { background: #f5f3ff; }

/* ── Tor ekran: boshqaruv matn ostiga tushadi (siqilmasin) ── */
@media (max-width: 420px) {
    .set-row { flex-direction: column; align-items: stretch; gap: 8px; }
    /* Kalit va holat yorlig'i YONDOSH turadi (space-between ularni
       ekranning ikki chetiga tashlab, aloqasiz ko'rinardi). */
    .set-row__ctrl { justify-content: flex-start; gap: 10px; }
    /* ⚠️ 2026-09-27: mobilda ustun qat'iy kengligi kerak emas (matn chapga
       tekislanadi va joy yetmaydi) — shuning uchun `width` bekor qilinadi. */
    .set-switch__state { width: auto; min-width: 0; text-align: left; }
}

/* ── Harakatni kamaytirish (prefers-reduced-motion) ── */
@media (prefers-reduced-motion: reduce) {
    .set-switch__track,
    .set-switch__track::after,
    .set-opt,
    .set-row,
    .set-btn { transition: none !important; }
}
