:root{font-family:Inter,ui-sans-serif,"Segoe UI",Arial,sans-serif;color:#263447;background:#eef2f6;font-synthesis:none;font-size:13px}
*{box-sizing:border-box}
[hidden]{display:none!important}
html,body{margin:0;min-height:100%;overflow:hidden}
button,input,select,textarea{font:inherit}button{cursor:pointer}
:focus-visible{outline:2px solid #3674cb;outline-offset:2px}
.site-header{height:53px;background:#14263c;color:#fff}
.header-inner{height:100%;max-width:1900px;padding:0 18px;margin:auto;display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;gap:9px}.brand-icon{width:23px;height:23px;display:grid;grid-template-columns:repeat(2,1fr);gap:3px;transform:rotate(-7deg)}.brand-icon i{border-radius:3px;background:#4f97ed}.brand-icon i:nth-child(2){background:#36ac72}.brand-icon i:nth-child(3){background:#efbd48}.brand-icon i:nth-child(4){background:#9b73c8}
.brand h1{font-size:18px;margin:0;font-weight:800;letter-spacing:-.4px}.brand p{font-size:8px;margin:0;letter-spacing:1px;color:#b4c5d8;font-weight:700}
.header-actions,.selected-actions,.date-nav{display:flex;align-items:center;gap:6px}
.button{padding:7px 11px;border:1px solid transparent;border-radius:6px;font-size:12px;font-weight:750;white-space:nowrap}
.button.primary,.primary{background:#2b6fc5;color:#fff}.primary:hover{background:#1a5cae}
.button.secondary{background:#fff;border-color:#cbd5e1;color:#33465b}.button.secondary:hover{background:#e8eef6}
.button.ghost{background:#ffffff13;border-color:#ffffff33;color:#f3f8fe}.button.ghost:hover{background:#ffffff29}
.button.ghost-dark{background:transparent;color:#41516a}.button.ghost-dark:hover{background:#e1e8f2}
.button.danger{background:#fff5f5;border-color:#f2c5ca;color:#b22f42}
.button:disabled{opacity:.45;cursor:default}
.page{height:calc(100dvh - 53px);max-width:1900px;margin:auto;padding:10px 14px 5px;display:flex;flex-direction:column;min-height:0}
.page-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:6px;flex-shrink:0}
.page-heading h2{font-size:16px;margin:0;color:#16273b;line-height:1.3}.page-heading h2 small{font-size:12px;font-weight:500;color:#5b6b82;margin-left:7px}
.page-heading p{font-size:10px;margin:2px 0;color:#7b8a9a}
.date-nav input{height:30px;border:1px solid #cfd9e5;border-radius:6px;background:#fff;padding:4px 7px;color:#2d405a;font-weight:650}
.icon-button{border:1px solid #cbd6e5;background:#fff;color:#39516d;border-radius:6px;height:30px;min-width:30px;font-size:19px;line-height:1}
.icon-button:hover{background:#e9f1fc}
.stats{display:flex;gap:6px;margin:0 0 6px;flex-shrink:0}
.stat{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:5px 11px;min-width:135px;max-width:210px;flex:1;background:#fff;border:1px solid #dfe6ee;border-radius:6px}
.stat span{font-size:11px;color:#66778b;font-weight:650}.stat strong{font-size:17px;color:#223d60}.stat small{display:none}
.controls{display:flex;align-items:center;gap:6px;padding:5px 7px;margin-bottom:7px;background:#fff;border:1px solid #dbe4ee;border-radius:7px;flex-wrap:wrap;flex-shrink:0}
.search-wrap{position:relative;flex:0 0 210px}.search-wrap span{position:absolute;left:9px;top:5px;font-size:16px;color:#78889a}.search-wrap input{height:29px;width:100%;padding:5px 8px 5px 28px;border:1px solid #d4dce6;border-radius:6px;font-size:11px}
.controls select{height:29px;padding:3px 7px;border:1px solid #d4dce6;background:white;border-radius:6px;color:#394b62;font-size:11px}
.controls .button{padding:6px 8px;font-size:11px}
.team-legend{display:flex;align-items:center;justify-content:flex-end;gap:9px;margin-left:auto;font-size:10px;color:#5a6c81;flex-wrap:wrap}.team-legend span{display:flex;align-items:center;gap:4px}
.dot{display:inline-block;width:9px;height:9px;border-radius:2px;flex:none;border:1px solid #0002}.dot.blue{background:#368bdd}.dot.red{background:#e65b64}.dot.yellow{background:#f2c43b}.dot.green{background:#2caf7a}.dot.lates{background:#9764c7}.dot.white{background:white;border-color:#b0bdcc}
.board-layout{flex:1;display:grid;grid-template-columns:minmax(290px,28%) minmax(0,1fr);gap:8px;min-height:0}
.staff-sidebar,.department-board{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.staff-sidebar{border:1px solid #cfdbe7;border-radius:7px;background:white;display:flex;flex-direction:column;overflow:hidden;min-width:0}
.sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:8px 11px;background:#e7eef6;border-bottom:1px solid #cad7e4;flex:none}
.sidebar-header h3{font-size:13px;margin:0}.sidebar-header p{font-size:10px;margin:2px 0 0;color:#677b91}
.count-pill{background:#cfdef0;border-radius:12px;padding:3px 8px;font-size:11px;color:#315d8c}
.unallocated-drop{overflow:auto;flex:1;padding:6px 8px 10px;min-height:0;scrollbar-width:thin}
.staff-team{margin-bottom:8px}
.staff-team h4{margin:3px 0 5px;padding:3px 5px;display:flex;align-items:center;gap:6px;background:#f1f5f9;border-radius:4px;font-size:11px;color:#2d4259}
.staff-team h4 span{margin-left:auto;color:#788ca3;font-weight:600}
.staff-team-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
.staff-tile{display:flex;align-items:center;gap:4px;min-width:0;min-height:24px;padding:3px 7px;border:1px solid var(--tile-border);border-radius:4px;background:var(--tile-bg);color:var(--tile-text);font-size:11px;font-weight:650;line-height:1.25;text-align:left;user-select:none;touch-action:manipulation;cursor:grab}
.staff-tile:hover{filter:brightness(.96)}.staff-tile:active{cursor:grabbing}.staff-tile.selected{outline:2px solid #226ece;outline-offset:-2px;box-shadow:0 0 0 1px #fff inset}
.staff-tile.dragging{opacity:.35}.staff-tile .tile-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.staff-tile .tick{color:#174d99;font-weight:900;font-size:11px}
.staff-tile .team-symbol{width:5px;height:12px;flex:none;background:currentColor;border-radius:2px;opacity:.55}
.staff-tile.blue{--tile-bg:#deedfe;--tile-border:#b2d4f3;--tile-text:#235989}.staff-tile.red{--tile-bg:#ffe2e5;--tile-border:#efb5bc;--tile-text:#842f38}.staff-tile.yellow{--tile-bg:#fff3c9;--tile-border:#ead892;--tile-text:#675415}.staff-tile.green{--tile-bg:#dcf4e9;--tile-border:#a7d9c4;--tile-text:#216346}.staff-tile.lates{--tile-bg:#eddefa;--tile-border:#cbb6e9;--tile-text:#633b86}.staff-tile.white{--tile-bg:#fff;--tile-border:#cbd5df;--tile-text:#314155}
.department-board{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;align-content:start;min-width:0;padding-right:2px}
.dept{border:1px solid #d2deeb;background:#fff;border-radius:7px;min-width:0;overflow:hidden}.dept.wide{grid-column:1/-1}
.dept-heading{height:29px;padding:5px 10px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #e5ebf2;background:#f3f7fb}
.dept-heading h3{font-size:12px;margin:0;font-weight:800;color:#234365}
.dept-heading-right{display:flex;align-items:center;gap:6px}.dept-total{padding:1px 7px;border-radius:10px;background:#dce8f4;color:#466483;font-size:10px}
.dept-content{padding:7px}
.station-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}.station-grid.one{grid-template-columns:1fr}.station-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.station-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.bench-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
.subhead{font-size:10px;color:#6c7f95;font-weight:800;letter-spacing:.4px;margin:9px 0 5px}
.station{min-height:42px;max-height:160px;overflow:auto;padding:5px;border:1px dashed #c8d6e4;border-radius:5px;background:#fbfcfe;cursor:pointer;min-width:0;scrollbar-width:thin}
.station.staffed{border:1px solid #d4dfe9;background:#fff}.station:hover{border-color:#6498d7;background:#f2f8ff}.station.drag-over,.unallocated-drop.drag-over{background:#dcecff;box-shadow:inset 0 0 0 2px #3a84da}
.station-label{display:flex;align-items:center;justify-content:space-between;font-size:10px;font-weight:750;color:#546981;gap:5px;margin-bottom:4px;position:sticky;top:-5px;padding:1px 0;background:inherit}
.station-count{color:#8195aa;font-weight:750;line-height:1}.station-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
.station .staff-tile{font-size:10px;min-height:22px;padding:3px 4px}.station .team-symbol{height:11px;width:3px}
.station.bench{min-height:39px;max-height:103px;padding:4px}.station.bench .staff-tile{font-size:9.5px;min-height:20px}.station.bench .station-tiles{grid-template-columns:1fr}.station.empty .station-count{color:#a3b4c7}
.selected-strip{position:fixed;z-index:30;left:8px;top:8px;right:auto;bottom:auto;width:min(310px,calc(100vw - 16px));max-width:calc(100vw - 16px);display:flex;flex-direction:column;align-items:stretch;gap:7px;background:#183758;color:#fff;padding:12px;border-radius:9px;border:1px solid #41658e;box-shadow:0 10px 30px #17365377;font-size:12px}
.selected-strip .selection-summary{min-width:0;display:flex;flex-wrap:wrap;gap:4px;align-items:center}
.selected-strip strong{font-weight:800}
.selected-strip .selection-hint{color:#bfd3e9;font-size:11px}
.selected-strip .selected-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;width:100%;align-items:stretch}
.selected-strip .selected-actions label{grid-column:1/-1;font-size:11px;color:#d0dded;font-weight:700}
.selected-strip select{grid-column:1/-1;width:100%;height:34px;min-width:0;max-width:none;border:1px solid #b8cbe2;border-radius:5px;padding:4px 6px;background:white;color:#20334b;font-size:12px}
.selected-strip .button{padding:7px 6px;font-size:11px;min-width:0}
.selected-strip .ghost-dark{color:white}.selected-strip .ghost-dark:hover{background:#2d527b}
.footer{flex:none;font-size:10px;color:#8291a4;text-align:right;padding:4px 2px 0}
dialog{width:min(700px,calc(100vw - 25px));max-height:min(91vh,860px);padding:0;background:white;color:#22354a;border:1px solid #d6e2ef;border-radius:10px;box-shadow:0 22px 70px #091b32a8}
dialog::backdrop{background:#101f32ad}
.dialog-head{padding:17px 18px 11px;display:flex;justify-content:space-between;align-items:flex-start}.dialog-head h2{font-size:19px;margin:0 0 4px}.dialog-head p{font-size:11px;margin:0;color:#79899e}
.close-button{font-size:24px}.dialog-tabs{display:flex;gap:8px;padding:0 18px;border-bottom:1px solid #e1e8f1}.dialog-tab{background:white;border:0;border-bottom:2px solid transparent;padding:10px;font-size:12px;font-weight:700;color:#66788f}.dialog-tab.active{color:#1762b5;border-bottom-color:#2b74cd}
.dialog-body{padding:15px 18px;overflow:auto;max-height:63vh}.form-stack{display:grid;gap:8px}.form-stack label,.tab-panel>label{font-size:12px;font-weight:750;color:#50677e}
.form-stack input,.form-stack select,.tab-panel textarea,.manager-row input,.manager-row select{padding:9px;border:1px solid #cfdcea;border-radius:6px;width:100%;min-width:0;background:white;color:#20354b}.form-stack .button{justify-self:start;margin-top:7px}
.tab-panel textarea{display:block;min-height:175px;margin-top:8px;resize:vertical}.helper{font-size:11px;color:#718397;line-height:1.45;margin:0 0 11px}
.form-end{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-top:9px}.form-end .helper{margin:0}
.manager-list{display:grid;gap:6px}.manager-row{display:grid;grid-template-columns:minmax(100px,2fr) minmax(100px,1.1fr) auto auto;gap:5px;align-items:center;padding:6px;border:1px solid #e0e7ef;border-radius:6px}.manager-row.inactive{opacity:.6}.manager-row input,.manager-row select{padding:6px;font-size:11px}.manager-row .button{font-size:10px;padding:7px}.manager-actions{display:flex;gap:4px}.manager-row.area-row{grid-template-columns:minmax(100px,1fr) auto auto}
.area-group h4{margin:10px 0 4px;font-size:12px;color:#51647a}.login-dialog{width:min(410px,calc(100vw - 28px))}
.toast{position:fixed;bottom:17px;left:18px;z-index:50;background:#17324f;color:white;padding:10px 14px;border-radius:7px;font-size:12px;box-shadow:0 6px 23px #162a4255;opacity:0;transform:translateY(12px);transition:.15s;pointer-events:none}.toast.show{opacity:1;transform:translateY(0)}.toast.bad{background:#ad3044}
.touch-ghost{position:fixed!important;z-index:1000;width:165px;pointer-events:none;opacity:.8;box-shadow:0 6px 25px #132a4d50}
@media(max-width:1150px){.team-legend{display:none}.board-layout{grid-template-columns:minmax(240px,30%) minmax(0,1fr)}.bench-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.station-grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:800px){.department-board{grid-template-columns:repeat(2,minmax(0,1fr))}.page-heading p{display:none}.stat{min-width:0}.station-tiles{grid-template-columns:1fr}.dept.wide{grid-column:1/-1}}
@media(max-width:640px){html,body{overflow:auto}.site-header{height:auto;min-height:50px}.header-inner{padding:8px 12px}.brand p{display:none}.page{height:auto;min-height:calc(100dvh - 50px);padding:8px;display:block}.page-heading{flex-wrap:wrap}.page-heading h2{font-size:15px}.page-heading h2 small{display:block;margin:1px 0}.date-nav{flex-wrap:wrap}.stats{gap:4px}.stat{padding:4px 5px;gap:2px}.stat span{font-size:9px}.stat strong{font-size:13px}.controls{gap:4px}.search-wrap{flex:1 1 160px}.board-layout{display:block}.staff-sidebar{height:285px;margin-bottom:8px}.department-board{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));overflow:visible}.dept.wide{grid-column:1/-1}.bench-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.station-grid.four{grid-template-columns:repeat(2,minmax(0,1fr))}.selected-strip{width:min(310px,calc(100vw - 16px));display:flex}.selected-strip .selection-hint{display:none}.footer{text-align:center}.manager-row{grid-template-columns:1fr 1fr}.manager-actions{grid-column:1/-1}.manager-actions button{flex:1}}
@page{size:A4 landscape;margin:8mm}

/* v1.0.6: persistent assigned staff pins */
.staff-tile .pin-marker{font-size:10px;line-height:1;flex:none;opacity:.82}.staff-tile.has-pin{box-shadow:inset 0 -2px 0 #4c6d94}.selected-strip .pin-button{background:#f6d87a;color:#312b19;font-weight:800;grid-column:span 2}.selected-strip .pin-button:hover{background:#ffe39a}.selected-strip .pin-button[hidden]{display:none!important}

/* v1.0.7 — selection bar is inline, never overlays staff or blocks clicking names. */
.selected-strip{position:relative;left:auto;top:auto;right:auto;bottom:auto;width:100%;max-width:none;margin:0 0 6px;padding:6px 9px;display:flex;flex-direction:row;gap:10px;align-items:center;flex-shrink:0;border-radius:6px;box-shadow:0 2px 7px #18375818}
.selected-strip .selection-summary{flex:0 0 auto;gap:4px;max-width:240px;min-width:0}
.selected-strip .selected-actions{display:flex;flex-direction:row;align-items:center;gap:6px;flex:1;min-width:0;width:auto}
.selected-strip .selected-actions label{grid-column:auto;flex:0 0 auto;white-space:nowrap}
.selected-strip select{grid-column:auto;flex:1 1 185px;min-width:120px;max-width:330px;width:auto;height:28px}
.selected-strip .button{white-space:nowrap;padding:6px 9px;flex:0 0 auto}
.selected-strip .pin-button{grid-column:auto}
.select-team-small{margin-left:4px;border:1px solid #afc6df;background:#fff;color:#24588d;padding:2px 5px;border-radius:3px;font-size:10px;font-weight:800;white-space:nowrap}
.select-team-small:hover{background:#dfeafa}
.staff-team h4 span{margin-left:auto}
@media(max-width:1000px){.selected-strip{flex-wrap:wrap}.selected-strip .selection-summary{max-width:none}.selected-strip .selected-actions{flex-wrap:wrap}.selected-strip select{max-width:none}.selected-strip .selection-hint{display:none}}
@media(max-width:640px){.selected-strip{width:100%;display:flex}.selected-strip .selected-actions{display:flex;flex-wrap:wrap}.selected-strip .button{flex:1 1 auto}.selected-strip select{flex:1 1 100%;min-width:100%}}

/* v1.0.9 - pinned staff names always readable, including narrow picking/bench boxes. */
.staff-tile{box-sizing:border-box;width:100%;align-items:center;min-width:0;min-height:25px}
.staff-tile .tile-name{flex:1 1 auto;min-width:0;display:block;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;line-height:1.25}
.staff-tile .pin-marker{flex:0 0 12px;display:inline-flex;align-items:center;justify-content:center;width:12px;min-width:12px;font-size:9px;line-height:1;opacity:1}
.staff-tile .tick{flex:0 0 9px;line-height:1}
/* Narrow work areas must use full-width staff rows: two columns truncate pinned names. */
.station .station-tiles,.station.bench .station-tiles{grid-template-columns:minmax(0,1fr)}
.station.bench{max-height:160px}

/* v1.0.9: expose all staff when an area has more names than its compact height. */
.station.expanded,.station.bench.expanded{max-height:none;overflow:visible}
.station.expanded .station-label{position:static}
.zone-expand{border:0;border-radius:3px;background:#e9f2fd;color:#1d5fa6;padding:2px 4px;font-size:9px;font-weight:800;white-space:nowrap;margin-left:auto;cursor:pointer}
.zone-expand:hover,.zone-expand:focus-visible{background:#cfe4ff;outline:1px solid #83b4ee}

/* v1.0.10 — admin-controlled box layout. Layout is read-only to normal users. */
#layoutModeBtn.active{background:#214e81;color:white;border-color:#214e81}
.station-grid:not(.four){grid-template-columns:repeat(2,minmax(0,1fr))}
.station.layout-sized{max-height:none;overflow:auto}
.station.layout-edit{position:relative;min-height:90px!important;overflow:auto;border:2px solid #6d98d0;cursor:default;padding-bottom:18px}
.station.layout-edit .staff-tile{cursor:default}
.station.layout-edit .box-edit-controls{display:flex;align-items:center;gap:3px;flex-wrap:wrap;margin:2px 0 5px;padding:4px 0;border-top:1px dotted #bed1e8;border-bottom:1px dotted #bed1e8}
.box-edit-controls button{border:1px solid #adcaec;background:#e8f2ff;border-radius:4px;padding:3px 5px;font-size:10px;font-weight:800;color:#204c81}
.box-edit-controls [data-layout-grab]{cursor:grab;touch-action:none}
.box-edit-controls [data-layout-grab]:active{cursor:grabbing}
.box-edit-controls .box-size-label{font-size:9px;margin-left:auto;color:#617e9c;white-space:nowrap}
.box-resize-grip{position:absolute;bottom:1px;right:1px;width:23px;height:23px;border-radius:3px;display:grid;place-items:center;color:white;background:#2c6db5;cursor:nwse-resize;touch-action:none;user-select:none;font-size:18px;font-weight:bold;z-index:3}
.station.layout-edit.drag-over{border:2px solid #155dac;box-shadow:inset 0 0 0 2px #b4d7ff}
.station.layout-edit .station-label{position:static}
@media(max-width:1150px){.station-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:640px){.station-grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.station.layout-edit{min-height:100px!important}}
/* Keep adjacent boxes compact when another box in the same row is made taller. */
.station{align-self:start}
