:root{font:16px system-ui,sans-serif;color:#171719;background:#f6f6f7;--red:#df002f;--line:#dedee3}
*{box-sizing:border-box}
body{margin:0} [hidden]{display:none!important}
h1,h2,p{margin:0} h1{font-size:2rem} h2{font-size:1.2rem}
#login{min-height:100vh;background:#141315;color:#fff;display:grid;grid-template-columns:1fr 1fr}
#signin{align-self:center;justify-self:center;max-width:420px;width:100%;padding:2rem;display:grid;gap:1rem}
.login-photo{background:#070707 url("/login.jpg") center/cover no-repeat;position:relative}
.login-photo img{position:absolute;right:1.5rem;bottom:1.5rem}
#signin h1{font-size:3rem} #signin h2{margin-bottom:.4rem}
#login-message{min-height:1.4em;color:#ffb2c1}
#workspace{min-height:100vh;display:grid;grid-template-columns:205px minmax(0,1fr)}
aside{padding:1.25rem;background:#19191c;color:white;display:flex;flex-direction:column;gap:1.3rem}
.brand{text-align:center}.brand span{display:block;font-size:.8rem;margin-top:.5rem}
nav{display:grid;gap:.35rem}
button{font:inherit;min-height:42px;padding:.58rem .8rem;border:1px solid #bfbfc6;border-radius:7px;background:#fff;color:#171719;cursor:pointer}
button.primary{background:var(--red);color:#fff;border-color:var(--red);font-weight:650}
button:disabled{opacity:.5;cursor:wait}
nav button,#signout{color:white;background:transparent;border-color:#444;text-align:left}
nav button[aria-current]{background:#37373c;border-color:#797980}
:focus-visible{outline:2px solid #8d1838;outline-offset:3px}
.main{padding:clamp(.8rem,3vw,2rem)} header{display:flex;align-items:center;justify-content:space-between;gap:.8rem;margin-bottom:1rem}
#who{font-size:.9rem;color:#595960}
#search{display:flex;gap:.6rem;align-items:end;flex-wrap:wrap}
label{display:grid;gap:.3rem;font-weight:600}
input,select,textarea{width:100%;min-width:0;min-height:42px;padding:.6rem;border:1px solid #bfbfc6;border-radius:6px;background:#fff;color:#171719;font:inherit;font-weight:400}
textarea{min-height:95px;resize:vertical}
#search label{width:min(100%,360px)}
#connection{min-height:1.5em;margin:.7rem 0;color:#40404a}
#actions{display:flex;gap:.5rem;flex-wrap:wrap}
#editor,.section{margin-top:1rem;background:#fff;border:1px solid var(--line);border-radius:9px;padding:1rem}
#command{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,235px),1fr));gap:.8rem;margin-top:.8rem;align-items:end}
#editor h2{margin-bottom:.3rem}
.section h2{margin-bottom:.65rem}
.rma-finder form{display:flex;align-items:end;gap:.55rem;flex-wrap:wrap}
.rma-finder input{width:9rem}
.rma-finder label{flex-basis:100%}
.rma-preview{display:grid;gap:1rem;padding:1.2rem}
.rma-preview .sheet-footer{padding:.75rem 0}
.section .limit{margin-bottom:.55rem;color:#575760}
.scroll{overflow:auto;max-height:420px}
table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap;font-size:.9rem}
th,td{padding:.52rem .65rem;border-bottom:1px solid var(--line)}
thead{position:sticky;top:0;background:#eeeeef}
tr:nth-child(even){background:#f9f9fb}
td:last-child{white-space:normal;min-width:8rem}
.home-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 1rem}
.attendance-group{display:grid;gap:.35rem;margin-top:.75rem}
.attendance-group h3{font-size:.96rem;margin:0}
.attendance-group div{display:flex;justify-content:space-between;gap:.8rem}
.presence{background:#eeedf0;color:#474750;border-radius:4px;padding:.15rem .4rem;font-size:.8rem}
.presence.present{background:#e0f3e5;color:#245534}
.presence.away{background:#f3e9df;color:#683e25}
.workshop-tabs,.range-filter{display:flex;flex-wrap:wrap;gap:.4rem;margin:.7rem 0}
.range-filter{align-items:end}
.range-filter label{min-width:9.25rem}
.project-tabs{display:flex;overflow:auto;gap:0;margin-top:.85rem;background:#ededef;border:1px solid var(--line);border-bottom:0;border-radius:7px 7px 0 0}
.project-tabs button{flex:none;border:0;border-right:1px solid var(--line);border-radius:0;background:transparent;white-space:nowrap}
.project-tabs button[aria-selected=true]{background:#fff;box-shadow:inset 0 -3px var(--red);font-weight:700}
.project-panel{background:#fff;border:1px solid var(--line);border-radius:0 0 7px 7px;padding:0 .65rem .65rem}
.project-panel .section{margin-top:.65rem;min-width:0}
[data-order-row]{cursor:pointer;user-select:none}
[data-order-row]:hover{background:#f3f2f4}
[data-order-row][aria-selected=true]{background:#ffe7ee}
[data-order-row][aria-selected=true] td:first-child{box-shadow:inset 3px 0 var(--red);font-weight:700}
[data-order-row]:focus-visible{outline-offset:-2px}
.preferences{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:1rem}
.workshop-tabs button[aria-pressed=true]{background:#ffe8ee;border-color:#df002f;color:#811332;font-weight:650}
.text-button{border:0;background:none;color:#a00026;text-decoration:underline;padding:.2rem;min-height:32px;font-weight:650}
.planning-frame{width:100%;height:76vh;min-height:430px;border:0;border-radius:8px}
.stack{display:grid;justify-items:start;gap:.6rem}
.empty-hint{padding:1rem;color:#565660}
.order-window{position:fixed;z-index:10;inset:12px max(10px,calc((100vw - 1340px) / 2)) 68px;display:flex;flex-direction:column;
  background:#fff;border:1px solid #c6c6cb;border-radius:12px;box-shadow:0 14px 48px #17171b59;overflow:hidden}
.order-window-bar{display:flex;align-items:center;gap:.45rem;padding:.35rem .65rem;background:#eeeef0;border-bottom:1px solid var(--line)}
.order-window-bar span{flex:1;font-size:.9rem;font-weight:650}
.order-window-bar button,#order-window-dock button{min-height:34px;padding:.3rem .65rem}
.order-window-body{display:flex;flex-direction:column;flex:1;min-height:0}
.order-window-body>p,.order-window-body>button{margin:.75rem;align-self:start}
#order-window-dock{position:fixed;z-index:11;bottom:8px;left:10px;right:10px;display:flex;gap:.35rem;overflow:auto;
  padding:.3rem;background:#202024;border-radius:8px;box-shadow:0 4px 16px #17171b33}
#order-window-dock button{flex:none;white-space:nowrap}
#order-window-dock button[aria-pressed=true]{background:#fff;color:#171719;border-color:#fff}
body:has(#order-window-dock:not([hidden])) .main{padding-bottom:4.5rem}
.sheet-form{display:flex;flex:1;min-height:0;flex-direction:column;overflow:hidden;background:#fff}
.sheet-header{flex:none;padding:1.3rem 1.5rem 1rem;background:#fff}
.sheet-header h2{font-size:clamp(1.1rem,2.2vw,1.75rem);margin-bottom:.75rem}
.sheet-quick-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem;max-width:760px}
.sheet-header-actions details{margin-top:.55rem}
.sheet-header-actions summary{cursor:pointer;font-weight:650}
.sheet-header-actions textarea{min-height:54px}
.sheet-header-actions details[open]{max-width:460px}
.sheet-header>p{font-size:.85rem;color:#565660;margin-bottom:.5rem}
.sheet-tabs{flex:none;display:flex;overflow-x:auto;overflow-y:hidden;white-space:nowrap;gap:1px;background:#eeeef0;border:1px solid var(--line);border-width:1px 0}
.sheet-tabs button{min-height:39px;border:0;border-right:1px solid var(--line);border-radius:0;background:#f7f7f8;color:#1c1c22;padding:.4rem .75rem}
.sheet-tabs button[aria-pressed=true]{box-shadow:inset 0 -3px var(--red);background:#fff;font-weight:700}
.sheet-scroll{min-height:0;overflow:auto;flex:1 1 auto}
.sheet-pane{padding:1rem 1.5rem}
.sheet-columns{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,250px),1fr));gap:1.25rem;margin-bottom:1rem}
.sheet-card{border:1px solid var(--line);border-radius:8px;padding:.85rem;display:grid;gap:.55rem;align-content:start}
.sheet-card h3{font-size:1rem;margin:0 0 .25rem}
.sheet-form label{font-size:.92rem;gap:.25rem}
.sheet-form input,.sheet-form select,.sheet-form textarea{min-height:34px;padding:.35rem .58rem}
.sheet-form :is(input,select,textarea):disabled{background:#f5f5f7;color:#424249;opacity:1}
.sheet-form textarea{min-height:80px}
.sheet-checkbox{display:flex;gap:.45rem!important;align-items:center;min-height:35px}
.sheet-checkbox input{width:15px;min-height:15px}
.sheet-footer{flex:none;display:flex;gap:.55rem;align-items:center;flex-wrap:wrap;padding:.72rem 1.5rem;border-top:1px solid var(--line);background:#fff}
.sheet-error{color:#a40028;font-size:.87rem}
.sheet-part-actions{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) auto;gap:.5rem;align-items:end}
.sheet-part-search{display:grid;grid-template-columns:minmax(120px,330px) auto;justify-content:start;align-items:end;gap:.5rem;margin-bottom:.6rem}
@media(min-width:900px) and (max-height:850px){
 .sheet-header{padding-top:.7rem;padding-bottom:.65rem}.sheet-header h2{margin-bottom:.45rem}
 .sheet-pane,.sheet-footer{padding-top:.65rem;padding-bottom:.65rem}
 .sheet-card{gap:.35rem;padding:.65rem}.sheet-columns{margin-bottom:.7rem}
 .sheet-form label{font-size:.85rem;gap:.12rem}
 .sheet-form input,.sheet-form select{min-height:29px;padding:.27rem .48rem;font-size:.88rem}
 .sheet-form textarea{min-height:62px}
}
@media(max-width:720px){
 #workspace{display:block}.brand{display:flex;gap:.8rem;align-items:center;text-align:left}.brand img{width:80px}
 aside{padding:.8rem;gap:.65rem}nav{display:flex;overflow:auto}nav button{white-space:nowrap}
 #signout{align-self:start} #login{grid-template-columns:1fr;grid-template-rows:auto minmax(160px,1fr)}
 .home-grid{grid-template-columns:minmax(0,1fr)}
 .sheet-pane,.sheet-header,.sheet-footer{padding:.65rem}
 .sheet-part-actions{grid-template-columns:minmax(0,1fr)}
}
