/* Нээлттэй мэдээллийн самбар (/dashboard) */
:root { --pd-navy:#003A8C; --pd-deep:#00265e; --pd-blue:#1D5FC2; --pd-sky:#4C9FE8; --pd-ink:#0b1a2e; --pd-muted:#64748b; --pd-line:#e5e9f0; --pd-bg:#f3f5f9; --pd-side:#0f1b3d; --pd-side2:#162452;
  --c1:#2f6bff; --c2:#ff7a45; --c3:#27c28b; --c4:#ffc83d; --c5:#8b5cf6; --c6:#14b8a6; }
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body.pd-body { margin:0; font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif; background:var(--pd-bg); color:var(--pd-ink); -webkit-font-smoothing:antialiased; }
.pd-page { max-width:1480px; margin:0 auto; padding:0 1rem 1rem; }
.pd-crumb { display:flex; align-items:center; gap:.5rem; font-size:.74rem; color:var(--pd-muted); padding:.9rem .25rem .6rem; }
.pd-crumb a { color:inherit; text-decoration:none; } .pd-crumb a:hover { color:var(--pd-navy); } .pd-crumb b { color:var(--pd-navy); font-weight:700; }
.pd-shell { display:grid; grid-template-columns:230px minmax(0,1fr); gap:1rem; align-items:start; }
.pd-side-title { margin:0 0 .25rem; display:flex; align-items:center; gap:.5rem; color:#fff; font-size:.8rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; }
.pd-side-title svg { width:18px; height:18px; color:#8fb4ff; }
.pd-menu { position:relative; display:inline-block; }
.pd-menu-list { display:none; position:absolute; right:0; top:calc(100% + 4px); z-index:40; min-width:230px; background:#fff; border:1px solid var(--pd-line); border-radius:.75rem; box-shadow:0 16px 36px -16px rgba(2,20,60,.4); padding:.3rem; }
.pd-menu.is-open .pd-menu-list { display:block; }
.pd-menu-list button { display:flex; flex-direction:column; align-items:flex-start; width:100%; border:0; background:transparent; text-align:left; padding:.5rem .65rem; border-radius:.5rem; font:inherit; cursor:pointer; }
.pd-menu-list button:hover { background:#f1f5f9; }
.pd-menu-list b { font-size:.8rem; color:var(--pd-ink); } .pd-menu-list small { font-size:.68rem; color:var(--pd-muted); }
.pd-print-head { display:none; }

/* Хажуугийн самбар */
.pd-side { position:sticky; top:calc(var(--pd-header-h, 0px) + .75rem); max-height:calc(100vh - var(--pd-header-h, 0px) - 1.5rem); overflow-y:auto; background:linear-gradient(180deg,var(--pd-side),var(--pd-side2)); color:#cbd5e1; padding:1rem; border-radius:1rem; display:flex; flex-direction:column; gap:.9rem; }
.pd-brand { display:flex; align-items:center; gap:.65rem; color:#fff; text-decoration:none; }
.pd-brand i { width:38px; height:38px; border-radius:.75rem; display:grid; place-items:center; background:rgba(255,255,255,.1); }
.pd-brand i svg { width:20px; height:20px; }
.pd-brand b { font-size:.72rem; line-height:1.2; letter-spacing:.06em; text-transform:uppercase; }
.pd-nav { display:flex; flex-direction:column; gap:.15rem; }
.pd-nav a { display:flex; align-items:center; gap:.6rem; padding:.55rem .7rem; border-radius:.65rem; color:#cbd5e1; text-decoration:none; font-size:.84rem; font-weight:600; transition:.15s; }
.pd-nav a svg { width:16px; height:16px; opacity:.8; }
.pd-nav a:hover, .pd-nav a.is-on { background:rgba(255,255,255,.1); color:#fff; }
.pd-nav a.is-on { background:#2f6bff; }
.pd-filters { border-top:1px solid rgba(255,255,255,.1); padding-top:1rem; }
.pd-filters p { margin:0 0 .6rem; font-size:.66rem; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:#94a3b8; display:flex; align-items:center; gap:.4rem; }
.pd-filters p svg { width:14px; height:14px; }
.pd-filters label { display:block; font-size:.72rem; color:#94a3b8; margin:.55rem 0 .25rem; }
.pd-filters select { width:100%; background:#0b1736; color:#fff; border:1px solid rgba(255,255,255,.14); border-radius:.55rem; padding:.5rem .6rem; font-size:.82rem; font-family:inherit; }
.pd-filters .pd-btn-ghost { width:100%; margin-top:.8rem; }
.pd-side-foot { margin-top:auto; border-top:1px solid rgba(255,255,255,.1); padding-top:.9rem; display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; font-size:.78rem; }
.pd-side-foot a { color:#cbd5e1; text-decoration:none; display:inline-flex; align-items:center; gap:.35rem; }
.pd-side-foot a:hover { color:#fff; }
.pd-side-foot svg { width:14px; height:14px; }
.pd-lang { margin-left:auto; display:inline-flex; border:1px solid rgba(255,255,255,.14); border-radius:.5rem; overflow:hidden; }
.pd-lang a { padding:.25rem .5rem; font-size:.68rem; font-weight:800; }
.pd-lang a.is-on { background:#fff; color:var(--pd-navy); }

/* Үндсэн хэсэг */
.pd-main { padding:0 0 1rem; min-width:0; }
.pd-top { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:space-between; gap:.75rem 1rem; margin-bottom:1rem; }
.pd-top h1 { margin:0; font-size:1.05rem; font-weight:900; letter-spacing:.04em; text-transform:uppercase; color:var(--pd-navy); }
.pd-top p { margin:.2rem 0 0; font-size:.78rem; color:var(--pd-muted); }
.pd-actions { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.pd-live { display:inline-flex; align-items:center; gap:.4rem; padding:.35rem .7rem; border-radius:999px; background:#e8f7ef; color:#15803d; font-size:.72rem; font-weight:800; }
.pd-live i { width:7px; height:7px; border-radius:999px; background:#22c55e; animation:pd-pulse 1.6s infinite; }
@keyframes pd-pulse { 0%,100% { opacity:.35; } 50% { opacity:1; } }
.pd-time { font-size:.72rem; color:var(--pd-muted); font-variant-numeric:tabular-nums; }
.pd-btn, .pd-btn-ghost { display:inline-flex; align-items:center; justify-content:center; gap:.4rem; height:34px; padding:0 .8rem; border-radius:.6rem; font:inherit; font-size:.78rem; font-weight:700; cursor:pointer; text-decoration:none; transition:.15s; }
.pd-btn { background:#fff; border:1px solid var(--pd-line); color:var(--pd-navy); }
.pd-btn:hover { border-color:var(--pd-navy); background:#f8fafc; }
.pd-btn.is-primary { background:var(--pd-navy); color:#fff; border-color:var(--pd-navy); }
.pd-btn svg, .pd-btn-ghost svg { width:15px; height:15px; }
.pd-btn-ghost { background:transparent; border:1px solid rgba(255,255,255,.2); color:#cbd5e1; }
.pd-btn-ghost:hover { background:rgba(255,255,255,.08); color:#fff; }
.pd-btn[disabled] { opacity:.6; cursor:wait; }

.pd-sec { margin-bottom:1.1rem; scroll-margin-top:.5rem; }
.pd-sec-h { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin:.4rem 0 .6rem; }
.pd-sec-h h2 { margin:0; font-size:.86rem; font-weight:900; color:var(--pd-ink); }
.pd-sec-h span { font-size:.72rem; color:var(--pd-muted); }
.pd-grid { display:grid; grid-template-columns:repeat(12, minmax(0,1fr)); gap:.8rem; }
.pd-card { background:#fff; border:1px solid var(--pd-line); border-radius:1rem; padding:.95rem 1.05rem; box-shadow:0 1px 2px rgba(2,20,50,.04); min-width:0; grid-column:span 12; display:flex; flex-direction:column; }
.pd-card.s3 { grid-column:span 3; } .pd-card.s4 { grid-column:span 4; } .pd-card.s5 { grid-column:span 5; } .pd-card.s6 { grid-column:span 6; } .pd-card.s7 { grid-column:span 7; } .pd-card.s8 { grid-column:span 8; }
.pd-card-h { display:flex; align-items:flex-start; justify-content:space-between; gap:.6rem; margin-bottom:.6rem; }
.pd-card-h h3 { margin:0; font-size:.8rem; font-weight:800; color:var(--pd-ink); }
.pd-card-h small { font-size:.68rem; color:var(--pd-muted); white-space:nowrap; }
.pd-card .pd-canvas { position:relative; flex:1; min-height:200px; }
.pd-card .pd-canvas.h-sm { min-height:150px; } .pd-card .pd-canvas.h-lg { min-height:280px; }
.pd-card canvas { width:100% !important; height:100% !important; }
.pd-legend { display:flex; flex-wrap:wrap; gap:.3rem .8rem; margin-top:.5rem; font-size:.68rem; color:var(--pd-muted); }
.pd-legend span { display:inline-flex; align-items:center; gap:.3rem; }
.pd-legend i { width:9px; height:9px; border-radius:999px; display:inline-block; }
.pd-empty { flex:1; display:grid; place-items:center; color:#94a3b8; font-size:.78rem; text-align:center; padding:1.5rem; }

/* KPI карт */
.pd-kpi { border-left:4px solid var(--c, var(--c1)); padding-bottom:.6rem; }
.pd-kpi .k-l { font-size:.72rem; font-weight:700; color:var(--pd-ink); display:flex; justify-content:space-between; gap:.5rem; }
.pd-kpi .k-l small { color:#94a3b8; font-weight:600; }
.pd-kpi .k-v { display:flex; align-items:baseline; gap:.5rem; margin:.3rem 0 .1rem; }
.pd-kpi .k-v b { font-size:1.9rem; font-weight:900; letter-spacing:-.03em; line-height:1; font-variant-numeric:tabular-nums; }
.pd-kpi .k-v em { font-style:normal; font-size:.78rem; color:#94a3b8; }
.pd-kpi .k-d { display:inline-flex; align-items:center; gap:.2rem; padding:.12rem .45rem; border-radius:.4rem; font-size:.68rem; font-weight:800; }
.pd-kpi .k-d.up { background:#e8f7ef; color:#15803d; } .pd-kpi .k-d.down { background:#fdecec; color:#b91c1c; } .pd-kpi .k-d.flat { background:#f1f5f9; color:#64748b; }
.pd-kpi .k-s { font-size:.68rem; color:var(--pd-muted); }
.pd-kpi .k-spark { height:46px; margin-top:.45rem; position:relative; }
.pd-kpi .k-spark canvas { width:100% !important; height:46px !important; }

/* Газрын зураг */
.pd-map-wrap { background:linear-gradient(180deg,#f8fafc,#eef2f8); border-radius:.9rem; padding:.6rem; position:relative; }
.pd-map { width:100%; height:auto; display:block; }
.pd-aimag { fill:#dbe4f3; stroke:#fff; stroke-width:1.2; stroke-linejoin:round; cursor:pointer; transition:fill .35s, filter .15s; }
.pd-aimag:hover { filter:brightness(.92); }
.pd-aimag.is-sel { stroke:var(--pd-navy); stroke-width:2; }
.pd-map-legend { display:flex; align-items:center; gap:.3rem; font-size:.66rem; color:var(--pd-muted); margin-top:.4rem; }
.pd-map-legend i { width:16px; height:9px; border-radius:2px; display:inline-block; }
.pd-tip { position:fixed; z-index:60; pointer-events:none; background:var(--pd-deep); color:#fff; font-size:.72rem; padding:.45rem .65rem; border-radius:.55rem; box-shadow:0 10px 24px -10px rgba(0,0,0,.5); opacity:0; transition:opacity .12s; white-space:nowrap; }
.pd-map-top { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:.5rem; margin-top:.7rem; }
.pd-map-top div { padding:.5rem .6rem; border-radius:.6rem; background:#f8fafc; border:1px solid var(--pd-line); }
.pd-map-top small { display:block; font-size:.64rem; color:var(--pd-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pd-map-top b { font-size:1.05rem; font-weight:900; }
.pd-map-top em { font-style:normal; font-size:.64rem; color:var(--c1); font-weight:700; }
.pd-sel { border:1px solid var(--pd-line); border-radius:.5rem; padding:.3rem .5rem; font:inherit; font-size:.72rem; color:var(--pd-ink); background:#fff; max-width:220px; }
.pd-seg { display:inline-flex; border:1px solid var(--pd-line); border-radius:.5rem; overflow:hidden; }
.pd-seg button { border:0; background:#fff; padding:.3rem .6rem; font:inherit; font-size:.7rem; font-weight:700; color:var(--pd-muted); cursor:pointer; }
.pd-seg button.is-on { background:var(--c4); color:#1f2937; }

/* Дулааны хүснэгт */
.pd-heat { width:100%; border-collapse:separate; border-spacing:3px; font-size:.72rem; }
.pd-heat th { font-weight:700; color:var(--pd-muted); text-align:center; padding:.2rem .3rem; font-size:.66rem; white-space:nowrap; }
.pd-heat th:first-child, .pd-heat td:first-child { text-align:left; font-weight:600; color:var(--pd-ink); white-space:nowrap; }
.pd-heat td { text-align:center; padding:.3rem .25rem; border-radius:.35rem; font-weight:700; font-variant-numeric:tabular-nums; color:#fff; min-width:44px; }
.pd-heat td[data-a] { cursor:default; transition:transform .12s, box-shadow .12s; } .pd-heat td[data-a]:hover { transform:scale(1.08); box-shadow:0 4px 12px -4px rgba(0,0,0,.35); position:relative; z-index:1; }
.pd-card .pd-canvas canvas { cursor:crosshair; }
.pd-heat td.z { background:#f1f5f9; color:#94a3b8; font-weight:600; }
.pd-heat td.t { background:#0f1b3d; }
.pd-heat tr.total td { background:#1f2937; }
.pd-heat tr.total td:first-child, .pd-heat td:first-child { background:transparent; color:var(--pd-ink); }
.pd-scroll { overflow:auto; max-height:520px; }

/* Мини статистик */
.pd-stats { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:.5rem; }
.pd-stat { padding:.7rem .75rem; border-radius:.7rem; background:#f8fafc; border:1px solid var(--pd-line); }
.pd-stat small { display:block; font-size:.64rem; color:var(--pd-muted); }
.pd-stat b { font-size:1.25rem; font-weight:900; letter-spacing:-.02em; }
.pd-stat em { font-style:normal; font-size:.64rem; color:#94a3b8; margin-left:.25rem; }
.pd-poll { margin-top:.7rem; }
.pd-poll p { margin:0 0 .4rem; font-size:.74rem; font-weight:700; }
.pd-poll div { display:flex; align-items:center; gap:.5rem; font-size:.68rem; margin:.25rem 0; }
.pd-poll i { height:8px; border-radius:999px; background:var(--c1); display:block; }
.pd-poll span { flex:1; color:var(--pd-muted); }
.pd-foot { margin-top:1.5rem; text-align:center; font-size:.7rem; color:#94a3b8; }

.pd-rv { opacity:0; transform:translateY(14px); transition:opacity .5s ease, transform .5s ease; }
.pd-rv.is-on { opacity:1; transform:none; }

@media (max-width: 1180px) { .pd-card.s3 { grid-column:span 6; } .pd-card.s4 { grid-column:span 6; } .pd-card.s5, .pd-card.s7, .pd-card.s8 { grid-column:span 12; } }
@media (max-width: 900px) {
  .pd-shell { grid-template-columns:1fr; }
  .pd-side { position:static; max-height:none; }
  .pd-side .pd-nav { flex-direction:row; flex-wrap:wrap; }
  .pd-filters { padding-top:.5rem; } .pd-filters .row { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:.5rem; }
  .pd-main { padding:.9rem .9rem 2rem; }
}
@media (max-width: 640px) { .pd-card.s3, .pd-card.s4, .pd-card.s6 { grid-column:span 12; } .pd-map-top { grid-template-columns:repeat(2,1fr); } .pd-stats { grid-template-columns:repeat(2,1fr); } }

/* Хэвлэх */
@media print {
  @page { size:A4 landscape; margin:7mm; }
  body.pd-body { background:#fff; }
  #mainHeader, footer, .pd-crumb, .pd-side, .pd-actions, .pd-tip, .pd-sel, .pd-seg, .pd-top, #mobileMenu, #a11yToolbar, #voiceWidgets, #chatbotBtn, #chatbotWindow, #cookieConsent, .cookie-consent, [data-voice-widget] { display:none !important; }
  .pd-page > :not(.pd-shell) { display:none; }
  .pd-page { max-width:none; padding:0; }
  .pd-shell { display:block; }
  .pd-main { padding:0; zoom:.62; }
  .pd-print-head { display:block; font-size:1rem; color:#334155; border-bottom:2px solid var(--pd-navy); padding-bottom:.4rem; margin-bottom:.7rem; }
  .pd-sec { margin-bottom:.6rem; } .pd-sec-h { margin:.2rem 0 .4rem; }
  .pd-grid { gap:.55rem; }
  .pd-card { break-inside:avoid; box-shadow:none; border-color:#cbd5e1; align-self:start; padding:.75rem .85rem; }
  .pd-card.s3 { grid-column:span 3; } .pd-card.s4 { grid-column:span 4; } .pd-card.s5 { grid-column:span 5; } .pd-card.s6 { grid-column:span 6; } .pd-card.s7 { grid-column:span 7; } .pd-card.s8 { grid-column:span 8; }
  .pd-card .pd-canvas, .pd-card .pd-canvas.h-lg { flex:none; height:170px !important; min-height:0; }
  .pd-grid { align-items:start; }
  .pd-kpi .k-spark { height:40px; }
  .pd-map-wrap { max-width:560px; margin:0 auto; }
  .pd-heat { font-size:.78rem; border-spacing:2px; } .pd-heat td { padding:.18rem .2rem; min-width:40px; }
  .pd-rv { opacity:1 !important; transform:none !important; }
  .pd-scroll { max-height:none; overflow:visible; }
  .pd-foot { margin-top:.6rem; }
}
body.pd-capturing .pd-rv { opacity:1 !important; transform:none !important; }
body.pd-capturing .pd-scroll { max-height:none; overflow:visible; }
