@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================================
   Mavriyat.uz — dizayn tizimi.  Asosiy ranglar: OQ · KO'K · QORA
   ----------------------------------------------------------------------------
   Brend rangi `--brand` (ko'k) butun panel bo'ylab ishlatiladi. Eski
   `--purple*` nomlari alias sifatida saqlangan — kodning biror chetida
   qolib ketgan joy ham to'g'ri (ko'k) rang oladi.
   ========================================================================= */
:root {
    --brand: #27519F;
    --brand-dark: #1D3E7D;
    --brand-light: #E7EEF9;
    --brand-gradient: linear-gradient(135deg, #3568C4 0%, #27519F 50%, #1D3E7D 100%);

    --blue: #3568C4;
    --blue-light: #E7EEF9;

    --bg: #F4F7FB;
    --surface: #FFFFFF;
    --card-bg: #FFFFFF;
    --bg-secondary: #F1F5F9;
    --hover-bg: #F1F5F9;
    --bg-hover: #F1F5F9;

    --text: #16233B;
    --text-primary: #16233B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border: #E6EAF0;

    /* Kodning bir qismi `--primary` nomini kutadi — brend rangining o'zi */
    --primary: #27519F;
    --primary-light: #E7EEF9;

    --success: #16A34A;
    --success-bg: #DCFCE7;
    --danger: #EF4444;
    --danger-bg: #FEE2E2;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --pink: #EC4899;
    --pink-bg: #FCE7F3;

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 18px;
    --shadow: 0 1px 2px rgba(22, 35, 59, 0.04), 0 6px 20px rgba(22, 35, 59, 0.05);
    --shadow-card: 0 1px 3px rgba(22, 35, 59, 0.05), 0 10px 30px rgba(22, 35, 59, 0.06);

    /* Eski nomlar — moslik uchun */
    --purple: var(--brand);
    --purple-dark: var(--brand-dark);
    --purple-light: var(--brand-light);
    --purple-gradient: var(--brand-gradient);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

/* ========== AUTH ========== */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 24px;
}

.auth-body::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(39, 81, 159, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.auth-container {
    background: var(--surface);
    padding: 48px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 440px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.auth-logo-img {
    height: 80px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    display: block;
}

.auth-container h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 32px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-group input,
.form-select,
.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #F8FAFC;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: var(--text);
}

.form-group input:focus,
.form-select:focus,
.form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(39, 81, 159, 0.1);
    background: #fff;
}

.btn-auth {
    width: 100%;
    padding: 14px;
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
}

.btn-auth:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(39, 81, 159, 0.35);
}

.input-password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-wrap input {
    flex: 1;
    padding-right: 44px;
}

.input-eye-btn {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 44px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    padding: 0;
}

.input-eye-btn:hover {
    color: var(--text);
}

.input-eye-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-footer {
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

.auth-footer a {
    color: var(--brand);
    text-decoration: none;
    font-weight: 600;
}

.alert-danger {
    background: var(--danger-bg);
    color: #991B1B;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}

/* ========== APP SHELL ========== */
.app-shell {
    display: flex;
    min-height: 100vh;
    padding: 16px;
    gap: 16px;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 20px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    position: sticky;
    top: 16px;
    height: calc(100vh - 32px);
    overflow: hidden;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
    min-height: 0;
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 36px;
    padding: 8px 12px 0;
}

.brand-logo {
    height: 58px;
    width: auto;
    max-width: 168px;
    object-fit: contain;
    display: block;
}

.sidebar-brand h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.menu-group {
    margin-bottom: 2px;
}

.menu-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.menu-group-toggle .label {
    flex: 1;
}

.menu-group-toggle>svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.menu-group-toggle:hover {
    background: #F1F5F9;
    color: var(--text);
}

.menu-subitems {
    display: none;
    padding: 0 0 4px 8px;
}

.menu-group.open .menu-subitems {
    display: block;
}

.settings-sidebar-section {
    padding: 4px 0 6px;
}

.settings-language-toggle { display:flex; align-items:center; gap:10px; width:100%; border:0; background:transparent; cursor:pointer; text-align:left; }
.settings-language-toggle svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; }
.settings-language-chevron { margin-left:auto; font-size:18px; line-height:1; transition:transform .2s ease; }
.settings-sidebar-section.is-open .settings-language-chevron { transform:rotate(180deg); }
.settings-language-options { padding:2px 0 3px; }
.settings-language-options[hidden] { display:none; }

.archive-modal { max-height:64vh; overflow-y:auto; padding-right:3px; }
.archive-intro { display:grid; gap:4px; padding:13px 14px; margin-bottom:14px; border-radius:12px; background:#F3F0FF; color:var(--text); }
.archive-intro b { font-size:15px; }.archive-intro span { color:var(--text-muted); font-size:12px; }
.archive-group { margin:0 0 18px; }.archive-group h4 { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 8px; font-size:14px; }.archive-group h4 span { min-width:22px; padding:2px 7px; border-radius:999px; background:var(--bg-secondary); color:var(--text-muted); text-align:center; font-size:11px; }
.archive-item { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:11px 0; border-bottom:1px solid var(--border); }.archive-item:last-child { border-bottom:0; }.archive-item > div { display:grid; min-width:0; gap:3px; }.archive-item b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }.archive-item small, .archive-item time { color:var(--text-muted); font-size:11px; }.archive-restore-btn { flex:none; padding:7px 11px; font-size:12px; }
.archive-role-group { padding:9px 12px; margin-bottom:8px; border:1px solid var(--border); border-radius:10px; }.archive-role-group > b { display:block; margin-bottom:2px; color:var(--brand); font-size:12px; }
@media (max-width:480px) { .archive-item { align-items:flex-start; }.archive-restore-btn { padding:6px 9px; } }

.settings-sidebar-label {
    display: block;
    padding: 5px 14px 4px 36px;
    color: var(--text-light);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.settings-sidebar-action svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.menu-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 10px 36px;
    margin-bottom: 4px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    transition: all 0.2s;
    position: relative;
}

.menu-sub-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.menu-flag {
    width: 20px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.menu-flag-emoji {
    font-size: 16px;
    line-height: 1;
    flex-shrink: 0;
    display: inline-block;
    width: 20px;
    text-align: center;
}

.menu-sub-item:hover {
    background: #F1F5F9;
    color: var(--text);
}

.menu-sub-item.active,
.menu-sub-item--active {
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 500;
}

.menu-sub-item.active::before,
.menu-sub-item--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 22px;
    background: var(--brand);
    border-radius: 0 4px 4px 0;
}

.lang-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border: none;
    background: none;
}

[data-theme="dark"] .menu-group-toggle:hover,
[data-theme="dark"] .menu-sub-item:hover {
    background: #1F2734;
}

.inline-flag {
    width: 18px;
    height: 12px;
    vertical-align: -2px;
    margin-right: 6px;
}

.placeholder-card {
    text-align: center;
    padding: 56px 32px;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.menu-item:hover {
    background: #F1F5F9;
    color: var(--text);
}

.menu-item.active {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(39, 81, 159, 0.28);
}

.menu-item.active::before {
    content: none;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--brand);
    border-radius: 0 4px 4px 0;
}

/* ========== MAIN AREA ========== */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    height: calc(100vh - 32px);
    overflow: hidden;
}

.top-header {
    flex-shrink: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow);
}

.search-box {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    stroke: var(--text-light);
    fill: none;
    stroke-width: 2;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: none;
    background: #F1F5F9;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: var(--text);
}

.search-box input::placeholder {
    color: var(--text-light);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--pink-bg);
    color: var(--pink);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--pink);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.icon-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #F1F5F9;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--brand-light);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 1.8;
}

.communication-hub-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.communication-hub-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.communication-hub-row:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.communication-hub-avatar {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 12px;
    background: var(--brand-light);
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
}

.communication-hub-meta {
    min-width: 0;
    flex: 1;
}

.communication-hub-name,
.communication-hub-preview {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.communication-hub-name {
    font-size: 14px;
    font-weight: 700;
}

.communication-hub-preview {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

.communication-hub-count {
    min-width: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(39, 81, 159, 0.3);
}

/* Avatar faylining o'zida qolgan oq hoshiyalar ham ko'rinmasin. */
.user-avatar > img,
.lead-mgr-avatar-img,
.profile-avatar-large img,
.sal-profile-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transform: scale(1.14);
}

/* ========== CONTENT LAYOUT ========== */
.content-layout {
    display: flex;
    gap: 16px;
    flex: 1;
    align-items: stretch;
    min-height: 0;
    overflow: hidden;
}

.content-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#tab-sales.tab-content.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#tab-profile.tab-content.active {
    display: flex;
    flex-direction: column;
}

#tab-student-app.tab-content.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#tab-students.tab-content.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.students-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.students-panel.active {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.students-panel[data-students-panel="faol"].active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#tab-marketing.tab-content.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.marketing-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.marketing-panel.active {
    display: flex;
    flex-direction: column;
}

/* Sozlamalar */
#tab-settings.tab-content.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.settings-panel.active {
    display: flex;
    flex-direction: column;
}

#settingsNotifList {
    max-height: none;
}

.menu-group-toggle.active {
    background: var(--brand-light);
    color: var(--brand);
}

/* HR Bo'limi */
#tab-hr.tab-content.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hr-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.hr-panel.active {
    display: flex;
    flex-direction: column;
}

.finance-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.finance-panel.active {
    display: flex;
    flex-direction: column;
}

/* Analitika */
#tab-analitika.tab-content.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.analitika-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.analitika-panel.active {
    display: flex;
    flex-direction: column;
}

/* Target Monitoringi */
.tm-wrap {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tm-months {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tm-month-tab {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
}

.tm-month-tab:hover { border-color: var(--brand); color: var(--brand); }
.tm-month-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.tm-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    padding-bottom: 4px;
    border-bottom: 2px solid var(--border);
}

.tm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.tm-kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tm-kpi-icon { font-size: 20px; }
.tm-kpi-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

.tm-kpi-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tm-kpi-val {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tm-kpi-sublabel { font-size: 10px; color: var(--text-muted); font-weight: 500; }
.tm-kpi-num { font-size: 17px; font-weight: 800; color: var(--text); }
.tm-kpi-num--fakt { color: var(--brand); }

.tm-kpi-pct {
    font-size: 15px;
    font-weight: 700;
    margin-left: auto;
}

.tm-progress {
    height: 6px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 2px;
}

.tm-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .3s;
}

.tm-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.tm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 820px;
}

.tm-table thead th {
    background: var(--bg);
    padding: 8px 10px;
    text-align: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    white-space: nowrap;
}

.tm-th-name { text-align: left !important; min-width: 170px; }

.tm-table tbody tr:nth-child(even) { background: var(--bg); }
.tm-table tbody tr:hover { background: #f0ebff; }
.tm-tr-active { background: #F2F7FF !important; }

.tm-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
}

.tm-td-name { text-align: left; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 8px; }
.tm-td-plan { color: var(--text-light); font-size: 12px; }
.tm-td-fakt { font-weight: 600; color: var(--text-muted); }
.tm-td-has { color: var(--brand); }
.tm-td-sotuv { font-weight: 700; }
.tm-td-sotuv-pos { color: #10b981; }

.tm-avatar { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-light, #E7EEF9); }
.tm-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.tm-avatar-initials { font-size: 11px; font-weight: 700; color: var(--brand, #27519F); }

[data-theme="dark"] .tm-table tbody tr:hover { background: rgba(39, 81, 159,.1); }
[data-theme="dark"] .tm-tr-active { background: rgba(39, 81, 159,.07) !important; }

.student-app-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.student-app-open-link {
    text-decoration: none;
    white-space: nowrap;
}

.student-app-frame-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0 16px 24px;
    overflow: auto;
}

.student-app-frame {
    width: 100%;
    max-width: 430px;
    height: min(860px, calc(100vh - 180px));
    min-height: 520px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
}

.sales-pinned {
    flex-shrink: 0;
}

.sales-header-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 12px;
    align-items: center;
    margin-bottom: 8px;
}

.sales-header-nav.section-nav {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
    padding: 0 4px;
}

.sales-header-lang {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
}

.leads-filters-bar[hidden],
.leads-add-btn[hidden] {
    display: none !important;
}

.leads-filters-bar {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
}

.leads-add-btn {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: center;
    flex-shrink: 0;
    white-space: nowrap;
    min-height: 38px;
    padding: 8px 16px;
}

.leads-filter-box {
    display: flex;
    align-items: center;
    position: relative;
    min-height: 38px;
    min-width: 200px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    flex: 0 1 240px;
    max-width: 300px;
}

.leads-filter-box--select {
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.leads-filter-display {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    user-select: none;
}

.leads-filter-display.is-selected {
    color: var(--text);
}

.leads-filter-select-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    background: transparent;
}

.leads-columns-filter-wrap {
    padding: 0;
    border: none;
    background: transparent;
    min-width: 200px;
    flex: 0 1 240px;
    max-width: 300px;
}

.leads-columns-filter-wrap .leads-columns-filter {
    width: 100%;
}

.leads-columns-filter {
    position: relative;
}

.leads-filter-trigger {
    width: 100%;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.leads-filter-trigger .leads-filter-display {
    text-align: left;
}

.leads-filter-trigger svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-light);
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
    margin-left: auto;
}

.leads-filter-trigger:hover {
    border-color: var(--brand);
}

.leads-columns-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 280px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 28px rgba(22, 35, 59, 0.14);
    padding: 8px;
    z-index: 30;
}

.leads-column-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}

.leads-column-option:hover {
    background: #F1F5F9;
}

.leads-column-option input {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--brand);
}

.leads-column-option--optional span {
    color: var(--text-muted);
}

