/* ==========================================================================
   Ijro intizomi tizimi — dizayn tizimi
   Palitra: "ink navy" (rasmiy, ishonchli) + "muhr oltin" (tasdiq/ekspertiza ramzi)
   ========================================================================== */

:root {
    /* --- Rang tokenlari (light mode) --- */
    --ink-950: #0A1628;
    --ink-800: #13284A;
    --ink-700: #1B3A63;
    --azure-500: #3E7CB1;
    --azure-600: #2E6690;
    --gold-500: #C9A227;
    --gold-300: #E4C868;
    --gold-050: #FBF3DA;
    --success-600: #1F8A5F;
    --success-100: #DFF3EA;
    --danger-600: #B3261E;
    --danger-100: #FBE4E2;
    --neutral-50: #F6F7FA;
    --neutral-100: #EEF0F5;
    --neutral-200: #E2E5EC;
    --neutral-400: #9AA3B2;
    --neutral-600: #5B6472;
    --neutral-800: #232B38;

    --bg-canvas: var(--neutral-50);
    --bg-surface: #FFFFFF;
    --bg-surface-2: var(--neutral-100);
    --bg-sidebar: var(--ink-950);
    --text-primary: var(--ink-950);
    --text-secondary: var(--neutral-600);
    --text-on-dark: #E9EDF4;
    --border-color: var(--neutral-200);
    --shadow-card: 0 1px 2px rgba(10, 22, 40, 0.04), 0 8px 24px -12px rgba(10, 22, 40, 0.12);

    --radius-card: 16px;
    --radius-control: 10px;
    --radius-pill: 999px;

    --font-display: "Golos Text", "Inter", system-ui, sans-serif;
    --font-body: "Inter", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, monospace;

    --sidebar-width: 272px;
    --sidebar-width-collapsed: 76px;
    --topbar-height: 68px;
}

[data-theme="dark"] {
    --bg-canvas: #0B1220;
    --bg-surface: #111C31;
    --bg-surface-2: #16223A;
    --bg-sidebar: #070D19;
    --text-primary: #EEF1F6;
    --text-secondary: #9CA8BC;
    --text-on-dark: #EEF1F6;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
    --success-100: rgba(31, 138, 95, 0.16);
    --danger-100: rgba(179, 38, 30, 0.18);
    --gold-050: rgba(201, 162, 39, 0.14);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0 0 .5em;
}
h2 { font-size: 1.5rem; }
h4 { font-size: 1.1rem; }

a { color: var(--azure-600); text-decoration: none; }
a:hover { color: var(--azure-500); text-decoration: underline; }

code, .mono { font-family: var(--font-mono); }

::selection { background: var(--gold-300); color: var(--ink-950); }

:focus-visible {
    outline: 2px solid var(--gold-500);
    outline-offset: 2px;
}

/* ==========================================================================
   Shell: sidebar + topbar + main
   ========================================================================== */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: width .22s ease, transform .22s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

body.sidebar-collapsed .sidebar { width: var(--sidebar-width-collapsed); }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: 1.1rem 1.15rem;
    min-height: var(--topbar-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
    overflow: hidden;
}
.brand-mark {
    flex: none;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--gold-500);
    display: flex; align-items: center; justify-content: center;
    background: rgba(201, 162, 39, 0.08);
    padding: 0;
    box-sizing: border-box;
}
.brand-mark svg { width: 19px; height: 19px; stroke: var(--gold-300); flex: none; }
.sidebar-brand .brand-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .94rem;
    line-height: 1.25;
    color: #fff;
    opacity: 1;
    transition: opacity .15s ease;
}
.sidebar-brand .brand-text .brand-subtitle {
    display: block;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: .68rem;
    letter-spacing: .03em;
    color: rgba(233, 237, 244, 0.55);
    margin-top: .1rem;
}
body.sidebar-collapsed .sidebar-brand .brand-text { opacity: 0; width: 0; }

