@import url("../js/libs/bootstrap/css/bootstrap.min.css");
@import url("bootstrap-icons/font/bootstrap-icons.css");

/* ============================================================
   Хуулийн хэрэгжилтийн үр дагаврын үнэлгээ — Dashboard загвар
   Загвар:  new.parliament.mn/landing
   Өнгө, лого, фонт:  brandbook.pdf (Парламентын брэнд ном, 2025)
   ============================================================ */

/* ------------------------------------------------------------
   БРЭНДИЙН ӨНГӨ  (brandbook 2.1 / 2.2 / 2.3)
   ------------------------------------------------------------ */
:root {
    /* --- 2.1 Төрийн сүлдний өнгө --- */
    --bb-gold:        #ffc700;   /* Алтан шар      · PANTONE 7548 C */
    --bb-blue:        #0041a5;   /* Тэнгэрийн хөх  · PANTONE 293 C  */
    --bb-blue-mid:    #1a84c2;   /* Хадган цэнхэр  · Medium Blue C  */
    --bb-green:       #009848;   /* Ногоон         · PANTONE 347 C  */
    --bb-brown:       #3c2816;   /* Элгэн хүрэн    · Black 4 C      */
    --bb-browngold:       #D1A858;   /* Элгэн хүрэн    · Black 4 C      */

    /* --- 2.2 Туслах өнгө --- */
    --bb-blue-deep:   #00379b;
    --bb-blue-strong: #0050c3;
    --bb-sky:         #85d0fa;
    --bb-tint:        #eff3ff;
    --bb-cream:       #fdf8f4;
    --bb-gray:        #ecedef;
    --bb-gold-soft:   #ffe077;

    /* --- 2.3 Чандмань өнгө --- */
    --bb-navy:        #1d4590;
    --bb-cyan:        #27aae1;
    --bb-green-mid:   #55c364;
    --bb-green-soft:  #b4d78b;
    --bb-red:         #d12026;
    --bb-orange:      #e45a22;
    --bb-amber:       #f7941d;

    /* --- Хуудасны хэрэглээ (landing-тэй ижил) --- */
    --c-blue:        var(--bb-blue);
    --c-blue-dark:   #023378;
    --c-gray:        #667085;
    --c-green:       var(--bb-green);
    --c-red:         var(--bb-red);
    --c-orange:      var(--bb-amber);
    --c-browngold:      var(--bb-browngold);

    --c-text:        #16264a;
    --c-muted:       #6b7280;
    --c-border:      #e2e8f2;
    --c-line:        #eef2f8;
    --c-track:       #e2e8f2;

    --c-page:        #f8f9fa;
    --c-card:        #ffffff;
    --c-footer:      var(--c-blue-dark);

    --radius:        10px;
    --shadow:        0 1px 2px rgba(15, 23, 42, .05),
                     0 8px 24px rgba(15, 23, 42, .06);
    --shadow-lg:     0 2px 8px rgba(15, 23, 42, .06),
                     0 16px 36px rgba(15, 23, 42, .16);

    /* --- 4.1 Үндсэн үсгийн эв: SF Pro Display --- */
    --font-sans:     "SF Pro Display", -apple-system, BlinkMacSystemFont,
                     "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* --- 4.3 Туслах үсгийн эв: Cormorant Garamond --- */
    --font-display:  "Cormorant Garamond", "SF Pro Display", Georgia, serif;

    --shell:         1400px;   /* landing-ийн савны өргөн */
}

/* ------------------------------------------------------------
   Ерөнхий
   ------------------------------------------------------------ */
* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--c-page);
    color: var(--c-text);
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100vh;           /* footer-г дэлгэцийн доор байрлуулах */
}

/* Бүх мөрийн дотоод хүрээ — landing дээрх шиг нэг л өргөнтэй */
.shell {
    width: 100%;
    max-width: calc(var(--shell) + 48px);   /* 24px×2 padding-ийг нөхнө → агуулга яг 1400px */
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   1. Дээд туслах мөр (topbar) — гүн хөх
   ============================================================ */
.topbar {
    background: var(--bb-blue);
    color: #fff;
}
.topbar .shell {
    display: flex;
    align-items: center;
    gap: 16px;              /* burger → эхний цэс */
    height: 48px;           /* landing: min-height 48px */
}

.topbar__burger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;            /* landing: 24×24 icon */
    height: 24px;
    flex-shrink: 0;
    background: none;
    border: 0;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
    opacity: .95;
}
.topbar__burger:hover { opacity: 1; }

