/* Dashboard สาธารณะ: ข้อมูลสถานประกอบการด้านสุขภาพ จังหวัดสมุทรสงคราม */
:root{
  --bg:#f2f5f9;--surface:#ffffff;--ink:#132a3e;--ink-2:#4c6072;--muted:#6f8294;--line:#e3e9ef;--grid:#e9eef3;--axis:#cfd8e1;
  --brand-1:#0c4a6e;--brand-2:#0f766e;--accent:#2a78d6;--radius:16px;--shadow:0 1px 2px rgba(16,42,62,.06),0 8px 24px rgba(16,42,62,.06);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.6 'IBM Plex Sans Thai','Segoe UI',Tahoma,sans-serif;-webkit-font-smoothing:antialiased}
a{color:#0b6aa2}
h1,h2,h3{margin:0;line-height:1.3}
.wrap{max-width:1280px;margin:0 auto;padding:0 24px}
.muted{color:var(--muted)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ส่วนหัว */
.hero{background:radial-gradient(1200px 400px at 85% -10%,rgba(56,189,248,.35),transparent 60%),linear-gradient(120deg,var(--brand-1),var(--brand-2));color:#fff;padding:28px 0 0;margin-bottom:28px}
.hero-top{display:flex;gap:18px;align-items:center;padding-bottom:22px}
.hero-top img{width:64px;height:64px;border-radius:50%;background:#fff;padding:3px;flex-shrink:0;box-shadow:0 4px 14px rgba(0,0,0,.18)}
.hero .eyebrow{margin:0 0 4px;font-size:13px;letter-spacing:.02em;color:#cdeefa}
.hero h1{font-size:28px;font-weight:700}
.hero-sub{margin:6px 0 0;font-size:13px;color:#d5ecf3}
.tabs{display:flex;gap:4px;overflow-x:auto;scrollbar-width:thin;padding-bottom:0}
.tabs a{display:flex;align-items:center;gap:8px;white-space:nowrap;color:#e3f4f9;text-decoration:none;padding:11px 16px;border-radius:12px 12px 0 0;font-size:14px;font-weight:500}
.tabs a i{width:9px;height:9px;border-radius:50%;background:var(--c);box-shadow:0 0 0 2px rgba(255,255,255,.7)}
.tabs a:hover{background:rgba(255,255,255,.12)}
.tabs a[aria-current=page]{background:var(--bg);color:var(--ink);font-weight:600}

/* การ์ด */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:22px 24px;margin-bottom:22px;min-width:0}
.card h2{font-size:18px;font-weight:600;margin-bottom:4px}
.card > .muted{margin:0 0 12px;font-size:13px}
.card-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;flex-wrap:wrap;margin-bottom:12px}
.card-head .muted{margin:2px 0 0;font-size:13px}
.grid-2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:22px}
.grid-2 > .card{margin-bottom:22px}

/* ตัวเลขหลัก */
.kpi-row{display:grid;grid-template-columns:1fr 1fr 1.1fr;gap:22px;margin-bottom:22px}
.kpi-row > .card{margin:0}
.kpi-hero{position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:center;min-height:168px;border-top:5px solid var(--c,var(--accent))}
.kpi-hero.alt{--c:#0f766e}
.kpi-label{font-size:14px;color:var(--ink-2);font-weight:500}
.kpi-big{font-size:56px;font-weight:700;line-height:1.1;letter-spacing:-.01em;color:var(--ink);font-variant-numeric:tabular-nums;margin:6px 0 2px}
.kpi-unit{font-size:13px;color:var(--muted)}
.kpi-small{display:flex;flex-direction:column;justify-content:center}
.kpi-small strong{font-size:40px;font-weight:700;line-height:1.15;font-variant-numeric:tabular-nums}
.district-card{display:flex;flex-direction:column;gap:12px;justify-content:center}
.district > div:first-child{display:flex;justify-content:space-between;align-items:baseline;font-size:14px}
.district strong{font-size:20px;font-variant-numeric:tabular-nums}
.meter{height:8px;border-radius:4px;background:#eef2f6;overflow:hidden;margin-top:4px}
.meter span{display:block;height:100%;border-radius:4px;background:var(--c,#0f766e)}

/* หัวหน้างาน */
.page-head{display:flex;align-items:center;gap:14px;margin:-6px 0 18px;padding-left:14px;border-left:5px solid var(--c)}
.page-head .eyebrow{margin:0;font-size:13px;color:var(--muted)}
.page-head h2{font-size:24px;font-weight:700}

/* กราฟ */
.chart{position:relative;min-height:120px}
.chart svg{display:block;overflow:visible}
.chart.small{min-height:180px}
.chart-tip{position:absolute;z-index:500;pointer-events:none;background:#fff;border:1px solid #d6dee6;border-radius:10px;box-shadow:0 6px 20px rgba(16,42,62,.16);padding:8px 12px;font-size:12px;color:var(--ink-2);white-space:nowrap}
.chart-tip b{display:block;color:var(--ink);font-size:13px;font-weight:600;margin-bottom:2px}
.chart-tip strong{color:var(--ink);font-size:15px}
.hbar-row{cursor:default}.hbar-row.link{cursor:pointer}
.multiples{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:18px}
.multiple{border:1px solid var(--line);border-radius:12px;padding:14px 16px}
.multiple.is-empty{background:#fafbfc}
.multiple-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.multiple-head .muted{font-size:12px;margin-left:auto}
.dot{width:10px;height:10px;border-radius:3px;background:var(--c);display:inline-block}
.empty-note{font-size:13px;margin:8px 0 2px}

/* แผนที่ */
.map{height:430px;border-radius:12px;overflow:hidden;border:1px solid var(--line);background:#e8eef3;z-index:0}
.map-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid #d3dce5;background:#fff;border-radius:999px;padding:3px 10px 3px 4px;font:500 12px/1.6 inherit;color:var(--ink-2);cursor:pointer}
.chip .pin{width:20px;height:20px;font-size:10px;border-width:1.5px}
.chip[aria-pressed=false]{opacity:.45}
.chip:focus-visible,.tabs a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid #7cc4fa;outline-offset:2px}
.pin{width:24px;height:24px;border-radius:50%;background:var(--c);color:#fff;border:2px solid #fff;box-shadow:0 1px 4px rgba(16,42,62,.45);display:grid;place-items:center;font:700 11px/1 'IBM Plex Sans Thai','Segoe UI',sans-serif}
.leaflet-popup-content{font:13px/1.55 'IBM Plex Sans Thai','Segoe UI',sans-serif;color:var(--ink)}
.leaflet-popup-content strong{font-size:14px}

/* ตาราง */
.search input{width:min(360px,80vw);padding:9px 14px;border:1px solid #cfd8e1;border-radius:10px;font:inherit;background:#fff}
.table-wrap{overflow-x:auto}
.data-table{width:100%;border-collapse:collapse;font-size:14px}
.data-table th{text-align:left;font-weight:600;color:var(--ink-2);background:#f5f8fb;padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
.data-table td{padding:10px 12px;border-bottom:1px solid #eef2f5;vertical-align:top}
.data-table tbody tr:hover{background:#f7fafc}
.data-table td:first-child{color:var(--muted);width:48px;font-variant-numeric:tabular-nums}
.data-table td:nth-child(2){font-weight:500}
.table-foot{display:flex;justify-content:space-between;align-items:center;margin-top:12px;font-size:13px;gap:12px;flex-wrap:wrap}
.pager{display:flex;align-items:center;gap:10px}
.pager button{width:34px;height:34px;border-radius:10px;border:1px solid #cfd8e1;background:#fff;font-size:18px;cursor:pointer;color:var(--ink)}
.pager button:disabled{opacity:.35;cursor:default}

.foot{color:var(--muted);font-size:12px;padding:6px 0 36px;text-align:center}
.foot p{margin:4px 0}

@media (max-width:980px){.grid-2,.kpi-row{grid-template-columns:1fr}.kpi-big{font-size:46px}.hero h1{font-size:23px}}
@media (max-width:560px){.wrap{padding:0 14px}.card{padding:18px}.hero-top img{width:50px;height:50px}.map{height:340px}}
@media print{.hero{background:none;color:var(--ink)}.tabs,.map,.map-chips,.search,.pager{display:none}.card{box-shadow:none;break-inside:avoid}}
