/* ================================================================
   style.css — Dashboard ความเคลื่อนไหวชักชวนแนะนำธรรม มหานคร 2
   Light & Vibrant Theme
   ================================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --blue:   #2280eb;
  --blue-d: #1560c0;
  --gold:   #f0b429;
  --gold-l: #fff3cc;
  --red:    #ec3e29;
  --white:  #ffffff;
  --light:  #ededed;
  --dark:   #3a3d3c;

  --bg:     #f0f4ff;
  --bg-2:   #e8eeff;

  --glass:    rgba(255,255,255,.72);
  --glass-b:  rgba(255,255,255,.88);
  --glass-bd: rgba(255,255,255,.9);

  --txt:    #1a2340;
  --txt-2:  #4a5580;
  --txt-3:  #8896b8;

  --r:    16px;
  --r-sm:  8px;
  --sh:   0 4px 24px rgba(34,128,235,.10), 0 1px 4px rgba(0,0,0,.06);
  --sh-hover: 0 8px 32px rgba(34,128,235,.18), 0 2px 8px rgba(0,0,0,.08);
  --tr:   all .25s cubic-bezier(.4,0,.2,1);
}

/* ── Site Navigation ────────────────────────────────────────── */
.site-nav{
  display:flex;gap:8px;padding:14px 0 0;
}
.nav-tab{
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 20px;border-radius:20px;
  font-size:13px;font-weight:700;text-decoration:none;
  background:rgba(255,255,255,.6);
  border:1.5px solid rgba(255,255,255,.8);
  color:var(--txt-2);
  backdrop-filter:blur(10px);
  transition:all .22s cubic-bezier(.4,0,.2,1);
  box-shadow:0 2px 8px rgba(34,128,235,.08);
}
.nav-tab:hover{
  background:rgba(255,255,255,.85);
  color:var(--blue);
  transform:translateY(-1px);
  box-shadow:0 4px 14px rgba(34,128,235,.18);
}
.nav-tab.active{
  background:linear-gradient(135deg,#2280eb,#1560c0);
  color:#fff;border-color:#2280eb;
  box-shadow:0 4px 16px rgba(34,128,235,.35);
}

/* ── Reset ──────────────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{
  font-family:'Sarabun','Noto Sans Thai','Segoe UI',Arial,sans-serif;
  background:var(--bg);
  color:var(--txt);
  min-height:100vh;
  overflow-x:hidden;
  line-height:1.65;
}

/* ── Parallax Background ────────────────────────────────────── */
#parallax-bg{
  position:fixed;inset:0;z-index:0;
  background:
    radial-gradient(ellipse 70% 60% at 10% 20%, #c8dcff66 0%, transparent 60%),
    radial-gradient(ellipse 55% 50% at 90% 10%, #ffe8c255 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 90%, #ffd0ca44 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 20% 90%, #d0e8ff55 0%, transparent 60%),
    linear-gradient(160deg, #eef3ff 0%, #f5f0ff 50%, #fff4ee 100%);
  overflow:hidden;
}
.blob{
  position:absolute;border-radius:50%;
  filter:blur(72px);opacity:.45;
  will-change:transform;pointer-events:none;
}
.blob-1{width:600px;height:600px;background:radial-gradient(circle,#2280eb33,transparent 70%);top:-200px;left:-120px}
.blob-2{width:500px;height:500px;background:radial-gradient(circle,#f0b42933,transparent 70%);top:20%;right:-100px}
.blob-3{width:450px;height:450px;background:radial-gradient(circle,#ec3e2922,transparent 70%);bottom:-60px;left:35%}
.blob-4{width:350px;height:350px;background:radial-gradient(circle,#a855f722,transparent 70%);top:55%;left:5%}

/* ── App Wrapper ────────────────────────────────────────────── */
#app{
  position:relative;z-index:1;
  max-width:1380px;margin:0 auto;
  padding:0 20px 72px;
}

/* ── Glass Utility ──────────────────────────────────────────── */
.glass{
  background:var(--glass);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  border:1px solid rgba(255,255,255,.9);
  border-radius:var(--r);
  box-shadow:var(--sh);
}
.glass-b{
  background:var(--glass-b);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border:1px solid rgba(255,255,255,.95);
  border-radius:var(--r);
  box-shadow:var(--sh);
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header{
  display:flex;align-items:center;gap:16px;
  padding:28px 0 22px;
}
.site-logo{
  width:72px;height:72px;flex-shrink:0;
  border-radius:50%;object-fit:contain;
  filter:drop-shadow(0 4px 18px rgba(249,100,100,.35));
}
.logo-fallback{
  width:68px;height:68px;border-radius:50%;flex-shrink:0;
  background:linear-gradient(135deg,#f9a8c9,#fb923c);
  display:flex;align-items:center;justify-content:center;
  font-size:22px;font-weight:900;color:#fff;
  box-shadow:0 4px 14px rgba(249,168,201,.4);
}
.site-title h1{
  font-size:clamp(17px,2.6vw,26px);font-weight:800;
  background:linear-gradient(120deg, #1560c0 0%, #2280eb 50%, #f0b429 100%);
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;
  line-height:1.2;
}
.site-title p{font-size:13px;color:var(--txt-2);letter-spacing:.06em;margin-top:3px}
.header-right{margin-left:auto;text-align:right}
.update-badge{font-size:11px;color:var(--txt-3)}

/* ── Filter Bar ─────────────────────────────────────────────── */
.filter-bar{
  padding:16px 20px;margin-bottom:20px;
  display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end;
}
.fg{display:flex;flex-direction:column;gap:5px;min-width:135px}
.fg label{
  font-size:11px;font-weight:700;color:var(--txt-3);
  text-transform:uppercase;letter-spacing:.07em;
}
.fg select{
  appearance:none;-webkit-appearance:none;
  background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234a5580' stroke-width='1.5' stroke-linecap='round' fill='none'/%3E%3C/svg%3E") no-repeat right 10px center;
  border:1.5px solid #dce5f5;color:var(--txt);
  padding:8px 30px 8px 12px;border-radius:var(--r-sm);
  font-size:13px;font-family:inherit;cursor:pointer;transition:var(--tr);
  box-shadow:0 1px 4px rgba(34,128,235,.08);
}
.fg select:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(34,128,235,.12)}
.filter-range{display:flex;gap:6px;align-items:center}
.filter-range span{font-size:12px;color:var(--txt-3)}
.btn-reset{
  padding:8px 18px;
  background:linear-gradient(135deg,#2280eb,#1560c0);
  border:none;color:#fff;border-radius:var(--r-sm);
  font-size:13px;font-family:inherit;cursor:pointer;
  transition:var(--tr);align-self:flex-end;
  box-shadow:0 2px 8px rgba(34,128,235,.35);
}
.btn-reset:hover{transform:translateY(-1px);box-shadow:0 4px 14px rgba(34,128,235,.45)}
.filter-summary{font-size:12px;color:var(--txt-3);align-self:flex-end;margin-left:auto}

/* ── Hero Split ─────────────────────────────────────────────── */
.hero-split{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:20px}

/* Gallery — 3×3 grid */
.gallery-block{padding:20px;display:flex;flex-direction:column;gap:14px}
.gallery-label{
  font-size:11px;font-weight:700;color:var(--txt-3);
  text-transform:uppercase;letter-spacing:.1em;
  display:flex;align-items:center;gap:8px;margin-bottom:0;
}
.gallery-label::after{content:'';flex:1;height:1px;background:rgba(34,128,235,.12)}
.gallery-wrap{flex:1;overflow:hidden;border-radius:10px}
.gallery-stack{
  display:grid;grid-template-columns:repeat(4,1fr);gap:6px;
  will-change:transform,opacity;
}
.gallery-stack.slide-next{
  animation:gSlideNext .38s cubic-bezier(.22,.68,0,1.2) both;
}
.gallery-stack.slide-prev{
  animation:gSlidePrev .38s cubic-bezier(.22,.68,0,1.2) both;
}
@keyframes gSlideNext{
  from{ transform:translateX(60px); opacity:0; }
  to{   transform:translateX(0);    opacity:1; }
}
@keyframes gSlidePrev{
  from{ transform:translateX(-60px); opacity:0; }
  to{   transform:translateX(0);     opacity:1; }
}
.g-card{
  border-radius:8px;overflow:hidden;
  aspect-ratio:4/3;cursor:pointer;
  transition:transform .22s,box-shadow .22s;
}
.g-card:hover{transform:scale(1.04);box-shadow:0 8px 24px rgba(34,128,235,.25)}
.g-card:active{transform:scale(.97)}
.g-card img{width:100%;height:100%;object-fit:cover;display:block}
.g-placeholder{
  border-radius:12px;padding:40px 20px;
  background:linear-gradient(135deg,#eef3ff,#f5f0ff);
  border:2px dashed rgba(34,128,235,.2);
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:10px;
  color:var(--txt-3);
}
.g-placeholder .ph-ico{font-size:46px;opacity:.5}
.g-placeholder p{font-size:13px;text-align:center;line-height:1.55;color:var(--txt-2)}
.g-placeholder small{font-size:11px;color:var(--txt-3)}
.gallery-nav{
  display:flex;align-items:center;justify-content:center;gap:12px;
}
.g-btn{
  width:32px;height:32px;border-radius:50%;
  background:rgba(34,128,235,.1);border:1.5px solid rgba(34,128,235,.2);
  color:var(--blue);display:flex;align-items:center;justify-content:center;
  cursor:pointer;font-size:15px;transition:var(--tr);
}
.g-btn:hover{background:rgba(34,128,235,.2)}
.g-btn:disabled{opacity:.3;cursor:default}
.g-counter{font-size:12px;color:var(--txt-2);font-weight:600;min-width:80px;text-align:center;display:none}
.g-dots{display:none}

/* Lightbox */
#g-lightbox{
  display:none;position:fixed;inset:0;z-index:9999;
  background:rgba(10,14,30,.88);backdrop-filter:blur(6px);
  align-items:center;justify-content:center;
}
#g-lightbox.open{display:flex}
#g-lightbox img{
  max-width:90vw;max-height:88vh;
  border-radius:14px;object-fit:contain;
  box-shadow:0 24px 64px rgba(0,0,0,.6);
}
.lb-close{
  position:absolute;top:20px;right:24px;
  font-size:32px;color:#fff;cursor:pointer;opacity:.7;transition:opacity .2s;line-height:1;
}
.lb-close:hover{opacity:1}
.lb-prev,.lb-next{
  position:absolute;top:50%;transform:translateY(-50%);
  font-size:44px;color:#fff;cursor:pointer;opacity:.6;
  transition:opacity .2s;padding:0 16px;user-select:none;
}
.lb-prev{left:0}.lb-next{right:0}
.lb-prev:hover,.lb-next:hover{opacity:1}
.lb-info{
  position:absolute;bottom:20px;left:50%;transform:translateX(-50%);
  color:rgba(255,255,255,.6);font-size:13px;
}

/* Quote — full-width horizontal layout */
.quote-block{
  padding:28px 36px;display:flex;flex-direction:row;gap:32px;
  align-items:flex-start;position:relative;overflow:hidden;
  margin-bottom:20px;
  background:linear-gradient(135deg, rgba(255,255,255,.85), rgba(240,244,255,.85)) !important;
}
.quote-block::before{
  content:'\201C';position:absolute;top:-28px;left:16px;
  font-size:180px;font-family:Georgia,serif;
  color:rgba(34,128,235,.06);line-height:1;pointer-events:none;
}
.q-meta{
  display:flex;flex-direction:column;gap:14px;
  min-width:160px;flex-shrink:0;padding-top:2px;
}
.q-body{display:flex;flex-direction:column;gap:10px;flex:1}
.q-tag{
  display:inline-flex;align-items:center;gap:6px;
  background:rgba(34,128,235,.1);border:1px solid rgba(34,128,235,.2);
  color:var(--blue-d);padding:4px 12px;border-radius:20px;
  font-size:12px;font-weight:700;width:fit-content;
}
.q-author{
  font-size:13px;font-weight:700;color:var(--gold);
  display:flex;align-items:center;gap:8px;
}
.q-author::before{content:'';width:22px;height:2px;background:var(--gold);display:inline-block}
.q-text{
  font-size:14px;color:var(--txt);
  line-height:1.9;white-space:pre-line;
}
.q-source{
  font-size:11px;color:var(--txt-3);font-style:italic;
  border-top:1px solid rgba(34,128,235,.1);padding-top:10px;
}

/* ── KPI Grid ───────────────────────────────────────────────── */
.kpi-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.kpi-card{
  padding:22px 20px;border-radius:var(--r);
  position:relative;overflow:hidden;
  transition:var(--tr);cursor:default;
}
.kpi-card:hover{transform:translateY(-4px);box-shadow:var(--sh-hover)}
.kpi-card .kpi-ico{font-size:28px;margin-bottom:8px;display:block;line-height:1}
.kpi-card .kpi-lbl{
  font-size:11px;font-weight:700;
  text-transform:uppercase;letter-spacing:.06em;margin-bottom:6px;
  line-height:1.3;opacity:.75;
}
.kpi-card .kpi-val{
  font-size:clamp(28px,3vw,44px);font-weight:900;
  line-height:1;margin-bottom:3px;
}
.kpi-card .kpi-unit{font-size:12px;opacity:.6;margin-bottom:10px}
.kpi-grow{font-size:13px;font-weight:700;display:flex;align-items:center;gap:5px}
.kpi-grow.pos{color:#16a34a}
.kpi-grow.neg{color:#dc2626}
.kpi-grow.neu{color:var(--txt-3);font-weight:400;font-size:11px}
.kpi-no-data{font-size:11px;opacity:.5;font-style:italic}

/* KPI card color variants */
.kpi-card-0{
  background:linear-gradient(135deg,#dbeafe,#eff6ff);
  border:1.5px solid #bfdbfe;color:#1e40af;
}
.kpi-card-1{
  background:linear-gradient(135deg,#fef9c3,#fffde7);
  border:1.5px solid #fde047;color:#854d0e;
}
.kpi-card-2{
  background:linear-gradient(135deg,#fee2e2,#fff5f5);
  border:1.5px solid #fca5a5;color:#991b1b;
}
.kpi-card-3{
  background:linear-gradient(135deg,#ede9fe,#f5f3ff);
  border:1.5px solid #c4b5fd;color:#5b21b6;
}

/* ── Section Title ──────────────────────────────────────────── */
.sec-title{
  font-size:15px;font-weight:700;color:var(--txt);
  margin-bottom:4px;display:flex;align-items:center;gap:10px;
}
.sec-title .dot{width:8px;height:8px;border-radius:50%;background:var(--gold);flex-shrink:0}
.sec-sub{font-size:12px;color:var(--txt-3);margin-bottom:14px;padding-left:18px}
.corr-label{
  text-align:center;padding:10px 0 2px;
  font-size:13px;color:var(--txt);line-height:1.6;
}
.corr-r{ font-size:11px; color:var(--txt-3); }

/* ── Charts ─────────────────────────────────────────────────── */
.charts-section{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-bottom:20px}
.chart-card{padding:22px}
.chart-card.wide{grid-column:1/-1}
.chart-wrap{position:relative;height:280px}
.chart-wrap.tall{height:360px}
.no-data-msg{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  height:100%;color:var(--txt-3);font-size:13px;text-align:center;line-height:1.6;
  padding:16px;
}
.no-data-msg span{
  font-size:12px;color:var(--txt-3);opacity:.8;
  border-top:1px dashed rgba(74,85,128,.2);padding-top:8px;max-width:360px;
}

/* ── Insights ───────────────────────────────────────────────── */
.insights-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.ins-item{
  background:#fff;border-radius:10px;
  padding:16px;border-left:3px solid var(--blue);
  box-shadow:0 1px 4px rgba(34,128,235,.08);
  display:flex;flex-direction:column;gap:6px;
}
.ins-item.gold{border-left-color:var(--gold)}
.ins-item.red {border-left-color:var(--red)}
.ins-item.grn {border-left-color:#16a34a}
.ins-caption{
  font-size:13px;color:var(--txt);line-height:1.6;font-weight:500;
}
.ins-val{font-size:20px;font-weight:800;color:var(--txt);line-height:1.2}
.ins-desc{font-size:11px;color:var(--txt-3);margin-top:2px}

/* ── Data Table ─────────────────────────────────────────────── */
.table-section{padding:22px;margin-bottom:20px}
.table-ctrl{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;flex-wrap:wrap;gap:12px}
.table-search{
  background:#fff;border:1.5px solid #dce5f5;
  color:var(--txt);padding:8px 14px;border-radius:var(--r-sm);
  font-size:13px;font-family:inherit;width:230px;
  box-shadow:0 1px 4px rgba(34,128,235,.06);
}
.table-search:focus{outline:none;border-color:var(--blue);box-shadow:0 0 0 3px rgba(34,128,235,.1)}
.table-search::placeholder{color:var(--txt-3)}
.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13px;min-width:720px}
thead th{
  background:linear-gradient(135deg,#2280eb,#1560c0);
  color:rgba(255,255,255,.9);
  padding:10px 12px;text-align:left;
  font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;
  white-space:nowrap;
}
thead th:first-child{border-radius:8px 0 0 0}
thead th:last-child{border-radius:0 8px 0 0}
tbody tr{border-bottom:1px solid #eef2ff;transition:var(--tr)}
tbody tr:hover{background:#f0f6ff}
tbody td{padding:10px 12px;color:var(--txt-2)}
tbody td.num{font-weight:700;color:var(--txt)}
tbody td.zero{color:#c8d0e0}
.badge{display:inline-block;padding:2px 9px;border-radius:12px;font-size:11px;font-weight:700}
.bd-blue {background:#dbeafe;color:#1e40af}
.bd-green{background:#dcfce7;color:#15803d}
.bd-gray {background:#f1f5f9;color:#94a3b8}
.pagination{display:flex;gap:6px;justify-content:flex-end;margin-top:14px;flex-wrap:wrap}
.pg-btn{
  padding:5px 11px;
  background:#fff;border:1.5px solid #dce5f5;
  color:var(--txt-2);border-radius:6px;
  cursor:pointer;font-size:12px;font-family:inherit;transition:var(--tr);
}
.pg-btn:hover,.pg-btn.active{background:var(--blue);border-color:var(--blue);color:#fff}

/* ── Loading ─────────────────────────────────────────────────── */
#loading{
  position:relative;z-index:2;
  display:flex;flex-direction:column;
  align-items:center;justify-content:center;
  min-height:80vh;gap:18px;
}
.spinner{
  width:46px;height:46px;
  border:3px solid rgba(34,128,235,.15);
  border-top-color:var(--blue);
  border-radius:50%;animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes fadeUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:none}}
.fade-up  {animation:fadeUp .5s ease both}
.fade-up-2{animation:fadeUp .5s .1s  ease both}
.fade-up-3{animation:fadeUp .5s .2s  ease both}
.fade-up-4{animation:fadeUp .5s .3s  ease both}

/* ── Responsive ─────────────────────────────────────────────── */
@media(max-width:1100px){
  .kpi-grid{grid-template-columns:repeat(2,1fr)}
  .charts-section{grid-template-columns:1fr}
  .chart-card.wide{grid-column:1}
}
/* ── Monthly Highlight ──────────────────────────────────────── */
.q-highlight{
  display:flex;flex-direction:column;gap:8px;
  width:220px;flex-shrink:0;
  border-left:1px solid rgba(34,128,235,.15);
  padding-left:24px;
}
.hl-badge{
  display:inline-flex;align-items:center;gap:5px;
  background:linear-gradient(135deg,rgba(245,158,11,.15),rgba(252,211,77,.1));
  border:1px solid rgba(245,158,11,.3);
  border-radius:20px;padding:3px 10px;
  font-size:11px;font-weight:700;color:#92400e;width:fit-content;
}
.hl-img{
  width:100%;aspect-ratio:16/9;object-fit:cover;
  border-radius:10px;
  box-shadow:0 4px 16px rgba(34,128,235,.15);
  transition:transform .3s ease;cursor:pointer;
}
.hl-img:hover{ transform:scale(1.02); }
.hl-title{
  font-size:12px;font-weight:700;color:var(--blue);
  letter-spacing:.3px;
}
.hl-caption{
  font-size:12px;color:var(--txt-2);line-height:1.65;white-space:pre-line;
}

/* ── Scatter Summary & Zone Legend ─────────────────────────── */
.scatter-summary{
  padding:10px 0 4px;
  font-size:14px;font-weight:600;color:var(--txt);line-height:1.7;
  text-align:center;
}
/* Per-area-group summary chips */
.ag-sum-grid{
  display:flex;flex-wrap:wrap;gap:10px;justify-content:center;padding:4px 0;
}
.ag-sum-chip{
  display:flex;align-items:center;gap:8px;
  background:#fff;border-radius:20px;
  padding:6px 14px;
  box-shadow:0 1px 4px rgba(34,128,235,.10);
  border:1.5px solid rgba(34,128,235,.1);
  font-size:13px;
}
.ag-sum-chip.no-data{
  background:#f8fafc;
  border-color:rgba(148,163,184,.25);
  opacity:.8;
}
.ag-sum-name{font-weight:700;white-space:nowrap}
.ag-sum-txt{color:var(--txt-2);font-weight:500}
.zone-legend{
  display:grid;grid-template-columns:1fr 1fr;
  gap:12px;margin-top:16px;
}
.zone-card{
  border-radius:10px;padding:14px 16px;
  border-left:4px solid;
  box-shadow:0 1px 4px rgba(34,128,235,.08);
}
.zone-card .zc-head{font-size:13px;font-weight:700;margin-bottom:6px}
.zone-card .zc-body{font-size:12px;color:var(--txt-2);line-height:1.65}
.z-tr{border-left-color:#16a34a;background:linear-gradient(135deg,#f0fdf4,#fff)}
.z-tl{border-left-color:#f59e0b;background:linear-gradient(135deg,#fffbeb,#fff)}
.z-br{border-left-color:#f97316;background:linear-gradient(135deg,#fff7ed,#fff)}
.z-bl{border-left-color:#94a3b8;background:linear-gradient(135deg,#f8fafc,#fff)}
.z-tr .zc-head{color:#15803d}
.z-tl .zc-head{color:#b45309}
.z-br .zc-head{color:#c2410c}
.z-bl .zc-head{color:#64748b}

@media(max-width:768px){
  #app{padding:0 14px 48px}
  .gallery-stack{grid-template-columns:repeat(2,1fr)}
  .quote-block{flex-direction:column;gap:16px;padding:22px 20px}
  .q-meta{min-width:unset}
  .q-highlight{width:100%;border-left:none;padding-left:0;border-top:1px solid rgba(34,128,235,.12);padding-top:16px}
  .kpi-grid{grid-template-columns:repeat(2,1fr)}
  .filter-bar{gap:10px}
  .fg{min-width:120px}
  .filter-summary{margin-left:0;flex-basis:100%}
  .insights-grid{grid-template-columns:1fr}
  .site-title h1{font-size:16px}
  .zone-legend{grid-template-columns:1fr}
}
@media(max-width:480px){
  .kpi-grid{grid-template-columns:1fr 1fr}
  .table-ctrl{flex-direction:column;align-items:stretch}
  .table-search{width:100%}
  .filter-range{flex-wrap:wrap}
}

/* ── Custom scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar{width:7px;height:7px}
::-webkit-scrollbar-track{background:#f0f4ff}
::-webkit-scrollbar-thumb{background:rgba(34,128,235,.28);border-radius:4px}
::-webkit-scrollbar-thumb:hover{background:rgba(34,128,235,.5)}

/* ── Ripple effect ──────────────────────────────────────────── */
.ripple{
  position:absolute;border-radius:50%;
  width:120px;height:120px;margin:-60px 0 0 -60px;
  background:rgba(255,255,255,.38);
  transform:scale(0);
  animation:rippleAnim .55s linear;
  pointer-events:none;
}
@keyframes rippleAnim{to{transform:scale(3.5);opacity:0}}
.btn-reset{position:relative;overflow:hidden}

/* ── Filter-change pulse ────────────────────────────────────── */
@keyframes filterPulse{
  0%{opacity:1;transform:translateY(0)}
  35%{opacity:.65;transform:translateY(3px) scale(.995)}
  100%{opacity:1;transform:translateY(0) scale(1)}
}
.filter-pulse{animation:filterPulse .4s cubic-bezier(.4,0,.2,1) both}

/* ── Gallery dots ───────────────────────────────────────────── */
.g-dots{display:flex!important;gap:5px;align-items:center}
.g-dot{
  width:7px;height:7px;border-radius:50%;
  background:rgba(34,128,235,.22);cursor:pointer;
  transition:all .28s cubic-bezier(.4,0,.2,1);
  flex-shrink:0;
}
.g-dot.active{width:20px;border-radius:4px;background:var(--blue)}
.g-dot:hover:not(.active){background:rgba(34,128,235,.45);transform:scale(1.2)}

/* ── Enhanced interactive states ───────────────────────────── */
.kpi-card{transition:var(--tr);cursor:default}
.kpi-card:hover{
  transform:translateY(-6px) scale(1.02);
  box-shadow:0 14px 44px rgba(34,128,235,.20),0 3px 10px rgba(0,0,0,.08);
}
.kpi-card:active{transform:translateY(-2px) scale(1.005)}

.chart-card{transition:box-shadow .28s,transform .28s}
.chart-card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 38px rgba(34,128,235,.14),0 2px 8px rgba(0,0,0,.07);
}

.g-btn{transition:background .2s,transform .15s,box-shadow .2s}
.g-btn:hover:not(:disabled){
  background:rgba(34,128,235,.22);
  box-shadow:0 2px 10px rgba(34,128,235,.25);
  transform:scale(1.1);
}
.g-btn:active:not(:disabled){transform:scale(.88)}

.fg select{transition:border-color .2s,box-shadow .2s,background .2s}
.fg select:hover{border-color:rgba(34,128,235,.45);background:#f8fbff}

.g-card{transition:transform .22s cubic-bezier(.34,1.56,.64,1),box-shadow .22s}
.g-card:hover{
  transform:scale(1.05);
  box-shadow:0 8px 28px rgba(34,128,235,.28);
}
.g-card:active{transform:scale(.96)}

.ins-item{transition:transform .22s,box-shadow .22s;cursor:default}
.ins-item:hover{transform:translateY(-2px);box-shadow:0 4px 18px rgba(34,128,235,.12)}

.table-section table tbody tr{transition:background .15s,transform .15s}
.table-section table tbody tr:hover{
  background:#e8f0ff;
  transform:translateX(2px);
}

/* ── KPI Breakdown Modal ────────────────────────────────────── */
.kpi-modal-overlay{
  display:none;position:fixed;inset:0;z-index:9000;
  background:rgba(10,14,30,.52);backdrop-filter:blur(5px);
  align-items:center;justify-content:center;padding:20px;
}
.kpi-modal-overlay.open{display:flex}
.kpi-modal-box{
  width:min(480px,92vw);max-height:82vh;overflow-y:auto;
  padding:28px 24px 22px;position:relative;
  animation:modalPop .28s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes modalPop{
  from{transform:scale(.88) translateY(14px);opacity:0}
  to  {transform:scale(1)   translateY(0);   opacity:1}
}
.kpi-modal-close{
  position:absolute;top:14px;right:16px;
  background:none;border:none;font-size:20px;
  color:var(--txt-3);cursor:pointer;line-height:1;
  padding:4px 6px;border-radius:6px;transition:var(--tr);
}
.kpi-modal-close:hover{background:rgba(34,128,235,.1);color:var(--txt)}
.kpi-modal-title{font-size:17px;font-weight:800;color:var(--txt);margin-bottom:4px}
.kpi-modal-sub{font-size:12px;color:var(--txt-3);margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid rgba(34,128,235,.1)}
.kpi-modal-row{
  display:flex;align-items:center;gap:10px;
  padding:11px 14px;border-radius:10px;
  margin-bottom:8px;background:#fff;
  box-shadow:0 1px 4px rgba(34,128,235,.07);
  border-left:3px solid;transition:transform .18s,box-shadow .18s;
}
.kpi-modal-row:hover{transform:translateX(3px);box-shadow:0 3px 12px rgba(34,128,235,.12)}
.kpi-modal-row.no-data{border-left-color:#e2e8f0;background:#f8fafc;opacity:.75}
.kmr-name{font-weight:700;font-size:13px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kmr-nums{display:flex;flex-direction:column;align-items:flex-end;gap:1px;min-width:56px}
.kmr-val{font-size:20px;font-weight:900;line-height:1}
.kmr-unit{font-size:10px;color:var(--txt-3)}
.kmr-grow{font-size:12px;font-weight:700;min-width:76px;text-align:right;white-space:nowrap}
.kmr-grow.pos{color:#16a34a}.kmr-grow.neg{color:#dc2626}
.kmr-grow.neu{color:var(--txt-3);font-weight:400;font-size:11px}
.kmr-nodata{font-size:12px;color:var(--txt-3);font-style:italic;flex:1}

/* KPI card — clickable hint */
.kpi-card{cursor:pointer}
.kpi-hint{font-size:10px;color:rgba(255,255,255,.55);text-align:right;margin-top:6px;letter-spacing:.04em}

/* ── Count-up number style ──────────────────────────────────── */
.kpi-val{
  font-variant-numeric:tabular-nums;
  transition:color .3s;
}
