:root{--sidebar-width:236px}
.sidebar{width:var(--sidebar-width);height:100dvh;max-height:100dvh;transition:transform .18s;z-index:40}
.main{margin-left:var(--sidebar-width);min-width:0}
.sidebar-toggle{width:100%;margin-top:12px;padding:9px;border:1px solid #638478;border-radius:9px;background:transparent;color:#fff}
.nav-reopen{display:none;position:fixed;z-index:41;left:12px;top:12px;padding:10px 13px;border:1px solid #c5d1c6;border-radius:10px;background:#fffdf9;color:#174238;box-shadow:0 3px 16px #17423820}
body.nav-collapsed .sidebar{transform:translateX(-100%);visibility:hidden}
body.nav-collapsed .main{margin-left:0}
body.nav-collapsed .nav-reopen{display:block}
body.nav-collapsed .topbar{padding-left:145px}
.nav-mask{display:none}
.desk-message{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);padding:12px 20px;background:#174238;color:white;border-radius:10px;z-index:100;max-width:90vw;box-shadow:0 4px 20px #0003}
.desk-stage-nav{display:flex;gap:7px;flex-wrap:wrap;margin:14px 0}.desk-stage-nav button{padding:9px 12px;border:1px solid var(--line);border-radius:9px;background:var(--card);color:var(--green)}.desk-stage-nav button.active{background:var(--green);color:white}
#scStructured{margin:16px 0}#scStructured fieldset{border:1px solid var(--line);border-radius:12px;padding:20px;margin-top:16px}#scStructured legend{font-weight:bold;color:var(--green)}#scStructured label{display:block;margin:12px 0}#scStructured input:not([type=checkbox]),#scStructured select,#scStructured textarea{display:block;width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;background:#fcfaf6}#scStructured .actions{display:flex;gap:12px;flex-wrap:wrap}#scStructured .actions>label{flex:1;min-width:160px}#scStructured .check-grid label{margin:0}#scStructured .sc-actions{position:sticky;top:8px;z-index:3;background:var(--card);padding:12px;border:1px solid var(--line);border-radius:10px}#scStructured button{padding:10px 14px;border:0;border-radius:8px;background:#ece8df;color:var(--green)}#scStructured button.primary{background:var(--green);color:white}
.desk-hint{padding:12px 14px;margin:10px 0;border-left:3px solid #789c7d;border-radius:8px;background:#eff5e9}.desk-hint.critical{background:#fff0ec;border-color:#bd5547}.desk-hint p{margin:5px 0}.desk-hint small{color:#64756a}.desk-pathways details{padding:12px 0;border-bottom:1px solid var(--line)}.desk-pathways summary{cursor:pointer;color:var(--green);font-weight:bold}.desk-pathways p{line-height:1.7;margin:9px 0}.desk-pathways input{width:100%}.desk-history{max-height:350px;overflow:auto}.desk-history pre{white-space:pre-wrap;overflow-wrap:anywhere}.desk-chips{display:flex;gap:6px;flex-wrap:wrap}.desk-chips button{font-size:12px;padding:5px 9px;border:1px solid #c8d7c4;border-radius:6px;background:#f4f8ef;color:#315f50}.sc-legacy>summary{cursor:pointer;font-weight:bold;color:var(--green)}.sc-legacy>div{margin-top:15px}
#home{overflow:hidden}.card,.content,.grid>*{min-width:0}.brand h1{color:#fff}.topbar{gap:16px;flex-wrap:wrap}.auth-area{flex-wrap:wrap}button:focus-visible,a:focus-visible{outline:3px solid #d8844d;outline-offset:3px}
@media(max-width:980px){:root{--sidebar-width:218px}.sidebar{width:var(--sidebar-width)}.main{margin-left:var(--sidebar-width)}}
@media(max-width:700px){.sidebar{position:fixed;inset:0 auto 0 0;width:min(86vw,280px);padding:22px 16px;background:#174238;box-shadow:8px 0 25px #0003}.sidebar .nav{display:block;overflow:visible}.sidebar .nav button{display:block;width:100%;white-space:normal;text-align:left}.sidebar .subnav{display:block;overflow:visible;border-left:1px solid #638478;margin-left:12px;padding-left:8px}.main{margin-left:0}.topbar,body.nav-collapsed .topbar{padding:72px 18px 18px}.nav-mask{display:block;position:fixed;inset:0;background:#10271c66;z-index:39;border:0}.nav-collapsed .nav-mask{display:none}.content{padding:16px}.row{flex-wrap:wrap}.row>*{min-width:120px}.patient-head .row{width:100%}.session-banner{flex-wrap:wrap;gap:8px}.session-banner b{font-size:20px}.stage-pagination{flex-wrap:wrap}.sc-hero{flex-wrap:wrap}.sc-hero .row{flex-wrap:wrap}.auth-modal{max-height:90dvh;overflow:auto}#scStructured fieldset{padding:12px}#scStructured .sc-actions{position:static}.brand{padding-bottom:16px}}
@media print{.nav-reopen,.sidebar-toggle,.nav-mask,.desk-message{display:none!important}}
#sc .sc-hero .sc-flow{display:none}
#deskSCHistory button{margin:5px}
#scStructured [hidden]{display:none!important}
.nav .hidden,.sidebar .subnav.hidden{display:none!important}
.table-wrap{overflow-x:auto;max-width:100%}
@media(max-width:700px){body:not(.nav-collapsed) .main{pointer-events:none}.sidebar{overflow-y:auto}.grid,.grid-3{grid-template-columns:1fr!important}}
#home .table-wrap table{min-width:0;table-layout:fixed}
#home th,#home td{white-space:normal;overflow-wrap:anywhere;padding:10px 5px;font-size:12px}
#home td:last-child{width:95px}#home td .btn{padding:7px;font-size:12px;white-space:normal}
@media(max-width:700px){#home .table-wrap table{min-width:500px}}