.topbar__nav {
    display: flex;
    align-items: center;
    gap: 24px;              /* landing: цэс хоорондын зай */
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.topbar__nav a {
    color: #fff;
    font-size: 11px;        /* landing: 11px / 400 */
    font-weight: 400;
    line-height: 16.5px;
    text-decoration: none;
    white-space: nowrap;
    opacity: .92;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.topbar__nav a:hover { opacity: 1; text-decoration: underline; }
.topbar__nav i { font-size: 9px; }

.topbar__login {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 2.4px 20px;    /* landing: өндөр ≈26.8px */
    border: 1px solid #fff;
    border-radius: 7px;     /* landing: pill биш, 7px */
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 19.25px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.topbar__login:hover {
    background: rgba(255, 255, 255, .14);
    border-color: #fff;
    color: #fff;
}

/* ============================================================
   2. Брэндийн мөр — сүлд + нэр + хайлт
   ============================================================ */
.brandbar {
    background: #fff;
    position: relative;
    z-index: 2;
    box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .2);   /* landing: толгойн доод сүүдэр */
}
/* Доор нь цэсний мөр байвал сүүдрийг тэр аваад явна */
.brandbar:has(+ .navbar-main) { box-shadow: none; }
.brandbar .shell {
    display: flex;
    align-items: center;
    gap: 16px;              /* landing: лого → нэр */
    padding-top: 16px;      /* landing: 16px 0 4px → мөрийн өндөр 96px */
    padding-bottom: 4px;
}

.brandbar__emblem {
    height: 76px;           /* landing: сүлдний өндөр яг 76px */
    width: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.brandbar__name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 76px;           /* логотой ижил өндөр — босоо голдоо */
}
.brandbar__name strong {
    font-size: 18px;        /* landing: 18px / 600 / 27px */
    font-weight: 600;
    line-height: 27px;
    letter-spacing: normal;
    color: var(--c-blue-dark);
    text-transform: uppercase;
}
.brandbar__name span {
    font-size: 11px;        /* landing-ийн туслах бичгийн хэмжээ */
    font-weight: 600;
    line-height: 16.5px;
    letter-spacing: 1.2px;
    color: var(--bb-blue-mid);
    text-transform: uppercase;
}

.brandbar__spacer { flex: 1; }

/* Хамрах хүрээний индекс — landing дээрх «ШИЛЭН ИНДЕКС» шиг */
.index-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;               /* landing: шошго → тэмдэг */
    font-size: 11px;        /* landing: 11px / 600 / 16.5px */
    font-weight: 600;
    line-height: 16.5px;
    letter-spacing: normal;
    color: var(--c-blue-dark);
    text-transform: uppercase;
    white-space: nowrap;
}
.index-badge b {
    display: inline-flex;
    align-items: center;
    height: 24px;           /* landing: 24px өндөр, 8px радиус */
    padding: 0 8px;
    background: var(--bb-green);
    color: #fff;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16.5px;
    letter-spacing: normal;
}

.searchbox {
    position: relative;
    width: 340px;           /* landing: 340×28, радиус 120px */
    max-width: 34vw;
    margin-left: 16px;
}
.searchbox input {
    width: 100%;
    height: 28px;
    padding: 0 34px 0 14px;
    border: 0;
    border-radius: 120px;
    background: #f9f9fb;
    font-family: inherit;
    font-size: 12px;
    color: var(--c-text);
    outline: none;
    transition: box-shadow .15s;
}
.searchbox input::placeholder { color: #9aa4b6; }
.searchbox input:focus { box-shadow: 0 0 0 3px rgba(133, 208, 250, .35); }
.searchbox i {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-muted);
    font-size: 13px;
    pointer-events: none;
}

/* ============================================================
   3. Үндсэн цэсний мөр — идэвхтэй нь navy pill + алтан зураас
   ============================================================ */
.navbar-main {
    background: #fff;
    /* landing: доод хүрээ биш, зөөлөн сүүдэр */
    box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .2);
    position: relative;
    z-index: 2;
}
.navbar-main .shell {
    display: flex;
    align-items: center;
    gap: 4px;               /* landing: таб хоорондын зай */
    height: 50.4px;         /* landing: цэсний мөрийн өндөр */
}

