:root {
    --bs-primary: #1D4ED8;
    --bs-secondary: #94A3B8;
    --bs-danger: rgb(220, 38, 38);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

html, body {
    font-size: 14px;
    background: #F0F4F8;
}

.btn-danger { --bs-btn-bg: var(--bs-danger); }
.text-secondary { color: var(--bs-secondary) !important; }
.bg-emoji { background: #EEF2FF !important; }

.login-info {
    background: linear-gradient(155deg, #0A1628 0%, #0D2444 45%, #0A1E3C 100%);
}

form label {
    font-weight: bold;
    text-transform: uppercase;
    color: #64748B;
    font-size: 12px;
}

form input[type='text'], form input[type='password'], form input[type='date'], form textarea {
    border: 1px solid #E2E8F0;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    outline: none !important;
}

form input[type='text']:focus, form input[type='password']:focus,
form input[type='date']:focus, form textarea:focus {
    border-color: var(--bs-primary) !important;
}

form .form-text { font-size: 12px; }

.beautiful-checkbox-list > div {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.beautiful-checkbox-list.node-list > div {
    max-height: 240px;
    overflow-y: auto;
}

.beautiful-checkbox-list .form-check { margin: 0; padding: 0; }

.beautiful-checkbox-list .form-check label {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 99px;
    border: 1.5px solid rgb(226, 232, 240);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: rgb(55, 65, 81);
    background: #fff;
    transition: 0.15s;
}

.beautiful-checkbox-list .form-check input { opacity: 0; }

.beautiful-checkbox-list .form-check input:checked + label {
    border: 1.5px solid rgb(59, 130, 246);
    color: rgb(29, 78, 216);
    background: rgb(239, 246, 255);
}

/* ── Районы: TAB (region pills) ── */
#id_district_tabs { padding: 0; }

#id_district_tabs .nav-link {
    padding: 7px 16px;
    border-radius: 99px;
    border: 1.5px solid #E2E8F0;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    transition: 0.15s;
}

#id_district_tabs .nav-link:hover { border-color: #93C5FD; }

#id_district_tabs .nav-link.active {
    border-color: #3B82F6;
    background: #EFF6FF;
    color: #1D4ED8;
}

/* ── Районы: tab count badge ── */
#id_district_tabs .nav-link .tab-count {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.6;
}

/* ── Районы: "*" select-all — form-check pill + rounded-circle ── */
.district-select-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    border: 1.5px solid rgb(226, 232, 240);
    background: #fff;
    color: rgb(55, 65, 81);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: 0.15s;
}

.district-select-all:hover { border-color: rgb(59, 130, 246); }

.district-select-all.active {
    border: 1.5px solid rgb(59, 130, 246);
    color: rgb(29, 78, 216);
    background: rgb(239, 246, 255);
}

.btn-login {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #1D4ED8, #2563EB);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(29, 78, 216, 0.35);
    transition: all 0.2s;
}

.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(29, 78, 216, 0.45); }

.btn-logout {
    font-size: 13px;
    color: #94A3B8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px 16px;
    cursor: pointer;
    flex-shrink: 0;
    font-weight: 600;
}

.page-header { background: #0F172A; }

.page-logo {
    background: rgba(29, 78, 216, 0.18);
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.adbus-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3B82F6;
    animation: pulse-dot 2s ease-in-out infinite;
    display: inline-block;
}

.badge.bg-danger .adbus-dot { background: #FCA5A5; }

.adbus-label {
    font-weight: 700;
    color: #475569;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1D4ED8, #2563EB);
    box-shadow: 0 4px 20px rgba(29, 78, 216, 0.4);
}

.logo-text { font-size: 64px; font-weight: 900; }
.login-sub-text { color: #7CB9F4; }
.stat-lbl { font-size: 11px; color: #475569; }

.sidebar {
    position: sticky;
    width: 220px;
    min-width: 220px;
    border-right: 1px solid #E2E8F0;
    gap: 4px;
    top: 98px;
    height: calc(100vh - 98px);
    transition: left 0.3s linear;
}

.sidebar .pp { padding: 20px 12px; }

.sidebar .header {
    font-size: 10px;
    color: #94A3B8;
    letter-spacing: 0.1em;
    padding: 0 8px;
    margin-bottom: 8px;
}

.sidebar .item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    background: transparent;
    color: #64748B;
}

.sidebar .item.active { background: #EFF6FF; color: #1D4ED8; }

.page-title { color: #0F172A; }
.page-subtitle { color: #94A3B8; }

.card-icon { background: #EFF6FF; width: 40px; height: 40px; }
.card-number { height: 36px; }
.card-title { font-size: 12px; color: #94A3B8; }
.form-block-label { color: #64748B; font-size: 12px; }

.oxvat { font-size: 13px; color: rgb(100, 116, 139); }
.oxvat strong { color: #0F172A; font-size: 16px; }

.device-screen-container { background: #1A1A2E; }
.device-screen { height: 200px; line-height: 20px; background: #aaa; min-width: 0; }

.btn-save {
    border: medium;
    background: linear-gradient(135deg, rgb(220, 38, 38), rgb(185, 28, 28));
    color: #fff;
    cursor: pointer;
    box-shadow: rgba(220, 38, 38, 0.35) 0 4px 14px;
    transition: opacity 0.2s;
}

.btn-save:hover { opacity: 0.9; }

.alert-row { border-left: 5px solid #1D4ED8; }

/* ── alertlar ro'yxati: region chip + hover popover ── */
.region-chip { position: relative; cursor: default; }

.region-chip-pop {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10;
    min-width: 160px;
    max-width: 280px;
    max-height: 240px;
    overflow-y: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    text-align: left;
    white-space: normal;
}

.region-chip:hover .region-chip-pop,
.region-chip:focus .region-chip-pop,
.region-chip:focus-within .region-chip-pop { display: block; }

.region-chip-pop span {
    display: block;
    padding: 3px 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    border-radius: 6px;
}

.region-chip-pop span:hover { background: #F1F5F9; }

.badge.bg-info { background: #EFF6FF !important; color: #1D4ED8; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.inline-card { background: #F8FAFC; border: 1px solid #E2E8F0; }

@media (min-width: 992px) {
    .vh-lg-100 { height: 100vh; }
    .fs-lg-3 { font-size: 1.5rem; }
}

@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        z-index: 1000;
        top: 0;
        left: -100%;
        width: 100%;
        bottom: 0;
    }
    .sidebar.show { left: 0; }
}