.sales-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sales-panel {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sales-panel.active {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sales-panel[data-sales-panel="leads"].active {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.leads-kanban {
    display: flex;
    gap: 16px;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    overflow: auto;
    padding-bottom: 12px;
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
}

.lead-column {
    flex: 0 0 280px;
    min-width: 260px;
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    border: 1.5px solid transparent;
    align-self: flex-start;
}

.right-panel {
    width: 300px;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.right-panel.hidden {
    display: none;
}

.page-title-bar {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.page-title-bar > div { flex: 1; min-width: 0; }

.hr-lang-filter {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.hr-lang-filter .subject-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    font-size: 13px;
}

.emp-lang-sub {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.emp-lang-sub label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 7px 14px;
    transition: border-color .15s, background .15s;
}

.emp-lang-sub input[type="radio"] { display: none; }

.emp-lang-sub label:has(input:checked) {
    border-color: var(--primary);
    background: var(--brand-light);
    color: var(--primary);
}

.page-title-bar h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
}

.page-title-bar p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== CARDS ========== */
.card {
    background: var(--surface);
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.view-all {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
    text-decoration: none;
    letter-spacing: 0.5px;
}

/* ========== WELCOME BANNER ========== */
.dashboard-section-title { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin:4px 0 14px; }
.dashboard-section-title h3 { margin:0; font-size:18px; }
.dashboard-section-title span, .dashboard-panel-head span { color:var(--text-muted); font-size:12px; }
.dashboard-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.dashboard-kpi-grid--single { grid-template-columns:minmax(240px,1fr); }
.dashboard-kpi { display:flex; align-items:center; gap:11px; padding:15px; border-radius:14px; background:var(--bg-card); border:1px solid var(--border); box-shadow:var(--shadow-sm); }
.dashboard-kpi-icon { width:38px; height:38px; display:grid; place-items:center; flex:none; border-radius:11px; font-size:18px; }
.dashboard-kpi-icon.purple { background:#EEE9FF; }.dashboard-kpi-icon.blue { background:#E7F2FF; }.dashboard-kpi-icon.green { background:#E4FAEF; }.dashboard-kpi-icon.yellow { background:#FFF6D9; }
.dashboard-kpi small { display:block; color:var(--text-muted); font-size:12px; margin-bottom:3px; }.dashboard-kpi b { display:block; font-size:18px; white-space:nowrap; }
.dashboard-kpi em { display:block; margin-top:3px; color:var(--text-muted); font-size:11px; font-style:normal; }
.dashboard-grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.dashboard-panel { padding:18px; }.dashboard-panel-head { display:flex; justify-content:space-between; align-items:baseline; gap:8px; border-bottom:1px solid var(--border); padding-bottom:12px; margin-bottom:5px; }.dashboard-panel-head h3 { margin:0; font-size:16px; }
.dashboard-rank-row { display:grid; grid-template-columns:25px minmax(0,1fr) auto; align-items:center; gap:9px; padding:11px 0; border-bottom:1px solid var(--border); }.dashboard-rank-row:last-child { border-bottom:0; }
.dashboard-rank-place { width:23px; height:23px; display:grid; place-items:center; border-radius:50%; background:#E7EEF9; color:var(--brand); font-size:12px; font-weight:800; }.dashboard-rank-info { min-width:0; }.dashboard-rank-info b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; }.dashboard-rank-row > strong { font-size:11px; color:var(--text-muted); white-space:nowrap; text-align:right; }
.dashboard-rank-track { height:4px; margin-top:6px; overflow:hidden; background:var(--bg-secondary); border-radius:99px; }.dashboard-rank-track i, .dashboard-funnel-row i { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#3568C4,#27519F); }
.dashboard-empty { color:var(--text-muted); text-align:center; padding:22px 0 10px; font-size:13px; }
.dashboard-funnel-row { display:grid; grid-template-columns:120px minmax(30px,1fr) 28px; gap:9px; align-items:center; padding:9px 0; }.dashboard-funnel-row span { font-size:12px; }.dashboard-funnel-row > div { height:10px; overflow:hidden; border-radius:99px; background:var(--bg-secondary); }.dashboard-funnel-row b { font-size:12px; text-align:right; }
.dashboard-target-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding-top:10px; }.dashboard-target-stats div { padding:13px; border-radius:11px; background:var(--bg-secondary); }.dashboard-target-stats small { display:block; color:var(--text-muted); font-size:11px; margin-bottom:5px; }.dashboard-target-stats b { font-size:16px; }
@media (max-width: 900px) { .dashboard-kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.dashboard-grid-2 { grid-template-columns:1fr; } }
@media (max-width: 480px) { .dashboard-kpi { padding:12px; }.dashboard-kpi b { font-size:14px; }.dashboard-kpi-icon { width:33px; height:33px; font-size:15px; }.dashboard-section-title { flex-direction:column; gap:3px; }.dashboard-funnel-row { grid-template-columns:95px minmax(25px,1fr) 22px; } }
.welcome-banner {
    background: var(--brand-gradient);
    border-radius: var(--radius);
    padding: 32px 36px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    min-height: 160px;
    transition: background 0.4s ease;
}

/* 30-vazifa: 3 ta rangli karusel slayd - bir vaqtda faqat .active bo'lgani ko'rinadi */
.welcome-banner-inner {
    display: none;
    justify-content: space-between;
    align-items: center;
}

.welcome-banner-inner.active {
    display: flex;
}

.welcome-banner.banner-color-2 {
    background: linear-gradient(135deg, #0EA5E9, #0369A1);
}

.welcome-banner.banner-color-3 {
    background: linear-gradient(135deg, #10B981, #047857);
}

.welcome-banner::after {
    content: '';
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.welcome-text h2 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.welcome-text p {
    font-size: 14px;
    opacity: 0.85;
    margin-bottom: 16px;
    max-width: 400px;
    line-height: 1.5;
}

.welcome-link {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.3px;
    opacity: 0.9;
}

.welcome-link:hover {
    opacity: 1;
}

.banner-emoji {
    font-size: 72px;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}

.banner-dots {
    display: flex;
    gap: 6px;
    position: absolute;
    left: 36px;
    bottom: 20px;
    z-index: 2;
    cursor: pointer;
}

.banner-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
}

.banner-dots span.active {
    background: #fff;
}

/* ========== STAT CARDS ========== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--surface);
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: var(--brand-light);
}

.stat-icon.blue {
    background: var(--blue-light);
}

.stat-icon.green {
    background: var(--success-bg);
}

.stat-icon.yellow {
    background: var(--warning-bg);
}

.stat-info .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-info .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

/* ========== COURSE CARDS ========== */
.course-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.course-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.course-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.course-card-top {
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    position: relative;
}

.course-card-top.purple {
    background: linear-gradient(135deg, #A8C2EA, #6E9AE0);
}

.course-card-top.yellow {
    background: linear-gradient(135deg, #FDE68A, #FBBF24);
}

.course-card-top.pink {
    background: linear-gradient(135deg, #F9A8D4, #F472B6);
}

.course-card-body {
    padding: 16px 18px 18px;
}

.course-card-body h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-card-body p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.course-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.progress-bar-wrap {
    background: #F4F7FB;
    border-radius: 8px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar {
    height: 100%;
    border-radius: 8px;
    background: var(--brand-gradient);
}

.progress-text {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* ========== SCHEDULE GRID ========== */
.schedule-grid {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    gap: 4px;
    font-size: 11px;
}

.schedule-grid .day-header {
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 4px;
    font-size: 11px;
}

.schedule-grid .day-header.today {
    background: var(--brand);
    color: #fff;
    border-radius: 10px;
}

.schedule-grid .time-label {
    color: var(--text-light);
    font-weight: 500;
    padding: 8px 4px;
    font-size: 10px;
}

.schedule-event {
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text);
    min-height: 36px;
    display: flex;
    align-items: center;
}

.schedule-event.yellow {
    background: #FEF3C7;
    border-left: 3px solid #FBBF24;
}

.schedule-event.blue {
    background: #DBEAFE;
    border-left: 3px solid #6E9AE0;
}

.schedule-event.green {
    background: #D1FAE5;
    border-left: 3px solid #34D399;
}

.schedule-event.pink {
    background: #FCE7F3;
    border-left: 3px solid #F472B6;
}

.schedule-event.empty {
    background: transparent;
}

/* ========== RIGHT WIDGETS ========== */
.widget {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

/* Calendar widget */
.cal-week {
    display: flex;
    gap: 6px;
    justify-content: space-between;
}

.cal-day {
    text-align: center;
    flex: 1;
    padding: 8px 4px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.cal-day:hover {
    background: #F1F5F9;
}

.cal-day.active {
    background: var(--brand);
    color: #fff;
}

.cal-day .day-name {
    font-size: 10px;
    color: var(--text-light);
    margin-bottom: 4px;
    font-weight: 500;
}

.cal-day.active .day-name {
    color: rgba(255, 255, 255, 0.7);
}

.cal-day .day-num {
    font-size: 15px;
    font-weight: 700;
}

/* Growth widget */
.growth-ring {
    display: flex;
    align-items: center;
    gap: 20px;
}

.ring-chart {
    width: 80px;
    height: 80px;
    position: relative;
    flex-shrink: 0;
}

.ring-chart svg {
    transform: rotate(-90deg);
}

.ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--brand);
}

.growth-info h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.growth-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.growth-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

/* Mavriyat progress widget */
.hw-item {
    margin-bottom: 16px;
}

.hw-item:last-child {
    margin-bottom: 0;
}

.hw-item h5 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.hw-item p {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.hw-segments {
    display: flex;
    gap: 4px;
}

.hw-seg {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: #F4F7FB;
}

.hw-seg.filled {
    background: var(--brand);
}

.hw-seg.partial {
    background: #A8C2EA;
}

.hw-pct {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
    margin-top: 4px;
}

/* ========== TABLES ========== */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: #F8FAFC;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.table tbody tr:hover {
    background: #F8FAFC;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ========== BADGES & BUTTONS ========== */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #F4F7FB;
    color: var(--text-muted);
}

.badge-success {
    background: var(--success-bg);
    color: #065F46;
}

.badge-danger {
    background: var(--danger-bg);
    color: #991B1B;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.form-control-sm {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    background: #F8FAFC;
    font-family: inherit;
    color: var(--text);
}

.form-control-sm:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(39, 81, 159, 0.1);
}

.btn-primary-sm {
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: box-shadow 0.2s;
}

.btn-primary-sm:hover {
    box-shadow: 0 4px 16px rgba(39, 81, 159, 0.35);
}

.btn-danger-sm {
    background: var(--danger-bg);
    color: #991B1B;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
}

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
}

.text-muted {
    color: var(--text-muted);
    font-size: 14px;
}

.mini-card {
    background: #F8FAFC;
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 14px;
}

/* Timetable */
.timetable-table .tt-time {
    font-weight: 600;
    white-space: nowrap;
    background: #F8FAFC;
    color: var(--brand);
}

.tt-row:nth-child(even) {
    background: #F8FAFC;
}

/* Haftalik dars jadvali */
.tt-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tt-edit-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background 0.15s;
}
.tt-edit-btn:hover {
    background: var(--surface-hover, #f0f0f0);
}

/* Payment Closed Survey context block */
.pcs-context {
    background: var(--surface-2, #f8f9fa);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
}
.pcs-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 2px 0;
    color: var(--text-secondary, #666);
}
.pcs-row span { min-width: 120px; flex-shrink: 0; }
.pcs-row strong { color: var(--text, #111); }
.pcs-row--debt strong { color: var(--danger, #dc2626); }

.tt-card-header {
    flex-wrap: wrap;
    gap: 12px;
}

.tt-toolbar .tt-subject-tabs {
    padding: 0;
    gap: 6px;
    flex-wrap: nowrap;
}

.tt-toolbar .tt-subject-tabs .subject-tab {
    flex: 0 0 auto;
    padding: 7px 12px;
    font-size: 12px;
    min-width: 0;
    white-space: nowrap;
}

.tt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 24px 12px;
}

.tt-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.tt-legend-item::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.tt-legend-free::before {
    background: #F8FAFC;
}

.tt-legend-lead::before {
    background: #16233B;
    border-color: #374151;
}

.tt-legend-d15::before {
    background: #FEF3C7;
    border-color: #FCD34D;
}

.tt-legend-d30::before {
    background: #D1FAE5;
    border-color: #6EE7B7;
}

.tt-legend-d60::before {
    background: #E0F2FE;
    border-color: #7DD3FC;
}

.tt-grid-wrap {
    padding: 0 16px 16px;
    max-height: 70vh;
    overflow: auto;
}

.tt-grid-header {
    padding: 12px 8px;
    font-size: 14px;
    color: var(--text-muted);
}

.tt-teacher-block {
    margin-bottom: 20px;
}

.tt-teacher-block-title {
    margin: 0 0 10px 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.tt-teacher-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0 20px;
}

.tt-week-table,
.tt-teacher-table {
    font-size: 12px;
    border-collapse: separate;
    border-spacing: 2px;
}

.tt-week-table th,
.tt-teacher-table th {
    text-align: center;
    font-size: 12px;
    padding: 10px 8px;
    background: #F8FAFC;
    border-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.tt-date-num {
    display: block;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}

.tt-date-dow {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.tt-time-col,
.tt-teacher-col {
    position: sticky;
    left: 0;
    z-index: 3;
    background: var(--surface) !important;
    min-width: 60px;
    text-align: left !important;
    font-weight: 700;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.04);
}

.tt-time-head {
    min-width: 40px;
    font-size: 10px !important;
    padding: 6px 4px !important;
}

.tt-cell {
    min-width: 72px;
    min-height: 36px;
    text-align: center;
    vertical-align: middle;
    border-radius: 8px;
    padding: 6px 4px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}

.tt-cell--sunday {
    background: #fdfdfd;
}

.tt-cell--sunday:hover {
    background: #ECFDF5;
    border-color: #6EE7B7;
}

.tt-cell--free {
    background: #F8FAFC;
}

.tt-cell--free:hover {
    background: #ECFDF5;
    border-color: #6EE7B7;
}

.tt-cell--off {
    background: #E2E8F0 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.tt-cell--lead {
    background: #16233B;
    border-color: #374151;
    color: #fff;
}

.tt-cell--lead:hover {
    background: #232B39;
}

.tt-cell--trial {
    background: #FFEDD5;
    border-color: #FDBA74;
    color: #C2410C;
}

.tt-cell--trial:hover {
    background: #FED7AA;
}

.tt-cell--d15 {
    background: #FEF3C7;
    border-color: #FCD34D;
    color: #92400E;
}

.tt-cell--d15:hover {
    background: #FDE68A;
}

.tt-cell--d30 {
    background: #D1FAE5;
    border-color: #6EE7B7;
    color: #065F46;
}

.tt-cell--d30:hover {
    background: #A7F3D0;
}

.tt-cell--d60 {
    background: #E0F2FE;
    border-color: #7DD3FC;
    color: #0369A1;
}

.tt-cell--d60:hover {
    background: #BAE6FD;
}

.tt-cell-id {
    display: block;
    font-weight: 800;
    font-size: 12px;
}

.tt-cell-name {
    display: block;
    font-size: 10px;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 2px;
}

[data-theme="dark"] .tt-cell--free {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .tt-cell--lead {
    background: #0F1117;
    color: #F3F4F6;
}

[data-theme="dark"] .tt-cell--d15 {
    background: rgba(245, 158, 11, 0.2);
    color: #FDE68A;
}

[data-theme="dark"] .tt-cell--d30 {
    background: rgba(16, 185, 129, 0.18);
    color: #A7F3D0;
}

[data-theme="dark"] .tt-cell--d60 {
    background: rgba(56, 189, 248, 0.18);
    color: #BAE6FD;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand);
}

/* Attendance */
.attendance-table {
    font-size: 12px;
}

.attendance-table th,
.attendance-table td {
    padding: 6px 4px;
    text-align: center;
    min-width: 28px;
}

.attendance-table .sticky-col {
    position: sticky;
    left: 0;
    background: #F8FAFC;
    z-index: 2;
    min-width: 40px;
}

.attendance-table .sticky-col-2 {
    position: sticky;
    left: 40px;
    background: #F8FAFC;
    z-index: 2;
    min-width: 120px;
    text-align: left;
}

.att-day {
    font-size: 11px;
    min-width: 28px !important;
}

.att-cell {
    padding: 2px !important;
}

.att-present {
    background: var(--success-bg) !important;
}

.att-check {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--brand);
}

.salary-total {
    margin-top: 20px;
    padding: 18px 22px;
    background: var(--brand-light);
    border-radius: var(--radius-sm);
    font-size: 17px;
    color: var(--brand);
    font-weight: 700;
}

.info-banner {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.info-banner-blue {
    background: #F1F5FC;
    border-color: #CBDCF3;
    color: #16305F;
}

.info-banner-purple {
    background: var(--brand-light);
    border-color: #A8C2EA;
    color: #16305F;
}

.kpi-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    background: #F8FAFC;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.kpi-breakdown {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.kpi-breakdown-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.kpi-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
}

.kpi-breakdown-row:last-child {
    border-bottom: none;
}

.kpi-stat {
    text-align: center;
}

.kpi-stat .kpi-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--brand);
}

.kpi-stat .kpi-lbl {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.attendance-table th.lesson-day-col {
    background: #E7EEF9 !important;
    color: var(--brand);
    font-weight: 700;
}

.attendance-table td.lesson-day-col {
    background: #FAF5FF;
}

.attendance-table td.lesson-day-col.att-present {
    background: #D1FAE5 !important;
}

.kpi-progress-wrap {
    margin: 16px 0;
    background: #F4F7FB;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
}

.kpi-progress-bar {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: 10px;
    transition: width 0.3s;
}

.badge-probniy {
    background: #DBEAFE;
    color: #16305F;
}

/* Fan filtri (Ingliz / Rus) */
.subject-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 24px 0;
}

.subject-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.subject-flag {
    width: 22px;
    height: 15px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.subject-tab:hover {
    border-color: var(--brand);
    color: var(--text);
}

.subject-tab.active {
    background: var(--brand-light);
    border-color: var(--brand);
    color: var(--brand);
}

[data-theme="dark"] .subject-tab {
    background: #111827;
}

[data-theme="dark"] .subject-tab.active {
    background: var(--brand-light);
}

/* HR Bo'limi — pozitsiya (rol) filtri: tugmalar kontentiga mos, ixcham holda */
.role-filters {
    gap: 6px;
    flex-wrap: wrap;
}

.role-filters .subject-tab {
    flex: 0 0 auto;
    padding: 7px 14px;
    font-size: 13px;
}

/* Sotuv bo'limi — gorizontal navigatsiya */
.section-nav {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 0 8px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.section-nav::-webkit-scrollbar {
    display: none;
}

.section-nav-item {
    flex-shrink: 0;
    padding: 12px 14px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.section-nav-item:hover {
    color: var(--text);
}

.section-nav-item.active {
    color: var(--brand);
    font-weight: 600;
    border-bottom-color: var(--brand);
}

[data-theme="dark"] .section-nav-item.active {
    color: #A8C2EA;
}

@media (max-width: 600px) {
    .section-nav {
        padding: 0 4px;
        border-radius: var(--radius-sm);
    }

    .section-nav-item {
        padding: 14px 12px;
        font-size: 13px;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(22, 35, 59, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    /* 9-vazifa qayta ish 2: .sdp-panel (o'quvchi tafsilotlari to'liq
       ekran paneli) z-index: 1101 bo'lgani uchun, undan ochiladigan
       "Ustoz almashtirish"/"Jadval o'zgartirish" kabi modallar (bu
       overlay orqali) uning ORQASIDA qolib ketardi. Modal har doim eng
       tepada bo'lishi kerak — shuning uchun 1101'dan yuqori qo'yildi. */
    z-index: 1150;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 24px 48px rgba(22, 35, 59, 0.2);
    max-height: calc(100dvh - 48px);
    display: flex;
    flex-direction: column;
}

.modal--wide {
    max-width: 620px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    background: #F1F5F9;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* Mobile sidebar controls — desktopda yashirin */
.sidebar-backdrop,
.sidebar-toggle,
.sidebar-close {
    display: none;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .right-panel {
        display: none;
    }

    .course-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(22, 35, 59, 0.45);
        z-index: 300;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.25s ease, visibility 0.25s ease;
    }

    .sidebar-backdrop.visible {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-toggle,
    .sidebar-close {
        display: flex;
        flex-shrink: 0;
    }

    body.sidebar-open {
        overflow: hidden;
        touch-action: none;
    }

    .app-shell {
        flex-direction: column;
        padding: 8px;
        gap: 8px;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(300px, 88vw);
        min-width: unset;
        height: 100vh;
        height: 100dvh;
        z-index: 400;
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        padding: 20px 16px;
        transform: translateX(-105%);
        transition: transform 0.28s ease;
        box-shadow: 0 8px 40px rgba(22, 35, 59, 0.18);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-brand {
        position: relative;
        margin-bottom: 24px;
        padding: 4px 40px 0 0;
    }

    .sidebar-close {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
    }

    .sidebar-menu {
        display: block;
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        padding-right: 4px;
    }

    .menu-item span.label {
        display: inline;
    }

    .menu-group {
        width: 100%;
    }

    .main-area {
        width: 100%;
        min-width: 0;
        height: calc(100dvh - 16px);
    }

    .content-layout {
        gap: 10px;
        min-height: 0;
    }

    .tab-content.active {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding-bottom: 8px;
    }

    .page-title-bar {
        margin-bottom: 14px;
    }

    .top-header {
        padding: 12px 14px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .search-box {
        flex: 1;
        min-width: 0;
        max-width: none;
    }

    .search-box input {
        padding: 10px 12px 10px 40px;
        font-size: 13px;
    }

    .header-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .grid-2,
    .grid-3,
    .course-cards {
        grid-template-columns: 1fr;
    }

    .welcome-banner-inner {
        flex-direction: column;
        text-align: center;
    }

    .banner-emoji {
        font-size: 48px;
        margin-top: 16px;
    }

    .notif-panel {
        width: calc(100vw - 32px);
        right: -8px;
    }

    .page-title-bar h1 {
        font-size: 20px;
        line-height: 1.3;
        word-break: break-word;
    }

    .page-title-bar p {
        font-size: 12px;
        line-height: 1.5;
        word-break: break-word;
    }

    .card {
        padding: 18px 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .toolbar {
        width: 100%;
    }

    .form-control-sm {
        min-width: 0;
    }

    .subject-tabs {
        flex-wrap: wrap;
    }

    .section-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .info-banner {
        font-size: 13px;
        line-height: 1.5;
    }
}

@media (max-width: 480px) {
    .app-shell {
        padding: 6px;
        gap: 6px;
    }

    .top-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .live-badge {
        display: none;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 12px;
        border-radius: 12px;
    }

    .page-title-bar h1 {
        font-size: 18px;
    }

    .card {
        padding: 14px 12px;
        border-radius: var(--radius-sm);
    }

    .card-header h3 {
        font-size: 15px;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar .form-control-sm,
    .toolbar .btn-primary-sm,
    .toolbar select,
    .toolbar input {
        width: 100%;
    }

    .subject-tab {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    .welcome-banner {
        padding: 20px 16px;
    }

    .welcome-text h2 {
        font-size: 20px;
    }

    .stat-card {
        padding: 14px;
    }

    .modal {
        width: calc(100vw - 24px);
        margin: 12px;
        max-height: calc(100dvh - 24px);
    }

    .modal--wide {
        max-width: calc(100vw - 24px);
    }

    .modal-footer {
        flex-shrink: 0;
        flex-wrap: wrap;
    }
}

/* ========== NOTIFICATIONS ========== */
.notif-wrap {
    position: relative;
}

#notifToggle {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

.notif-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    max-height: 420px;
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(22, 35, 59, 0.18);
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
    overflow: hidden;
}

.notif-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.notif-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.notif-panel-header h4 {
    font-size: 15px;
    font-weight: 700;
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--brand);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.notif-mark-all:hover {
    text-decoration: underline;
}

.notif-list {
    max-height: 340px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    transition: background 0.15s;
}

.notif-item:hover {
    background: var(--bg);
}

.notif-item.read {
    opacity: 0.65;
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.notif-warning .notif-icon,
.notif-icon.notif-warning {
    background: var(--warning-bg);
}

.notif-info .notif-icon,
.notif-icon.notif-info {
    background: var(--blue-light);
}

.notif-success .notif-icon,
.notif-icon.notif-success {
    background: var(--success-bg);
}

.notif-content strong {
    display: block;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 2px;
}

.notif-content p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 4px;
}

.notif-time {
    font-size: 11px;
    color: var(--text-light);
}

.notif-dot {
    width: 8px;
    height: 8px;
    background: var(--brand);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.notif-empty {
    padding: 32px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.icon-btn.theme-active {
    background: var(--brand-light);
}

.icon-btn.theme-active svg {
    stroke: var(--brand);
}

.auth-theme-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

/* ========== DARK THEME ========== */
[data-theme="dark"] {
    --bg: #16233B;
    --surface: #151B26;
    --text: #F4F7FB;
    --text-muted: #9CA3B8;
    --text-light: #6B7289;
    --border: #232B39;
    --brand-light: #16294A;
    --blue-light: #1E2A45;
    /* Yorug rejimda oq bo'lgan sirtlar — qorong'ida ham to'g'ri ko'rinsin */
    --card-bg: #151B26;
    --bg-secondary: #1B2330;
    --hover-bg: #1B2330;
    --bg-hover: #1B2330;
    --text-primary: #F4F7FB;
    --primary-light: #16294A;
    --success-bg: #134E3A;
    --danger-bg: #4C1D1D;
    --warning-bg: #4A3F0A;
    --pink-bg: #4A1D35;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Qorong'i rejimda logotip matni oq variantga almashadi */
[data-theme="dark"] .brand-logo,
[data-theme="dark"] .auth-logo-img {
    content: url("../images/mavr-logo-dark.png");
}

[data-theme="dark"] body {
    background: var(--bg);
    color: var(--text);
}

[data-theme="dark"] .auth-body::before {
    background: radial-gradient(circle, rgba(39, 81, 159, 0.08) 0%, transparent 70%);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-control-sm {
    background: #111827;
    border-color: var(--border);
    color: var(--text);
}

[data-theme="dark"] .search-box input {
    background: #111827;
    color: var(--text);
}

[data-theme="dark"] .icon-btn {
    background: #111827;
}

[data-theme="dark"] .icon-btn:hover {
    background: var(--brand-light);
}

[data-theme="dark"] .table th {
    background: #111827;
}

[data-theme="dark"] .table tbody tr:hover {
    background: #111827;
}

[data-theme="dark"] .mini-card,
[data-theme="dark"] .kpi-summary {
    background: #111827;
    border-color: var(--border);
}

[data-theme="dark"] .attendance-table .sticky-col,
[data-theme="dark"] .attendance-table .sticky-col-2 {
    background: #111827;
}

[data-theme="dark"] .timetable-table .tt-time {
    background: #111827;
}

[data-theme="dark"] .tt-row:nth-child(even) {
    background: #1a1d2a;
}

[data-theme="dark"] .info-banner {
    background: #1a2e1f;
    border-color: #2d5a3d;
    color: #86efac;
}

[data-theme="dark"] .info-banner-blue {
    background: #1a2540;
    border-color: #2d4a7a;
    color: #A8C2EA;
}

[data-theme="dark"] .info-banner-purple {
    background: #16294A;
    border-color: #334A6B;
    color: #A8C2EA;
}

[data-theme="dark"] .welcome-banner::after {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .user-avatar {
    border-color: var(--surface);
}

[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .notif-panel {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .schedule-event.yellow {
    background: #4a3f0a;
    color: #fde68a;
}

[data-theme="dark"] .schedule-event.blue {
    background: #1e3a5f;
    color: #A8C2EA;
}

[data-theme="dark"] .schedule-event.green {
    background: #134e3a;
    color: #6ee7b7;
}

[data-theme="dark"] .schedule-event.pink {
    background: #4a1d35;
    color: #f9a8d4;
}

[data-theme="dark"] .progress-bar-wrap,
[data-theme="dark"] .hw-seg,
[data-theme="dark"] .kpi-progress-wrap {
    background: #111827;
}

[data-theme="dark"] .attendance-table th.lesson-day-col {
    background: #16294A !important;
}

[data-theme="dark"] .attendance-table td.lesson-day-col {
    background: #151B26;
}

[data-theme="dark"] .att-present,
[data-theme="dark"] .attendance-table td.lesson-day-col.att-present {
    background: #134e3a !important;
}

.save-error-toast {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #fee2e2;
    color: #991b1b;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-width: 360px;
}

.lead-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.lead-badge-domwork {
    background: #E7EEF9;
    color: #16305F;
}

.lead-badge-homework {
    background: #dbeafe;
    color: #1D3E7D;
}

[data-theme="dark"] .lead-badge-domwork {
    background: #16294A;
    color: #CBDCF3;
}

[data-theme="dark"] .lead-badge-homework {
    background: #1e3a5f;
    color: #CBDCF3;
}

/* Lidlar — Kanban */
.sales-header-lang .leads-lang-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 0;
}

.sales-header-lang .subject-tab {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 0;
}

.leads-lang-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
}

.leads-lang-tabs .subject-tab {
    flex: 0 1 auto;
    min-width: 140px;
}

.lead-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    /* 2-vazifa: kartochkalar ustun ichida pastga scroll qilinganda ham
       ustun sarlavhasi (nomi/soni) doim tepada ko'rinib tursin — desktopda
       ham (mobil uchun bu allaqachon 4778-qatorda bor edi). */
    position: sticky;
    top: 0;
    z-index: 2;
}

.lead-column-title {
    font-size: 13px;
    font-weight: 800;
    flex: 1;
    line-height: 1.35;
}

.lead-column-count {
    font-size: 12px;
    font-weight: 700;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #fff;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lead-column-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lead-column-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 28px 12px;
    border: 1.5px dashed rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.65);
}

.leads-kanban-empty {
    width: 100%;
    margin: 24px auto;
    max-width: 420px;
}

.lead-card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 14px;
    box-shadow: 0 2px 14px rgba(22, 35, 59, 0.07);
    border: 1px solid var(--border);
    transition: transform 0.15s, box-shadow 0.15s;
}

.lead-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(22, 35, 59, 0.1);
}

.lead-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.lead-bulk-checkbox {
    margin-top: 4px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.lead-card-title-wrap {
    flex: 1;
    min-width: 0;
}

.lead-card-top-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    margin-left: auto;
}

.lead-card-notify,
.lead-card-menu-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--text-light);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
}

.lead-card-notify {
    position: relative;
}

.lead-card-notify-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface, #fff);
    border-radius: 999px;
    background: #EF4444;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    z-index: 1;
}

.lead-card-notify.is-ringing {
    animation: lead-card-bell-nudge 7s ease-in-out infinite;
    transform-origin: 50% 12%;
}

@keyframes lead-card-bell-nudge {
    0%, 84%, 100% { transform: rotate(0); }
    86% { transform: rotate(12deg); }
    88% { transform: rotate(-12deg); }
    90% { transform: rotate(9deg); }
    92% { transform: rotate(-9deg); }
    94% { transform: rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
    .lead-card-notify.is-ringing { animation: none; }
}

.lead-card-notify svg,
.lead-card-menu-btn svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.lead-card-menu-btn svg {
    fill: currentColor;
    stroke: none;
}

.lead-card-notify:hover,
.lead-card-menu-btn:hover {
    background: #F1F5F9;
    color: var(--text-muted);
}

.lead-card-menu-wrap {
    position: relative;
}

.lead-card-menu-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 168px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 28px rgba(22, 35, 59, 0.14);
    padding: 6px;
    z-index: 20;
}

.lead-card-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 370;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
}

.lead-card-menu-item:hover {
    background: #F1F5F9;
}

.lead-card-menu-item--danger {
    color: var(--danger);
}

.lead-card-menu-item--danger:hover {
    background: var(--danger-bg);
}

/* Lead card submenu (Boshqa bosqichga o'tkazish) */
.lead-card-menu-submenu-wrap {
    position: relative;
}
.lead-card-menu-item--submenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.lead-card-menu-item--submenu svg {
    flex-shrink: 0;
    stroke: currentColor;
}
.lead-card-menu-submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 210px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.13);
    z-index: 1100;
    padding: 4px 0;
    max-height: 320px;
    overflow-y: auto;
}
@media (max-width: 600px) {
    .lead-card-menu-submenu {
        left: 0;
        top: 100%;
    }
}

.lead-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 2px;
    word-break: break-word;
}

.lead-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lead-card-time {
    font-size: 12px;
    color: var(--text-muted);
}

.lead-card-serial {
    font-size: 12px;
    font-weight: 600;
    color: #B45309;
    letter-spacing: 0.02em;
}

.lead-card-contacts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.lead-card-contact {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    min-width: 0;
}

.lead-card-contact svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    flex-shrink: 0;
}

.lead-card-contact span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.lead-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lead-card-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: none;
    background: #F1F5F9;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.lead-card-action:hover {
    background: var(--brand-light);
    color: var(--brand);
}

.lead-card-action--active {
    color: var(--brand);
}

.lead-card-action--mgr {
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg);
    border: 2px solid var(--border);
    flex-shrink: 0;
}

.lead-card-action--mgr.lead-card-action--active {
    border-color: var(--brand);
}

.lead-mgr-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
}

.lead-mgr-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: inherit;
    display: block;
}

.lead-mgr-avatar-initials {
    font-size: 10px;
    font-weight: 700;
    color: var(--brand);
    line-height: 1;
}

.lead-mgr-avatar svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.lead-card-action svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    flex-shrink: 0;
}

.lead-card-action--rec {
    color: #1D3E7D;
    background: #F2F7FF;
}
.lead-card-action--rec:hover {
    background: #E7EEF9;
    color: #27519F;
}

/* 4-ish: Zapis modal */
.lead-recording-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 0 8px;
    color: var(--text-muted);
}
.lead-recording-notice svg {
    stroke: #1D3E7D;
}
.lead-recording-notice-text {
    font-size: 15px;
    font-weight: 600;
    color: #27519F;
    margin: 0;
}

/* SMS matniga qo'shiladigan o'rin egallovchi tugmachalari */
.sms-placeholder-chip {
    padding: 4px 10px;
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #27519F;
    background: rgba(39, 81, 159, .08);
    border: 1px solid rgba(39, 81, 159, .25);
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.sms-placeholder-chip:hover {
    background: rgba(39, 81, 159, .16);
    border-color: rgba(39, 81, 159, .45);
}

/* Zapis ro'yxatidagi o'chirish tugmasi — odatda so'nik, ustiga borilganda
   qizarib, tasodifan bosilishi ehtimoli kamayadi. */
.lead-recording-delete {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s, background .15s, border-color .15s;
}
.lead-recording-delete:hover:not(:disabled) {
    color: #dc2626;
    background: rgba(220, 38, 38, .09);
    border-color: rgba(220, 38, 38, .28);
}
.lead-recording-delete:disabled {
    opacity: .45;
    cursor: default;
}

.lead-card--dragging {
    opacity: 0.55;
}

.lead-column-cards.drag-over {
    outline: 2px dashed var(--brand);
    outline-offset: 4px;
    border-radius: var(--radius-sm);
}

.lead-card-kind {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.lead-comments-list,
.lead-attach-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-manager-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.lead-manager-preview-img {
    width: 100%;
    max-width: 280px;
    max-height: 280px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

[data-theme="dark"] .lead-card-menu-dropdown {
    background: var(--surface);
}

[data-theme="dark"] .leads-filter-box,
[data-theme="dark"] .leads-filter-trigger,
[data-theme="dark"] .leads-columns-dropdown {
    background: var(--surface);
}

[data-theme="dark"] .leads-filter-box--select {
    background-color: var(--surface);
}

[data-theme="dark"] .leads-column-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .lead-card-notify:hover,
[data-theme="dark"] .lead-card-menu-btn:hover,
[data-theme="dark"] .lead-card-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.lead-comment-item {
    background: #F1F5F9;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid transparent;
}

.lead-comment-item--contact-fail {
    background: #F2F7FF;
    border-color: rgba(39, 81, 159, 0.18);
}

.lead-comment-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
}

.lead-comment-meta-main {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.lead-comment-meta strong {
    color: var(--text);
    font-size: 13px;
}

.lead-comment-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(39, 81, 159, 0.12);
    color: #16305F;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.lead-comment-time {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.lead-comment-text {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    margin: 0;
    word-break: break-word;
}

.lead-comment-item p {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text);
    margin: 0;
}

.lead-attach-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: #F1F5F9;
    border-radius: var(--radius-sm);
}

.lead-attach-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lead-attach-info strong {
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-attach-info span {
    font-size: 12px;
    color: var(--text-muted);
}

.lead-attach-btns {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lead-attach-dl {
    text-decoration: none;
    font-size: 12px;
    padding: 6px 12px;
}

.lead-empty-hint {
    font-size: 13px;
    text-align: center;
    padding: 12px 0;
}

.lead-reason-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.failed-sale-group {
    margin-bottom: 16px;
}
.failed-sale-group:last-child {
    margin-bottom: 0;
}
.failed-sale-group-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.lead-reason-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lead-reason-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #F1F5F9;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}

.lead-reason-option:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.lead-reason-option:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-light);
    box-shadow: 0 0 0 1px rgba(39, 81, 159, 0.2);
}

.lead-reason-option input {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--brand);
}

.lead-reason-option input[type="radio"] {
    border-radius: 50%;
}

.lead-reason-option span {
    line-height: 1.4;
}

.lead-survey-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Bog'lanildi anketa */
.lead-survey {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: min(68vh, 560px);
    overflow-y: auto;
    padding-right: 4px;
}

.lead-survey-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lead-survey-section[hidden] {
    display: none !important;
}

.lead-survey-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.lead-survey-sub {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.lead-survey-options--compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lead-survey-carousel-block {
    margin-top: 4px;
}

.lead-age-slider {
    padding: 4px 2px 0;
}

.lead-age-slider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.lead-age-slider-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.lead-age-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand);
    min-width: 32px;
    text-align: right;
}

.lead-age-range {
    width: 100%;
    height: 6px;
    appearance: none;
    border-radius: 999px;
    background: linear-gradient(90deg,
            var(--brand) 0%,
            var(--brand) var(--age-pct, 30%),
            #E8E4F8 var(--age-pct, 30%),
            #E8E4F8 100%);
    outline: none;
    cursor: pointer;
}

.lead-age-range::-webkit-slider-thumb {
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand-gradient);
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(39, 81, 159, 0.45);
    cursor: grab;
}

.lead-age-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--brand);
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(39, 81, 159, 0.45);
    cursor: grab;
}

.lead-age-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.lead-carousel {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
}

.lead-carousel-viewport {
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.lead-carousel-viewport::-webkit-scrollbar {
    display: none;
}

.lead-carousel-track {
    display: flex;
    gap: 10px;
    padding: 4px 2px 8px;
}

.lead-carousel-item {
    position: relative;
    flex: 0 0 auto;
    min-width: 132px;
    max-width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #F1F5F9;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.lead-carousel-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lead-carousel-item span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.lead-carousel-item:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.lead-carousel-item.is-selected,
.lead-carousel-item:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-light);
    box-shadow: 0 0 0 1px rgba(39, 81, 159, 0.2);
}

.lead-carousel-nav {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    color: var(--brand);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lead-carousel-nav:hover {
    background: var(--brand-light);
    border-color: var(--brand);
}

.lead-comment-item--survey {
    background: #ECFEFF;
    border-color: rgba(6, 182, 212, 0.2);
}

.lead-comment-badge--survey {
    background: rgba(6, 182, 212, 0.14);
    color: #0E7490;
}

.lead-comment-item--info {
    background: #F1F5FC;
    border-color: rgba(79, 70, 229, 0.2);
}

.lead-comment-badge--info {
    background: rgba(79, 70, 229, 0.14);
    color: #3730A3;
}

.lead-comment-item--decision {
    background: #FFF7ED;
    border-color: rgba(234, 88, 12, 0.2);
}

.lead-comment-badge--decision {
    background: rgba(234, 88, 12, 0.14);
    color: #C2410C;
}

.lead-comment-item--payment {
    background: #FFFBEB;
    border-color: rgba(217, 119, 6, 0.2);
}

.lead-comment-badge--payment {
    background: rgba(217, 119, 6, 0.14);
    color: #B45309;
}

.lead-comment-item--onboard {
    background: #F0FDF4;
    border-color: rgba(22, 163, 74, 0.2);
}

.lead-comment-item--reminder {
    background: #FEF2F2;
    border-color: rgba(220, 38, 38, 0.32);
}

.lead-comment-badge--reminder {
    background: rgba(220, 38, 38, 0.12);
    color: #B91C1C;
}

.lead-comment-badge--onboard {
    background: rgba(22, 163, 74, 0.14);
    color: #166534;
}

.lead-survey--onboard {
    gap: 16px;
}

.lead-survey-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lead-survey-field label,
.lead-survey-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.lead-contract-number-block {
    margin-top: 4px;
}

.lead-payment-debt {
    display: block;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: #FFF7ED;
    border: 1px solid rgba(217, 119, 6, 0.25);
    font-size: 16px;
    font-weight: 700;
    color: #B45309;
}

.lead-survey-hint {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.lead-survey-options--levels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lead-survey--onboard .form-control,
.lead-survey--onboard .form-select {
    padding: 12px 14px;
    font-size: 14px;
}

.lead-survey--onboard input[type="date"].form-control {
    min-height: 44px;
}

.onboard-schedule-picker {
    overflow-x: auto;
    margin-top: 4px;
}

.onboard-schedule-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.onboard-schedule-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.onboard-schedule-legend-item::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.onboard-schedule-legend-item--free::before {
    background: #ECFDF5;
    border-color: #6EE7B7;
}

.onboard-schedule-legend-item--busy::before {
    background: #FEF2F2;
    border-color: #FCA5A5;
}

.onboard-schedule-legend-item--picked::before {
    background: #F1F5FC;
    border-color: #818CF8;
}

.onboard-schedule-grid {
    display: grid;
    grid-template-columns: 52px repeat(var(--osd-cols, 3), minmax(72px, 1fr));
    gap: 4px;
    min-width: 280px;
    font-size: 11px;
}

.onboard-schedule-corner {
    min-height: 1px;
}

.onboard-schedule-day {
    text-align: center;
    font-weight: 700;
    color: var(--brand);
    padding: 6px 4px;
    background: #F8FAFC;
    border-radius: 8px;
}

.onboard-schedule-time {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 6px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.onboard-schedule-cell {
    min-height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 10px;
    border: 1px solid transparent;
    user-select: none;
}

.onboard-schedule-cell--free {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #047857;
    cursor: pointer;
}

.onboard-schedule-cell--free:hover {
    background: #D1FAE5;
    border-color: #34D399;
}

.onboard-schedule-cell--busy {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #B91C1C;
    cursor: not-allowed;
}

.onboard-schedule-cell--picked {
    background: #F1F5FC;
    border-color: #818CF8;
    color: #3730A3;
    cursor: pointer;
    box-shadow: 0 0 0 2px rgba(39, 81, 159, 0.2);
}

.onboard-schedule-selected {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
}

.lead-survey--info {
    gap: 14px;
}

.lead-info-question {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.lead-info-question--invalid {
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}

.lead-info-question-error,
.lead-info-validation-summary {
    margin: 0;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.lead-info-validation-summary {
    padding: 10px 12px;
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}

.lead-validation-target--invalid {
    border: 1px solid var(--danger) !important;
    border-radius: var(--radius-sm);
    padding: 12px;
    background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}

.lead-modal-validation-summary {
    margin: 10px 0 0;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.lead-info-question:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.lead-info-question--invalid:last-child {
    border-bottom: 1px solid var(--danger);
}

.lead-info-question-text {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
}

.lead-info-yesno {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.lead-reason-option--inline {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px 12px;
}

.lead-comment-text {
    white-space: pre-line;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

[data-theme="dark"] .lead-card {
    background: var(--surface);
}

@media (max-width: 900px) {
    .main-area {
        height: calc(100dvh - 16px);
        min-height: 0;
        overflow: hidden;
    }

    #tab-sales.tab-content.active {
        overflow: hidden;
    }

    .sales-body {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .sales-panel[data-sales-panel="leads"].active {
        min-height: 0;
    }

    .leads-kanban {
        overflow-x: auto;
        /* Ustunlar yonlama scroll qilinadi. Vertikal scroll har bir ustunning
           o'zida bo'ladi — shunda uning sarlavhasi kartochkalardan mustaqil
           ravishda qotib turadi. */
        overflow-y: hidden;
        flex: 1 1 0;
        min-height: 0;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        /* 4-vazifa (46-vazifa'ni qayta ko'rib chiqish): avval bu yerda faqat
           "pan-x" bor edi, .lead-column'da esa faqat "pan-y" — ya'ni ustun
           ustida boshlangan teginish harakati uchun ikkalasining kesishmasi
           BO'SH bo'lib qolar edi (birontasi ham ishlamaydi), chunki ustun
           ekranning deyarli butun kengligini egallaydi (86vw) va gorizontal
           surish deyarli har doim ustun ustidan boshlanadi. Natijada
           ustundan-ustunga surib o'tish deyarli imkonsiz bo'lib qoldi. Endi
           ikkalasida ham "pan-x pan-y" — brauzerning o'zi tegishli teginish
           harakati yo'nalishiga qarab qaysi konteyner (gorizontal qatormi,
           vertikal ustunmi) scroll qilishini tabiiy tanlaydi.
        */
        touch-action: pan-x pan-y;
        gap: 12px;
        padding-bottom: 16px;
    }

    .sales-header-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: 8px;
    }

    .sales-header-nav,
    .sales-header-lang,
    .leads-filters-bar,
    .leads-add-btn {
        grid-column: 1;
        justify-self: stretch;
    }

    .sales-header-nav {
        grid-row: 1;
    }

    .sales-header-lang {
        grid-row: 2;
    }

    .leads-filters-bar {
        grid-row: 3;
    }

    .leads-add-btn {
        grid-row: 4;
    }

    .sales-header-lang .leads-lang-tabs {
        width: 100%;
    }

    .sales-header-lang .subject-tab {
        flex: 1;
        min-width: 0;
        padding: 10px 8px;
        font-size: 12px;
    }

    .leads-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .leads-filter-box,
    .leads-columns-filter-wrap {
        max-width: none;
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }

    .leads-columns-dropdown {
        left: 0;
        right: 0;
        min-width: 0;
        max-height: min(50vh, 320px);
    }

    .leads-add-btn {
        width: 100%;
        justify-content: center;
    }

    .leads-lang-tabs {
        flex-wrap: wrap;
    }

    .leads-lang-tabs .subject-tab {
        flex: 1;
        min-width: 0;
    }

    .lead-column {
        flex: 0 0 min(280px, 86vw);
        min-width: min(260px, 84vw);
        height: 100%;
        min-height: 0;
        align-self: stretch;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        /* 4-vazifa: yuqoridagi .leads-kanban'dagi izohga qarang — endi
           ikkalasida ham "pan-x pan-y", brauzer teginish yo'nalishiga qarab
           to'g'ri konteynerni tanlaydi. */
        touch-action: pan-x pan-y;
        scroll-snap-align: start;
    }

    /* 51/68-vazifa: kartochkalar ustun ichida pastga scroll qilinsa ham
       sarlavha o'sha ustunning yuqorisida qoladi. */
    .sales-panel[data-sales-panel="leads"] .lead-column-header {
        position: sticky;
        top: 0;
        z-index: 4;
        box-shadow: 0 7px 12px -12px rgba(15, 23, 42, 0.7);
    }

    .table {
        font-size: 13px;
    }

    .table th,
    .table td {
        padding: 10px 8px;
    }

    .attendance-table {
        font-size: 11px;
    }

    .attendance-table .sticky-col-2 {
        min-width: 96px;
        max-width: 110px;
        font-size: 11px;
    }

    .timetable-table {
        font-size: 12px;
    }

    .placeholder-card {
        padding: 28px 20px;
    }
}

/* Kichik telefonlar — modallar, anketalar, header */
@media (max-width: 600px) {
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: min(92dvh, 720px);
    }

    .modal--wide {
        max-width: 100%;
    }

    .modal-header {
        padding: 18px 16px;
    }

    .modal-header h3 {
        font-size: 16px;
        line-height: 1.35;
        padding-right: 8px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 0 16px max(16px, env(safe-area-inset-bottom));
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .modal-footer .btn-primary-sm,
    .modal-footer .btn-danger-sm {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        min-height: 44px;
    }

    .lead-survey {
        max-height: none;
        gap: 14px;
    }

    .lead-survey-options--compact {
        grid-template-columns: 1fr;
    }

    .lead-carousel {
        grid-template-columns: 36px 1fr 36px;
        gap: 6px;
    }

    .lead-carousel-nav {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .lead-carousel-item {
        min-width: 118px;
        max-width: 150px;
        padding: 10px 12px;
    }

    .lead-carousel-item span {
        font-size: 12px;
    }

    .lead-age-range::-webkit-slider-thumb {
        width: 26px;
        height: 26px;
    }

    .lead-reason-option {
        padding: 12px;
        min-height: 44px;
        align-items: center;
    }

    .lead-survey-options--levels {
        grid-template-columns: 1fr;
    }

    .section-nav-item {
        padding: 12px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .app-shell {
        padding: max(6px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom));
    }

    .main-area {
        height: calc(100dvh - 12px);
    }

    .search-box input {
        font-size: 16px;
    }

    .lead-column {
        flex: 0 0 88vw;
        min-width: 84vw;
    }

    .lead-card {
        padding: 12px;
    }

    .lead-card-name {
        font-size: 13px;
    }

    .auth-container {
        padding: 32px 20px;
        border-radius: var(--radius);
    }

    .auth-logo-img {
        height: 64px;
    }

    .notif-panel {
        width: calc(100vw - 20px);
        right: -4px;
        max-height: min(70dvh, 480px);
    }

    .grid-3 {
        gap: 10px;
    }

    .stat-value {
        font-size: 22px;
    }
}

@media (max-width: 380px) {
    .live-badge {
        display: none;
    }

    .search-box {
        min-width: 0;
        flex: 1;
    }

    .header-actions {
        gap: 6px;
    }

    .sales-header-nav .section-nav-item {
        padding: 10px 8px;
        font-size: 11px;
    }

    .subject-tab .subject-flag,
    .menu-flag {
        width: 16px;
        height: 16px;
    }
}

body.modal-open {
    overflow: hidden;
    touch-action: none;
}

/* ========== PROFILE PAGE ========== */
.profile-page {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-bottom: 24px;
}

.profile-page-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.profile-nav {
    flex-shrink: 0;
    width: 220px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
}

.profile-nav-group {
    margin-bottom: 16px;
}

.profile-nav-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-light);
    padding: 0 10px 8px;
}

.profile-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.profile-nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.profile-nav-item:hover {
    background: #F1F5F9;
    color: var(--text);
}

.profile-nav-item.active {
    background: var(--brand-light);
    color: var(--brand);
    font-weight: 600;
}

.profile-nav-danger {
    color: var(--danger);
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
    border-radius: 0;
}

.profile-nav-danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.profile-body {
    flex: 1;
    min-width: 0;
}

.profile-header-bar {
    margin-bottom: 20px;
}

.profile-header-bar h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.profile-header-bar p {
    font-size: 14px;
    color: var(--text-muted);
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

.profile-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.profile-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.profile-card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.profile-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.profile-edit-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
}

.profile-edit-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 800;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(39, 81, 159, 0.25);
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-actions h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.profile-avatar-actions p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    max-width: 260px;
    line-height: 1.5;
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.profile-info-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-info-item span {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.profile-info-item .role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    background: var(--brand-light);
    color: var(--brand);
}

.profile-field-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.profile-field-form .form-control {
    flex: 1;
    min-width: 200px;
}

.profile-field-form textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.profile-save-row {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.profile-info-item--full {
    grid-column: 1 / -1;
}

.profile-docs-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #7a5c00;
}

[data-theme="dark"] .profile-docs-banner {
    background: #2a2400;
    border-color: #6b5200;
    color: #ffe082;
}

.profile-docs-banner svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
}

.profile-docs-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    background: var(--surface);
    border: 1px solid #ffe082;
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text);
    max-width: 500px;
    width: calc(100vw - 40px);
    animation: toastSlideUp 0.3s ease;
}

@keyframes toastSlideUp {
    from { transform: translateX(-50%) translateY(30px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0);   opacity: 1; }
}

.profile-docs-toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: #f59e0b;
}

.profile-docs-toast span {
    flex: 1;
}

.profile-docs-toast #profileDocsBannerGoBtn {
    padding: 6px 14px;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.profile-docs-toast #profileDocsBannerClose {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 4px;
    line-height: 1;
    font-family: inherit;
}

/* ══════════════════════════════════════════════════
   MENING MAOSHIM — Salary Page
══════════════════════════════════════════════════ */

.sal-page {
    padding: 0;
    max-width: 1200px;
}

.sal-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 28px;
}

.sal-header-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.sal-header-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin: 4px 0 0;
}

.sal-grid {
    display: grid;
    grid-template-columns: 1fr 320px 240px;
    gap: 20px;
    align-items: start;
}

.sal-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Stat cards ── */
.sal-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sal-stat-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}

.sal-stat-card--earn { border-left: 4px solid #27519F; }
.sal-stat-card--total { border-left: 4px solid #10b981; }

.sal-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sal-stat-card--earn .sal-stat-icon { background: #E7EEF9; color: #27519F; }
.sal-stat-card--total .sal-stat-icon { background: #d1fae5; color: #059669; }

[data-theme="dark"] .sal-stat-card--earn .sal-stat-icon { background: rgba(39, 81, 159,.2); }
[data-theme="dark"] .sal-stat-card--total .sal-stat-icon { background: rgba(16,185,129,.15); }

.sal-stat-icon svg { width: 18px; height: 18px; stroke: currentColor; }

.sal-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.sal-stat-value {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
}

/* ── Chart card ── */
.sal-chart-card,
.sal-history-card,
.sal-card-info-card,
.sal-balance-card,
.sal-profile-card,
.sal-notice-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
}

.sal-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.sal-chart-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.sal-chart-period {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.sal-chart {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 100px;
    padding: 0 4px;
}

.sal-chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
    cursor: default;
}

.sal-chart-bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #A8C2EA 0%, #CBDCF3 100%);
    transition: height 0.4s ease;
    min-height: 4px;
}

.sal-chart-bar--current {
    background: linear-gradient(180deg, #27519F 0%, #6E9AE0 100%);
    box-shadow: 0 4px 12px rgba(39, 81, 159,.35);
}

.sal-chart-label {
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ── History ── */
.sal-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sal-history-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.sal-history-row:last-child { border-bottom: none; }

.sal-history-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sal-history-dot--paid { background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.sal-history-dot--pending { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.2); }
.sal-history-dot--cancelled { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.2); }

.sal-history-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sal-history-month {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.sal-history-status {
    font-size: 11px;
    color: var(--text-muted);
}

.sal-history-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

/* ══ PLASTIC CARD ══ */
.sal-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 4px;
}

.sal-card-3d {
    perspective: 1000px;
    cursor: default;
}

.sal-card-inner {
    width: 100%;
    height: 195px;
    border-radius: 20px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.sal-card-3d:hover .sal-card-inner {
    transform: rotateY(8deg) rotateX(4deg);
}

.sal-card-face {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    backface-visibility: hidden;
    overflow: hidden;
}

.sal-card-front {
    background: linear-gradient(135deg, #1D3E7D 0%, #27519F 45%, #16233B 100%);
    box-shadow: 0 20px 60px rgba(39, 81, 159,.45), 0 8px 20px rgba(0,0,0,.2);
    color: #fff;
}

/* Shimmer effect */
.sal-card-shimmer {
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.12) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: cardShimmer 3s ease-in-out infinite;
}

@keyframes cardShimmer {
    0%   { background-position: 200% 0; }
    50%  { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.sal-card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Chip */
.sal-card-chip {
    width: 38px;
    height: 28px;
    background: linear-gradient(135deg, #fde68a 0%, #f59e0b 50%, #fbbf24 100%);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.sal-chip-lines {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom, transparent 30%, rgba(0,0,0,.12) 30%, rgba(0,0,0,.12) 33%, transparent 33%),
        linear-gradient(to right,  transparent 40%, rgba(0,0,0,.12) 40%, rgba(0,0,0,.12) 43%, transparent 43%);
}

.sal-card-wave { width: 36px; opacity: .7; }

.sal-card-number {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: .18em;
    color: rgba(255,255,255,.95);
    text-shadow: 0 1px 3px rgba(0,0,0,.2);
    font-family: 'Courier New', monospace;
}

.sal-card-bottom-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
}

.sal-card-field-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.65);
    margin-bottom: 3px;
}

.sal-card-field-val {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,.95);
    letter-spacing: .04em;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sal-card-logo {
    margin-left: auto;
    width: 44px;
    flex-shrink: 0;
}

/* Card info */
.sal-card-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.sal-card-info-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.sal-card-info-warn {
    font-size: 11px;
    font-weight: 600;
    color: #f59e0b;
    background: #fef3c7;
    padding: 3px 8px;
    border-radius: 8px;
}

[data-theme="dark"] .sal-card-info-warn { background: rgba(245,158,11,.15); }

.sal-card-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.sal-card-info-item label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.sal-card-info-item span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* ── Right col ── */
.sal-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: default;
}

.sal-profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: var(--brand);
    flex-shrink: 0;
}

.sal-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sal-profile-info { flex: 1; }

.sal-profile-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.sal-profile-role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sal-profile-chevron {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.sal-balance-card {
    text-align: center;
    padding: 28px 20px;
    background: linear-gradient(135deg, #F2F7FF 0%, #E7EEF9 100%);
    border: 1px solid #CBDCF3;
}

[data-theme="dark"] .sal-balance-card {
    background: linear-gradient(135deg, rgba(39, 81, 159,.15) 0%, rgba(53, 104, 196,.1) 100%);
    border-color: rgba(39, 81, 159,.25);
}

.sal-balance-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
}

.sal-balance-amount {
    font-size: 20px;
    font-weight: 900;
    color: var(--text);
    line-height: 1.1;
}

.sal-balance-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.sal-notice-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #fff8e1;
    border-color: #ffe082;
}

[data-theme="dark"] .sal-notice-card {
    background: rgba(245,158,11,.08);
    border-color: rgba(245,158,11,.25);
}

.sal-notice-icon {
    width: 36px;
    height: 36px;
    background: #fef3c7;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #d97706;
}

[data-theme="dark"] .sal-notice-icon { background: rgba(245,158,11,.15); }

.sal-notice-icon svg { width: 18px; height: 18px; stroke: currentColor; }

.sal-notice-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.sal-notice-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .sal-grid { grid-template-columns: 1fr 280px; }
    .sal-col--right { display: none; }
}

@media (max-width: 720px) {
    .sal-grid { grid-template-columns: 1fr; }
    .sal-col--mid, .sal-col--right { display: flex; }
    .sal-card-number { font-size: 14px; letter-spacing: .12em; }
}

/* ══════════════════════════════════════════════════
   END SALARY SECTION
══════════════════════════════════════════════════ */

.profile-completion-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 0;
}

.profile-completion-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.profile-ring {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.profile-ring .ring-chart {
    width: 100px;
    height: 100px;
}

.profile-ring .ring-value {
    font-size: 22px;
}

.profile-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-checklist li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.profile-checklist li:last-child {
    border-bottom: none;
}

.profile-check-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
}

.profile-check-icon.done {
    background: var(--success-bg);
    color: var(--success);
}

.profile-check-icon.todo {
    background: #F4F7FB;
    color: var(--text-light);
}

.profile-checklist li.done {
    color: var(--text);
}

.profile-checklist .check-pct {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-light);
}

.profile-checklist li.done .check-pct {
    color: var(--success);
}

.profile-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.profile-toggle-row:last-child {
    border-bottom: none;
}

.profile-toggle-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-toggle-info p {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.profile-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.profile-toggle-slider {
    position: absolute;
    inset: 0;
    background: #E2E4EC;
    border-radius: 24px;
    cursor: pointer;
    transition: 0.2s;
}

.profile-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.profile-toggle input:checked+.profile-toggle-slider {
    background: var(--brand);
}

.profile-toggle input:checked+.profile-toggle-slider::before {
    transform: translateX(20px);
}

.profile-session-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.profile-session-item:last-child {
    border-bottom: none;
}

.profile-session-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--brand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.profile-session-info {
    flex: 1;
}

.profile-session-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.profile-session-info span {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.profile-session-card {
    margin-bottom: 8px;
}

.profile-session-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--success-bg);
    color: var(--success);
}

[data-theme="dark"] .profile-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .profile-check-icon.todo {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .profile-toggle-slider {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 1100px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-completion-card {
        position: static;
    }
}

@media (max-width: 900px) {
    .profile-page-inner {
        flex-direction: column;
    }

    .profile-nav {
        width: 100%;
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 12px;
    }

    .profile-nav-group {
        display: contents;
    }

    .profile-nav-label {
        width: 100%;
        padding-top: 8px;
    }

    .profile-nav-label:first-child {
        padding-top: 0;
    }

    .profile-nav-danger {
        width: 100%;
        border-top: 1px solid var(--border);
        margin-top: 8px;
        padding-top: 12px;
    }

    .profile-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== HR EMPLOYEES ========== */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.employee-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border: 1px solid transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}

.employee-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(39, 81, 159, 0.1);
}

.employee-card-actions {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 50%;
}

.employee-card-actions:hover {
    background: var(--bg);
}

.employee-card-actions svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Employee card dropdown menu */
.emp-menu-wrap {
    position: absolute;
    top: 12px;
    right: 12px;
}

.emp-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(22, 35, 59,.14);
    min-width: 170px;
    z-index: 50;
    padding: 4px 0;
    overflow: hidden;
}

.emp-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    padding: 11px 16px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background .12s;
}

.emp-menu-item:hover { background: var(--bg); }
.emp-menu-item svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; }
.emp-menu-item--danger { color: var(--danger); }
.emp-menu-item--danger:hover { background: var(--danger-bg, #fef2f2); }

.employee-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid var(--brand-light);
    background: var(--bg);
}

.employee-avatar-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 3px solid var(--brand-light);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--brand);
    overflow: hidden;
}

