/* Khuandon Hospital — interface refresh. Presentation only; no behavior overrides. */
:root{
 --navy:#163447;--teal:#176b63;--teal-dark:#10564f;--ink:#203544;
 --muted:#627480;--line:#dce4e8;--bg:#f2f5f7;--red:#a83038;
 --surface:#fff;--soft:#f6f8f9;--sidebar:264px;--radius:6px;
}
*{box-sizing:border-box}
html{color-scheme:light;scroll-padding-top:90px}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.7 Tahoma,"Noto Sans Thai",Arial,sans-serif;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit}
a,button,input,select,textarea{outline-offset:3px}
a{color:var(--teal-dark);text-decoration:none}
button{min-height:42px;cursor:pointer;border:1px solid transparent;border-radius:var(--radius);padding:9px 16px;font-weight:600;line-height:1.5;transition:background-color .15s,border-color .15s}
button:disabled{opacity:.5;cursor:not-allowed}
.primary{background:var(--teal);border-color:var(--teal);color:#fff}
.primary:hover{background:var(--teal-dark);border-color:var(--teal-dark)}
.secondary{background:#fff;color:#304a59;border-color:#cbd7dd}
.secondary:hover{background:#f1f6f5;border-color:#91b5ad}
.plain{background:transparent;color:#506571}
.plain:hover{color:var(--teal-dark);background:#eaf1f0}
.danger{color:#a52c3b;background:#fff0f1;border-color:#f0d1d5}
.wide{width:100%;margin-top:12px}
h1,h2,h3,p{margin-top:0}
h1{font-size:26px;font-weight:700;line-height:1.45;margin-bottom:7px;letter-spacing:-.35px}
h2{font-size:20px;line-height:1.5}
h3{font-size:15px;font-weight:700;margin-bottom:20px}
p{margin-bottom:16px}
.muted{color:var(--muted);font-size:13px}
.eyebrow{font-size:11px;letter-spacing:.5px;font-weight:600;color:var(--muted)}
.error{color:#a22f3b;white-space:pre-wrap;font-size:13px}
.error:empty{display:none}
.notice{padding:13px 16px;background:#edf5f3;border:1px solid #d6e7e1;border-left:3px solid #6a9b8d;border-radius:4px;color:#355b50;font-size:13px;line-height:1.8}
.warning{background:#fffaed;border-color:#e9ddb9;color:#78551c}
label{display:block;margin-bottom:20px;font-size:13px;font-weight:600;color:#344d5b}
input,select,textarea{display:block;width:100%;min-width:0;min-height:44px;margin-top:7px;padding:10px 12px;border:1px solid #c8d4db;border-radius:5px;background:#fff;color:var(--ink);line-height:1.55;transition:border-color .15s,box-shadow .15s}
input::placeholder,textarea::placeholder{color:#7f8d97;opacity:1}
input:hover,select:hover,textarea:hover{border-color:#9dafb9}
input:focus,select:focus,textarea:focus{outline:none;border-color:#377e71;box-shadow:0 0 0 3px #176b6317}
input[type=checkbox]{display:inline-block;width:18px;min-height:18px;margin:0 9px 0 0;vertical-align:middle;accent-color:var(--teal)}
textarea{resize:vertical}
[hidden],.auth[hidden]{display:none!important}

/* Authentication */
.auth{min-height:100vh;display:grid;grid-template-columns:minmax(340px,.9fr) minmax(460px,1.1fr);background:#fff}
.auth-brand{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:72px clamp(40px,6vw,100px);background:var(--navy);color:#fff;overflow:hidden}
.auth-brand:after{content:"";position:absolute;left:0;top:0;right:0;height:5px;background:#78aa96}
.brand-mark{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:38px;height:38px;background:#e6f0ec;border:1px solid #cddfd6;border-radius:6px;color:var(--teal);font-size:0}
.brand-mark:before{content:"";width:23px;height:23px;background:currentColor;clip-path:polygon(35% 0,65% 0,65% 35%,100% 35%,100% 65%,65% 65%,65% 100%,35% 100%,35% 65%,0 65%,0 35%,35% 35%)}
.auth-brand>.brand-mark{width:58px;height:58px;margin-bottom:28px;border-color:#68897c;background:transparent;color:#a7ccba;border-radius:8px}
.auth-brand>.brand-mark:before{width:29px;height:29px}
.auth-brand .eyebrow{font-size:12px;letter-spacing:.3px;color:#bacfcf}
.auth-brand h1{font-size:36px;font-weight:600;line-height:1.6;letter-spacing:0;margin:28px 0 20px}
.auth-brand p{font-size:15px;line-height:1.9;color:#c6d5dc;margin-bottom:0}
.auth-note{margin-top:60px;padding-top:20px;border-top:1px solid #ffffff26;font-size:12px;line-height:1.8;color:#b1c3cd;width:100%}
.auth-form{width:min(460px,calc(100% - 96px));margin:auto;padding:64px 0}
.auth-form>.eyebrow{display:block;padding-left:11px;border-left:3px solid var(--teal);font-size:12px;color:var(--teal-dark)}
.auth-form h2{font-size:28px;font-weight:700;margin:20px 0 10px;color:var(--navy)}
.auth-form>p.muted{margin-bottom:28px}
.auth-form form{margin-top:28px}
.auth-form .notice{margin:24px 0 16px;font-size:12px}
.thaid-button{display:flex;gap:16px;align-items:center;margin:28px 0 16px;padding:20px;border:1px solid #adc9bd;border-radius:8px;background:#fff;color:#244e43;box-shadow:0 2px 5px #153c2d04;transition:background .15s,border-color .15s}
.thaid-button:hover{border-color:var(--teal);background:#f5faf7}
.thaid-button img{display:block;flex:0 0 48px;width:48px;height:48px;border-radius:10px}
.thaid-button span{flex:1;min-width:0}
.thaid-button strong{display:block;font-size:16px;font-weight:700;line-height:1.6}
.thaid-button small{display:block;margin-top:3px;color:#667982;font-size:12px;line-height:1.7}
.thaid-button b{color:var(--teal);font-size:22px;font-weight:400}
.auth-approval-note{font-size:12px;color:#64786d;line-height:1.9;margin-bottom:20px}
.thaid-status{padding:13px;background:#f3f6f5;border:1px solid #d9e4df;border-radius:5px;color:#5c7166;font-size:13px}
#to-register{border:1px solid #d3dfe2;background:#f8fafb;color:#3b5967;font-size:13px}
#to-register:hover{background:#edf3f1;border-color:#9fb9b0}
#auth-error:not(:empty){padding:12px 14px;margin:20px 0 0;border:1px solid #efcbd0;border-left:3px solid #bd5662;background:#fff6f6;border-radius:4px;font-size:12px}

/* Application frame */
aside{position:fixed;inset:0 auto 0 0;z-index:100;display:flex;flex-direction:column;width:var(--sidebar);background:#fff;border-right:1px solid #d8e2e7;color:#415967}
.brand{display:flex;gap:12px;align-items:center;min-height:96px;padding:22px 18px;background:var(--navy);color:#fff;font-size:13px;font-weight:600;line-height:1.7}
.brand .brand-mark{background:#ffffff0c;border-color:#557766;color:#a7ceba}
.brand small{display:block;margin-top:3px;color:#b9cdd6;font-size:11px;font-weight:400}
.nav-label{padding:25px 24px 9px;color:#7b8c95;font-size:11px;font-weight:500;letter-spacing:.2px;flex-shrink:0}
nav{padding:0 12px 24px;overflow-y:auto;min-height:0;flex:1;scrollbar-width:thin}
nav>.nav-label{padding:26px 12px 9px;border-top:1px solid #edf1f3;margin-top:22px}
nav a{display:flex;align-items:center;gap:12px;min-height:46px;margin:3px 0;padding:11px 11px;border:1px solid transparent;border-radius:5px;color:#4b626f;font-size:13px;font-weight:400;line-height:1.7}
nav a:hover{background:#f1f5f6;color:var(--navy)}
nav a.active{border-color:#d8e8e1;background:#eaf3ef;color:#1c5c47;font-weight:600;box-shadow:inset 3px 0 #438b6a}
nav a.active:hover{background:#e2efe7}
nav a span{display:inline-flex;align-items:center;justify-content:center;flex:0 0 20px;width:20px;height:20px;font-size:0;color:#748d98}
nav a.active span{color:#2f775c}
nav a span:before{content:"";width:19px;height:19px;background:currentColor;-webkit-mask:var(--icon) center/contain no-repeat;mask:var(--icon) center/contain no-repeat}
.sidebar-bottom{display:flex;align-items:center;gap:12px;margin-top:auto;padding:18px;border-top:1px solid var(--line);background:#f8fafb;font-size:12px;flex-shrink:0}
.avatar{display:flex;align-items:center;justify-content:center;width:36px;height:36px;flex:0 0 auto;border:1px solid #d2e1dc;background:#e9f1ed;border-radius:5px;color:#36644e;font-size:11px;font-weight:600}
#sidebar-user{min-width:0;overflow-wrap:anywhere}
.sidebar-bottom small{display:block;margin-top:2px;color:#73838c;font-size:10px}
.workspace{display:flex;flex-direction:column;min-height:100vh;min-width:0;margin-left:var(--sidebar)}
header{position:sticky;top:0;z-index:50;display:flex;align-items:center;gap:14px;min-height:70px;padding:12px 32px;border-bottom:1px solid var(--line);background:#fffffff5}
.header-title{margin-right:auto;color:#3f5868;font-size:12px;font-weight:600}
.header-title .muted{font-weight:400;font-size:11px;color:#8b9aa3;margin-left:6px}
header button{min-height:37px;font-size:12px;padding:8px 13px}
#logout{border:1px solid #dbe4e8;color:#5e737f;background:#fff}
main{width:100%;min-width:0;max-width:1740px;margin:0 auto;padding:30px 32px 42px;flex:1}
.page-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:18px;margin-bottom:26px;padding-bottom:22px;border-bottom:1px solid #d9e3e8}
.page-heading .eyebrow{font-size:10px;letter-spacing:.6px;color:#7b8d96;margin-bottom:8px}
.page-heading p{margin-bottom:0;font-size:13px}
.page-heading #updated{white-space:nowrap;font-size:11px;line-height:1.8;color:#6e818c}
.menu-toggle{display:none}
footer{display:flex;justify-content:space-between;gap:16px;padding:17px 32px;background:#f9fbfc;border-top:1px solid var(--line);font-size:11px;color:#71838e}
footer span{font-size:10px;color:#8798a1}

/* Overview */
.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px}
.card,.panel{border:1px solid var(--line);border-radius:var(--radius);background:#fff;box-shadow:0 1px 2px #102f3c03}
.card{position:relative;min-height:146px;padding:20px 20px 17px;overflow:hidden}
.card:after{content:"";position:absolute;left:20px;bottom:0;width:30px;height:3px;background:var(--accent,var(--teal));opacity:.7}
.card .card-label{display:block;padding-right:30px;color:#607480;font-size:12px;line-height:1.7}
.card .num{display:block;margin-top:8px;padding-right:38px;color:#203e4e;font-size:34px;font-weight:600;line-height:1.3;letter-spacing:-1px;font-variant-numeric:tabular-nums}
.card .unit{font-size:12px;font-weight:400;color:#718591;margin-left:7px;letter-spacing:0}
.card .card-foot{display:block;margin-top:7px;color:#7b8c96;font-size:10px;line-height:1.7}
.card .card-icon{position:absolute;right:20px;top:22px;display:grid;place-items:center;width:24px;height:24px;border:0;border-radius:0;background:none;color:#78929b;font-size:0}
.card .card-icon:before{content:"";width:22px;height:22px;background:currentColor;-webkit-mask:var(--icon) center/contain no-repeat;mask:var(--icon) center/contain no-repeat}
.card:first-child{background:var(--navy);border-color:var(--navy)}
.card:first-child .card-label{color:#d6e4e8}
.card:first-child .num{color:#fff}
.card:first-child .unit,.card:first-child .card-foot{color:#aabfc9}
.card:first-child .card-icon{color:#b2d0c5}
.card:first-child:after{background:#88b49e;opacity:1}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
.panel{min-width:0;padding:24px}
.panel h3{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-bottom:16px;border-bottom:1px solid #e8edef;line-height:1.6}
.panel h3 small{font-size:10px;color:#82939d;font-weight:400;white-space:nowrap}
.chart{display:flex;align-items:flex-end;gap:24px;height:280px;padding:34px 6px 48px;margin-top:10px;border-bottom:1px solid #e0e8ec;background:repeating-linear-gradient(to top,transparent,transparent 53px,#edf1f3 54px,#edf1f3 55px)}
.bar-col{position:relative;display:flex;flex:1;min-width:0;height:100%;align-items:center;flex-direction:column;justify-content:flex-end}
.bar{position:relative;width:52%;max-width:64px;min-height:2px;border-radius:3px 3px 0 0;background:var(--teal)}
.bar strong{position:absolute;top:-29px;width:100%;text-align:center;color:#3d5666;font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}
.bar-col>span{position:absolute;top:calc(100% + 12px);width:110%;color:#6b7e89;font-size:11px;line-height:1.6;text-align:center;white-space:normal;overflow-wrap:anywhere}
.legend{display:flex;align-items:center;gap:12px 18px;flex-wrap:wrap;margin-top:20px;color:#6d808b;font-size:11px;line-height:1.8}
.dot{display:inline-block;width:7px;height:7px;margin-right:6px;border-radius:2px;background:var(--teal)}
.count-chip{display:inline-block;padding:4px 9px;border:1px solid #d9e5df;border-radius:4px;background:#f3f8f5;color:#456959;font-size:11px;font-weight:400;white-space:nowrap}
.section-gap{margin-top:24px}
.stack{display:grid;gap:15px}
.group-card{border-left:3px solid var(--teal);padding:24px}
.group-card h2{font-size:18px;margin-bottom:10px}
.group-card p,.group-card li{color:#5b7380;font-size:13px;line-height:1.9}
.group-card ul{padding-left:20px;margin-bottom:0}

/* Filters and data tables */
.toolbar{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;padding:20px;margin-bottom:20px;background:#fff}
.toolbar label{flex:1;min-width:145px;margin:0;font-size:12px;font-weight:600}
.toolbar label:first-child{flex:1.5}
.toolbar input,.toolbar select{font-size:13px;min-height:42px;padding:9px 10px;margin-top:7px}
.toolbar>button{min-height:42px;font-size:12px;white-space:nowrap}
.table-wrap{width:100%;max-width:100%;overflow:auto;background:#fff;border:1px solid #d7e1e7;border-radius:var(--radius);scrollbar-width:thin;scrollbar-color:#bdccd4 #f1f5f7}
table{border-collapse:collapse;width:100%;font-size:13px;line-height:1.7;text-align:left}
.table-wrap table{min-width:760px}
th{padding:14px 16px;background:#eaf0f3;color:#536a79;border-bottom:1px solid #d4dfe6;font-size:12px;font-weight:600;text-align:left;white-space:nowrap}
td{padding:16px;border-bottom:1px solid #e6ecef;color:#405b6a;vertical-align:middle;min-width:90px;max-width:320px;overflow-wrap:break-word}
td:first-child{min-width:160px}
td strong{color:#263f4e;font-size:13px;font-weight:600}
td small{display:block;margin-top:4px;color:#7b8d98;font-size:11px;line-height:1.6}
tbody tr:last-child td{border-bottom:0}
tbody tr:nth-child(even){background:#fcfdfe}
tbody tr:hover{background:#f2f7f5}
.row-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}
.row-actions button,td button{min-height:33px;padding:6px 10px;font-size:11px;white-space:nowrap}
.badge{display:inline-block;padding:3px 8px;border:1px solid #cbded6;border-radius:4px;color:#416b5b;background:#f0f6f2;font-size:11px;font-weight:500;line-height:1.7;white-space:nowrap}
.badge.red{color:#9c3344;background:#fff0f2;border-color:#f0d3da}
.badge.blue{color:#3b6185;background:#edf4fa;border-color:#d1e1ec}
.badge.green{color:#2f694d;background:#ecf5ef;border-color:#cddfd2}
.badge.yellow{color:#855f20;background:#fff8e6;border-color:#eddfba}
.watch-badge{font-weight:600;padding:4px 9px;border-radius:4px;background:#f1f5f9;border-color:#cbd5e1;white-space:nowrap}
.badge.watch-badge.watch-red{color:#991b1b;background:#fee2e2;border-color:#fecaca}
.badge.watch-badge.watch-yellow{color:#854d0e;background:#fef9c3;border-color:#fde68a}
.badge.watch-badge.watch-green{color:#166534;background:#dcfce7;border-color:#bbf7d0}
.empty{padding:50px 24px;text-align:center;font-size:13px;color:#738690}
.empty b{display:block;margin-bottom:10px;color:var(--ink);font-size:16px}
.pager{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:18px 0;font-size:12px;color:#6b808e}
.pager button{min-height:36px;font-size:12px}
.small-form{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;padding-top:20px;border-top:1px solid var(--line)}
.small-form label{flex:1;min-width:120px;margin-bottom:0}
.small-form input[type=color]{min-width:70px;padding:5px}

/* Patient details and dialogs */
dialog{width:min(800px,calc(100vw - 40px));max-height:90vh;padding:0;border:1px solid #cad6de;border-radius:8px;box-shadow:0 16px 64px #102a3c33;color:var(--ink);background:#fff}
dialog::backdrop{background:#1732438c}
.modal-head{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 24px;border-bottom:1px solid var(--line);background:#f8fafb}
.modal-head h2{font-size:18px;line-height:1.6;margin:0}
#close-modal{width:34px;min-height:34px;padding:3px;color:#6e828d;border:1px solid #d8e2e6;background:#fff}
#modal-content{padding:24px}
#modal-error{padding:0 24px 12px;margin-bottom:8px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 22px}
.form-grid .full{grid-column:1/-1}
.search-row{display:grid;grid-template-columns:140px minmax(0,1fr) auto;gap:12px;align-items:flex-end}
.search-row label{margin:0}
.person-card{padding:22px;margin:22px 0;background:#f5f8fa;border:1px solid #dbe5ea;border-radius:5px}
.person-card h3{font-size:19px;padding-bottom:15px;margin-bottom:18px;border-bottom:1px solid #dce6ea;color:#244b60}
.details{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px 16px;margin:0}
.details dt{font-size:11px;color:#7b8e99;line-height:1.6}
.details dd{margin:5px 0 0;color:#344f60;font-size:13px;overflow-wrap:anywhere;line-height:1.8}
.details .full{grid-column:1/-1}
.steps{display:flex;align-items:center;gap:8px;margin-bottom:24px;color:#7d8c96;font-size:11px}
.steps span{padding:6px 10px;border:1px solid #e0e6eb;border-radius:4px;background:#f6f8fa;line-height:1.6}
.steps .current{border-color:#bfd6c9;background:#edf5f0;color:#376c51;font-weight:600}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;padding-top:20px;margin-top:24px;border-top:1px solid var(--line)}
.tai-hint{padding:13px 15px;margin-bottom:18px;font-size:12px;color:#617985;background:#f2f6f8;border:1px solid #e0e9ee;border-radius:4px;line-height:1.8}
.inline-check{display:flex;align-items:center;padding:12px 0;color:#45616f}

/* Map and feedback */
.map-panel{position:relative;padding:10px}
.map{height:570px;border:1px solid #d7e1e6;border-radius:4px;z-index:1}
.map-message{margin:12px 8px 4px;font-size:12px;line-height:1.8;color:#856a36}
.map-detail{display:grid;gap:10px}
.map-popup-name{font-weight:600;font-size:14px;color:var(--navy)}
.map-popup button{margin-top:12px}
.map-marker{background:none;border:none}
.pin-dot{width:18px;height:18px;border:3px solid white;border-radius:50%;box-shadow:0 2px 7px #0005}
#toast{position:fixed;bottom:24px;right:24px;z-index:2000;max-width:min(440px,calc(100vw - 32px));padding:14px 20px;border:1px solid #456773;border-left:4px solid #7bb79d;border-radius:5px;background:#203e4e;color:white;box-shadow:0 4px 20px #1c374621;font-size:13px;line-height:1.8}
.loading{padding:60px 20px;text-align:center;color:#718591;font-size:13px}
nav a:focus-visible,a:focus-visible,button:focus-visible{outline:3px solid #74ac98;outline-offset:3px}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}

/* Responsive layouts: same navigation and form behavior as the original application. */
@media(min-width:1600px){main{padding:36px 40px 48px}.cards{gap:20px}.card{padding:24px;min-height:156px}.card:after{left:24px}.card .card-icon{right:24px;top:26px}.chart{height:300px}}
@media(max-width:1250px){:root{--sidebar:240px}.brand{padding:20px 14px;font-size:12px}.brand-mark{width:33px;height:33px}header{padding:12px 24px}.header-title .muted{display:none}main{padding:26px 24px 36px}.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-2{gap:18px}.panel{padding:20px}.chart{gap:16px}.bar-col>span{font-size:10px}.toolbar label{min-width:140px}}
@media(max-width:900px){.auth{grid-template-columns:minmax(300px,.85fr) minmax(380px,1.15fr)}.auth-brand{padding:50px 32px}.auth-brand h1{font-size:29px}.auth-form{width:calc(100% - 64px)}.auth-note{margin-top:42px}}
@media(max-width:850px){aside{transform:translateX(-100%);transition:transform .18s}.menu-open aside{transform:translateX(0);box-shadow:8px 0 30px #12303e28}.workspace{margin-left:0}.menu-toggle{display:block;border:1px solid #d7e2e7;background:#fff;color:var(--navy);width:38px;font-size:18px;padding:4px}header{padding:10px 16px;gap:10px;min-height:64px}.header-title{display:none}header .add-patient{margin-left:auto}#role-badge{margin-right:auto}header:has(.add-patient:not([hidden])) #role-badge{margin-right:0}.grid-2{grid-template-columns:1fr}.page-heading #updated{white-space:normal;max-width:160px;text-align:right}.auth{grid-template-columns:1fr;grid-template-rows:auto 1fr}.auth-brand{padding:28px 32px;min-height:0}.auth-brand>.brand-mark{width:38px;height:38px;margin-bottom:14px}.auth-brand>.brand-mark:before{width:21px;height:21px}.auth-brand .eyebrow{font-size:11px}.auth-brand h1{font-size:25px;line-height:1.5;margin:14px 0 8px}.auth-brand p{font-size:12px;line-height:1.8}.auth-note{display:none}.auth-form{width:min(460px,calc(100% - 48px));margin:0 auto;padding:36px 0 44px}.auth-form h2{font-size:25px;margin-top:16px}.details{grid-template-columns:repeat(2,minmax(0,1fr))}.map{height:62vh;min-height:340px}footer{padding:16px 24px}.panel h3{flex-wrap:wrap}}
@media(max-width:520px){main{padding:24px 16px 32px}header{gap:8px;padding:10px 12px}header button{font-size:11px;padding:8px 10px}#role-badge{font-size:10px;padding:3px 6px}.page-heading{padding-bottom:18px;margin-bottom:20px;align-items:flex-start}.page-heading #updated{display:none}.page-heading .eyebrow{font-size:9px;letter-spacing:0}h1{font-size:23px}.page-heading p{font-size:12px;line-height:1.8}.cards{gap:12px;margin-bottom:20px}.card{padding:16px 14px;min-height:142px}.card:after{left:14px}.card .card-label{font-size:11px;padding-right:0}.card .card-icon{display:none}.card .num{font-size:31px;padding-right:0;margin-top:12px}.card .unit{font-size:10px;margin-left:5px}.card .card-foot{font-size:9px;line-height:1.8}.panel{padding:18px}.grid-2{gap:18px}.panel h3{font-size:14px;gap:8px}.chart{height:270px;gap:12px;padding-left:0;padding-right:0}.bar-col>span{font-size:10px}.legend{font-size:10px;gap:10px 13px}.toolbar{padding:16px;gap:12px}.toolbar label{min-width:calc(50% - 12px);font-size:11px}.toolbar label:first-child{flex-basis:100%}.toolbar>button{flex:1}.toolbar input,.toolbar select{font-size:12px}.pager{align-items:flex-start;flex-wrap:wrap;font-size:11px}.table-wrap{border-radius:4px}.form-grid{grid-template-columns:1fr}.form-grid .full{grid-column:auto}.search-row{grid-template-columns:minmax(110px,1fr) minmax(0,1.7fr)}.search-row button{grid-column:1/-1}.modal-head{padding:15px 18px}.modal-head h2{font-size:16px}dialog{width:calc(100vw - 20px);max-height:94vh;border-radius:6px}#modal-content{padding:18px}#modal-error{padding:0 18px 10px}.person-card{padding:16px}.person-card h3{font-size:17px}.details{gap:16px 12px}.details dd{font-size:12px}.steps{gap:5px;flex-wrap:wrap}.steps span{padding:5px 7px;font-size:10px}.modal-actions{flex-wrap:wrap}.modal-actions button{flex:1;min-width:110px}.auth-brand{padding:24px}.auth-brand h1{font-size:23px}.auth-brand p{font-size:12px}.auth-form{width:calc(100% - 48px);padding:32px 0 40px}.auth-form>.eyebrow{font-size:11px}.auth-form>p.muted{font-size:12px}.thaid-button{padding:16px;gap:12px}.thaid-button img{width:43px;height:43px;flex-basis:43px}.thaid-button strong{font-size:14px}.thaid-button small{font-size:10px}.thaid-button b{font-size:19px}.auth-approval-note{font-size:11px}footer{padding:16px;font-size:10px}footer span{display:none}#toast{right:16px;bottom:16px;font-size:12px}.small-form{gap:12px}.small-form button{width:100%}}

/* Consistent local outline icons; no remote fonts or image requests. */
nav a[data-page="dashboard"]{--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221%22%2F%3E%3C%2Fsvg%3E")}
nav a[data-page="registry"]{--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%224%22%20y%3D%223%22%20width%3D%2216%22%20height%3D%2218%22%20rx%3D%222%22%2F%3E%3Cpath%20d%3D%22M8%208h8M8%2012h8M8%2016h5%22%2F%3E%3C%2Fsvg%3E")}
nav a[data-page="map"],.card:nth-child(8){--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%2010c0%206-8%2011-8%2011S4%2016%204%2010a8%208%200%201%201%2016%200Z%22%2F%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2210%22%20r%3D%222.5%22%2F%3E%3C%2Fsvg%3E")}
nav a[href="https://kdhospital.moph.go.th/kdh-pin/"]{--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M9%205%203%203v16l6%202%206-2%206%202V5l-6-2-6%202ZM9%205v16M15%203v16%22%2F%3E%3C%2Fsvg%3E")}
nav a[data-page="groups"],.card:nth-child(1){--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%228%22%20cy%3D%227%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M2%2021v-3a6%206%200%200%201%2012%200v3M15%204a3%203%200%200%201%200%206M22%2021v-3a6%206%200%200%200-5-6%22%2F%3E%3C%2Fsvg%3E")}
nav a[data-page="facilities"]{--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M4%2021V3h16v18M2%2021h20M9%2021v-5h6v5M8%207h8M12%204v6%22%2F%3E%3C%2Fsvg%3E")}
nav a[data-page="users"]{--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%229%22%20cy%3D%227%22%20r%3D%223%22%2F%3E%3Cpath%20d%3D%22M3%2021v-3a6%206%200%200%201%2010-4M18%2012l4%202v3c0%203-4%205-4%205s-4-2-4-5v-3Z%22%2F%3E%3C%2Fsvg%3E")}
nav a[data-page="audit"]{--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%2011a9%209%200%201%201%202%207M3%205v6h6M12%207v5l3%202%22%2F%3E%3C%2Fsvg%3E")}
.card:nth-child(2){--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M3%204v17M3%2015h18v6M3%2018h18M7%2010h3a3%203%200%200%201%203%203v2M13%208h5a3%203%200%200%201%203%203v4%22%2F%3E%3Ccircle%20cx%3D%227%22%20cy%3D%2210%22%20r%3D%222%22%2F%3E%3C%2Fsvg%3E")}
.card:nth-child(3){--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m3%2010%209-7%209%207M5%209v12h14V9M9%2021v-7h6v7%22%2F%3E%3C%2Fsvg%3E")}
.card:nth-child(4){--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M12%204c-4-4-9%201-6%204-5%200-5%207-1%208-1%205%207%207%207%202V4Zm0%200c4-4%209%201%206%204%205%200%205%207%201%208%201%205-7%207-7%202M6%208l3%202M5%2016l4-1M18%208l-3%202M19%2016l-4-1%22%2F%3E%3C%2Fsvg%3E")}
.card:nth-child(5){--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M20%205c-3-3-7-1-8%202-1-3-5-5-8-2-5%205%202%2011%208%2016%206-5%2013-11%208-16Z%22%2F%3E%3Cpath%20d%3D%22M3%2012h5l2-4%204%208%202-4h5%22%2F%3E%3C%2Fsvg%3E")}
.card:nth-child(6){--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%224%22%20r%3D%222%22%2F%3E%3Cpath%20d%3D%22m9%208-3%206M9%208l4%203h4M9%208l1%207-3%206M10%2015l4%206M19%2012v9%22%2F%3E%3C%2Fsvg%3E")}
.card:nth-child(7){--icon:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2211%22%20cy%3D%223%22%20r%3D%222%22%2F%3E%3Cpath%20d%3D%22M11%207v7h6l3%205%202-1M11%2010h5M8%2010a6%206%200%201%200%207%2010%22%2F%3E%3C%2Fsvg%3E")}

/* Dashboard category colors: full tinted surfaces with prominent category rails. */
.cards>.card:nth-child(2){--card-surface:#fff0f2;--card-border:#efc5cd;--card-strong:#a62e46;--card-icon-bg:#fbdbe2}
.cards>.card:nth-child(3){--card-surface:#fff2e5;--card-border:#edcfac;--card-strong:#935018;--card-icon-bg:#ffe0bd}
.cards>.card:nth-child(4){--card-surface:#f1edff;--card-border:#d6c8f1;--card-strong:#6944a3;--card-icon-bg:#e2d8fa}
.cards>.card:nth-child(5){--card-surface:#eaf3ff;--card-border:#bed6f2;--card-strong:#25619c;--card-icon-bg:#d2e5fb}
.cards>.card:nth-child(6){--card-surface:#fff8dc;--card-border:#e6d99c;--card-strong:#7d6113;--card-icon-bg:#f7e9ab}
.cards>.card:nth-child(7){--card-surface:#edf0f6;--card-border:#c9d2e2;--card-strong:#4b5f87;--card-icon-bg:#dce3f0}
.cards>.card:nth-child(8){--card-surface:#e6f6f0;--card-border:#b6ddce;--card-strong:#166a52;--card-icon-bg:#c7e9dc}
.cards>.card:not(:first-child){background:var(--card-surface);border-color:var(--card-border);border-left:5px solid var(--card-strong)}
.cards>.card:not(:first-child):after{display:none}
.cards>.card:not(:first-child) .card-label{color:var(--card-strong);font-weight:600;padding-right:32px}
.cards>.card:not(:first-child) .num{color:var(--card-strong)}
.cards>.card:not(:first-child) .card-foot,.cards>.card:not(:first-child) .unit{color:#506473}
.cards>.card:not(:first-child) .card-icon{width:34px;height:34px;top:16px;right:16px;background:var(--card-icon-bg);border-radius:6px;color:var(--card-strong)}
.cards>.card:not(:first-child) .card-icon:before{width:21px;height:21px}
@media(min-width:1600px){.cards>.card:not(:first-child) .card-icon{top:20px;right:20px}}
@media(max-width:520px){.cards>.card:not(:first-child) .card-label{padding-right:0}}

/* Independent patient registration flags and Palliative category. */
.patient-flags{display:flex;align-items:center;gap:12px 32px;flex-wrap:wrap;margin-bottom:18px;padding:4px 0}
.patient-flags .inline-check{margin:0;padding:8px 0;min-height:40px}
.badge.palliative-badge{color:#991b1b;background:#fee2e2;border-color:#fecaca;font-weight:600}
.cards>.card:nth-child(8){--card-surface:#fff0f2;--card-border:#efc5cd;--card-strong:#a62e46;--card-icon-bg:#fbdbe2;--icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 5c-3-3-7-1-8 2-1-3-5-5-8-2-5 5 2 11 8 16 6-5 13-11 8-16Z'/%3E%3Cpath d='M12 8v7M8.5 11.5h7'/%3E%3C/svg%3E")}

/* Classification catalog management */
.catalog-toolbar{display:flex;gap:12px;flex-wrap:wrap;margin-top:20px}
.catalog-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.catalog-heading h2{margin:0;font-size:18px}.catalog-heading button,.catalog-subgroup button{min-height:34px;padding:7px 11px;font-size:11px;white-space:nowrap}
.catalog-description{white-space:pre-wrap;overflow-wrap:anywhere}
.catalog-subgroup{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;padding:15px 0;border-top:1px solid var(--line)}
.catalog-subgroup>div{min-width:0}.catalog-subgroup strong{font-size:13px}.catalog-subgroup p{margin:7px 0 0;font-size:12px}.catalog-subgroups .catalog-subgroup:first-child{margin-top:14px}
.catalog-statuses{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 24px}.catalog-statuses small{display:inline-block;margin-left:8px;font-size:10px}
#catalog-form input[readonly]{background:#f1f4f6;color:#657a88}
.cards>.card.dynamic-card{background:var(--card-surface);border-color:var(--card-border);border-left:5px solid var(--card-strong)}
.cards>.card.dynamic-card:after{display:none}
.cards>.card.dynamic-card .card-label,.cards>.card.dynamic-card .num{color:var(--card-strong)}
.cards>.card.dynamic-card .card-icon{background:var(--card-icon-bg);color:var(--card-strong)}
.cards>.card:first-child .card-icon:before{content:'＋';font-size:25px;line-height:1;background:none;mask:none;-webkit-mask:none}
@media(max-width:600px){.catalog-statuses{grid-template-columns:1fr}.catalog-toolbar button{flex:1}.catalog-heading{gap:10px}.catalog-subgroup{gap:10px}.catalog-subgroup button{font-size:10px}.catalog-heading h2{font-size:16px}}
