/* =========================================================
   HotelPulse — dizayn tizimi
   Ranglar token sifatida :root'da; tungi rejim pastda qayta belgilanadi.
   ========================================================= */
:root {
    --bg: #f3f5fa;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, #e4ebff 0%, transparent 60%),
               radial-gradient(900px 500px at -10% 0%, #e9f6f1 0%, transparent 55%);
    --surface: #ffffff;
    --surface-2: #f7f8fc;
    --glass: rgba(255, 255, 255, .72);
    --text: #141a2a;
    --muted: #687189;
    --border: #e3e7f0;
    --border-strong: #cfd5e3;

    --primary: #2f5bea;
    --primary-hover: #2349c7;
    --primary-soft: #e9efff;
    --primary-grad: linear-gradient(135deg, #3d6bff 0%, #2a4fd6 100%);
    --accent: #6fb7a1;
    --violet: #8b5cf6;
    --amber: #f59e0b;

    --success: #16a061;
    --success-soft: #e2f6ec;
    --danger: #dc3c3c;
    --danger-soft: #fdeaea;
    --warning: #a06a00;
    --warning-soft: #fff3d6;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 48, .06);
    --shadow: 0 1px 2px rgba(16, 24, 48, .05), 0 4px 16px rgba(16, 24, 48, .06);
    --shadow-lg: 0 2px 6px rgba(16, 24, 48, .06), 0 16px 40px rgba(16, 24, 48, .12);
    --ring: 0 0 0 4px rgba(47, 91, 234, .18);

    --ease: cubic-bezier(.2, .8, .2, 1);
    --t-fast: .15s;
    --t: .25s;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d111b;
        --bg-grad: radial-gradient(1200px 600px at 100% -10%, rgba(61, 107, 255, .16) 0%, transparent 60%),
                   radial-gradient(900px 500px at -10% 0%, rgba(111, 183, 161, .10) 0%, transparent 55%);
        --surface: #151b29;
        --surface-2: #1b2232;
        --glass: rgba(21, 27, 41, .72);
        --text: #e8ecf5;
        --muted: #8f99b3;
        --border: #252e42;
        --border-strong: #34405a;
        --primary: #6b8cff;
        --primary-hover: #8aa4ff;
        --primary-soft: rgba(107, 140, 255, .14);
        --primary-grad: linear-gradient(135deg, #5b7fff 0%, #3d63e6 100%);
        --success: #3ccf8e;
        --success-soft: rgba(60, 207, 142, .13);
        --danger: #ff6b6b;
        --danger-soft: rgba(255, 107, 107, .13);
        --warning: #f5c04e;
        --warning-soft: rgba(245, 192, 78, .14);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
        --shadow-lg: 0 4px 10px rgba(0, 0, 0, .3), 0 20px 48px rgba(0, 0, 0, .4);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-feature-settings: "cv11", "ss01";
    background: var(--bg-grad), var(--bg);
    background-attachment: fixed;
    color: var(--text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }
h1, h2, h3 { letter-spacing: -.02em; }

/* ---------- Header ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 28px;
    transition: border-color var(--t), box-shadow var(--t);
}
.topbar.scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.brand { font-weight: 800; font-size: 18px; color: var(--text); display: flex; align-items: center; gap: 10px; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--primary-grad);
    box-shadow: 0 0 0 4px var(--primary-soft);
    animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--primary-soft); }
    50% { box-shadow: 0 0 0 8px transparent; }
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
    position: relative;
    color: var(--muted); padding: 8px 14px; border-radius: 10px;
    font-weight: 600; font-size: 14px; white-space: nowrap;
    transition: background var(--t-fast), color var(--t-fast);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { color: var(--primary); background: var(--primary-soft); }
.user-box { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.user-box span { white-space: nowrap; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-grad); color: #fff; font-weight: 700; font-size: 14px;
    flex-shrink: 0;
}

/* ---------- Layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.2; }
.subtitle { color: var(--muted); margin: 6px 0 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

/* Sahifaga kirishda navbat bilan paydo bo'lish */
.reveal { opacity: 0; transform: translateY(12px); animation: fadeUp .55s var(--ease) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
.stagger > * { opacity: 0; transform: translateY(12px); animation: fadeUp .55s var(--ease) forwards; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .07s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .17s; }
.stagger > *:nth-child(5) { animation-delay: .22s; }
.stagger > *:nth-child(6) { animation-delay: .27s; }
.stagger > *:nth-child(7) { animation-delay: .32s; }
.stagger > *:nth-child(8) { animation-delay: .37s; }
.stagger > *:nth-child(n+9) { animation-delay: .42s; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 11px;
    border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2;
    cursor: pointer;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast),
                box-shadow var(--t), transform var(--t-fast) var(--ease);
    text-decoration: none;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 4px 14px rgba(47, 91, 234, .28); }
.btn-primary:hover { color: #fff; box-shadow: 0 6px 20px rgba(47, 91, 234, .38); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.btn-danger { background: var(--surface); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-section { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 -6px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 12.5px; }
.field input[type=text], .field input[type=password], .field input[type=number], .field select {
    font: inherit;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.field input:hover, .field select:hover { border-color: var(--border-strong); }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: var(--ring); }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.check input, .check-list input { width: 18px; height: 18px; accent-color: var(--primary); }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.check-list label {
    border: 1px solid var(--border); border-radius: 11px; padding: 11px 14px;
    display: flex; gap: 10px; align-items: center; cursor: pointer; background: var(--surface-2);
    transition: border-color var(--t-fast), background var(--t-fast);
}
.check-list label:hover { border-color: var(--primary); }
.check-list label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 20px; }

/* ---------- Alerts / badges ---------- */
.alert {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 16px; border-radius: 12px; margin-bottom: 20px; font-weight: 600;
    animation: slideDown .4s var(--ease);
    transition: opacity var(--t), transform var(--t), margin var(--t), padding var(--t), max-height var(--t);
    max-height: 120px; overflow: hidden;
}
.alert.hide { opacity: 0; transform: translateY(-6px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; }
.alert-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.alert-close:hover { opacity: 1; background: rgba(0, 0, 0, .06); }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-info { background: var(--primary-soft); color: var(--primary); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-ok { background: var(--success-soft); color: var(--success); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }
.badge-off { background: var(--surface-2); color: var(--muted); }
.badge-role { background: var(--primary-soft); color: var(--primary); }
.badge-role::before { display: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; padding: 6px 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
td.wrap { white-space: normal; }

/* ---------- Hotel cards (bosh sahifa) ---------- */
.hotel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.hotel-card {
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 12px;
    color: var(--text);
    transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t);
}
.hotel-card::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
    background: var(--primary-grad); opacity: .85;
}
.hotel-card:hover { color: var(--text); transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.hotel-card h3 { margin: 4px 0 0; font-size: 18px; font-weight: 700; }
.hotel-card .arrow { position: absolute; right: 20px; top: 24px; color: var(--muted); transition: transform var(--t) var(--ease), color var(--t); }
.hotel-card:hover .arrow { transform: translateX(4px); color: var(--primary); }
.hotel-meta { color: var(--muted); font-size: 14px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.hotel-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 2px; }
.hotel-stats .k { color: var(--muted); font-size: 12px; font-weight: 600; }
.hotel-stats .v { font-weight: 800; font-size: 18px; letter-spacing: -.02em; }

/* Progress (bandlik) chizig'i — kenglik JS orqali 0 dan to'ladi */
.meter { height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; margin-top: 8px; }
.meter-fill { height: 100%; width: 0; border-radius: inherit; background: var(--primary-grad); transition: width 1.1s var(--ease); }
.meter-fill.warn { background: linear-gradient(90deg, #f5b544, #f08c2e); }
.meter-fill.good { background: linear-gradient(90deg, #34c48a, #16a061); }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.empty-icon svg { width: 28px; height: 28px; }
.empty strong { color: var(--text); font-size: 17px; }

/* ---------- Hotel KPI page ---------- */
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 0 14px; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat {
    position: relative;
    display: flex; flex-direction: column; gap: 4px; padding: 18px 20px;
    transition: transform var(--t) var(--ease), box-shadow var(--t);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon svg { width: 18px; height: 18px; }
.i-blue { background: var(--primary-soft); color: var(--primary); }
.i-green { background: var(--success-soft); color: var(--success); }
.i-violet { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.i-amber { background: var(--warning-soft); color: var(--warning); }
.i-red { background: var(--danger-soft); color: var(--danger); }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -.03em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.stat-sub { color: var(--muted); font-size: 12.5px; }
.stat-alert { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); background: linear-gradient(180deg, var(--danger-soft), var(--surface) 70%); }
.stat-alert .stat-value { color: var(--danger); }

.delta { display: inline-flex; align-items: center; gap: 4px; width: fit-content; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.delta.up { color: var(--success); background: var(--success-soft); }
.delta.up::before { content: "↑"; }
.delta.down { color: var(--danger); background: var(--danger-soft); }
.delta.down::before { content: "↓"; }

.period-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.segmented {
    position: relative;
    display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
    padding: 4px; gap: 2px; flex-wrap: wrap; box-shadow: var(--shadow-sm);
}
.segmented a {
    position: relative; z-index: 1;
    padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap;
    transition: color var(--t), background var(--t);
}
.segmented a:hover { color: var(--text); background: var(--surface-2); }
.segmented a.active { color: #fff; background: var(--primary-grad); box-shadow: 0 3px 10px rgba(47, 91, 234, .3); }
.custom-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.custom-period input[type=date] {
    font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.custom-period input[type=date]:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.period-caption { color: var(--muted); font-size: 14px; margin: 0 0 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period-caption strong { color: var(--text); }

.chart-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.card-title { margin: 0 0 14px; font-size: 16px; font-weight: 700; }
.chart-box { position: relative; height: 320px; }
.chart-box-sm { height: 200px; margin-bottom: 14px; }
table.compact td { padding: 8px 4px; font-size: 14px; }
table.compact tr:hover { background: none; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 10px; vertical-align: middle; }

/* ---------- Exely: yo'riqnoma va sinxronlash holati ---------- */
.field-wide { grid-column: 1 / -1; }
.howto {
    border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px 16px; background: var(--surface-2);
    font-size: 14px; color: var(--muted);
}
.howto summary { cursor: pointer; font-weight: 600; color: var(--primary); list-style: none; display: flex; align-items: center; gap: 8px; }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::before { content: "›"; font-size: 18px; line-height: 1; transition: transform var(--t) var(--ease); }
.howto[open] summary::before { transform: rotate(90deg); }
.howto ol { margin: 12px 0 8px; padding-left: 22px; display: grid; gap: 6px; }
.howto b { color: var(--text); font-weight: 600; }
.howto p { margin: 6px 0 0; }

.sync-card { margin-top: 18px; }
.sync-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.sync-head .card-title { margin-bottom: 0; }
.sync-head .subtitle { margin-top: 4px; font-size: 14px; }
.sync-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; }
.sync-meta div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 14px; }
.sync-meta dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.sync-meta dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.text-danger { color: var(--danger); }
.sync-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.push-right { margin-left: auto; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.spinner {
    width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid currentColor; border-right-color: transparent;
    animation: spin .8s linear infinite;
}
.badge:has(.spinner)::before { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.note { font-size: 12.5px; color: var(--muted); font-style: italic; }

/* ---------- Profil va Telegram ---------- */
.user-link { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); padding: 4px 10px 4px 4px; border-radius: 999px; transition: background var(--t-fast), color var(--t-fast); }
.user-link:hover, .user-link.active { background: var(--surface-2); color: var(--text); }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.profile-head, .tg-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.profile-head .card-title, .tg-head .card-title { margin: 0 0 4px; }
.avatar-lg { width: 54px; height: 54px; font-size: 22px; }
.info-list { display: grid; gap: 10px; margin: 0; }
.info-list div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.info-list div:last-child { border-bottom: 0; }
.info-list dt { color: var(--muted); font-size: 14px; }
.info-list dd { margin: 0; font-weight: 600; text-align: right; }
.muted { color: var(--muted); }

.tg-card { display: flex; flex-direction: column; gap: 14px; }
.tg-card .tg-head { margin-bottom: 4px; }
.tg-logo {
    width: 54px; height: 54px; border-radius: 16px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #37aee2, #1e96c8); color: #fff;
    box-shadow: 0 6px 18px rgba(30, 150, 200, .35);
}
.tg-logo svg { width: 28px; height: 28px; margin-left: -2px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feature-list li { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 14px; font-size: 14px; }
.btn-telegram { background: linear-gradient(135deg, #37aee2, #1e96c8); color: #fff; box-shadow: 0 4px 14px rgba(30, 150, 200, .32); }
.btn-telegram:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(30, 150, 200, .42); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.switch-title { font-weight: 600; }
.switch { position: relative; display: inline-block; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; cursor: pointer; background: var(--border-strong); border-radius: 999px; transition: background var(--t) var(--ease); }
.switch .slider::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--t) var(--ease); }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider { box-shadow: var(--ring); }
code { font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }

/* ---------- Xato sahifasi ---------- */
.error-card { text-align: center; }
.error-code {
    font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -.04em;
    background: var(--primary-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
    margin-bottom: 10px;
}
.error-title { font-size: 21px; margin: 0 0 6px; }
.error-card .subtitle { display: block; margin-bottom: 24px; }

/* ---------- Login ---------- */
.login-page {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px;
    position: relative; overflow: hidden;
}
.login-page::before, .login-page::after {
    content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: 0;
    animation: float 14s ease-in-out infinite;
}
.login-page::before { width: 420px; height: 420px; background: #6b8cff; top: -120px; right: -80px; }
.login-page::after { width: 360px; height: 360px; background: #6fb7a1; bottom: -120px; left: -80px; animation-delay: -7s; }
@keyframes float { 50% { transform: translate(30px, 24px) scale(1.06); } }
.login-card {
    position: relative; z-index: 1; width: 100%; max-width: 400px; padding: 34px 30px;
    background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg); border-radius: var(--radius-lg);
}
.login-card .brand { justify-content: center; margin-bottom: 6px; font-size: 24px; }
.login-card .subtitle { justify-content: center; margin-bottom: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .topbar { padding: 10px 16px; gap: 10px; height: auto; flex-wrap: wrap; justify-content: space-between; }
    .nav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: none; }
    .chart-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .container { padding: 22px 16px 56px; }
    .page-head h1 { font-size: 23px; }
    .form-grid { grid-template-columns: 1fr; }
    .sync-meta { grid-template-columns: 1fr; }
    .push-right { margin-left: 0; }
    .stat { padding: 15px 16px; }
    .stat-value { font-size: 21px; }
    .user-box .name { display: none; }
    .period-bar { flex-direction: column; align-items: stretch; }
    .segmented { overflow-x: auto; flex-wrap: nowrap; }
}

@media (max-width: 420px) {
    .stats-grid { gap: 10px; }
    .stat { padding: 13px 13px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 12px; }
    .stat-icon { width: 28px; height: 28px; border-radius: 8px; }
    .stat-icon svg { width: 15px; height: 15px; }
    .stat-sub { font-size: 11.5px; }
    .head-actions { width: 100%; }
    .head-actions > * { flex: 1; }
    .head-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .reveal, .stagger > * { opacity: 1; transform: none; }
}