.employee-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.emp-edit-avatar-wrap {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2.5px solid var(--brand-light);
    background: var(--bg);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.emp-edit-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.emp-edit-avatar-initials {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand);
}

.employee-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.employee-role {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.employee-status {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 12px;
    background: var(--success-bg);
    color: var(--success);
    margin-bottom: 20px;
}

.employee-status.inactive {
    background: #F1F5F9;
    color: var(--text-muted);
}

[data-theme="dark"] .employee-status.inactive {
    background: rgba(255, 255, 255, 0.05);
}

.employee-contact {
    width: 100%;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.employee-contact-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}

.employee-contact-item svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

.employee-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.employee-footer-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.employee-footer-label {
    color: var(--text-muted);
}

.employee-footer-value {
    color: var(--text);
    font-weight: 600;
}
/* ── Settings page ─────────────────────────────────────────── */
.settings-page {
    padding: 32px 24px;
    max-width: 560px;
}
.settings-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}
.settings-section-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}
/* Language selector */
.lang-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.lang-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    min-width: 140px;
}
.lang-btn:hover {
    border-color: var(--primary, #27519F);
    background: #F1F5FC;
}
.lang-btn--active {
    border-color: var(--primary, #27519F);
    background: #F1F5FC;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.lang-flag {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}
.lang-name {
    font-size: 14px;
}
.lang-saved-msg {
    font-size: 13px;
    color: var(--success, #16a34a);
    font-weight: 500;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.2s;
    margin: 0;
}
.lang-saved-msg--visible {
    opacity: 1;
}


@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   RESPONSIVE — yangi o'zgarishlar uchun mobil moslash
   ===================================================== */

/* ---------- 900px ---------- */
@media (max-width: 900px) {
    /* Book Roadmap paneli leads paneli kabi scroll qilsin */
    .sales-panel[data-sales-panel="book-roadmap"].active {
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    /* BR kanban ham leads-kanban kabi ishlash uchun */
    .sales-panel[data-sales-panel="book-roadmap"].active .leads-kanban {
        flex: 1 1 0;
        min-height: 0;
    }

    /* Section nav — 7 ta tab bor, kichroq padding */
    .section-nav-item {
        padding: 12px 10px;
        font-size: 13px;
    }

    /* Lead card menu dropdown — karta ichida qolib ketmasin */
    .lead-card-menu-dropdown {
        min-width: 185px;
    }

    /* Card touch targetlari */
    .lead-card-notify,
    .lead-card-menu-btn {
        width: 36px;
        height: 36px;
    }
}

/* ---------- 600px ---------- */
@media (max-width: 600px) {
    /* Section nav — kichikroq */
    .section-nav-item {
        padding: 12px 8px;
        font-size: 12px;
    }

    /* Lead card 3-dot dropdown — ekranning pastidan chiqsin (bottom sheet) */
    .lead-card-menu-wrap {
        position: static;
    }

    .lead-card-menu-dropdown {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        min-width: 100%;
        width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        border-bottom: none;
        padding: 8px 8px max(12px, env(safe-area-inset-bottom));
        box-shadow: 0 -4px 32px rgba(22, 35, 59, 0.18);
        z-index: 200;
        max-height: 70dvh;
        overflow-y: auto;
    }

    /* Submenu ham pastga ochilsin, kenglik to'liq */
    .lead-card-menu-submenu {
        position: static;
        left: auto;
        top: auto;
        min-width: 0;
        width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid var(--border);
        border-radius: 0;
        padding: 4px 0;
        max-height: none;
    }

    /* Menu item touch-friendly */
    .lead-card-menu-item {
        padding: 14px 14px;
        font-size: 14px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .lead-card-menu-item--submenu {
        justify-content: space-between;
    }

    /* Notify + menu btn — 44px touch target */
    .lead-card-notify,
    .lead-card-menu-btn {
        width: 38px;
        height: 38px;
    }

    /* Lead card footer — joyida qolsin */
    .lead-card-footer {
        flex-wrap: wrap;
        gap: 6px;
    }

    .lead-card-actions {
        gap: 6px;
    }

    .lead-card-action {
        min-height: 36px;
        min-width: 44px;
        padding: 6px 10px;
    }

    /* Menejer avatari profil avatari kabi doim kvadrat ramkada qolsin. */
    .lead-card-action--mgr {
        min-width: 36px;
        max-width: 36px;
        padding: 0;
    }

    /* Muvaffaqiyatsiz sotuv modal guruhlari */
    .failed-sale-group {
        margin-bottom: 12px;
    }

    .failed-sale-group-label {
        font-size: 11px;
        margin-bottom: 6px;
    }

    /* Lead reason option — touch friendly */
    .lead-reason-option {
        min-height: 48px;
        padding: 12px 14px;
    }

    /* Modal body ko'proq joy */
    .modal-body {
        max-height: calc(70dvh - 110px);
        overflow-y: auto;
    }
}

/* ---------- 480px ---------- */
@media (max-width: 480px) {
    /* Section nav eng kichik */
    .section-nav-item {
        padding: 10px 7px;
        font-size: 11px;
    }

    /* Lead card compact */
    .lead-card {
        padding: 10px 12px;
    }

    .lead-card-top {
        gap: 6px;
    }

    .lead-card-name {
        font-size: 13px;
    }

    .lead-card-time {
        font-size: 11px;
    }

    .lead-card-serial {
        font-size: 10px;
        padding: 1px 5px;
    }

    .lead-card-contact {
        font-size: 12px;
    }

    /* Lead card footer — o'quvchi ID badge */
    .lead-badge {
        font-size: 9px;
        padding: 1px 5px;
    }

    /* Menu dropdown item */
    .lead-card-menu-item {
        font-size: 14px;
        padding: 14px 12px;
    }

    /* Sotuv rejasi, Qarzdorlar placeholder */
    .placeholder-card {
        padding: 24px 16px;
    }

    /* Failed sale groups spacing */
    .failed-sale-group {
        margin-bottom: 8px;
    }
}

/* ---------- 380px ---------- */
@media (max-width: 380px) {
    .section-nav-item {
        padding: 10px 6px;
        font-size: 10px;
    }

    .lead-card-notify,
    .lead-card-menu-btn {
        width: 34px;
        height: 34px;
    }

    .lead-card-notify svg,
    .lead-card-menu-btn svg {
        width: 15px;
        height: 15px;
    }
}

/* ══════════════════════════════════════════════════════════════════
   GLOBAL RESPONSIVE — barcha bo'limlar uchun
   Breakpoints: 900px (tablet), 600px (kichik telefon), 480px, 380px
══════════════════════════════════════════════════════════════════ */

/* ─── 900px ─── */
@media (max-width: 900px) {

    /* Dashboard stat cards */
    .grid-2, .grid-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
    .course-cards    { grid-template-columns: 1fr 1fr; gap: 12px; }

    /* Stat cards */
    .stat-icon { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; }
    .stat-info .stat-value { font-size: 22px; }
    .stat-info .stat-label { font-size: 12px; }

    /* Welcome banner */
    .welcome-banner { padding: 20px 20px; }
    .welcome-text h2 { font-size: 20px; }

    /* Calendar widget */
    .calendar-widget { overflow-x: auto; }

    /* Teacher / Student cards */
    .employees-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

    /* Timetable */
    .timetable-table, .tt-week-table {
        font-size: 11px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .timetable-table thead, .timetable-table tbody,
    .tt-week-table thead, .tt-week-table tbody { display: table; width: 100%; }

    /* Payments table */
    table { font-size: 13px; }
    th, td { padding: 10px 8px; }

    /* HR page */
    .employees-grid { gap: 12px; }

    /* Profile */
    .profile-page-inner { gap: 12px; }

    /* Modal: wider on tablet */
    .modal { max-width: calc(100vw - 32px); }
}

/* ─── 600px ─── */
@media (max-width: 600px) {

    /* App shell */
    .app-shell { padding: 0; gap: 0; }
    .main-area {
        height: 100dvh;
        border-radius: 0;
        gap: 0;
    }

    /* Top header */
    .top-header {
        border-radius: 0;
        padding: 10px 12px;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .search-box { display: none; }
    .live-badge { display: none; }

    /* Content layout */
    .content-layout { border-radius: 0; gap: 0; }
    .content-main { border-radius: 0; }
    .tab-content.active { border-radius: 0; padding: 12px 10px 80px; }
    #tab-sales.tab-content.active { padding-bottom: 0; }

    /* Dashboard grids */
    .grid-2 { grid-template-columns: 1fr 1fr; gap: 8px; }
    .grid-3 { grid-template-columns: 1fr 1fr; gap: 8px; }
    .course-cards { grid-template-columns: 1fr; gap: 8px; }

    /* Stat cards compact */
    .stat-card { padding: 14px 12px; gap: 10px; border-radius: 14px; }
    .stat-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 10px; }
    .stat-info .stat-value { font-size: 20px; }
    .stat-info .stat-label { font-size: 11px; }

    /* Welcome banner */
    .welcome-banner { padding: 16px; border-radius: 16px; }
    .welcome-banner-inner { flex-direction: column; }
    .welcome-text h2 { font-size: 18px; }
    .banner-emoji { margin: 0 auto; }

    /* Cards */
    .card { padding: 14px 12px; border-radius: 14px; }
    .card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .card-header h3 { font-size: 15px; }

    /* Page title */
    .page-title-bar { padding: 0 0 10px; }
    .page-title-bar h1 { font-size: 18px; }
    .page-title-bar p { font-size: 12px; }

    /* Section nav — horizontal scroll */
    .section-nav { gap: 2px; }
    .section-nav-item { padding: 10px 8px; font-size: 11px; white-space: nowrap; }

    /* Toolbar */
    .toolbar { flex-direction: column; gap: 8px; }
    .toolbar > * { width: 100%; }
    .toolbar .btn-primary-sm,
    .toolbar .btn-danger-sm { width: 100%; justify-content: center; }

    /* Timetable */
    .timetable-table { font-size: 10px; min-width: 500px; }
    .timetable-table th,
    .timetable-table td { padding: 6px 4px; }
    .timetable-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Data tables — block layout for horizontal scroll */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table.table, .attendance-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        min-width: 0;
        width: 100%;
        font-size: 12px;
    }
    table.table thead, table.table tbody,
    .attendance-table thead, .attendance-table tbody { display: table; width: 100%; }
    th, td { padding: 8px 6px; }

    /* HR employees grid */
    .employees-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .employee-card { padding: 16px 12px; }
    .employee-avatar { width: 56px; height: 56px; font-size: 20px; }

    /* Profile nav */
    .profile-nav { gap: 4px; padding: 8px 10px; }
    .profile-nav-item { padding: 8px 10px; font-size: 12px; }
    .profile-nav-item svg { width: 14px; height: 14px; }

    /* Profile cards */
    .profile-card { padding: 16px; border-radius: 14px; }
    .profile-info-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .profile-avatar-section { flex-direction: column; gap: 12px; }
    .profile-avatar-large { width: 80px; height: 80px; font-size: 28px; }

    /* Salary page */
    .sal-grid { grid-template-columns: 1fr; }
    .sal-col--right { display: flex; }
    .sal-card-inner { height: 170px; }
    .sal-card-number { font-size: 14px; letter-spacing: .1em; }
    .sal-stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
    .sal-stat-card { padding: 12px 10px; gap: 8px; }

    /* Modal — full screen on phone */
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .modal {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 92dvh;
    }
    .modal--wide {
        max-width: 100%;
        height: auto;
        max-height: 92dvh;
    }
    .modal-header { padding: 16px 16px 12px; }
    .modal-body { padding: 0 16px; }
    .modal-footer { padding: 12px 16px max(16px, env(safe-area-inset-bottom)); }

    /* Form controls */
    .form-group label { font-size: 12px; }
    .form-control { font-size: 14px; padding: 10px 12px; }
    input[type="date"].form-control { font-size: 13px; }

    /* HR employee add modal */
    .form-group { margin-bottom: 10px; }
}

/* ─── 480px ─── */
@media (max-width: 480px) {

    /* App shell tighter */
    .top-header { padding: 8px 10px; }

    /* Grids all single column */
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }

    /* Dashboard stat cards 2-col */
    .stat-card { padding: 12px 10px; gap: 8px; }
    .stat-icon { width: 36px; height: 36px; font-size: 16px; }
    .stat-info .stat-value { font-size: 18px; }

    /* HR employees single column */
    .employees-grid { grid-template-columns: 1fr; }

    /* Profile info grid single column */
    .profile-info-grid { grid-template-columns: 1fr; }

    /* Salary page */
    .sal-stats-row { grid-template-columns: 1fr; gap: 8px; }
    .sal-card-inner { height: 160px; }
    .sal-card-number { font-size: 13px; letter-spacing: .08em; }
    .sal-card-field-val { font-size: 11px; }

    /* Employee card compact */
    .employee-card { padding: 14px 10px; gap: 8px; }
    .employee-avatar { width: 48px; height: 48px; font-size: 18px; border-radius: 14px; }

    /* Section nav even smaller */
    .section-nav-item { padding: 9px 6px; font-size: 10px; }

    /* Lead card even more compact */
    .lead-card { padding: 10px; }
    .lead-card-name { font-size: 12px; }

    /* Modal */
    .modal { max-height: 94dvh; }
    .modal-header h2 { font-size: 15px; }
}

/* ─── 380px ─── */
@media (max-width: 380px) {
    /* Stat values */
    .stat-info .stat-value { font-size: 16px; }

    /* Section nav minimum */
    .section-nav-item { padding: 8px 5px; font-size: 9px; letter-spacing: 0; }

    /* Profile nav */
    .profile-nav-item { padding: 7px 8px; font-size: 11px; }

    /* Top header */
    .top-header { padding: 8px; gap: 6px; }
    .icon-btn { width: 32px; height: 32px; }
    .user-avatar { width: 32px; height: 32px; font-size: 11px; }

    /* Salary card */
    .sal-card-inner { height: 150px; }
    .sal-card-number { font-size: 12px; }
    .sal-header-title { font-size: 18px; }
}

/* ===== O'quvchilar jadval yangi ko'rinish ===== */
.students-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.students-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.students-search-wrap {
    position: relative;
    flex: 1;
    max-width: 340px;
}
.students-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    stroke: var(--text-muted);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}
.students-search-input {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    box-sizing: border-box;
}
.students-search-input:focus { border-color: var(--primary); }
.students-total-label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}
.students-table th { font-size: 11px; white-space: nowrap; }
.students-table td { font-size: 13px; vertical-align: middle; }
.student-avatar-mini {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-light, #E7EEF9);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.student-id-badge {
    font-size: 11px;
    font-family: monospace;
    background: var(--bg-secondary, #f3f4f6);
    border-radius: 4px;
    padding: 2px 5px;
    color: var(--text-muted);
}
.student-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}
.student-menu-btn:hover { background: var(--bg-secondary, #f3f4f6); }
.student-menu-btn svg { stroke: currentColor; fill: none; stroke-width: 2; }
.student-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 200;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 170px;
    padding: 4px 0;
}
.student-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 14px;
    background: none;
    border: none;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}
.student-dropdown-item:hover { background: var(--bg-secondary, #f5f5f5); }
.student-dropdown-item--danger { color: var(--danger, #dc2626); }
.student-check-input { cursor: pointer; width: 15px; height: 15px; }

/* ===== Mobil ilova admin panel ===== */
.mac-tab-btn {
    background: none; border: none; padding: 12px 18px;
    font-size: 13px; font-weight: 500; color: var(--text-muted);
    cursor: pointer; border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.mac-tab-active { color: var(--primary); border-bottom-color: var(--primary); }
.mac-tab-btn:hover:not(.mac-tab-active) { color: var(--text); }
.mac-content-list { display: flex; flex-direction: column; gap: 12px; }
.mac-content-card {
    display: flex; align-items: flex-start; gap: 14px;
    background: var(--card-bg,#fff); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px; transition: box-shadow .15s;
}
.mac-content-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.mac-content-thumb {
    width: 120px; height: 68px; border-radius: 8px;
    background: #f3f4f6; flex-shrink: 0; overflow: hidden;
}
.mac-content-info { flex: 1; min-width: 0; }
.mac-content-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.mac-content-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.mac-content-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; line-clamp: 2; }
.mac-content-link { font-size: 12px; color: var(--primary); text-decoration: none; }
.mac-content-link:hover { text-decoration: underline; }
.mac-content-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.mac-empty { text-align: center; padding: 48px; color: var(--text-muted); font-size: 14px; }

/* Darslik sub-tab layout */
#tpTextbook { height: 100%; overflow: hidden; }
#tpTextbook.sales-panel.active {
    flex-direction: row; overflow: hidden;
}
.tp-tb-sidebar {
    width: 220px; flex-shrink: 0; border-right: 1px solid var(--border);
    background: var(--bg, #f8fafc); padding: 12px 0; overflow-y: auto;
}
.tp-tb-sidebar-title {
    font-size: 11px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .06em;
    padding: 0 16px 8px;
}
.tp-tb-tab {
    display: flex; align-items: center; gap: 9px;
    width: 100%; padding: 10px 16px; background: none; border: none;
    text-align: left; font-size: 13px; color: var(--text); cursor: pointer;
    border-left: 3px solid transparent; transition: background .12s, border-color .12s;
    line-height: 1.3;
}
.tp-tb-tab:hover { background: var(--bg-hover, rgba(0,0,0,.04)); }
.tp-tb-tab.active {
    background: var(--primary-light, rgba(39, 81, 159,.08));
    border-left-color: var(--primary); color: var(--primary); font-weight: 600;
}
.tp-tb-tab-icon { font-size: 16px; flex-shrink: 0; }
.tp-tb-body {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column;
}

/* Elektron doska */
.wb-tool-btn {
    width: 36px; height: 36px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--card-bg,#fff);
    font-size: 16px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: background .15s;
}
.wb-tool-btn.active { background: var(--primary); border-color: var(--primary); }
.wb-tool-btn:hover:not(.active) { background: var(--bg-hover, #f3f4f6); }

/* ===== Student Detail Panel ===== */
.sdp-overlay { display: none !important; }
.sdp-panel {
    position: fixed; inset: 0; width: 100%; height: 100vh;
    background: var(--bg, #f8fafc);
    z-index: 1101; display: flex; flex-direction: column;
    opacity: 0; transform: translateY(14px); pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
    overflow: hidden;
}
.sdp-panel.sdp-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sdp-header {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 40px; border-bottom: 1px solid var(--border);
    background: var(--card-bg, #fff); flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sdp-close-btn {
    display: flex; align-items: center; gap: 6px;
    background: none; border: 1px solid var(--border); cursor: pointer;
    color: var(--text-muted); padding: 6px 14px; border-radius: 8px;
    font-size: 13px; font-weight: 500; flex-shrink: 0;
    transition: background .15s, color .15s;
}
.sdp-close-btn::before { content: "←"; font-size: 15px; }
.sdp-close-btn:hover { background: var(--bg-secondary,#f3f4f6); color: var(--text); }
.sdp-header-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; }
.sdp-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--primary-light,#E7EEF9); color: var(--primary);
    font-size: 20px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sdp-name { font-size: 20px; font-weight: 700; color: var(--text); margin: 0 0 3px; }
.sdp-meta { font-size: 13px; color: var(--text-muted); }
.sdp-frozen-badge {
    display: inline-flex; align-items: center; gap: 4px;
    background: #dbeafe; color: #1D3E7D;
    font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 20px; margin-left: 8px;
}
.sdp-header-actions { display: flex; flex-direction: row; gap: 8px; flex-shrink: 0; align-items: center; }
.sdp-action-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--card-bg,#fff); font-size: 12px; font-weight: 500;
    color: var(--text); cursor: pointer; white-space: nowrap;
}
.sdp-action-btn:hover { background: var(--bg-secondary,#f5f5f5); }
.sdp-action-btn--freeze { color: #1D3E7D; border-color: #CBDCF3; }
.sdp-action-btn--unfreeze { color: #15803d; border-color: #bbf7d0; }
.sdp-action-btn--danger { color: var(--danger,#dc2626); border-color: #fecaca; }
.sdp-tabs {
    display: flex; border-bottom: 1px solid var(--border);
    background: var(--card-bg,#fff); padding: 0 40px; flex-shrink: 0; overflow-x: auto;
}
.sdp-tab {
    background: none; border: none; padding: 13px 18px;
    font-size: 13px; font-weight: 500; color: var(--text-muted);
    cursor: pointer; border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.sdp-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.sdp-tab:hover:not(.active) { color: var(--text); }
.sdp-body { flex: 1; overflow-y: auto; overflow-x: auto; padding: 32px 40px; }
.sdp-body-inner { max-width: 1080px; margin: 0 auto; }
.sdp-section { margin-bottom: 28px; }
.sdp-section-title {
    font-size: 12px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .06em;
    margin: 0 0 14px;
}
.sdp-info-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.sdp-info-item { background: var(--card-bg,#fff); border-radius: 10px; padding: 12px 16px; border: 1px solid var(--border); }
.sdp-info-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.sdp-info-value { font-size: 14px; font-weight: 600; color: var(--text); }
.sdp-stat-grid {
    display: grid; grid-template-columns: repeat(3,1fr); gap: 12px;
}
.sdp-stat-card {
    background: var(--bg,#f8fafc); border-radius: 10px; padding: 14px;
    text-align: center; border: 1px solid var(--border);
}
.sdp-stat-value { font-size: 22px; font-weight: 800; color: var(--primary); }
.sdp-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.sdp-progress-bar-wrap {
    background: var(--border); border-radius: 99px; height: 8px; margin: 6px 0 2px;
}
.sdp-progress-bar { height: 100%; border-radius: 99px; background: var(--primary); }
.sdp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sdp-table th {
    text-align: left; padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing:.04em;
}
.sdp-table td { padding: 10px; border-bottom: 1px solid var(--border); }
.sdp-table tr:last-child td { border-bottom: none; }
.sdp-att-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(34px,1fr)); gap: 4px;
}
.sdp-att-day {
    width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--border);
    font-size: 11px; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.sdp-att-day--present { background: #dcfce7; color: #15803d; border-color: #86efac; }
.sdp-att-day--absent { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.sdp-lead-step {
    display: flex; align-items: flex-start; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.sdp-lead-step:last-child { border-bottom: none; }
.sdp-lead-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary); flex-shrink: 0; margin-top: 4px;
}
.sdp-lead-dot--closed { background: #22c55e; }
.sdp-empty { text-align: center; padding: 40px; color: var(--text-muted); font-size: 13px; }

/* ===== Sales Funnel ===== */
.sales-funnel { display: flex; flex-direction: column; gap: 6px; }
.funnel-row {
    display: grid;
    grid-template-columns: 200px 1fr 160px;
    align-items: center;
    gap: 12px;
}
.funnel-label-left {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 2px; text-align: right;
}
.funnel-count { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1; }
.funnel-name { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.funnel-bar-wrap {
    display: flex; align-items: center; justify-content: center;
    height: 44px;
}
.funnel-bar {
    position: relative; height: 44px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: width 0.4s cubic-bezier(.4,0,.2,1);
    min-width: 40px;
}
.funnel-bar-label {
    position: relative; z-index: 1;
    font-size: 13px; font-weight: 700;
}
.funnel-label-right {
    display: flex; align-items: center; min-width: 0;
}
.funnel-conv { font-size: 12px; font-weight: 600; white-space: nowrap; }

@media(max-width:600px) {
    .sdp-panel { width: 100vw; }
    .sdp-info-grid { grid-template-columns: 1fr; }
    .sdp-stat-grid { grid-template-columns: repeat(2,1fr); }
    .funnel-row { grid-template-columns: 1fr; }
    .funnel-label-left { align-items: flex-start; text-align: left; }
    .funnel-label-right { display: none; }

    /* O'quvchi tafsilotlari paneli (.sdp-*) - 40px gorizontal padding va
       qattiq flex-direction:row amallar qatori tor ekranda mos kelmasdi.
       Amallar qatori (Ustoz almashtirish/Jadval o'zgartirish/Muzlatish)
       endi tablar kabi alohida, gorizontal surila oladigan qatorga
       tushadi. */
    .sdp-header { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
    .sdp-header-actions {
        flex: 1 1 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sdp-avatar { width: 44px; height: 44px; font-size: 16px; }
    .sdp-name { font-size: 17px; }
    .sdp-tabs { padding: 0 16px; }
    .sdp-body { padding: 16px; }
}

/* ===== Scripts / Skriptlar ===== */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-bottom: 40px;
}
.script-card {
    border-radius: 16px;
    padding: 22px 20px 18px;
    cursor: pointer;
    position: relative;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform .18s, box-shadow .18s;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    overflow: hidden;
}
.script-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,.13); }
.script-card-sticker {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.12));
}
.script-card-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    text-shadow: 0 1px 4px rgba(0,0,0,.15);
    max-width: calc(100% - 44px);
}
.script-card-subtitle {
    font-size: 12px;
    color: rgba(255,255,255,.82);
    margin: 0;
    line-height: 1.4;
}
.script-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}
.script-card-date {
    font-size: 11px;
    color: rgba(255,255,255,.65);
}
.script-card-preview {
    font-size: 11px;
    color: rgba(255,255,255,.7);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}
.script-card-actions {
    position: absolute;
    bottom: 12px;
    right: 14px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity .15s;
}
.script-card:hover .script-card-actions { opacity: 1; }
@media (hover: none) {
    .script-card-actions { opacity: 1; }
}
.script-card-action-btn {
    background: rgba(255,255,255,.22);
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .15s;
}
.script-card-action-btn:hover { background: rgba(255,255,255,.35); }

/* Script article full view */
#scriptsListView { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.script-article-view {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: var(--bg, #fff);
    animation: scriptFadeIn .2s ease;
}
.script-article-view.active { display: flex; }
@keyframes scriptFadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.script-article-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 40px;
    flex-shrink: 0;
}
.script-article-meta { flex: 1; }
.script-article-meta h2 { margin: 0; font-size: 18px; font-weight: 800; }
.script-article-meta p  { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }
.script-article-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}
.script-article-content {
    max-width: 760px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}

/* Script add modal */
.script-color-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 6px 0 2px;
}
.script-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform .12s, border-color .12s;
}
.script-color-swatch:hover { transform: scale(1.12); }
.script-color-swatch.selected { border-color: var(--primary, #27519F); transform: scale(1.12); }
.script-sticker-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 6px 0 2px;
}
.script-sticker-btn {
    font-size: 22px;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: var(--bg-secondary, #f3f4f6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, border-color .12s, transform .12s;
}
.script-sticker-btn:hover { background: var(--bg-hover, #e5e7eb); transform: scale(1.1); }
.script-sticker-btn.selected { border-color: var(--primary, #27519F); background: var(--primary-light, #F1F5FC); }
.script-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 6px;
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: var(--bg-secondary, #f9fafb);
}
.script-editor-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
}
.script-editor-btn:hover { background: rgba(0,0,0,.06); }
.script-editor-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.script-editor-color-wrap, .script-editor-emoji-wrap { position: relative; }
.script-editor-color-panel {
    position: absolute;
    top: 36px;
    left: 0;
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    width: 180px;
}
.script-editor-color-panel[hidden] { display: none; }
.script-editor-color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--border);
}
.script-editor-color-dot:hover { border-color: var(--primary, #27519F); }
.script-editor-emoji-panel {
    position: absolute;
    top: 36px;
    left: 0;
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    width: 220px;
    max-height: 180px;
    overflow-y: auto;
}
.script-editor-emoji-panel[hidden] { display: none; }
.script-editor-emoji-item {
    font-size: 18px;
    cursor: pointer;
    text-align: center;
    padding: 4px;
    border-radius: 6px;
}
.script-editor-emoji-item:hover { background: rgba(0,0,0,.06); }
.script-content-editable {
    width: 100%;
    min-height: 160px;
    max-height: 360px;
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
    font-size: 14px;
    line-height: 1.7;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}
.script-content-editable:focus { border-color: var(--primary, #27519F); background: #fff; }
.script-content-editable:empty::before { content: attr(data-placeholder); color: var(--text-muted); }

@media(max-width:900px) { .scripts-grid { grid-template-columns: repeat(2,1fr); } }
@media(max-width:600px) { .scripts-grid { grid-template-columns: 1fr; } }

/* ===== Reyting / Leaderboard ===== */
.rating-main-tabs {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    padding: 16px 0 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.rating-main-tabs-left {
    display: flex;
    gap: 4px;
    align-items: flex-end;
}
.rating-main-tabs #ratingPeriodFilter {
    display: flex;
    flex-direction: row;
    gap: 4px;
    margin-bottom: 4px;
}
.rating-main-tabs #ratingPeriodFilter .lang-btn {
    min-width: unset;
    padding: 7px 14px;
    font-size: 13px;
    border-radius: 8px;
}
.rating-main-tab {
    padding: 9px 18px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: color .15s, border-color .15s, background .15s;
}
.rating-main-tab:hover { background: var(--bg-secondary); color: var(--text); }
.rating-main-tab.active { color: var(--primary, #27519F); border-bottom-color: var(--primary, #27519F); }

.rating-section { flex: 1; min-height: 0; overflow-y: auto; }

/* Podium */
.rating-podium {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.rating-podium-card {
    border-radius: 16px;
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    will-change: transform;
    user-select: none;
}
.rating-podium-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 60%);
    pointer-events: none;
}
.rating-podium-rank { font-size: 28px; }
.rating-podium-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255,255,255,.5);
}
.rating-podium-name { font-size: 14px; font-weight: 800; color: #fff; text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,.2); }
.rating-podium-sales { font-size: 13px; color: rgba(255,255,255,.85); font-weight: 600; }
.rating-podium-prog-wrap { width: 100%; height: 6px; background: rgba(255,255,255,.3); border-radius: 3px; overflow: hidden; }
.rating-podium-prog-bar { height: 100%; background: rgba(255,255,255,.8); border-radius: 3px; }
.rating-podium-pct { font-size: 11px; color: rgba(255,255,255,.75); }

/* View toggle */
.rating-view-toggle {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 4px;
}
.rating-view-btn {
    padding: 7px 16px;
    border: none;
    background: none;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.rating-view-btn.active { background: #fff; color: var(--primary, #27519F); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* Avatar */
.rating-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #27519F, #3568C4);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Marra pills */
.marra-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 12px;
}
.marra-pill.reached { font-weight: 600; }

/* Bonus period label */
.bonus-period-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 12px;
}
.bonus-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 8px;
}

/* Bonus card with shimmer & 3D tilt */
.bonus-card {
    border-radius: 18px;
    padding: 22px 18px 18px;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--bc, #27519F) 80%, #fff) 0%,
        var(--bc, #27519F) 40%,
        color-mix(in srgb, var(--bc, #27519F) 55%, #000) 100%
    );
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 148px;
    box-shadow: 0 8px 28px rgba(0,0,0,.18), 0 2px 6px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.18);
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.14);
    will-change: transform;
    user-select: none;
}
.bonus-card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 15%,
        rgba(255,255,255,.12) 30%,
        rgba(255,255,255,.55) 48%,
        rgba(255,255,255,.12) 66%,
        transparent 80%
    );
    background-size: 220% 100%;
    animation: bonusShimmer 3.5s ease-in-out infinite;
    pointer-events: none;
    border-radius: inherit;
}
@keyframes bonusShimmer {
    0%   { background-position: 220% 0; }
    50%  { background-position: -120% 0; }
    100% { background-position: 220% 0; }
}
.bonus-card-edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 8px;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    backdrop-filter: blur(6px);
    transition: background .15s, border-color .15s;
    z-index: 3;
}
.bonus-card-edit-btn:hover { background: rgba(255,255,255,.38); border-color: rgba(255,255,255,.5); }
.bonus-card-icon { font-size: 30px; line-height: 1; }
.bonus-card-label { font-size: 15px; font-weight: 800; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.22); }
.bonus-card-prize { font-size: 23px; font-weight: 900; color: #fff; letter-spacing: -.3px; }
.bonus-card-cond  { font-size: 11px; color: rgba(255,255,255,.76); line-height: 1.5; margin-top: auto; }
.bd-row { display: flex; gap: 10px; align-items: flex-start; }
.bd-key { font-size: 12px; font-weight: 700; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; min-width: 120px; }
.bd-val { font-size: 13px; color: var(--text); line-height: 1.5; }

@media(max-width:900px) { .rating-podium { grid-template-columns: 1fr; } }
@media(max-width:600px) { .bonus-cards-grid { grid-template-columns: repeat(2,1fr); } }

/* ===== Qarzdorlar ===== */
.debtors-wrap { display: flex; flex-direction: column; gap: 16px; padding: 20px; height: 100%; box-sizing: border-box; }
.debtors-stats-bar { display: flex; gap: 14px; flex-wrap: wrap; }
.debtors-stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 14px 22px; display: flex; flex-direction: column; gap: 4px; min-width: 160px; }
.debtors-stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.debtors-stat-card .stat-value { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.debtors-stat-card .stat-value.danger { color: #e74c3c; }
.debtors-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.debtors-filters input[type="date"] { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); color: var(--text-primary); font-size: 13px; cursor: pointer; }
.debtors-filters select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); color: var(--text-primary); font-size: 13px; cursor: pointer; }
.debtors-table-wrap { flex: 1; overflow: auto; border-radius: 14px; border: 1px solid var(--border); }
.debtors-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 1400px; }
.debtors-table thead { position: sticky; top: 0; z-index: 2; background: var(--card-bg); }
.debtors-table th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--border); white-space: nowrap; }
.debtors-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-primary); white-space: nowrap; vertical-align: middle; }
.debtors-table tbody tr:last-child td { border-bottom: none; }
.debtors-table tbody tr:hover { background: var(--hover-bg, rgba(0,0,0,.03)); }
.debt-amount { color: #e74c3c; font-weight: 700; }
.paid-amount { color: #27ae60; font-weight: 700; }
.overdue { color: #e74c3c; font-weight: 700; font-size: 12px; }
.on-time { color: #27ae60; font-size: 12px; }
.debtor-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.debtor-badge.active { background: #d5f5e3; color: #1e8449; }
.debtor-badge.frozen { background: #d6eaf8; color: #1a5276; }
.debtor-badge.overdue { background: #fadbd8; color: #c0392b; }
.debtors-dot-menu-btn { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--text-muted); padding: 4px 8px; border-radius: 8px; line-height: 1; }
.debtors-dot-menu-btn:hover { background: var(--hover-bg, rgba(0,0,0,.06)); }

/* Sotuv rejasi (sales plan calculator) */
.sp-params-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.sp-param { display: flex; flex-direction: column; gap: 6px; }
.sp-param label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.sp-period-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.sp-period-tab {
    padding: 8px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
    background: var(--surface); color: var(--text-muted); font-weight: 700; font-size: 13px; cursor: pointer;
}
.sp-period-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.sp-plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.sp-plan-card {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-card);
    border-top: 4px solid var(--brand); overflow: hidden;
}
.sp-plan-header { padding: 14px 18px; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: space-between; }
.sp-plan-header-conv { font-size: 13px; font-weight: 700; opacity: .85; }
.sp-plan-block { padding: 14px 18px; }
.sp-plan-block + .sp-plan-block { border-top: 1px solid var(--border); }
.sp-plan-block-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.sp-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 13px; color: var(--text); }
.sp-row span { color: var(--text-muted); }
.sp-row b { font-weight: 700; }
.sp-row-strong { border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); margin: 2px 0; }
.sp-row-strong b { font-weight: 800; }
.sp-pos { color: var(--success); }
.sp-neg { color: var(--danger); }
@media (max-width: 768px) {
    .sp-plans-grid { grid-template-columns: 1fr; }
}

/* Cash Flow */
.cf-wrap { padding-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.cf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cf-toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cf-title { font-size: 22px; font-weight: 800; margin: 0; }
.cf-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cf-net-card, .cf-invest-card { padding: 24px; }
.cf-net-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.cf-net-header h3 { font-size: 15px; font-weight: 700; margin: 0; }
.cf-net-value { font-size: 32px; font-weight: 800; letter-spacing: -0.5px; }
.cf-net-sub { display: flex; gap: 18px; margin-top: 8px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }
.cf-invest-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 13px; color: var(--text-muted); }
.cf-invest-row b { font-size: 15px; }
.cf-invest-row-total { border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 12px; }
.cf-invest-row-total b { font-size: 18px; color: var(--text); }
.cf-pl-table-wrap { overflow-x: auto; }
.cf-chart-box { min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cf-chart-legend { display: flex; gap: 18px; justify-content: center; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.cf-chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.cf-donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; }
.cf-donut-legend { display: flex; flex-direction: column; gap: 8px; }
.cf-donut-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.cf-donut-legend-row i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.cf-donut-legend-row b { color: var(--text); font-weight: 700; margin-left: 4px; }
.cf-mgr-row { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 12px; padding: 8px 0; }
.cf-mgr-name { font-size: 13px; font-weight: 600; color: var(--text); }
.cf-mgr-bar-track { height: 10px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.cf-mgr-bar-fill { height: 100%; border-radius: 6px; background: var(--brand-gradient); }
.cf-mgr-value { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.cf-tx-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.cf-tx-toolbar h3 { margin: 0; font-size: 15px; font-weight: 700; }
.cf-tx-filters { display: flex; gap: 8px; }
.cf-tx-table-wrap { overflow-x: auto; }
.cf-tx-table { width: 100%; min-width: 900px; }
.cf-type-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.cf-type-badge.kirim { background: var(--success-bg); color: #1e8449; }
.cf-type-badge.chiqim { background: var(--danger-bg); color: #c0392b; }
.cf-row-action { background: none; border: none; cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.cf-row-action:hover { background: var(--hover-bg, rgba(0,0,0,.06)); }
@media (max-width: 768px) {
    .cf-grid-2 { grid-template-columns: 1fr; }
    .cf-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .cf-mgr-row { grid-template-columns: 1fr; gap: 4px; row-gap: 2px; }
    .cf-mgr-value { text-align: left; }
}
@media (max-width: 480px) {
    .cf-kpi-grid { grid-template-columns: 1fr; }
    .cf-toolbar { flex-direction: column; align-items: stretch; }
    .cf-toolbar-actions { justify-content: stretch; }
    .cf-toolbar-actions .btn-ghost, .cf-toolbar-actions .btn-primary-sm { flex: 1; text-align: center; }
    .cf-donut-wrap { flex-direction: column; }

    /* Skript tahrirlash toolbar — rang/emoji panellari tor ekranda o'ngga
       "yopishgan" tugmalar tagida chiqqanda ekrandan chiqib ketmasin */
    .script-editor-color-panel, .script-editor-emoji-panel {
        left: auto;
        right: 0;
        max-width: calc(100vw - 64px);
    }
}
@media print {
    body * { visibility: hidden; }
    .cf-wrap, .cf-wrap * { visibility: visible; }
    .cf-wrap { position: absolute; top: 0; left: 0; width: 100%; padding: 0; }
    .cf-toolbar-actions, .cf-tx-filters, .cf-row-action { display: none !important; }
    .cf-tx-table th:last-child, .cf-tx-table td:last-child { display: none !important; }
}

/* Org Struktura (tashkiliy tuzilma) */
.org-chart-wrap { margin-top: 20px; }
.org-tree-scroll { overflow-x: auto; padding: 24px 12px 40px; }
.org-tree-inner {
    position: relative;
    display: inline-flex;
    gap: 56px;
    min-width: 100%;
    justify-content: center;
    box-sizing: border-box;
}
.org-connectors-svg { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.org-node-group { display: flex; flex-direction: column; align-items: center; }
.org-children-row { display: flex; flex-direction: row; align-items: flex-start; gap: 28px; margin-top: 56px; }
.org-node-box {
    position: relative;
    width: 190px;
    background: var(--surface);
    border-radius: 16px;
    padding: 18px 14px 14px;
    box-shadow: var(--shadow-card);
    border-top: 4px solid var(--dept-color, var(--brand));
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform .15s, box-shadow .15s;
    z-index: 1;
    box-sizing: border-box;
}
.org-node-box:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(22, 35, 59,.12); }
.org-node-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.org-node-box:hover .org-node-actions { opacity: 1; }
.org-node-action-btn {
    width: 24px; height: 24px; border: none; border-radius: 6px;
    background: var(--bg); font-size: 11px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; color: var(--text-muted);
}
.org-node-action-btn:hover { background: var(--brand-light); color: var(--brand); }
.org-node-avatar {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px; color: #fff;
    background: var(--dept-color, var(--brand));
    margin-bottom: 8px;
    flex-shrink: 0;
}
.org-node-avatar--vacant { background: var(--border); color: var(--text-muted); }
.org-node-name { font-size: 14px; font-weight: 800; color: var(--text); }
.org-node-name--vacant { color: var(--text-muted); font-style: italic; font-weight: 600; }
.org-node-title { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.org-node-phone { font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.org-node-badge {
    margin-top: 6px; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 10px;
    background: var(--warning-bg); color: #92400e;
}
.org-assign-toggle { display: flex; gap: 8px; margin-top: 4px; }
.org-assign-toggle .lang-btn { min-width: unset; padding: 8px 14px; font-size: 13px; }
@media (max-width: 768px) {
    .org-node-box { width: 150px; }
    .org-children-row { gap: 16px; }
    .org-tree-inner { gap: 32px; }
}
@media (hover: none) {
    /* Sensorli ekranlarda hover ishlamaydi — tugmalar doim ko'rinib tursin */
    .org-node-actions { opacity: 1; }
}

/* Analitika: Hisobotlar */
.an-role-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.an-role-tab {
    padding: 9px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
    background: var(--surface); color: var(--text-muted); font-weight: 700; font-size: 13px; cursor: pointer;
    white-space: nowrap;
}
.an-role-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.an-manual-add-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 50%; border: none;
    background: var(--brand-light); color: var(--brand); font-size: 11px; font-weight: 800;
    cursor: pointer; line-height: 1; vertical-align: middle; margin-left: 4px;
}
.an-manual-add-btn:hover { background: var(--brand); color: #fff; }

/* ========== HR — VAKANSIYA VORONKASI ========== */
.hr-vac-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.hr-vac-filters {
    display: flex;
    gap: 10px;
    flex: 1;
    min-width: 260px;
    max-width: 620px;
}

.hr-vac-filters .form-select { max-width: 240px; }

.hr-vac-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

.hr-cand-card { cursor: pointer; }
.hr-cand-card.is-dragging { opacity: .45; }

.lead-column-cards.is-drop-target {
    outline: 2px dashed var(--brand);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.hr-cand-head { display: flex; gap: 10px; align-items: center; }

.hr-cand-photo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--brand-light);
}

.hr-cand-photo--empty {
    display: grid;
    place-items: center;
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
}

.hr-cand-main { min-width: 0; }
.hr-cand-main b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-cand-vac { display: block; font-size: 11.5px; color: var(--brand); font-weight: 700; }

.hr-cand-row { margin-top: 8px; font-size: 12.5px; }
.hr-cand-row--muted { color: var(--text-muted); font-size: 11.5px; margin-top: 3px; }

.hr-cand-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid var(--border);
}

.hr-cand-date { font-size: 11px; color: var(--text-light); }
.hr-cand-tags { display: flex; gap: 5px; flex-wrap: wrap; }

.hr-cand-tag {
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--bg-secondary);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.hr-cand-tag--warn { background: var(--warning-bg); color: #92400E; }

/* Nomzod kartasi (modal) */
.hr-modal-media { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; align-items: flex-start; }
.hr-modal-photo img { width: 132px; height: 132px; object-fit: cover; border-radius: 14px; display: block; }
.hr-modal-voice { flex: 1; min-width: 220px; }
.hr-modal-voice label { display: block; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.hr-modal-voice audio { width: 100%; }

.hr-modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.hr-modal-row { display: flex; flex-direction: column; gap: 2px; }
.hr-modal-row span { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.hr-modal-row b { font-size: 14px; }

.hr-modal-h { margin: 20px 0 10px; font-size: 14px; }
.hr-modal-answers { display: grid; gap: 10px; }
.hr-modal-answer {
    padding: 11px 13px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
}
.hr-modal-answer span { display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 3px; }
.hr-modal-answer b { font-size: 13.5px; }

@media (max-width: 640px) {
    .hr-modal-grid { grid-template-columns: 1fr; }
    .hr-vac-filters { flex-direction: column; max-width: none; }
    .hr-vac-filters .form-select { max-width: none; }
}
