﻿/* Qalqan legacy inline styles moved from local HTML head for CMS/Prod. */
:root { --primary: #006196; --success: #0acf97; --warning: #E0AA7A; --danger: #fa5c7c; --info: #39afd1; --bg: #eef4f8; --text: #2a2c31; }
        .qalqan-legacy-body-unused { margin: 0; background: var(--bg); color: var(--text); }
        
        #sidebar { width: 280px; background: #313a46; color: #909ca7; display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0;}
        #sidebar::-webkit-scrollbar { width: 6px; } #sidebar::-webkit-scrollbar-thumb { background: #4a5a6e; }
        
        .qalqan-legacy-logo-unused { padding: 25px 30px; border-bottom: 1px solid rgba(255,255,255,0.05); }
        .qalqan-legacy-logo-unused h2 { margin: 0; font-weight: 800; font-size: 22px; color: #fff; }
        .qalqan-legacy-logo-sub-unused { font-size: 10px; font-weight: 800; letter-spacing: 4px; color: #64748b; margin-top: 2px; display: block; }
        
        .menu-section { padding: 20px 30px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; color: #fff; opacity: 0.4; }
        
        .menu-item { padding: 12px 30px; cursor: pointer; font-size: 14px; font-weight: 400; transition: 0.2s; border-left: 4px solid transparent; position: relative; }
        .menu-item::before { content: ''; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: #4a5a6e; opacity: 0.5; transition: 0.2s; }
        .menu-item:hover { color: #fff; background: rgba(255,255,255,0.02); padding-left: 35px; }
        .menu-item:hover::before { background: var(--primary); opacity: 1; left: 20px; }
        .menu-item.active { color: #fff; border-left: 4px solid var(--primary); background: rgba(255,255,255,0.05); padding-left: 35px; }
        .menu-item.active::before { background: var(--primary); opacity: 1; left: 20px; }

        #main-content { flex: 1; padding: 40px; overflow-y: auto; scroll-behavior: smooth; }
        .view-section { display: none; animation: fadeIn 0.3s; }
        .view-section.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        .map-wrapper { background: #fff; padding: 30px; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border: 1px solid #eef2f7; display: flex; flex-direction: column; align-items: center; width: 100%; box-sizing: border-box; }
        .legend { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; color: #64748b; margin-bottom: 20px; }
        .gradient-bar { width: 120px; height: 8px; border-radius: 10px; background: linear-gradient(to right, rgba(71, 85, 105, 0.1), rgba(71, 85, 105, 1)); }
        
        #map-rk { display: grid; gap: 4px; grid-template-columns: repeat(35, 26px); grid-template-rows: repeat(20, 26px); position: relative; }
        .pixel { border-radius: 5px; transition: all 0.2s; cursor: crosshair; }
        .pixel.city { background: var(--mfsand) !important; }
        .pixel:hover { transform: scale(1.4); z-index: 100; border: 2px solid #fff; box-shadow: 0 5px 15px rgba(71, 85, 105, 0.4); }
        #map-rk.isolating .pixel { opacity: 1; filter: none; }
        #map-rk.isolating .pixel.active-group { background: rgb(0 97 150) !important; filter: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 6px 16px rgba(0,97,150,0.16); }
        #map-rk.isolating .pixel.city.active-group { background: var(--mfsand) !important; }

        #tooltip { position: fixed; background: #fff; padding: 15px; border-radius: 12px; font-size: 13px; display: none; z-index: 2000; box-shadow: 0 15px 40px rgba(0,0,0,0.15); border: 1px solid #e2e8f0; pointer-events: none; min-width: 250px; }
        .tt-title { font-weight: 800; color: var(--primary); margin-bottom: 12px; text-transform: uppercase; border-bottom: 1px solid #eef2f7; padding-bottom: 8px; }
        .tt-metric { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px;}
        .tt-label { color: #64748b; font-size: 12px; font-weight: 600; }
        .tt-bar-bg { width: 100%; height: 6px; background: #eef2f7; border-radius: 3px; margin-top: 4px; overflow: hidden; display: flex;}
        .tt-bar-gov { background: var(--primary); height: 100%; transition: 0.3s; }
        .tt-bar-priv { background: var(--mfsand); height: 100%; transition: 0.3s; }

        #mobile-region-list { display: none; flex-direction: column; gap: 10px; margin-top: 10px; width: 100%;}
        .region-accordion { background: #fff; border: 1px solid #eef2f7; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.02);}
        .region-header { padding: 15px 20px; font-weight: 800; color: var(--text); cursor: pointer; display: flex; justify-content: space-between; align-items: center;}
        .region-body { padding: 15px 20px; border-top: 1px solid #eef2f7; display: none; background: #f8fafc; }

        .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
        .qalqan-legacy-card-unused { background: #fff; padding: 24px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 24px; border: 1px solid #eef2f7;}
        
        .qalqan-shell table { width: 100%; border-collapse: collapse; font-size: 13px; }
        .qalqan-shell th { padding: 12px; background: #f8fafc; text-align: left; color: var(--text); font-size: 11px; text-transform: uppercase; }
        .qalqan-shell td { padding: 12px; border-bottom: 1px solid #eef2f7; font-weight: 600;}


        @media (max-width: 1024px) {

            #main-content { padding: 20px; }
            .kpi-grid { grid-template-columns: 1fr 1fr; }
            #map-rk { display: none !important; }
            .legend { display: none !important; }
            #mobile-region-list { display: flex; }
        }
        @media (max-width: 600px) {
            .kpi-grid { grid-template-columns: 1fr; }
        }

/* Qalqan Hyper page styles. */
:root {
    --primary: #006196;
    --text: var(--MFText);
    --bg: var(--mfbg);
}

body.bg-page-compact {
    display: block;
    min-height: 100vh;
    height: auto;
    overflow: auto;
    font-family: var(--font-family-sans-serif, "Inter", sans-serif);
    background: var(--mfbg);
    color: var(--MFText);
}

.qalqan-shell {
    font-family: var(--font-family-sans-serif, "Inter", sans-serif);
}

.qalqan-shell button,
.qalqan-shell input,
.qalqan-shell select,
.qalqan-shell textarea {
    font-family: inherit;
}

.qlq-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.qlq-mobile-nav {
    margin-bottom: 1rem;
}

#mobile-nav.qlq-mobile-nav {
    padding: 0;
    background: transparent;
    color: inherit;
    align-items: stretch;
}

.qlq-mobile-nav-toggle {
    width: 100%;
    justify-content: center;
}

.qlq-mobile-nav-panel {
    margin-top: 0.5rem;
    padding: 1rem 1rem 0.85rem;
    border-radius: 0.9rem;
    background: #ffffff;
    border: 1px solid rgba(95, 112, 127, 0.12);
    box-shadow: 0 0 35px 0 rgba(154, 161, 171, 0.15);
}

#sidebar.card {
    position: sticky;
    top: 1.5rem;
    width: 100%;
    max-height: calc(100vh - 3rem);
    padding: 0;
    overflow-y: auto;
    background: #ffffff;
    color: var(--secondary);
    border: 0;
    border-radius: 0.75rem;
    box-shadow: none;
}

#sidebar::-webkit-scrollbar {
    width: 4px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(95, 112, 127, 0.25);
    border-radius: 999px;
}

.menu-section {
    padding: 1rem 1.25rem 0.4rem;
    color: var(--secondary);
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 1;
}

.menu-item {
    display: block;
    margin: 0.15rem 0.75rem;
    padding: 0.55rem 0.5rem;
    color: var(--secondary);
    border-left: 0;
    border-radius: 0.35rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25;
    text-decoration: none;
}

.menu-item::before {
    display: none;
}

.menu-item:hover,
.menu-item.active {
    padding-left: 0.5rem;
    color: var(--primary);
    background: var(--mfbg);
    border-left: 0;
    font-weight: 500;
    text-decoration: none;
}

.menu-item.disabled,
.menu-item.disabled:hover {
    padding-left: 0.5rem;
    color: var(--secondary) !important;
    background: transparent;
    cursor: default;
    opacity: 0.55;
    font-weight: 400;
}

#main-content {
    min-width: 0;
    padding: 0;
    overflow: visible;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.qlq-grid {
    display: grid;
    gap: 1.25rem;
}

.qlq-grid--risk {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.qlq-grid--mis {
    grid-template-columns: 1fr;
}

.qlq-grid--beds-index {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.qlq-grid--beds-summary {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}

.qlq-kpi-card {
    margin: 0;
    border-bottom: 0;
}

.qlq-kpi-card--matrix {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    min-height: 7.25rem;
}

.qlq-kpi-art--stat-objects {
    background-image: url("./icons/stat-objects.jpg");
}

.qlq-kpi-art--stat-population {
    background-image: url("./icons/stat-population.jpg");
}

.qlq-kpi-art--stat-beds {
    background-image: url("./icons/stat-beds.jpg");
}

.qlq-kpi-art--stat-visits {
    background-image: url("./icons/stat-visits.jpg");
}

.qlq-kpi-card--art {
    display: grid;
    grid-template-columns: minmax(86px, 34%) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    min-height: 8.5rem;
}

.qlq-kpi-art {
    display: block;
    min-height: 6rem;
    border-radius: 0.5rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.qlq-kpi-art--mis-active {
    background-image: url("./icons/mis-active.jpg");
}

.qlq-kpi-art--mis-leader {
    background-image: url("./icons/mis-leader.jpg");
}

.qlq-kpi-art--mis-missing {
    background-image: url("./icons/mis-missing.jpg");
}

.qlq-kpi-art--mis-digitalization {
    background-image: url("./icons/mis-digitalization.jpg");
}

.qlq-kpi-art--norm-total {
    background-image: url("./icons/norm-total.jpg");
}

.qlq-kpi-art--norm-gov {
    background-image: url("./icons/norm-gov.jpg");
}

.qlq-kpi-art--norm-priv {
    background-image: url("./icons/norm-priv.jpg");
}

.qlq-kpi-art--norm-pct {
    background-image: url("./icons/norm-pct.jpg");
}

.qlq-kpi-art--risk-aids {
    background-image: url("./icons/risk-aids.jpg");
}

.qlq-kpi-art--risk-tb {
    background-image: url("./icons/risk-tb.jpg");
}

.qlq-kpi-art--risk-psy {
    background-image: url("./icons/risk-psy.jpg");
}

.qlq-kpi-art--risk-total {
    background-image: url("./icons/risk-total.jpg");
}

.qlq-kpi-art--school-students {
    background-image: url("./icons/school-students.jpg");
}

.qlq-kpi-art--school-cabinets {
    background-image: url("./icons/school-cabinets.jpg");
}

.qlq-kpi-art--school-workload {
    background-image: url("./icons/school-workload.jpg");
}

.qlq-kpi-art--school-total-cabinets {
    background-image: url("./icons/school-total-cabinets.jpg");
}

.qlq-kpi-art--beds-24h {
    background-image: url("./icons/beds-24h.jpg");
}

.qlq-kpi-art--beds-day {
    background-image: url("./icons/beds-day.jpg");
}

.qlq-kpi-art--beds-orgs {
    background-image: url("./icons/beds-orgs.jpg");
}

.qlq-kpi-art--beds-index {
    background-image: url("./icons/beds-index.jpg");
}

.qlq-kpi-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

.qlq-kpi-title {
    display: block;
    color: var(--secondary);
    font-size: 0.8125rem;
    line-height: 1.2;
    font-weight: 600;
    text-transform: uppercase;
}

.qlq-kpi-value {
    margin-top: 0.35rem;
    color: var(--MFText);
    font-size: 1.5rem;
    line-height: 1.1;
    font-weight: 700;
}

.qlq-kpi-value--text {
    font-size: 1.05rem;
    line-height: 1.2;
}

.qalqan-shell .card,
.map-wrapper,
.region-accordion {
    border: 0;
    border-radius: 0.75rem;
    box-shadow: none;
}

.qalqan-shell .card {
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #ffffff;
}

.map-wrapper {
    padding: 1.5rem;
    background: #ffffff;
}

.qlq-card-heading {
    margin-bottom: 1rem;
}

.qlq-card-heading--action {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.cgr-hlist {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cgr-hlist-scroll {
    max-height: 26rem;
    overflow-y: auto;
    padding-right: 0.35rem;
    scrollbar-gutter: stable;
}

.cgr-hlist-scroll::-webkit-scrollbar {
    width: 4px;
}

.cgr-hlist-scroll::-webkit-scrollbar-thumb {
    background: rgba(95, 112, 127, 0.2);
    border-radius: 999px;
}

.cgr-hlist-scroll--xl {
    max-height: 34rem;
}

.cgr-hlist--thick .cgr-hlist-bar {
    height: 14px;
    border-radius: 0.25rem;
}

.cgr-hlist--thick .cgr-hlist-fill,
.cgr-hlist--thick .cgr-hlist-stack {
    border-radius: 0.25rem;
}

.cgr-hlist--sm {
    gap: 0.5rem;
}

.cgr-hlist--sm .cgr-hlist-bar {
    height: 5px;
}

.cgr-hlist-item {
    display: block;
}

.cgr-hlist-bar {
    height: 6px;
    width: 100%;
    border-radius: 999px;
    background: rgba(0, 97, 150, 0.08);
    overflow: hidden;
    margin-bottom: 0.35rem;
}

.cgr-hlist-fill,
.cgr-hlist-stack,
.cgr-hlist-segment {
    display: block;
    height: 100%;
}

.cgr-hlist-fill,
.cgr-hlist-stack {
    border-radius: 999px;
    overflow: hidden;
    background: var(--primary);
}

.cgr-hlist-stack {
    display: flex;
    background: transparent;
}

.cgr-hlist-fill--primary,
.cgr-hlist-segment--primary {
    background: var(--primary);
}

.cgr-hlist-fill--sand,
.cgr-hlist-segment--sand {
    background: var(--mfsand);
}

.cgr-hlist-fill--success,
.cgr-hlist-segment--success {
    background: var(--success);
}

.cgr-hlist-fill--danger,
.cgr-hlist-segment--danger {
    background: var(--danger);
}

.cgr-hlist-fill--secondary,
.cgr-hlist-segment--secondary {
    background: var(--secondary);
}

.cgr-hlist-fill--dark,
.cgr-hlist-segment--dark {
    background: #313a46;
}

.cgr-hlist-fill--muted,
.cgr-hlist-segment--muted {
    background: rgba(95, 112, 127, 0.25);
}

.cgr-hlist-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.cgr-hlist-label {
    font-size: 0.8125rem;
    line-height: 1.3;
    color: var(--MFText);
}

.cgr-hlist-meta .badge {
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 600;
}

.cgr-hlist-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.85rem;
    margin-bottom: 0.85rem;
}

.cgr-hlist-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--secondary);
    font-size: 0.75rem;
    line-height: 1.2;
}

.cgr-hlist-legend-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 0.2rem;
    flex: 0 0 auto;
}

.qlq-sankey-alt-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
}

.qlq-sankey-alt-panel {
    min-width: 0;
}

.qlq-mini-title {
    margin: 0 0 0.25rem;
    color: var(--MFText);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.qlq-treemap {
    display: flex;
    min-height: 18rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-content: stretch;
}

.qlq-treemap-tile {
    display: flex;
    min-width: 9rem;
    min-height: 5.75rem;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.85rem;
    overflow: hidden;
    border-radius: 0.75rem;
    color: #ffffff;
}

.qlq-treemap-tile--primary {
    background: var(--primary);
}

.qlq-treemap-tile--sand {
    background: var(--mfsand);
}

.qlq-treemap-tile--success {
    background: var(--success);
}

.qlq-treemap-tile--secondary {
    background: var(--secondary);
}

.qlq-treemap-tile--danger {
    background: var(--danger);
}

.qlq-treemap-tile--muted {
    background: rgba(95, 112, 127, 0.65);
}

.qlq-treemap-label {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
}

.qlq-treemap-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.qlq-treemap-share {
    opacity: 0.8;
    font-size: 0.75rem;
}

.cgr-delay-track {
    display: flex;
    width: 100%;
    min-height: 46px;
    overflow: hidden;
    border-radius: 0.25rem;
    background: rgba(95, 112, 127, 0.08);
}

.cgr-delay-segment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.3rem;
    text-align: center;
}

.cgr-delay-segment--primary {
    background: rgba(0, 97, 150, 0.95);
}

.cgr-delay-segment--success {
    background: rgba(10, 207, 151, 0.92);
}

.cgr-delay-segment--sand {
    background: rgba(224, 170, 122, 0.92);
}

.cgr-delay-segment--danger {
    background: var(--danger);
}

.cgr-delay-segment--secondary {
    background: rgba(95, 112, 127, 0.92);
}

.cgr-delay-segment--muted {
    background: rgba(95, 112, 127, 0.35);
}

.cgr-delay-segment--teal {
    background: rgba(0, 150, 136, 0.9);
}

.cgr-delay-segment--blue {
    background: rgba(57, 175, 209, 0.9);
}

.cgr-delay-segment--orange {
    background: rgba(246, 151, 72, 0.9);
}

.cgr-delay-segment--slate {
    background: rgba(69, 91, 114, 0.9);
}

.cgr-delay-segment--rose {
    background: rgba(214, 96, 124, 0.9);
}

.cgr-delay-segment-value {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
}

.cgr-delay-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.25rem;
    margin-top: 1rem;
    overflow: visible;
}

.cgr-delay-legend-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.cgr-delay-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 auto;
}

.cgr-delay-legend-dot--primary {
    background: var(--primary);
}

.cgr-delay-legend-dot--success {
    background: var(--success);
}

.cgr-delay-legend-dot--sand {
    background: var(--mfsand);
}

.cgr-delay-legend-dot--danger {
    background: var(--danger);
}

.cgr-delay-legend-dot--secondary {
    background: var(--secondary);
}

.cgr-delay-legend-dot--muted {
    background: rgba(95, 112, 127, 0.35);
}

.cgr-delay-legend-dot--teal {
    background: #009688;
}

.cgr-delay-legend-dot--blue {
    background: #39afd1;
}

.cgr-delay-legend-dot--orange {
    background: #f69748;
}

.cgr-delay-legend-dot--slate {
    background: #455b72;
}

.cgr-delay-legend-dot--rose {
    background: #d6607c;
}

.cgr-delay-legend-label {
    font-size: 0.875rem;
    line-height: 1.35;
    color: var(--secondary);
}

.qlq-fast-tooltip {
    position: fixed;
    z-index: 5000;
    max-width: 260px;
    padding: 0.4rem 0.55rem;
    border-radius: 0.35rem;
    background: #20242b;
    color: #ffffff;
    font-size: 0.75rem;
    line-height: 1.25;
    box-shadow: 0 10px 24px rgba(42, 44, 49, 0.16);
    opacity: 0;
    pointer-events: none;
    transform: translateY(2px);
    transition: opacity 0.06s ease, transform 0.06s ease;
}

.qlq-fast-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.btn-download {
    font-weight: 500;
}

.btn-download:hover {
    color: #ffffff;
}

.qalqan-shell th {
    background: var(--mfbg);
    color: var(--secondary);
}

.qalqan-shell td {
    border-bottom-color: rgba(95, 112, 127, 0.12);
}

.gradient-bar {
    background: linear-gradient(to right, rgba(0, 97, 150, 0.12), rgba(0, 97, 150, 0.95));
}

.pixel {
    border-radius: 0.25rem;
}

#tooltip {
    border: 0;
    border-radius: 0.75rem;
}

@media (max-width: 1199.98px) {
    .qalqan-shell {
        padding: 1rem;
    }

    .qlq-layout {
        display: block;
    }

    #sidebar.card {
        display: none;
    }

    #mobile-nav {
        display: block;
    }

    .qlq-grid,
    .qlq-grid--mis,
    .qlq-grid--risk,
    .qlq-grid--beds-index,
    .qlq-grid--beds-summary,
    .qlq-sankey-alt-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .qlq-kpi-card--art {
        grid-template-columns: 7rem minmax(0, 1fr);
    }

    .qlq-treemap {
        min-height: 14rem;
    }
}

@media (max-width: 767.98px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .qalqan-shell .card,
    .map-wrapper {
        padding: 1rem;
    }

    .qlq-treemap-tile {
        min-width: 100%;
    }
}