.sidebar-nav {
    flex: 1;
    padding: 1rem .75rem;
    overflow-y: auto;
}
.sidebar-nav .nav-group-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--neutral-400);
    padding: .5rem .75rem;
    margin-top: .5rem;
}
body.sidebar-collapsed .nav-group-label { display: none; }

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .65rem .75rem;
    border-radius: var(--radius-control);
    color: rgba(233, 237, 244, 0.72);
    font-size: .92rem;
    font-weight: 500;
    margin-bottom: .15rem;
    white-space: nowrap;
    overflow: hidden;
    transition: background .15s ease, color .15s ease;
}
.sidebar-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; text-decoration: none; }
.sidebar-link.active {
    background: linear-gradient(90deg, rgba(201,162,39,.22), rgba(201,162,39,.04));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--gold-500);
}
.sidebar-link svg { flex: none; width: 20px; height: 20px; }
.sidebar-link .label-text { opacity: 1; transition: opacity .15s ease; }
body.sidebar-collapsed .sidebar-link .label-text { opacity: 0; width: 0; }
body.sidebar-collapsed .sidebar-link { justify-content: center; }

.sidebar-footer {
    padding: .9rem .9rem 1.1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-collapse-btn {
    display: flex; align-items: center; gap: .6rem;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255,255,255,.12);
    color: rgba(233,237,244,.75);
    border-radius: var(--radius-control);
    padding: .55rem .7rem;
    cursor: pointer;
    font-size: .85rem;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-collapse-btn svg { transition: transform .22s ease; flex: none; }
body.sidebar-collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }
body.sidebar-collapsed .sidebar-collapse-btn .label-text { display: none; }

.main-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left .22s ease;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
body.sidebar-collapsed .main-area { margin-left: var(--sidebar-width-collapsed); }

.topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 1rem;
}
.topbar-left { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    cursor: pointer;
    flex: none;
    font-family: inherit;
    padding: 0;
}
.icon-btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.icon-btn svg { width: 18px; height: 18px; }

.user-chip {
    display: flex; align-items: center; gap: .6rem;
    padding: .35rem .7rem .35rem .35rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
}
.user-chip .avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, var(--ink-700), var(--azure-500));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: .75rem;
    flex: none;
}
.user-chip .name { font-size: .85rem; font-weight: 600; white-space: nowrap; }

.main-content {
    padding: 1.75rem 1.75rem 3rem;
    max-width: 1320px;
    width: 100%;
    margin: 0 auto;
}

.mobile-menu-btn { display: none; }

/* ==========================================================================
   "Slayd" kartalari — asosiy tarkib shu kartalar ichida joylashadi
   ========================================================================== */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.card-body { padding: 1.5rem; }
.card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-2);
    font-weight: 700;
    font-family: var(--font-display);
    display: flex; align-items: center; justify-content: space-between;
}
.card.h-100 { height: 100%; }

