:root{font-family:'Segoe UI',Arial,sans-serif;color:#20344e;background:#f4f7fb;font-size:16px;--line:#cbd8e5}*{box-sizing:border-box}body{margin:0;padding:16px 22px}header{padding:18px 22px;background:linear-gradient(100deg,#2563eb,#06b6d4);color:white;border-radius:10px;display:flex;justify-content:space-between;gap:18px;align-items:center}small{font-size:13px}h1{margin:4px 0;font-size:27px}h2{font-size:21px}.header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}#lockStatus{font-size:14px;padding:7px 12px;border-radius:20px;background:#ffffffec;color:#0f766e}button,input,select,textarea{font:inherit}button{border:1px solid #c5d6e7;border-radius:6px;padding:8px 12px;background:#e8f0fb;color:#164b91;cursor:pointer;font-size:14px;font-weight:600}button:hover:not(:disabled){filter:brightness(.96)}button:disabled{opacity:.45;cursor:default}.primary{background:linear-gradient(100deg,#2563eb,#06b6d4);color:white;border:0}#lock{background:white;color:#1d4ed8}nav{display:flex;flex-wrap:wrap;gap:8px;padding:12px 0}.notice{background:#fff6dc;color:#745319;border:1px solid #f1dfa4;padding:9px 12px;border-radius:6px;font-size:13px;margin-bottom:12px}.tools{background:white;border:1px solid #d2dfec;border-radius:8px;padding:12px;display:flex;gap:10px;flex-wrap:wrap;align-items:end}label{display:flex;flex-direction:column;font-size:14px;font-weight:600;gap:5px}input,select,textarea{border:1px solid #bdcddd;border-radius:6px;background:white;color:#20344e;padding:8px 10px;min-height:38px;max-width:100%;font-size:14px}.search{flex:2;min-width:220px}.tools>label:not(.search){flex:1;min-width:140px}.tools>label:first-child{flex:0 0 155px}#summary{display:flex;flex-wrap:wrap;gap:6px 22px;align-items:center;margin:12px 0;font-size:14px}#summary span{white-space:nowrap}#summary strong{margin-left:7px;color:#164b91;font-size:17px}#summary span:first-child{font-weight:700}.tip{font-size:13px;color:#60758d;margin:8px 0}.table-scroll{width:100%;overflow:auto;max-height:calc(100vh - 330px);min-height:320px;border:1px solid #b5c9dc;border-radius:8px;background:white}.schedule{border-collapse:separate;border-spacing:0;width:100%;min-width:1280px;table-layout:fixed;font-size:14px;line-height:1.35}th,td{border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:7px;vertical-align:middle;text-align:left;overflow-wrap:anywhere}th:last-child,td:last-child{border-right:0}thead th{position:sticky;top:0;z-index:5;background:#164b91;color:white;font-weight:600;padding:10px 7px}.group-row td{padding:9px 12px;font-weight:700;font-size:14px;letter-spacing:.5px}.group-row.zone-b td{background:linear-gradient(100deg,#dbeafe,#eff6ff);color:#1d4ed8}.group-row.zone-n td{background:linear-gradient(100deg,#ccfbf1,#f0fdfa);color:#0f766e}.group-row.zone-t td{background:linear-gradient(100deg,#ede9fe,#f5f3ff);color:#6d28d9}.room-alt.zone-b td{background:#eff6ff}.room-alt.zone-n td{background:#f0fdfa}.room-alt.zone-t td{background:#f5f3ff}.room-start td,.empty-room td{border-top:2px solid #afc5dc}.room-label{font-weight:700;white-space:nowrap}.zone-b .room-label{color:#1d4ed8}.zone-n .room-label{color:#0f766e}.zone-t .room-label{color:#6d28d9}.seq,.cell-age,.cell-yc{text-align:center}.seq{font-weight:700;color:#164b91}.cell-name,.cell-surgeon{font-weight:600}.room-row:hover td{box-shadow:inset 0 0 0 1000px #2563eb08}.handle{touch-action:none;cursor:grab;width:27px;padding:0;background:transparent;border:0;font-size:23px;color:#52749a}.dragging{opacity:.45}.drop-before td{box-shadow:inset 0 3px #ed9b26!important}.drop-after td{box-shadow:inset 0 -3px #ed9b26!important}.drag-label{position:fixed;pointer-events:none;z-index:99;background:#164b91;color:white;padding:12px 18px;box-shadow:0 5px 20px #0003;border-radius:8px;max-width:320px}.actions{display:flex;flex-wrap:wrap;gap:3px}.actions button{font-size:13px;padding:5px 7px}.delete-button{background:#fff0ee;color:#a1322b}.empty{color:#71849a;font-size:14px;padding:12px}.yc-tick{width:20px;height:20px;min-height:0;accent-color:#2563eb;cursor:pointer;margin:0}.yc-tick:disabled{opacity:1;cursor:default}.yc-print{display:none}.check-label{flex-direction:row;align-items:center}.check-label input{width:20px;height:20px;min-height:0;accent-color:#2563eb}dialog{border:0;border-radius:12px;padding:24px;width:min(720px,94vw);max-height:90vh;box-shadow:0 20px 65px #102b4b45}dialog::backdrop{background:#172c44a8}#unlock{width:min(420px,94vw)}#unlockError{color:#b00020;font-size:14px}.fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}.wide{grid-column:1/-1}textarea{min-height:88px;resize:vertical}footer{display:flex;justify-content:end;gap:9px;margin-top:22px}#toast{position:fixed;right:20px;bottom:20px;background:#183e71;color:white;padding:12px 18px;border-radius:8px;z-index:100;display:none;max-width:90vw}#printTitle{display:none}.locked #add,.locked #undo,.locked #import,.locked #demo{display:none}.locked .tip{display:none}:focus-visible{outline:3px solid #e9a03a;outline-offset:2px}@media(max-width:650px){body{padding:10px}header{padding:16px;align-items:start;flex-direction:column}h1{font-size:25px}.table-scroll{max-height:none}.fields{grid-template-columns:1fr}.wide{grid-column:auto}nav{gap:6px}.tools>label:first-child{flex:1}.notice{font-size:13px}}
@page{size:A3 landscape;margin:10mm}@media print{body{background:white;padding:0;color:black}header,nav,.notice,.tools,.tip,#toast,dialog{display:none!important}#printTitle{display:block;text-align:center;font-size:22px;margin:0 0 12px}#summary{justify-content:center}#summary strong{font-size:14px}.table-scroll{border:0;overflow:visible;max-height:none;min-height:0}.schedule{min-width:0;table-layout:fixed;font-size:10px;line-height:1.3}th,td{padding:4px;overflow-wrap:anywhere}thead{display:table-header-group}thead th{position:static;background:#e5edf8!important;color:black;print-color-adjust:exact}tr{break-inside:avoid}.group-row{break-after:avoid}.group-row td,.room-alt td{print-color-adjust:exact}.room-label{white-space:normal}.handle,.actions,.empty-room button{display:none}.yc-tick{display:none}.yc-print{display:inline;font-size:13px}.schedule col:first-child:has(+col){width:auto}.schedule:has(.handle) col:first-child,.schedule:has(.handle) tr>:first-child:not([colspan]),.schedule:has(.handle) col:last-child,.schedule:has(.handle) tr>:last-child:not([colspan]){display:none}.drag-label{display:none}}

.add-row td{padding:5px 7px}.add-row button{background:transparent;border:1px dashed #b5c9dc;font-size:13px}.inline-draft td{background:#fffbea;border-top:2px solid #e9a03a;vertical-align:top}.inline-draft input:not([type=checkbox]),.inline-draft textarea,.inline-draft select{width:100%;min-width:0;padding:7px 5px;font-size:14px}.inline-draft textarea{min-height:90px}.inline-draft label{font-size:12px;margin-top:8px}.inline-draft .room-label small{display:block;font-weight:400;color:#9a6700;margin-top:5px}.draft-error{font-size:13px;color:#b00020;white-space:normal}.inline-draft .actions{gap:5px}@media print{.add-row,.inline-draft{display:none!important}}

.zone-section{margin:18px 0}.zone-title{font-size:16px;margin:0 0 10px;padding:10px 14px;border-radius:7px}.zone-b .zone-title,.room-block.zone-b summary{background:linear-gradient(100deg,#dbeafe,#eff6ff);color:#1d4ed8}.zone-n .zone-title,.room-block.zone-n summary{background:linear-gradient(100deg,#ccfbf1,#f0fdfa);color:#0f766e}.zone-t .zone-title,.room-block.zone-t summary{background:linear-gradient(100deg,#ede9fe,#f5f3ff);color:#6d28d9}.room-block{border:1px solid #cbd8e5;border-radius:8px;background:white;margin-bottom:12px;overflow:hidden}.room-block summary{cursor:pointer;padding:12px 14px;font-weight:700;list-style-position:inside}.room-count{font-size:14px;font-weight:500;margin-left:20px}.collapse-hint{float:right;font-size:13px;font-weight:400}.room-block .table-scroll{max-height:none;min-height:0;border:0;border-radius:0}.room-block[open] summary{border-bottom:1px solid #cbd8e5}.room-block .schedule{min-width:1280px}.sync-error{color:#b00020}@media print{.collapse-hint{display:none}.room-block{break-inside:auto}.room-block>.table-scroll{display:block!important}.room-block .schedule{min-width:0}.room-block summary{print-color-adjust:exact}.zone-title{break-after:avoid}.room-block summary{break-after:avoid}}

#syncStatus{font-size:13px;color:#526d85;align-self:center}@media print{#syncStatus{display:none}}

.connection-error{padding:12px;background:#fff0ee;color:#a1322b;border:1px solid #efc6c0;font-size:14px;border-radius:6px}.connection-error[hidden]{display:none}@media print{.connection-error{display:none}}

.draft-status{display:block;color:#9a6700;font-size:11px;font-weight:400;margin-top:4px}@media print{.room-block[data-count="0"]{display:none!important}.zone-section:not(:has(.room-block:not([data-count="0"]))){display:none!important}#printTitle{display:block;margin:0 0 12px;padding:0;font-size:22px;break-after:avoid}.zone-title{margin-top:12px}.schedule col{width:auto!important}}
