@import"https://fonts.googleapis.com/css2?family=Mali:wght@500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&display=swap";:root{--bg: #eef7f3;--card: #ffffff;--ink: #17302a;--muted: #5f7d73;--line: #d7ece3;--brand: #087f5b;--brand-bright: #1fb87e;--brand-soft: #dff5ec;--night: #6c63ff;--night-soft: #edecff;--warn: #c97a1b;--warn-soft: #fff3de;--ok: #0c6e8a;--ok-soft: #dff0f5;--danger: #d8534f;--danger-soft: #fdebea;--radius: 18px;--radius-sm: 12px;--shadow-soft: 0 4px 14px rgba(8, 127, 91, .1), 0 1px 3px rgba(8, 127, 91, .08);--shadow-pop: 0 8px 22px rgba(8, 127, 91, .14), 0 2px 5px rgba(8, 127, 91, .1)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Noto Sans Thai,Sarabun,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;font-size:15px;line-height:1.6}h1,h2,h3{font-family:Mali,Noto Sans Thai,sans-serif}button{font:inherit;cursor:pointer}a{color:var(--brand)}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--brand-bright);outline-offset:2px;border-radius:6px}@media (prefers-reduced-motion: reduce){*{transition-duration:.001ms!important;animation-duration:.001ms!important}}.app{max-width:1180px;margin:0 auto;padding:0 14px 64px}.topbar{position:sticky;top:0;z-index:20;background:var(--card);border-bottom:3px solid var(--line);margin:0 -14px 18px;padding:12px 14px;box-shadow:0 2px 12px #146a990f}.topbar-inner{max-width:1180px;margin:0 auto;display:flex;align-items:center;gap:12px;flex-wrap:wrap}.brand{font-family:Mali,sans-serif;font-weight:700;font-size:19px;margin-right:auto;color:var(--brand);display:flex;align-items:center;gap:8px}.brand:before{content:"";width:10px;height:10px;border-radius:50%;background:var(--brand-bright);flex-shrink:0;box-shadow:0 0 0 4px var(--brand-soft)}.brand span{color:var(--muted);font-weight:400;font-size:13px;display:block;font-family:Noto Sans Thai,sans-serif}.tabs{display:flex;gap:4px;flex-wrap:wrap}.tab{border:2px solid transparent;background:none;color:var(--muted);padding:7px 15px;border-radius:999px;font-weight:500;transition:background .15s ease,color .15s ease,transform .1s ease}.tab:hover{background:var(--bg);transform:translateY(-1px)}.tab.active{background:var(--brand-soft);color:var(--brand);font-weight:700;border-color:#b9e8d5}.card{background:var(--card);border:2px solid var(--line);border-radius:var(--radius);padding:16px;margin-bottom:16px;box-shadow:var(--shadow-soft)}.card h2{margin:0 0 10px;font-size:17px;color:var(--brand)}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.spacer{flex:1}.muted{color:var(--muted)}.small{font-size:13px}.tiny{font-size:12px}input,select,textarea{font:inherit;padding:9px 12px;border:2px solid var(--line);border-radius:var(--radius-sm);background:var(--card);color:var(--ink);transition:border-color .15s ease,box-shadow .15s ease}input:focus,select:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft);outline:none}.btn{border:2px solid var(--line);background:var(--card);color:var(--ink);padding:9px 16px;border-radius:var(--radius-sm);font-weight:500;transition:transform .12s ease,box-shadow .12s ease,background .12s ease;box-shadow:0 2px 0 var(--line)}.btn:hover{background:var(--bg);transform:translateY(-1px)}.btn:active{transform:translateY(1px);box-shadow:0 1px 0 var(--line)}.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff;box-shadow:0 3px #045538}.btn.primary:hover{filter:brightness(1.06)}.btn.primary:active{box-shadow:0 1px #045538}.btn.danger{color:var(--danger);border-color:#f6cfcd}.btn:disabled{opacity:.5;cursor:not-allowed;transform:none;box-shadow:none}.notice{padding:11px 14px;border-radius:var(--radius-sm);background:var(--warn-soft);color:var(--warn);border:2px solid #f4dfb8}.notice.err{background:var(--danger-soft);color:var(--danger);border-color:#f5c6c2}.notice.ok{background:var(--ok-soft);color:var(--ok);border-color:#bde0ea}.bands{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}@media (max-width: 720px){.bands{grid-template-columns:repeat(2,1fr)}}.band{border:2px solid var(--line);border-radius:var(--radius);background:var(--card);padding:12px;box-shadow:var(--shadow-soft);transition:transform .15s ease,box-shadow .15s ease}.band:hover{transform:translateY(-2px);box-shadow:var(--shadow-pop)}.band-head{display:flex;align-items:baseline;gap:6px;margin-bottom:9px}.band-name{font-weight:700;font-size:13px;color:var(--brand)}.band-count{margin-left:auto;font-size:22px;font-weight:700;font-family:Mali,sans-serif}.band.night{background:var(--night-soft);border-color:#d3d0fb}.band.night .band-name,.band.night .band-count{color:var(--night)}.chip{display:inline-flex;align-items:baseline;gap:5px;background:var(--bg);border:2px solid var(--line);border-radius:999px;padding:4px 11px;margin:0 5px 5px 0;font-size:13px;font-weight:500}.chip .time{color:var(--muted);font-size:11.5px}.chip.partial{border-style:dashed}.chip.unmatched{border-color:#f2c9c6;background:var(--danger-soft)}.chip.editable{position:relative;cursor:pointer;padding-right:22px;transition:border-color .12s ease,box-shadow .12s ease}.chip.editable:hover{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}.chip.editable .edit-pencil{position:absolute;top:3px;right:6px;font-size:10px;color:var(--muted);opacity:.6}.chip.editable:hover .edit-pencil{color:var(--brand);opacity:1}.tablewrap{overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:14px}th,td{text-align:left;padding:8px 10px;border-bottom:2px solid var(--bg);vertical-align:top}th{font-size:12.5px;color:var(--brand);font-weight:700;white-space:nowrap}tr:hover td{background:var(--brand-soft)}.dept-row{display:grid;grid-template-columns:190px 1fr;gap:12px;align-items:start;padding:12px 0;border-bottom:2px solid var(--bg)}@media (max-width: 720px){.dept-row{grid-template-columns:1fr;gap:4px}}.dept-name{font-weight:700;color:var(--ink)}.pill{display:inline-block;padding:2px 10px;border-radius:999px;font-size:12px;font-weight:500;background:var(--bg);border:2px solid var(--line)}.pill.night{background:var(--night-soft);border-color:#d3d0fb;color:var(--night)}.pill.warn{background:var(--warn-soft);border-color:#f4dfb8;color:var(--warn)}.pill.ok{background:var(--ok-soft);border-color:#bde0ea;color:var(--ok)}.pill.danger{background:var(--danger-soft);border-color:#f6cfcd;color:var(--danger)}.empty{text-align:center;color:var(--muted);padding:32px 12px}.chip.duty-night_in,.hour-cell.duty-night_in,.band.duty-night_in{background:#eeeafd;border-color:#d6cffa}.chip.duty-night_in .time,.chip.duty-night_in .tiny,.hour-cell.duty-night_in .tiny{color:#5b4fd6}.chip.duty-icu_ncu,.hour-cell.duty-icu_ncu,.band.duty-icu_ncu{background:#ffe9f1;border-color:#fbc9dc}.chip.duty-icu_ncu .time,.chip.duty-icu_ncu .tiny,.hour-cell.duty-icu_ncu .tiny{color:#c23673}.chip.duty-ccu,.hour-cell.duty-ccu,.band.duty-ccu{background:#fff1de;border-color:#fbdcac}.chip.duty-ccu .time,.chip.duty-ccu .tiny,.hour-cell.duty-ccu .tiny{color:#a15c0e}.chip.duty-consult_ipd,.hour-cell.duty-consult_ipd,.band.duty-consult_ipd{background:#e7f3ff;border-color:#bfe0fb}.chip.duty-consult_ipd .time,.chip.duty-consult_ipd .tiny,.hour-cell.duty-consult_ipd .tiny{color:#1c6fb0}.chip.duty-consult_opd,.hour-cell.duty-consult_opd,.band.duty-consult_opd{background:#e3f7f2;border-color:#bfeadf}.chip.duty-consult_opd .time,.chip.duty-consult_opd .tiny,.hour-cell.duty-consult_opd .tiny{color:#0d7d6e}.chip.duty-consult_intervention,.hour-cell.duty-consult_intervention,.band.duty-consult_intervention{background:#f1eaff;border-color:#ddccfb}.chip.duty-consult_intervention .time,.chip.duty-consult_intervention .tiny,.hour-cell.duty-consult_intervention .tiny{color:#6b3fb8}.chip.duty-eme,.hour-cell.duty-eme,.band.duty-eme{background:#fff8da;border-color:#f5e6a8}.chip.duty-eme .time,.chip.duty-eme .tiny,.hour-cell.duty-eme .tiny{color:#8a6a08}.chip.duty-oncall,.hour-cell.duty-oncall,.band.duty-oncall{background:#ffece6;border-color:#fac9b8}.chip.duty-oncall .time,.chip.duty-oncall .tiny,.hour-cell.duty-oncall .tiny{color:#b8461f}.chip.duty-admit_new,.hour-cell.duty-admit_new,.band.duty-admit_new{background:#e6f4fb;border-color:#bfe0f0}.chip.duty-admit_new .time,.chip.duty-admit_new .tiny,.hour-cell.duty-admit_new .tiny{color:#14688a}.chip.duty-rt,.hour-cell.duty-rt,.band.duty-rt{background:#eef3ec;border-color:#d3e0cd}.chip.duty-rt .time,.chip.duty-rt .tiny,.hour-cell.duty-rt .tiny{color:#4c6152}.chip.duty-other,.chip.duty-unset,.hour-cell.duty-other,.band.duty-other{background:#f0f0ef;border-color:#dcdcd9}.chip.duty-other .time,.chip.duty-unset .time,.hour-cell.duty-other .tiny{color:#63645f}.chip.duty-opd,.hour-cell.duty-opd,.band.duty-opd{background:var(--brand-soft);border-color:#b9e8d5}.chip.duty-opd .time,.chip.duty-opd .tiny,.hour-cell.duty-opd .tiny{color:var(--brand)}.chip.unmatched{background:var(--danger-soft);border-color:#f2c9c6}.chip.unmatched .time,.chip.unmatched .tiny{color:var(--danger)}.duty-legend{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}.duty-legend .pill{font-size:11px}.hour-grid th,.hour-grid td{padding:4px 6px}.hour-grid th:first-child,.hour-grid td:first-child{position:sticky;left:0;background:var(--card);z-index:1;max-width:160px;overflow:hidden;text-overflow:ellipsis}.hour-grid th{text-align:center}.hour-cell{text-align:center;width:52px;font-size:15px;border-radius:6px}.hour-cell .tiny{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:48px;vertical-align:bottom}.day-cell.hour-cell{text-align:center}.day-cell .chip{display:block;width:76px;box-sizing:border-box}.day-cell .chip .tiny{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media print{.topbar,.no-print{display:none!important}body{background:#fff;font-size:12px}.card{border:none;padding:0;box-shadow:none}.app{max-width:none}}