/* Stat kartalar (text-bg-*) — .card bilan birga ishlatiladi, masalan: class="card text-bg-primary" */
.card.text-bg-primary, .card.text-bg-success, .card.text-bg-info,
.card.text-bg-warning, .card.text-bg-danger {
    border: none;
    height: 100%;
}
.card.text-bg-primary .card-body, .card.text-bg-success .card-body,
.card.text-bg-info .card-body, .card.text-bg-warning .card-body,
.card.text-bg-danger .card-body {
    background: transparent;
    color: #fff;
    padding: 1.25rem 1.4rem;
}
.card.text-bg-primary .card-body h6, .card.text-bg-success .card-body h6,
.card.text-bg-info .card-body h6, .card.text-bg-warning .card-body h6,
.card.text-bg-danger .card-body h6 {
    color: rgba(255,255,255,.82); font-size: .78rem; text-transform: uppercase;
    letter-spacing: .04em; font-weight: 600; margin: 0 0 .35rem;
}
.card.text-bg-primary .card-body h3, .card.text-bg-success .card-body h3,
.card.text-bg-info .card-body h3, .card.text-bg-warning .card-body h3,
.card.text-bg-danger .card-body h3 {
    color: #fff; font-size: 1.9rem; margin: 0;
}
.card.text-bg-primary { background: linear-gradient(135deg, var(--ink-800), var(--azure-600)); }
.card.text-bg-success { background: linear-gradient(135deg, #14603F, var(--success-600)); }
.card.text-bg-info { background: linear-gradient(135deg, #1C4E6B, var(--azure-500)); }
.card.text-bg-warning { background: linear-gradient(135deg, #8A6A10, var(--gold-500)); }
.card.text-bg-danger { background: linear-gradient(135deg, #7A1D17, var(--danger-600)); }

.row.g-3 > .col-md-3, .row.g-3 > .col-md-4 { padding: .5rem; }
.row { display: flex; flex-wrap: wrap; margin: -.5rem; }
.row > [class*="col-"] { padding: .5rem; }
.row.g-3 { display: flex; flex-wrap: wrap; margin: -.5rem; }
.col-md-3 { flex: 1 1 220px; }
.col-md-4 { flex: 1 1 260px; }
.col-md-6 { flex: 1 1 320px; padding: .5rem; }
.row.g-2 { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.row.g-2 > * { flex: 1 1 200px; }

/* ==========================================================================
   Jadvallar
   ========================================================================== */

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table thead th {
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-secondary);
    font-weight: 700;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface-2);
}
.table td { padding: .8rem .9rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--bg-surface-2); }
.table-success td { background: var(--gold-050) !important; }
.table-responsive { overflow-x: auto; }

/* Bootstrap card ichida table bo'lsa, chekka radiusni buzmaslik uchun */
.card .table { margin: 0; }

/* ==========================================================================
   Muhr-uslubidagi status belgilari (signature element)
   ========================================================================== */

.seal {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
    font-weight: 700;
    padding: .28rem .7rem .28rem .45rem;
    border-radius: var(--radius-pill);
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.seal .seal-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex: none;
}
.seal-olingan { border-color: var(--gold-500); color: #8A6A10; background: var(--gold-050); }
.seal-olingan .seal-dot { background: var(--gold-500); color: #fff; }
[data-theme="dark"] .seal-olingan { color: var(--gold-300); }

.seal-bajarilgan { border-color: var(--success-600); color: var(--success-600); background: var(--success-100); }
.seal-bajarilgan .seal-dot { background: var(--success-600); color: #fff; }

.seal-bajarilmagan, .seal-olinmagan { border-color: var(--danger-600); color: var(--danger-600); background: var(--danger-100); }
.seal-bajarilmagan .seal-dot, .seal-olinmagan .seal-dot { background: var(--danger-600); color: #fff; }

.seal-aniqlanmagan { border: 1.5px dashed var(--neutral-400); color: var(--text-secondary); background: transparent; }
.seal-aniqlanmagan .seal-dot { background: var(--neutral-400); color: #fff; }

/* Eski .badge klasslarini ham shu uslubga moslashtiramiz (shablonlar shuni ishlatadi) */
.badge {
    display: inline-flex; align-items: center;
    font-size: .74rem; font-weight: 700;
    padding: .32rem .6rem;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}
.bg-success { background: var(--success-100); color: var(--success-600); }
.bg-danger { background: var(--danger-100); color: var(--danger-600); }
.bg-secondary { background: var(--bg-surface-2); color: var(--text-secondary); border: 1px dashed var(--neutral-400); }
.bg-info { background: rgba(62,124,177,.14); color: var(--azure-600); }
.bg-warning { background: var(--gold-050); color: #8A6A10; }
.text-dark { color: var(--text-primary) !important; }

/* ==========================================================================
   Tugmalar
   ========================================================================== */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .88rem;
    padding: .55rem 1.1rem;
    border-radius: var(--radius-control);
    border: 1px solid transparent;
    cursor: pointer;
    transition: filter .12s ease, background .12s ease, border-color .12s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(1.04); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-primary { background: var(--ink-950); color: #fff; }
[data-theme="dark"] .btn-primary { background: var(--gold-500); color: var(--ink-950); }
.btn-primary:hover { background: var(--ink-800); color: #fff; }
[data-theme="dark"] .btn-primary:hover { background: var(--gold-300); color: var(--ink-950); }
.btn-secondary { background: var(--bg-surface-2); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--neutral-200); color: var(--text-primary); }
.btn-outline-primary { background: transparent; color: var(--azure-600); border-color: var(--azure-500); }
.btn-outline-primary:hover { background: rgba(62,124,177,.08); color: var(--azure-600); }
.btn-outline-secondary { background: transparent; color: var(--text-secondary); border-color: var(--border-color); }
.btn-outline-secondary:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.btn.w-100 { width: 100%; }

/* ==========================================================================
   Formalar
   ========================================================================== */

.form-label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: var(--text-primary); }
.form-text { font-size: .78rem; color: var(--text-secondary); margin-top: .3rem; }
.form-control, .form-select {
    width: 100%;
    padding: .6rem .8rem;
    font-family: var(--font-body);
    font-size: .9rem;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-control);
    transition: border-color .12s ease, box-shadow .12s ease;
}
.form-control::placeholder { color: var(--neutral-400); }
.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(201,162,39,.18);
}
textarea.form-control { resize: vertical; min-height: 90px; }

/* ==========================================================================
   Alertlar
   ========================================================================== */

.alert { padding: .85rem 1.1rem; border-radius: var(--radius-control); margin-bottom: 1rem; font-size: .88rem; border: 1px solid transparent; }
.alert-success { background: var(--success-100); color: var(--success-600); border-color: rgba(31,138,95,.3); }
.alert-error, .alert-danger { background: var(--danger-100); color: var(--danger-600); border-color: rgba(179,38,30,.3); }
.alert-warning { background: var(--gold-050); color: #8A6A10; border-color: rgba(201,162,39,.35); }
.alert-info { background: rgba(62,124,177,.1); color: var(--azure-600); border-color: rgba(62,124,177,.3); }

/* ==========================================================================
   Tabs (expertise/tizim_detail.html uchun — Bootstrap JS bundle bilan ishlaydi)
   ========================================================================== */

.nav-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border-color); list-style: none; padding: 0; margin: 0; }
.nav-tabs .nav-link {
    background: transparent; border: none; border-bottom: 2px solid transparent;
    padding: .6rem .9rem; font-weight: 600; font-size: .86rem; color: var(--text-secondary);
    cursor: pointer; border-radius: 0;
}
.nav-tabs .nav-link.active { color: var(--ink-950); border-bottom-color: var(--gold-500); }
[data-theme="dark"] .nav-tabs .nav-link.active { color: #fff; }
.tab-content { }
.tab-pane { display: none; }
.tab-pane.show.active { display: block; }

/* ==========================================================================
   Muhr ustiga bosilganda ochiladigan PDF ro'yxati (details/summary, JS shart emas)
   ========================================================================== */

.seal-dropdown { position: relative; display: inline-block; }
.seal-dropdown summary {
    cursor: pointer;
    list-style: none;
}
.seal-dropdown summary::-webkit-details-marker { display: none; }
.seal-dropdown summary .seal:hover { filter: brightness(0.97); box-shadow: 0 0 0 3px rgba(201,162,39,.15); }
.seal-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    min-width: 240px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-control);
    box-shadow: var(--shadow-card);
    padding: .8rem .9rem;
}
.seal-dropdown-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-secondary); font-weight: 700; margin-bottom: .5rem; }
.seal-dropdown-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .3rem 0; font-size: .85rem; border-bottom: 1px dashed var(--border-color); }
.seal-dropdown-row:last-of-type { border-bottom: none; }
.seal-dropdown-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--azure-600); white-space: nowrap; }
.seal-dropdown-empty { font-size: .82rem; color: var(--text-secondary); }
.seal-dropdown-footer { display: block; margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--border-color); font-size: .78rem; font-weight: 600; }

.ai-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }

.spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: middle;
    margin-right: .4rem;
}
[data-theme="dark"] .btn-secondary .spinner,
.btn-secondary .spinner {
    border: 2px solid rgba(0,0,0,.15);
    border-top-color: var(--text-primary);
}
@keyframes spin { to { transform: rotate(360deg); } }
.yuklash-progress-track {
    width: 100%; height: 6px; border-radius: var(--radius-pill);
    background: var(--bg-surface-2); overflow: hidden; margin-top: .5rem;
}
.yuklash-progress-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
    border-radius: var(--radius-pill);
    transition: width .2s ease;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.page-item .page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 .5rem;
    border-radius: var(--radius-control);
    border: 1px solid var(--border-color);
    color: var(--text-primary); font-size: .82rem; font-weight: 600;
}
.page-ellipsis { border: none !important; color: var(--text-secondary) !important; }
.page-item.active .page-link { background: var(--ink-950); color: #fff; border-color: var(--ink-950); }
[data-theme="dark"] .page-item.active .page-link { background: var(--gold-500); color: var(--ink-950); border-color: var(--gold-500); }

/* ==========================================================================
   Login sahifasi
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 15% 20%, rgba(201,162,39,.14), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(62,124,177,.18), transparent 45%),
        linear-gradient(160deg, var(--ink-950) 0%, #0E2340 60%, var(--ink-800) 100%);
    padding: 1.5rem;
}
.auth-card {
    width: 100%; max-width: 400px;
    background: rgba(255,255,255,.98);
    border-radius: 20px;
    box-shadow: 0 24px 60px -20px rgba(0,0,0,.5);
    padding: 2.4rem 2.2rem 2.1rem;
}
[data-theme="dark"] .auth-card { background: var(--bg-surface); }
.auth-seal {
    width: 56px; height: 56px; border-radius: 50%;
    border: 2.5px solid var(--gold-500);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.1rem;
    font-family: var(--font-display); font-weight: 700; font-size: 1.1rem;
    color: var(--ink-950);
}
[data-theme="dark"] .auth-seal { color: var(--gold-300); }
.auth-title { text-align: center; font-size: 1.15rem; margin-bottom: .15rem; }
.auth-subtitle { text-align: center; color: var(--text-secondary); font-size: .84rem; margin-bottom: 1.6rem; }
.auth-card form p { margin: 0 0 1.1rem; }
.auth-card form label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.auth-card form input {
    width: 100%; padding: .65rem .85rem;
    border: 1px solid var(--border-color); border-radius: var(--radius-control);
    font-size: .9rem; background: var(--bg-surface); color: var(--text-primary);
}
.auth-card form input:focus { outline: none; border-color: var(--gold-500); box-shadow: 0 0 0 3px rgba(201,162,39,.18); }
.auth-divider { height: 1px; background: linear-gradient(90deg, transparent, var(--gold-500), transparent); margin: 1.4rem 0; opacity: .5; }

/* ==========================================================================
   Reyting (dashboard) — medal uslubi
   ========================================================================== */

.rank-badge {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: .8rem;
    background: var(--bg-surface-2); color: var(--text-secondary);
}
.rank-1 { background: linear-gradient(135deg, var(--gold-300), var(--gold-500)); color: #fff; }
.rank-2 { background: linear-gradient(135deg, #C9CDD6, #9AA3B2); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #D9A876, #B5763B); color: #fff; }

.progress-track {
    width: 100%; height: 8px; border-radius: var(--radius-pill);
    background: var(--bg-surface-2); overflow: hidden;
}
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold-500), var(--gold-300)); border-radius: var(--radius-pill); }

/* ==========================================================================
   Mobil (responsive)
   ========================================================================== */

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-width); box-shadow: 24px 0 48px rgba(0,0,0,.25); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .main-area { margin-left: 0 !important; }
    .mobile-menu-btn { display: inline-flex; }
    .sidebar-collapse-btn { display: none; }
    .main-content { padding: 1.1rem 1rem 2.5rem; }
    .topbar { padding: 0 1rem; }
    body.sidebar-open::after {
        content: ""; position: fixed; inset: 0; background: rgba(6,10,20,.55); z-index: 35;
    }
}

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

/* ==========================================================================
   Kichik utility klasslar (shablonlarda ishlatiladi)
   ========================================================================== */

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.text-danger { color: var(--danger-600); }
.text-success { color: var(--success-600); }
.small { font-size: .82rem; }
.h-100 { height: 100%; }
.mb-1 { margin-bottom: .35rem; } .mb-2 { margin-bottom: .6rem; }
.mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; } .mb-5 { margin-bottom: 2.5rem; }
.mt-2 { margin-top: .6rem; } .mt-4 { margin-top: 1.5rem; }
.pt-3 { padding-top: 1rem; }
.row.g-4 { display: flex; flex-wrap: wrap; margin: -.75rem; }
.row.g-4 > .col-md-6 { padding: .75rem; flex: 1 1 340px; }
.tab-pane.fade { transition: opacity .12s ease; }