/* Таб бүрийн бүрхүүл — унждаг дэд цэсний байрлалын тулгуур */
.navitem {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.navtab {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 4px 16px;      /* landing: таб 26px өндөр */
    border-radius: 6px;
    font-size: 12px;        /* landing: 12px / 500 / 18px */
    font-weight: 500;
    line-height: 18px;
    color: var(--c-blue-dark);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.navtab:hover { background: var(--bb-tint); color: var(--c-blue); }

.navtab.is-active {
    background: var(--c-blue-dark);
    color: #fff;
}
.navtab.is-active::after {          /* алтан доогуур зураас */
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    bottom: -12px;
    height: 4px;
    border-radius: 6px;
    background: var(--bb-gold);
}

/* ---------- Унждаг дэд цэс ----------
   Нээх нь: хулганаар дээгүүр (hover), гараас табаар (focus-within),
   мөн мэдрэгч дэлгэц дээр эхний товшилт (.is-open — js/app.js).        */
.navtab__caret {
    margin-left: 6px;
    font-size: 9px;
    line-height: 1;
    transition: transform .15s;
}
.navitem.is-open .navtab__caret { transform: rotate(180deg); }

.navsub {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 40;
    min-width: 246px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-top: 3px solid var(--bb-gold);   /* brandbook: алтан ирмэг */
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 14px 28px -10px rgba(2, 51, 120, .28);

    /* Хаалттай байдал — display:none биш, тул нээхэд зөөлөн гарч ирнэ */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .15s, transform .15s, visibility .15s;
}
.navitem--has-sub:hover .navsub,
.navitem--has-sub:focus-within .navsub,
.navitem.is-open .navsub {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.navsub__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    color: var(--c-text);
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.navsub__item i { color: var(--bb-blue-mid); font-size: 13px; }
.navsub__item:hover,
.navsub__item:focus-visible {
    background: var(--bb-tint);
    color: var(--c-blue);
    outline: none;
}
.navsub__item:hover i { color: var(--c-blue); }

.navbar-main__spacer { flex: 1; }

.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 26px;           /* табтай ижил өндөр, ижил радиус */
    padding: 0 12px;
    border: 0;
    background: var(--bb-tint);
    color: var(--c-blue-dark);
    font-weight: 600;
    font-size: 12px;
    line-height: 18px;
    border-radius: 6px;
    white-space: nowrap;
}
.date-badge i { color: var(--bb-blue-mid); }

/* ============================================================
   3.b Замчлал (breadcrumb) — хэсгийн гарчгаас дээр
   ============================================================ */
.crumbs { padding: 14px 0 0; }
.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    line-height: 18px;
}
.crumb a { color: var(--c-muted); text-decoration: none; }
.crumb a:hover { color: var(--bb-blue); text-decoration: underline; }
.crumb.is-current {
    color: var(--c-text);
    font-weight: 600;
    max-width: 52ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.crumb__sep i { font-size: 9px; color: var(--c-browngold); }

/* ============================================================
   4. Хэсгийн гарчиг + алтан чимэглэл (landing-ийн ornament)
   ============================================================ */
.section-head {
    text-align: center;
    padding: 34px 0 26px;
}

.section-head__title {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: .8px;
    line-height: 1.25;
    color: var(--c-blue-dark);
    text-transform: uppercase;
}
.section-head__sub {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--c-muted);
}

.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    max-width: 560px;
    margin: 0 auto;
}
.ornament--above { margin-bottom: 12px; }
.ornament--below { margin-top: 12px; max-width: 700px; }

.ornament__rule {
    flex: 1;
    height: 1.5px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(255,199,10,0) 0%, var(--bb-gold) 85%);
}
.ornament--above .ornament__rule:last-child,
.ornament--below .ornament__rule:last-child {
    background: linear-gradient(90deg, var(--bb-gold) 15%, rgba(255,199,10,0) 100%);
}

.ornament__bead {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--bb-gold);
    flex: 0 0 auto;
}
.ornament__bead--sm { width: 3px; height: 3px; opacity: .7; }

.ornament__emblem {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex: 0 0 auto;
    margin: 0 3px;
}

.ornament__diamond {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    background: var(--bb-gold);
    transform: rotate(45deg);
    border-radius: 2px;
    position: relative;
}
.ornament__diamond::before {
    content: "";
    position: absolute;
    inset: 2.5px;
    background: #fff;
    border-radius: 1px;
}

/* ============================================================
   5. Хуудасны их бие
   ============================================================ */
.page-body {
    flex: 1;
    padding-bottom: 40px;
}
/* ============================================================
   Статистик картууд
   ============================================================ */
.stats {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 11px;
    margin-bottom: 15px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 64px;                 /* бүх карт ижил өндөр */
    padding: 12px 13px;
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Дарж болох карт — тухайн төлвийн хуулийн жагсаалтыг modal-аар нээнэ */
.stat-card.is-clickable {
    cursor: pointer;
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.stat-card.is-clickable:hover {
    border-color: var(--bb-sky);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.stat-card.is-clickable:active { transform: none; }

/* .stat-card            { border-left: 3px solid var(--bb-blue); }
.stat-card--dark      { border-left: 3px solid var(--c-blue-dark); }
.stat-card--gray      { border-left: 3px solid #b7c0cf; }
.stat-card--yellow    { border-left: 3px solid var(--bb-gold); }
.stat-card--green     { border-left: 3px solid var(--c-green); }
.stat-card--red       { border-left: 3px solid var(--c-red); }
.stat-card--browngold { border-left: 3px solid var(--c-browngold); }
.stat-card--orange    { border-left: 3px solid var(--bb-orange); } */

.stat-card__icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--bb-tint);
    color: var(--c-blue);
}
.stat-card__icon i { font-size: 18px; }

.stat-card--green  .stat-card__icon { background: #e7f8ef; color: var(--c-green); }
.stat-card--black    .stat-card__icon { background: #fdeaea; color: var(--c-text); }
.stat-card--red    .stat-card__icon { background: #fdeaea; color: var(--c-red); }
.stat-card--browngold    .stat-card__icon { background: #fdeaea; color: var(--c-browngold); }
.stat-card--orange .stat-card__icon { background: #fef3e2; color: var(--c-orange); }
.stat-card--yellow .stat-card__icon { background: #fff6d6; color: #b98600; }
.stat-card--dark   .stat-card__icon { background: #e3ebfa; color: var(--c-blue-dark); }
.stat-card--gray   .stat-card__icon { background: var(--bb-gray); color: var(--c-gray); }

.stat-card__body {
    min-width: 0;
    margin-left: auto;        /* агуулгыг баруун тал руу шахах */
    text-align: right;
}

.stat-card__value {
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: var(--c-blue);     /* дундах картууд — өөрийн өнгөтэй (цэнхэр) */
}
/* PDF: 937, 205 — хар; 42 — сааралдуу */
.stat-card--dark   .stat-card__value { color: var(--c-blue-dark); }
.stat-card--black   .stat-card__value { color: var(--c-text); }
.stat-card--gray   .stat-card__value { color: var(--c-gray); }
.stat-card--yellow .stat-card__value { color: #b98600; }
.stat-card--green  .stat-card__value { color: var(--c-green); }
.stat-card--red    .stat-card__value { color: var(--c-red); }
.stat-card--browngold    .stat-card__value { color: var(--c-browngold); }
.stat-card--orange .stat-card__value { color: var(--bb-orange); }

.stat-card__label {
    margin-top: 5px;
    font-size: 11px;
    color: var(--c-muted);
    line-height: 1.25;
}

/* ============================================================
   Үндсэн самбарууд (3 багана)
   ============================================================ */
.panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
    align-items: stretch;        /* гурван самбар ижил өндөр */
    margin-bottom: 16px;
}

.panel {
    display: flex;
    flex-direction: column;      /* доторх агуулгыг босоо өрж note/highlight-г доор байрлуулах */
    height: 100%;
    min-width: 0;                /* grid баганад агуулгаасаа доош багасах боломж (ECharts overflow-оос сэргийлнэ) */
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px 17px;
}

.panel__title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 13px;
    font-size: 14px;
    font-weight: 600;
    /* letter-spacing: .3px; */
    color: var(--c-blue-dark);
    text-transform: uppercase;
}
.panel__title::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--bb-blue) 0 55%, var(--bb-gold) 55% 100%);
}

.panel__subtitle {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 20px 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
    color: var(--c-blue-dark);
    text-transform: uppercase;
}
.panel__subtitle::before {
    content: "";
    width: 4px;
    height: 15px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--bb-blue) 0 55%, var(--bb-gold) 55% 100%);
}

/* ---------- График сав ---------- */
.chart { width: 100%; min-width: 0; }

.charts-row {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 8px;
    align-items: center;
}
.charts-row > * { min-width: 0; }   /* доторх графикууд багасах боломжтой */

.chart--donut { height: 195px; }
.chart--gauge { height: 195px; }
.chart--line  { height: 205px; }
.chart--combo { height: 225px; }

.gauge-scale {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    margin-top: -14px;
    font-size: 11px;
    color: var(--c-muted);
}

/* ============================================================
   Хүснэгтүүд
   ============================================================ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    text-align: left;
    padding: 8px;
    font-weight: 600;
    color: var(--c-blue-dark);
    background: var(--bb-tint);
    border-bottom: 1px solid #d8e2f5;
    font-size: 12px;
    letter-spacing: .2px;
}
.data-table th.num,
.data-table td.num { text-align: right; }
.data-table th.date, 
.data-table td.date { text-align: center; }
.data-table th.center, 
.data-table td.center { text-align: center; }

.data-table td {
    padding: 8px;
    border-bottom: 1px solid var(--c-line);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table .row-total td {
    font-weight: 600;
    color: var(--c-text);
    border-top: 2px solid var(--c-border);
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 7px;
    vertical-align: middle;
}
.dot--green  { background: var(--c-green); }
.dot--red    { background: var(--c-red); }
.dot--orange { background: var(--c-orange); }

.txt-green  { color: var(--c-green);  font-weight: 600; }
.txt-red    { color: var(--c-red);    font-weight: 600; }
.txt-orange { color: var(--c-orange); font-weight: 600; }

.org-table td.rank { color: var(--c-muted); width: 26px; }
.org-table td.count { color: var(--c-blue); font-weight: 600; }
.org-table tbody tr { cursor: pointer; }
.org-table tbody tr:hover { background: var(--bb-tint); }

/* Хураасан үед 10-аас хойших мөрүүд нуугдана (app.js онооно) */
.org-table tbody tr.is-hidden { display: none; }

/* ---------- Байгууллагын гүйлгэдэг жагсаалт ----------
   max-height нь ~10 мөр + толгой хэсэгт таарна: хураасан үед scroll гарахгүй,
   бүгдийг нээхэд л гүйлгэх мөр үүснэ. */
.org-scroll {
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;   /* төгсгөлд хүрэхэд хуудас гүйхээс сэргийлнэ */
}

/* Гүйлгэх үед хүснэгтийн толгой дээрээ наалттай үлдэнэ */
.org-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Нарийн, эвгүй харагдахгүй гүйлгүүр */
.org-scroll::-webkit-scrollbar { width: 8px; }
.org-scroll::-webkit-scrollbar-thumb {
    background: #d7dce6;
    border-radius: 4px;
}
.org-scroll::-webkit-scrollbar-thumb:hover { background: #c2c9d6; }
.org-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- «Бусад байгууллагыг харах» товч ---------- */
.org-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    padding: 8px 10px;
    background: #f6f8fb;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-blue);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.org-more:hover { background: var(--bb-tint); color: var(--c-blue-dark); }
.org-more i { font-size: 11px; transition: transform .2s; }
.org-more.is-open i { transform: rotate(180deg); }

/* ---------- Тэмдэглэл ---------- */
.note {
    margin-top: auto;            /* card-ны доор наагдана */
    padding: 10px 12px;
    background: #f6f8fb;
    border-radius: 8px;
    font-size: 12px;
    color: var(--c-muted);
}

/* ---------- Онцлох тоо (баруун доод) ---------- */
.highlight {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;            /* card-ны доор наагдана */
    padding: 14px 17px;
    background: linear-gradient(135deg, var(--c-blue-dark) 0%, var(--bb-blue) 100%);
    border: 0;
    border-radius: var(--radius);
}
.highlight__label { font-size: 12px; font-weight: 600; color: #d9e5fa; }
.highlight__value { font-size: 20px; font-weight: 700; color: var(--bb-gold); }

/* ---------- Графикийн тайлбар (legend) ---------- */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin: 4px 0 6px;
    font-size: 11px;
    color: var(--c-text);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; }

.combo-summary {
    font-size: 11px;
    color: var(--c-muted);
    text-align: right;
    margin-top: 2px;
}
.combo-summary b { color: var(--c-blue); }

/* ============================================================
   «Үнэлгээ хийх шаардлагатай хууль» — хөлийн дээрх жагсаалт
   (modules/parts/lawneed.php + js/parts/lawneed.js)
   ============================================================ */
.lawneed {
    background: #fff;
    border-top: 1px solid var(--c-border);
    padding-bottom: 44px;
}
.lawneed .section-head { padding-top: 40px; }
.lawneed .section-head__title { font-size: 22px; }

.lawneed .panel { padding: 18px 20px 20px; }

/* Хайлтын шүүлтүүр — жагсаалтаас нэг зураасаар тусгаарлана */
.lawneed .flt { margin-bottom: 14px; }

.lawneed__note {
    margin: 0 0 10px;
    padding: 8px 12px;
    background: var(--bb-tint);
    border-radius: 7px;
    color: var(--c-blue-dark);
    font-weight: 600;
}

/* Ачаалж байх үед агуулгыг бүдгэрүүлнэ (байрлал нь хөдлөхгүй) */
.lawneed__body { min-height: 120px; }
.lawneed__body.is-loading { opacity: .45; transition: opacity .15s; }

.lawneed__table td { vertical-align: top; }
.lawneed__table tbody tr { cursor: pointer; }
.lawneed__table tbody tr:hover { background: var(--bb-tint); }
.lawneed__table td.rank { color: var(--c-muted); width: 34px; }
.lawneed__table .bi-chevron-right { color: var(--c-muted); font-size: 11px; }

.lawneed__pager { margin-top: 14px; }
.lawneed__pager .page-link {
    font-size: 12px;
    padding: 4px 10px;
    color: var(--c-blue);
    border-color: var(--c-border);
}
.lawneed__pager .page-item.active .page-link {
    background: var(--c-blue);
    border-color: var(--c-blue);
    color: #fff;
}
.lawneed__pager .page-item.disabled .page-link { color: var(--c-muted); }

/* ============================================================
   Хөл хэсэг — landing-ийн бүтэц: холбоо барих карт + баганууд + доод мөр
   ============================================================ */
.site-footer {
    margin-top: auto;
    background: #f4f7fc;
    border-top: 6px solid var(--bb-blue);
}

/* --- Холбоо барих цагаан карт --- */
.footer-card {
    display: flex;
    align-items: stretch;
    gap: 26px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 26px;
    margin: 30px 0 26px;
    flex-wrap: wrap;
}

.footer-card__brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 320px;
    min-width: 260px;
}
.footer-card__brand img { width: 54px; height: 54px; object-fit: contain; }
.footer-card__brand strong {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: .3px;
    color: var(--c-blue-dark);
    text-transform: uppercase;
}

.footer-card__col {
    flex: 1 1 190px;
    min-width: 170px;
    padding-left: 26px;
    border-left: 1px solid var(--c-line);
    font-size: 11.5px;
    color: var(--c-gray);
    line-height: 1.65;
}
.footer-card__col i {
    display: block;
    font-size: 17px;
    font-style: normal;
    color: var(--bb-blue);
    margin-bottom: 4px;
}
.footer-card__col em {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--bb-gold);
    margin-bottom: 8px;
}
.footer-card__col a { color: var(--c-gray); text-decoration: none; }
.footer-card__col a:hover { color: var(--bb-blue); text-decoration: underline; }
.footer-card__col--plain { border-left: 0; padding-left: 0; flex: 1 1 250px; }

/* --- Холбоосын баганууд --- */
.footer-links {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 26px;
    padding-bottom: 32px;
}
.footer-links h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-blue-dark);
}
.footer-links h4::after {
    content: "";
    display: block;
    width: 26px;
    height: 2px;
    background: var(--bb-gold);
    margin: 7px 0 12px;
}
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 7px; }
.footer-links a {
    font-size: 11.5px;
    color: #4b5563;
    text-decoration: none;
}
.footer-links a:hover { color: var(--bb-blue); text-decoration: underline; }

/* --- Доод хар хөх мөр --- */
.footer-bar {
    background: var(--c-footer);
    color: #cfdcf1;
}
.footer-bar .shell {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 52px;
    flex-wrap: wrap;
}
.footer-bar__copy {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: #fff;
}
.footer-bar__spacer { flex: 1; }
.footer-bar__links {
    display: flex;
    align-items: center;
    gap: 14px;
}
.footer-bar__links a {
    color: #cfdcf1;
    font-size: 11.5px;
    text-decoration: none;
}
.footer-bar__links a:hover { color: var(--bb-gold); }
.footer-bar__top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    border-radius: 6px;
    background: var(--bb-gold);
    color: var(--c-blue-dark);
    font-size: 14px;
    text-decoration: none;
}
.footer-bar__top:hover { background: var(--bb-gold-soft); color: var(--c-blue-dark); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1300px) {
    .footer-links { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1200px) {
    .stats  { grid-template-columns: repeat(4, 1fr); }
    .panels { grid-template-columns: 1fr; }
    .topbar__nav a:nth-child(n+6) { display: none; }
}
@media (max-width: 900px) {
    .brandbar .shell { flex-wrap: wrap; }
    .searchbox { width: 100%; max-width: none; order: 5; }
    /* Дэд цэс унжих зайтай байхын тулд гүйлгэхийн оронд мөрөө таслана
       (overflow-x:auto нь absolute унждаг цэсийг тасалж хаядаг) */
    .navbar-main .shell {
        flex-wrap: wrap;
        align-content: center;
        row-gap: 6px;
        height: auto;
        min-height: 50.4px;
    }
    .navsub {
        min-width: 210px;
        max-width: calc(100vw - 40px);
    }
    .navsub__item { white-space: normal; }
    .footer-card__col { border-left: 0; padding-left: 0; }
}
@media (max-width: 640px) {
    .shell  { padding: 0 14px; }
    .crumbs { padding-top: 10px; }
    .crumbs ol { font-size: 12px; }
    .stats  { grid-template-columns: repeat(2, 1fr); }
    .topbar__nav { display: none; }
    .brandbar__name strong { font-size: 16px; }
    .section-head__title { font-size: 19px; }
    .footer-links { grid-template-columns: repeat(2, 1fr); }
    .navbar-main__spacer { display: none; }
    .date-badge { margin-left: auto; }
}

/* ---------- Хуудасны агуулга ---------- */
#page.is-loading { opacity: .45; transition: opacity .15s; }
.panels--single { grid-template-columns: 1fr; }

/* ---------- Modal ---------- */
.m-body .data-table td.rank { color: var(--c-muted); width: 34px; }
.m-pager .page-link { font-size: 12px; padding: 3px 9px; }

/* ---------- Цонхны ТОГТМОЛ өндөр ----------
   .modal-dialog-scrollable нь .modal-content дээр max-height:100% тавьдаг тул
   өндөр нь агуулгаараа хэлбэлздэг. height болгож 85vh-д тогтооно.
   (centerVertical-ийн min-height-ийг мөн 0 болгож дарна.)

   Бүтэн дэлгэцийн (modal-fullscreen*) үед энэ дүрэм ХАМААРАХГҮЙ —
   өндөр/өргөнийг Bootstrap өөрөө (өөрийн breakpoint-той нь) барина. */
.m-dialog .modal-dialog:not([class*="modal-fullscreen"]) {
    height: 94vh;
    min-height: 0;
}
.m-dialog .modal-content { height: 100%; }

/* ---------- Гарчгийн мөр — topbar-ийн загвар ----------
   Дээд туслах мөртэй (.topbar) ижил: тэнгэрийн хөх дэвсгэр, цагаан бичиг,
   48px өндөр. Хаах товчийг Bootstrap-ийн btn-close-white цайруулна
   (router.js openDialog нэмнэ). */
.m-dialog .modal-header {
    background: var(--bb-blue);
    color: #fff;
    border-bottom: 0;
    min-height: 48px;
    padding: 8px 20px;
    align-items: center;
}
.m-dialog .modal-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}
.m-dialog .modal-header .btn-close { opacity: .85; }
.m-dialog .modal-header .btn-close:hover { opacity: 1; }
.m-dialog .modal-back { color: rgba(255, 255, 255, .78); }
.m-dialog .modal-back:hover { color: #fff; }

/* Бүтэн дэлгэц: булан, хажуугийн зай байхгүй тул дотоод зайг арай задгай */
.m-dialog .modal-dialog[class*="modal-fullscreen"] .modal-header,
.m-dialog .modal-dialog[class*="modal-fullscreen"] .modal-body { padding-inline: 20px; }

/* Гарчиг, хуудаслалт, «Хаах» зогсож, зөвхөн дунд хэсэг гүйнэ */
.m-dialog .modal-body { overflow-y: auto; }
.m-dialog .modal-footer {
    justify-content: space-between;
    padding: 7px 12px;
    gap: 10px;
}
.m-dialog .modal-footer > nav { margin: 0; }

/* Гүн рүү орох боломжтой мөр */
.m-body tr.is-drillable { cursor: pointer; }
.m-body tr.is-drillable:hover { background: #f6f8fc; }
.m-body tr.is-drillable .bi-chevron-right { color: var(--c-muted); font-size: 11px; }

/* Modal-ийн буцах товч (стек 2-оос дээш үед л харагдана) */
.modal-back {
    display: none;
    border: none;
    background: transparent;
    color: var(--c-muted);
    font-size: 16px;
    line-height: 1;
    padding: 0 10px 0 0;
    cursor: pointer;
}
.modal-back:hover { color: var(--c-text); }

/* Байгууллагын мөр — дарж болохыг илтгэнэ */
.org-table tbody tr[data-modal] { cursor: pointer; }
.org-table tbody tr[data-modal]:hover { background: #f6f8fc; }

/* ============================================================
   Дэлгэрэнгүй харагдац (.dv) — modal доторх «Бүртгэл» хуудас
   Хууль → үнэлгээний тайлан → дүн шинжилгээ
   ============================================================ */
.dv { font-size: 12px; }

/* ---------- Хэсгийн гарчиг (▸ Гарчиг) ---------- */
.dv-sec { margin-bottom: 24px; }
.dv-sec__title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-text);
    text-transform: uppercase;
}
.dv-sec__title::before {          /* жижиг гурвалжин заагч */
    content: "";
    width: 0; height: 0;
    border-left: 5px solid var(--c-muted);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}
.dv-year {
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: #eef3ff;
    color: var(--c-blue-dark);
    font-size: 12px;
}

/* ---------- Актын товч хуудас ---------- */
.dv-act {
    background: #f7f9fc;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    padding: 10px 12px;
}
.dv-act__head { display: flex; gap: 10px; align-items: flex-start; }
.dv-act__tag  { color: var(--c-muted); flex: 0 0 auto; }
.dv-act__name { font-weight: 600; color: var(--c-text); }
.dv-act__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 28px;
    margin-top: 8px;
    color: var(--c-muted);
}
.dv-act__meta > span {         /* span бүр нийт зайг тэнцүү хуваана */
    flex: 1 1 0;
    min-width: 0;
}
.dv-act__meta b { color: var(--c-text); font-weight: 600; }
.dv-act__subtitle {            /* карт доторх дэд гарчиг — доогуураа зураастай */
    display: block;
    margin: 14px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--c-border);
    font-size: 12px;
    color: var(--c-text);
    text-transform: uppercase;
}
.dv-act__meta__divider {       /* мөр хооронд хөндлөн тусгаарлах зураас */
    height: 1px;
    margin: 10px 0;
    background: var(--c-border);
}

/* ---------- Хариуцсан байгууллагын товчнууд ---------- */
.dv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dv-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #d8e3fb;
    border-radius: 999px;
    background: #eef3ff;
    color: var(--c-blue-dark);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.dv-chip:hover { background: #e0e9ff; }
.dv-chip .bi-chevron-right { font-size: 10px; color: var(--c-blue); }

/* ---------- Тайлангийн карт (аккордеон): зүүн 2/3, баруун 1/3 ---------- */
.dv-report {
    margin-top: 10px;
    border: 1px solid var(--c-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--c-card);
}

/* Дарж нээх гарчиг */
.dv-acc {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-bottom: 1px solid transparent;
    background: #f5f8fd;
    font: inherit;
    font-weight: 600;
    color: var(--c-text);
    text-align: left;
    cursor: pointer;
}
.dv-acc:hover { background: #eaf1fd; }
.dv-report.is-open .dv-acc { border-bottom-color: var(--c-border); }

.dv-acc__caret {
    color: var(--c-muted);
    font-size: 11px;
    transition: transform .15s ease;
}
.dv-report.is-open .dv-acc__caret { transform: rotate(90deg); }

.dv-acc__org {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    color: var(--c-gray);
    font-weight: 600;
}
.dv-acc__org i { color: var(--c-green); }

/* Дэлгэрэнгүй хэсэг — зөвхөн нээлттэй үед */
.dv-report__body { display: none; padding: 12px; }
.dv-report.is-open .dv-report__body { display: block; }
.dv-report__body .dv-sec { margin-bottom: 0; }
.dv-report__body .dv-sec__title {
    margin-bottom: 6px;
    color: var(--c-muted);
    font-size: 11px;
    letter-spacing: .2px;
}
.dv-report__body .dv-sec__title::before { display: none; }

/* Хоёр баганыг ганцхан нимгэн зураасаар тусгаарлана */
.dv-report__body .dv-grid > section + section {
    padding-left: 18px;
    border-left: 1px solid var(--c-line);
}
.dv-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    align-items: start;
}

/* ---------- Шошго : утга мөрүүд ----------
   Хүрээ, зураас, судалгүй — шошго саарал, утга тод. */
.dv-list { border: 0; }
.dv-row { display: grid; grid-template-columns: 175px 1fr; align-items: start; padding: 5px 0; }
.dv-list--narrow .dv-row { grid-template-columns: 145px 1fr; }   /* нарийн баганад */
.dv-row dt {
    padding: 0 12px 0 0;
    line-height: 1.45;          /* dd-тэй ижил мөрийн өндөр — дээд ирмэг тааруулна */
    color: var(--c-muted);       /* шошго — чухал биш */
    font-size: 11px;
    font-weight: 400;
}
.dv-row dd {
    margin: 0;
    line-height: 1.45;
    color: var(--c-text);        /* утга — үндсэн мэдээлэл */
    font-size: 12px;
    overflow-wrap: anywhere;
}
.dv-row dd .bold{
    font-weight: 600;
}
.dv-hint  { margin-top: 2px; color: var(--c-muted); font-size: 11px; font-weight: 400; }
.dv-empty { color: var(--c-muted); font-weight: 400; }

/* ---------- Тийм / Үгүй ---------- */
.dv-flag {
    display: inline-block;
    padding: 1px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.dv-flag--yes { background: #e7f8ef; color: #15803d; }
/* Хүчингүй актын шошго — жагсаалтын мөр, дэлгэрэнгүйн гарчигт */
.act-invalid {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #fdecec;
    color: var(--c-red);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: middle;
}
.dv-act__meta--invalid { color: var(--c-red); }
.dv-flag--no  { background: #f1f3f7; color: var(--c-gray); }

/* ---------- Файл, холбоос ---------- */
.dv-file {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--c-blue);
    font-weight: 600;
    text-decoration: none;
}
.dv-file i {
    font-size: 60px;
}
.dv-file:hover { text-decoration: underline; }
.dv-link { color: var(--c-blue); overflow-wrap: anywhere; }

/* ---------- Тайлангүй үед ---------- */
.dv-none {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 14px;
    border: 1px dashed var(--c-border);
    border-radius: 8px;
    background: #f9fafc;
    color: var(--c-gray);
}

@media (max-width: 900px) {
    .dv-grid { grid-template-columns: 1fr; }
    .dv-report__body .dv-grid > section + section {
        padding-left: 0;
        border-left: 0;
        border-top: 1px solid var(--c-line);
        padding-top: 10px;
    }
    .dv-acc  { flex-wrap: wrap; }
    .dv-acc__org { margin-left: 0; flex-basis: 100%; }
    .dv-row  { grid-template-columns: 130px 1fr; }
}

/* ============================================================
   Хайлтын шүүлтүүр (.flt) — modal доторх жагсаалтын дээр
   ============================================================ */
.flt {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #f7f9fc;
    border: 1px solid var(--c-border);
    border-radius: 8px;
}
.flt__f { display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
.flt__f--grow { flex: 1 1 240px; }
.flt__f label { color: var(--c-muted); font-size: 11px; }

.flt__f input,
.flt__f select {
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    background: var(--c-card);
    color: var(--c-text);
    font: inherit;
    font-weight: 600;
}
.flt__f input:focus,
.flt__f select:focus {
    outline: none;
    border-color: var(--c-blue);
    box-shadow: 0 0 0 2px rgba(47, 111, 237, .12);
}

.flt__btns { display: flex; gap: 6px; }
.flt__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid var(--c-border);
    border-radius: 6px;
    background: var(--c-card);
    color: var(--c-gray);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.flt__btn:hover { background: #eef3fb; color: var(--c-text); }
.flt__btn--go {
    background: var(--c-blue);
    border-color: var(--c-blue);
    color: #fff;
}
.flt__btn--go:hover { background: var(--c-blue-dark); border-color: var(--c-blue-dark); color: #fff; }

@media (max-width: 640px) {
    .flt__f, .flt__f--grow { min-width: 100%; flex-basis: 100%; }
}
.text_upper { text-transform: uppercase; }
