:root{font-family:system-ui,-apple-system,Segoe UI,sans-serif;color:#193448;background:#f1f5f8;font-size:16px;--blue:#143b53;--line:#d8e1e8;--green:#087f73}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,input,select{min-height:44px}button{cursor:pointer;border:1px solid var(--line);border-radius:8px;background:white;color:var(--blue);padding:9px 14px;font-weight:600}button:hover{background:#e9f3f5}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--green);color:white;border-color:var(--green)}input,select,textarea{border:1px solid #b9c9d5;background:white;color:#193448;border-radius:7px;padding:10px;max-width:100%}input[type=checkbox]{min-height:22px;width:22px;accent-color:var(--green)}textarea{width:100%;min-height:100px;resize:vertical}a{color:var(--green)}:focus-visible{outline:3px solid #ecaa37;outline-offset:3px}header{background:var(--blue);color:white;padding:20px 28px;display:flex;align-items:center;justify-content:space-between;gap:16px}header strong{font-size:1.4rem;letter-spacing:-.5px}header small{display:block;color:#c7dae5;margin-top:4px}.shell{display:grid;grid-template-columns:210px 1fr;min-height:calc(100vh - 85px)}nav{padding:26px 16px;border-right:1px solid var(--line);background:white;display:flex;flex-direction:column;gap:8px}nav button{text-align:left;border:0}nav button.active{background:#e0f1ee;color:#096d62}nav .small{margin-top:auto;padding:16px 10px}main{padding:28px;max-width:1400px;width:100%;margin:auto;margin-top:0}.notice{background:#fff5d9;border:1px solid #edda9f;border-radius:8px;padding:12px 16px;font-size:.875rem;margin-bottom:24px}.top{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}h1{font-size:1.85rem;letter-spacing:-.7px;margin:0 0 6px}h2{font-size:1.1rem;margin:0 0 14px}p{line-height:1.5}.muted,.small{color:#597183}.small{font-size:.875rem;line-height:1.5}.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.metrics{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:24px 0}.metric{background:white;border:1px solid var(--line);border-radius:10px;padding:18px}.metric strong{display:block;font-size:1.9rem;font-weight:700}.metric span{font-size:.875rem;color:#597183}.filters{display:flex;gap:10px;margin-bottom:16px;flex-wrap:wrap}.filters input{flex:1;min-width:180px}.board{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:20px}.panel{background:white;border:1px solid var(--line);border-radius:10px;overflow:hidden}.panel-head{padding:16px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:8px}.panel-head h2{margin:0}.worker{display:grid;grid-template-columns:24px minmax(0,1fr) 210px;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid #eaf0f4}.worker:last-child{border-bottom:0}.person{border:0;background:none;text-align:left;padding:0;min-height:44px;font-weight:650;line-height:1.35}.person:hover{background:none;color:var(--green)}.person small{display:block;font-weight:400;margin-top:4px;color:#597183}.count-row{padding:14px 18px;border-bottom:1px solid #eaf0f4;display:flex;justify-content:space-between;gap:12px}.count-row strong{color:var(--green);font-variant-numeric:tabular-nums}.batch{background:#e0f1ee;padding:12px;border-radius:8px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0}.empty{padding:32px;text-align:center;color:#597183}.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:14px}.card{padding:20px;background:white;border:1px solid var(--line);border-radius:10px}.badge{display:inline-block;border-radius:4px;padding:4px 8px;background:#e8f3f0;font-size:.875rem;margin:8px 4px 10px 0}.danger{color:#a13c32}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}label.field{display:flex;flex-direction:column;gap:6px;font-size:.875rem}.wide{grid-column:1/-1}.actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:20px}dialog{border:0;border-radius:14px;width:min(780px,calc(100% - 24px));max-height:90vh;padding:0;color:#193448;box-shadow:0 25px 80px #0a28394d}dialog::backdrop{background:#0b253a88}.dialog-head{padding:20px 24px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;gap:12px;align-items:center}.dialog-head h2{margin:0}.dialog-body{padding:24px}.tabs{display:flex;overflow-x:auto;gap:8px;margin-bottom:22px;padding-bottom:4px}.tabs .active{background:var(--blue);color:white}.entry{padding:16px 0;border-bottom:1px solid var(--line)}.entry p{white-space:pre-wrap;overflow-wrap:anywhere;margin:6px 0}.entry-top{display:flex;justify-content:space-between;gap:12px}.toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);background:#123f42;color:white;border-radius:10px;padding:14px 22px;box-shadow:0 5px 20px #0002;z-index:10;max-width:90%;text-align:center}#error{background:#fff0ed;border:1px solid #d9897d;color:#862b24;padding:14px;margin-bottom:18px;border-radius:8px}body.busy{cursor:progress}.foot{font-size:.875rem;color:#597183;margin:20px 0}details{margin:16px 0}summary{cursor:pointer;font-weight:600}#loading{padding:60px;text-align:center}
@media(max-width:1000px){.board{grid-template-columns:1fr}.shell{grid-template-columns:170px 1fr}.counts{display:grid;grid-template-columns:repeat(2,1fr)}.worker{grid-template-columns:24px minmax(0,1fr) 175px}}
@media(max-width:650px){header{padding:16px}header strong{font-size:1.2rem}header .small{display:none}.shell{display:block}nav{position:sticky;top:0;z-index:2;flex-direction:row;padding:8px;border-right:0;border-bottom:1px solid var(--line)}nav button{flex:1;text-align:center;padding:10px 5px;font-size:.875rem}nav .small{display:none}main{padding:18px 12px}.metrics{gap:8px;margin:18px 0;grid-template-columns:repeat(2,1fr)}.metric{padding:12px}.metric strong{font-size:1.55rem}.worker{grid-template-columns:24px minmax(0,1fr);padding:14px 12px;gap:8px}.worker select{grid-column:2;width:100%}.form-grid{grid-template-columns:1fr}.dialog-body{padding:16px}.dialog-head{padding:16px}.counts{grid-template-columns:1fr}h1{font-size:1.55rem}.toolbar{width:100%}.toolbar input[type=date]{flex:1}.notice{margin-bottom:18px}.filters>*{flex:1;min-width:130px}.toast{bottom:15px}.entry-top{flex-wrap:wrap}}

.site-team{margin:0;border-bottom:1px solid #eaf0f4}.site-team summary{border-bottom:0;min-height:52px;font-weight:500;align-items:center;list-style:none}.site-team summary::-webkit-details-marker{display:none}.site-team summary:hover{background:#edf7f5}.site-team summary strong{white-space:nowrap}.site-chevron{display:inline-block;margin-left:6px;transition:transform .15s}.site-team[open] .site-chevron{transform:rotate(180deg)}.site-team[open] summary{background:#e0f1ee}.site-members{padding:4px 14px 10px;background:#f8fbfc}.site-person{display:block;width:100%;padding:12px 4px;border-bottom:1px solid #e5edf1;font-size:.9375rem}.site-person:last-child{border-bottom:0}.site-person small{font-size:.875rem}
[hidden]{display:none!important}input[type=radio]{min-height:22px;width:22px;accent-color:var(--green)}.allocation-grid{border-collapse:separate;border-spacing:0;font-size:12px;width:max-content}.allocation-grid td,.allocation-grid th{border-right:1px solid #a9b9c4;border-bottom:1px solid #a9b9c4;padding:0;min-width:190px;max-width:190px}.allocation-grid th{position:sticky;top:0;z-index:2;padding:7px}.allocation-grid .grid-name{position:sticky;left:0;z-index:1;min-width:260px;max-width:260px;background:#dce3e8}.allocation-grid th.grid-name{z-index:3}.allocation-grid button{font-size:12px;border:0;border-radius:0;background:transparent;text-align:left;width:100%;min-height:38px;padding:5px 8px;font-weight:400}.allocation-grid .grid-cell{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:190px}.allocation-grid small{display:block;font-size:10px}.allocation-grid button:hover{background:#ffffff55}.allocation-grid select{font-size:12px}
.allocation-grid .grid-team{position:sticky;left:260px;min-width:80px;max-width:80px;width:80px;background:#edf2f6;z-index:1;padding:4px}.allocation-grid .grid-category-col{position:sticky;left:340px;min-width:150px;max-width:150px;width:150px;background:#edf2f6;z-index:1;padding:4px}.allocation-grid th.grid-team,.allocation-grid th.grid-category-col{z-index:3;background:#dce3e8}.allocation-grid th button[aria-pressed=true]{background:#bfded7;font-weight:700}

.app-brand{display:flex;align-items:center;gap:14px;max-width:470px}.app-brand img{width:92px;height:92px;object-fit:contain;background:white;border-radius:10px}.app-brand small{font-size:1rem;line-height:1.4;color:white}.dashboard-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:20px 0}.dashboard-columns{display:grid;grid-template-columns:1fr 1fr;gap:16px}.dashboard-bar{display:flex;height:18px;border-radius:5px;overflow:hidden;background:#eef2f5}.dashboard-bar span{display:block}.dashboard-legend{margin-top:18px}.dashboard-legend>div{display:flex;align-items:center;gap:8px;padding:7px 0}.dashboard-legend strong{margin-left:auto}.dashboard-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}.dashboard-work-numbers{display:flex;gap:20px;flex-wrap:wrap}.dashboard-work-numbers>div{flex:1;min-width:90px}.dashboard-work-numbers strong{display:block;font-size:2rem;color:var(--green)}.dashboard-section{margin-top:16px}.dashboard-team{margin-top:18px}.dashboard-team>div:first-child{display:flex;justify-content:space-between;gap:12px;margin-bottom:6px}.dashboard-team p{margin:5px 0}.dashboard-scroll{overflow-x:auto;margin-top:12px}.dashboard-table{width:100%;border-collapse:collapse;font-size:.9rem}.dashboard-table th,.dashboard-table td{text-align:left;padding:12px;border-bottom:1px solid var(--line);white-space:nowrap}.dashboard-table thead{background:#edf5f5}.dashboard-mini{height:7px;background:#e9eff2;border-radius:3px;margin-top:7px;min-width:100px}.dashboard-mini span{display:block;height:100%;background:#087f73;border-radius:3px}.shell{grid-template-columns:210px minmax(0,1fr)}main{box-sizing:border-box;min-width:0}
@media(max-width:650px){header{flex-wrap:wrap}.app-brand img{width:70px;height:70px}.app-brand small{font-size:.9rem}.dashboard-columns{grid-template-columns:1fr}.dashboard-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-legend>div{font-size:.85rem}.shell{display:block}nav{overflow-x:auto}nav button{flex:0 0 auto;max-width:150px}.dashboard-section{padding:14px}}

.alert-bell{display:inline-flex;align-items:center;gap:6px;flex-shrink:0}.alert-bell span{background:#b44435;color:white;border-radius:20px;padding:3px 7px;font-size:12px}.alert-entry{display:grid;grid-template-columns:1fr 1fr auto;gap:12px;text-align:left;width:100%;margin:8px 0;background:#f6f9fb}.alert-entry small{white-space:nowrap}.ring-layout{display:grid;grid-template-columns:minmax(200px,300px) minmax(0,1fr);align-items:center;gap:20px}.ring-svg{width:100%;max-width:300px}.ring-total{font-size:30px;fill:#193448;font-weight:bold}.ring-caption{font-size:12px;fill:#597183}.ring-legend>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 0;border-bottom:1px solid #edf1f4}.ring-legend strong{margin-left:auto;font-size:.9rem}.ring-legend .person{flex:1;min-width:90px}.ring-svg [role=button]{cursor:pointer;pointer-events:stroke}.ring-svg [role=button]:focus{stroke-width:34;outline:none}
@media(max-width:650px){.app-brand{flex-wrap:wrap}.ring-layout{grid-template-columns:1fr}.ring-svg{justify-self:center;max-width:260px}.alert-entry{grid-template-columns:1fr}.ring-legend>div{gap:6px}}
/* Shared layout for every page, table and employee/work dialog. */
:root{--surface:#fff;--surface-alt:#edf4f7;--text:#193448;--muted:#597183;--page:#f1f5f8;--header-height:100px;color-scheme:light;scroll-padding-top:calc(var(--header-height) + 16px)}
html[data-theme=dark]{--surface:#182b3b;--surface-alt:#223b4e;--text:#e0ebf4;--muted:#acc0d2;--page:#101e2b;--line:#395164;--blue:#badbf2;--green:#55c5b3;color-scheme:dark}
body{margin:0;background:var(--page);color:var(--text)}*,*::before,*::after{box-sizing:border-box}button,input,select,textarea{color:var(--text)}button,input,select,textarea,dialog,.card,.panel,.metric,nav{background:var(--surface)}button:hover,.person:hover{background:var(--surface-alt)}input,select,textarea{border-color:var(--line)}.muted,.small,.metric span,.person small{color:var(--muted)}.person,.person:hover{background:transparent}.badge{background:var(--surface-alt);color:var(--text)}.batch{background:var(--surface-alt)}.worker,.count-row,.entry,.site-person{border-color:var(--line)}.site-members{background:var(--surface)}.site-team[open] summary,.site-team summary:hover{background:var(--surface-alt)}button.primary{color:white;background:#087f73;border-color:#087f73}
#app-header{position:sticky;top:0;z-index:80;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:14px;padding:12px 24px;background:#143b53;color:white;box-shadow:0 2px 9px #0002;transition:padding .18s ease}
#app-header .app-brand{display:flex;flex-wrap:nowrap;max-width:none;min-width:0;gap:12px}#app-header .app-brand img{width:72px;height:72px;flex-shrink:0;transition:width .18s ease,height .18s ease}#app-header .app-brand small{display:block;max-width:340px;font-size:.95rem;color:white;margin:0;line-height:1.3}#app-header.header-compact{padding-block:6px}#app-header.header-compact .app-brand img{width:42px;height:42px}#app-header.header-compact .app-brand small{font-size:.8rem;max-width:300px}
#app-header .header-actions{display:flex;align-items:center;gap:8px;justify-content:flex-end;min-width:0}#app-header .header-action{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:8px;flex-shrink:0;background:#ffffff16;border-color:#ffffff55;color:white}#app-header .alert-bell{background:#ffffff16;color:white;border-color:#ffffff55;min-height:44px;padding:7px}#top-save-status{max-width:240px!important;font-size:.78rem}#top-save{font-size:.85rem;max-width:150px}
.shell{display:grid;grid-template-columns:220px minmax(0,1fr);min-height:calc(100dvh - var(--header-height));align-items:start}.shell>nav{position:sticky;top:var(--header-height);height:calc(100dvh - var(--header-height));overflow-y:auto;overflow-x:hidden;display:flex;flex-direction:column;padding:18px 12px;z-index:20}.shell>nav button{flex:none;width:100%;max-width:none;white-space:normal}.shell>nav .small{margin-top:auto}.shell>main{width:100%;max-width:1500px;padding:24px;min-width:0}.nav-collapsed .shell{grid-template-columns:minmax(0,1fr)}.nav-collapsed .shell>nav{display:none}#nav-backdrop{position:fixed;inset:var(--header-height) 0 0;z-index:65;background:#05152199;border:0;border-radius:0}
.card,.panel,.metric{min-width:0}.cards{grid-template-columns:repeat(auto-fit,minmax(min(270px,100%),1fr))}.toolbar,.top,.entry-top,.panel-head,.batch,.actions{min-width:0}.toolbar>*{max-width:100%}.field{min-width:0}.field>input,.field>select,.field>textarea{width:100%}.filters>label{flex:1;min-width:160px}.filters>input{min-width:160px}.dashboard-scroll,#grid-scroll,[style*="overflow:auto"]{max-width:100%;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.entry p,.card p,.worker .person,.ring-legend .person,.alert-entry{overflow-wrap:anywhere}.tabs{max-width:100%;flex-wrap:wrap;overflow-x:visible}.tabs>button{flex:0 0 auto}.worker{grid-template-columns:24px minmax(0,1fr) minmax(150px,210px)}
dialog{background:var(--surface);color:var(--text);max-height:calc(100dvh - 32px);max-width:calc(100vw - 24px);overflow:auto;overscroll-behavior:contain}dialog::backdrop{background:#041320aa}.dialog-head{position:sticky;top:0;z-index:5;background:var(--surface);gap:8px;flex-wrap:wrap}.dialog-head>div{flex:1;min-width:0}.dialog-head h2{overflow-wrap:anywhere;margin:0}.dialog-head #close-modal{margin-left:auto;flex-shrink:0}.dialog-body{min-width:0}.dialog-body .actions{position:sticky;bottom:-24px;background:var(--surface);padding:12px 0}.toast{bottom:calc(16px + env(safe-area-inset-bottom));max-width:calc(100% - 24px)}
html[data-theme=dark] .dashboard-table thead,html[data-theme=dark] .alert-entry{background:var(--surface-alt)}html[data-theme=dark] .ring-total{fill:var(--text)}html[data-theme=dark] .ring-caption{fill:var(--muted)}html[data-theme=dark] .ring-svg>circle[stroke="#e6edf1"]{stroke:var(--line)}html[data-theme=dark] nav button.active{background:#24544f;color:#d5fff5}html[data-theme=dark] .dashboard-mini,html[data-theme=dark] .dashboard-bar{background:#314354}html[data-theme=dark] .ring-legend>div{border-color:var(--line)}html[data-theme=dark] table{background:var(--surface)!important}html[data-theme=dark] thead{background:var(--surface-alt)!important}html[data-theme=dark] [style*="background:#e2eef1"],html[data-theme=dark] [style*="background:#dce3e8"]{background:var(--surface-alt)!important}html[data-theme=dark] .allocation-grid th,html[data-theme=dark] .allocation-grid .grid-name{background:var(--surface-alt)!important;color:var(--text)}html[data-theme=dark] .allocation-grid th button,html[data-theme=dark] .allocation-grid .grid-name button,html[data-theme=dark] .allocation-grid .grid-name small{color:var(--text)!important}html[data-theme=dark] .allocation-grid td:not(.grid-name) button{color:#193448}html[data-theme=dark] .allocation-grid button:hover{background:#0001}html[data-theme=dark] .danger{color:#ffa092}html[data-theme=dark] #error{background:#442b2a;color:#ffd0c7;border-color:#b27368}
@media(max-width:1100px){#top-save-status{display:none!important}.board{grid-template-columns:minmax(0,1fr)}.counts{display:block}.dashboard-columns{grid-template-columns:minmax(0,1fr)}}
@media(max-width:980px){#app-header{padding:8px 12px;gap:8px}#app-header .app-brand{gap:8px}#app-header .app-brand img{width:54px;height:54px}#app-header .app-brand small{display:none}#app-header.header-compact .app-brand img{width:38px;height:38px}.shell,.nav-collapsed .shell{display:block}.shell>main{padding:20px 14px}.shell>nav,.nav-collapsed .shell>nav{position:fixed;top:var(--header-height);left:0;bottom:0;height:auto;width:min(310px,85vw);z-index:70;box-shadow:8px 0 24px #0004;display:none;padding-bottom:calc(16px + env(safe-area-inset-bottom))}.nav-open .shell>nav{display:flex}.shell>nav .small{display:block}.nav-open{overflow:hidden}.ring-layout{grid-template-columns:minmax(160px,240px) minmax(0,1fr)}.metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid{gap:12px}.filters{gap:8px}.actions{justify-content:flex-start}}
@media(max-width:600px){#app-header{padding:7px 8px;gap:6px}#app-header .header-actions{gap:5px}#app-header .app-brand{gap:5px}#app-header .app-brand img{width:44px;height:44px}#app-header .header-action{width:42px;padding:8px}#app-header .alert-bell{padding:6px;gap:3px}#top-save{max-width:102px;padding:6px;font-size:.74rem}#app-header.header-compact{padding-block:4px}.shell>main{padding:16px 10px}.top .toolbar{width:100%}.toolbar{gap:8px}.toolbar>button,.toolbar>input,.toolbar>select{flex:1 1 auto}.toolbar>label{flex:1 1 140px}.form-grid{grid-template-columns:minmax(0,1fr)}.wide{grid-column:auto}.card{padding:15px}.panel-head{padding:12px;flex-wrap:wrap}.worker{grid-template-columns:24px minmax(0,1fr);padding:12px;gap:8px}.worker select{grid-column:2;width:100%}.cards{grid-template-columns:minmax(0,1fr)}.ring-layout{grid-template-columns:minmax(0,1fr)}.ring-svg{max-width:240px;justify-self:center}.alert-entry{grid-template-columns:minmax(0,1fr)}.entry-top{flex-wrap:wrap}.filters>*,.filters>input{min-width:0;flex:1 1 140px}.filters>label{min-width:140px}.batch>*{max-width:100%}.batch>select{width:100%}input,select,textarea{font-size:16px}button{min-height:44px}.dashboard-metrics{gap:8px}.metric{padding:12px}.metric strong{font-size:1.6rem}.dashboard-table th,.dashboard-table td{padding:10px}.allocation-grid .grid-name{min-width:160px;max-width:160px;width:160px}.allocation-grid td,.allocation-grid th{min-width:145px;max-width:145px}.allocation-grid .grid-cell{max-width:145px}.allocation-grid button{min-height:46px;font-size:12px}.allocation-grid .grid-name button{overflow-wrap:anywhere}.allocation-grid th.grid-name{padding:6px}#grid-scroll{max-height:calc(100dvh - var(--header-height) - 90px)!important}dialog{width:calc(100vw - 12px);max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px);border-radius:10px}.dialog-head{padding:12px}.dialog-head h2{font-size:1.05rem}.dialog-body{padding:14px}.dialog-body .actions{bottom:-14px;gap:8px}.dialog-body .actions button{flex:1 1 120px}.tabs{gap:4px}.tabs button{padding:9px 10px}.ring-legend strong{font-size:.85rem}}
@media(max-height:600px) and (orientation:landscape){#app-header{padding-block:4px}#app-header .app-brand img{width:38px;height:38px}#app-header.header-compact .app-brand img{width:32px;height:32px}.shell>main{padding-top:12px}dialog{max-height:calc(100dvh - 8px);width:min(900px,calc(100vw - 20px))}.dialog-head{padding:8px 14px}.dialog-body{padding:14px}#grid-scroll{max-height:65dvh!important}.allocation-grid .grid-name{min-width:190px;max-width:190px}.dashboard-metrics{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){#app-header,#app-header .app-brand img{transition:none}}
@media(max-height:600px) and (orientation:landscape){#app-header.header-compact{padding-block:2px}}
@media(max-width:360px){#app-header .app-brand img{width:36px;height:36px}#app-header.header-compact .app-brand img{width:32px;height:32px}#top-save{max-width:80px;font-size:.7rem}#app-header .alert-bell{padding:4px}}

.filters .field>input,.filters .field>select{min-width:0;max-width:100%}
html[data-theme="dark"] .tabs .active{background:#24544f;color:#d5fff5}
html[data-theme="dark"] .allocation-grid th button{background:#25434e;color:#f1f7fa}
html[data-theme="dark"] .allocation-grid th button[aria-pressed="true"]{background:#24544f;color:#d5fff5}
.shell>nav button{text-align:left}
.work-weather{min-width:310px;width:350px;vertical-align:top}.weather-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}.weather-cards>div{display:flex;flex-direction:column;gap:4px;align-items:center;text-align:center;padding:8px 4px;background:var(--surface-alt);border-radius:8px;min-width:0}.weather-cards strong{font-size:.72rem;line-height:1.25}.weather-cards strong small{font-weight:400;display:block;font-size:.63rem}.weather-cards b{font-size:.86rem;white-space:nowrap}.weather-cards span:not(.weather-icon){font-size:.69rem}.weather-cards small{font-size:.66rem}.weather-cards .weather-now{border:1px solid var(--green)}.weather-icon{font-size:1.55rem;line-height:1.3}.weather-meta{display:block;max-width:350px;font-size:.67rem;margin-top:6px;color:var(--muted)}.weather-status{display:block;font-size:.8rem;color:var(--muted);padding:10px}.weather-credits{line-height:1.5}.weather-credits a{color:inherit;text-decoration:underline}
@media(max-width:600px){.weather-sites-table,.weather-sites-table tbody{display:block;width:100%}.weather-sites-table thead{display:none}.weather-sites-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-bottom:2px solid var(--line);padding:10px 0;gap:0}.weather-sites-table tbody th,.weather-sites-table tbody td{min-width:0;border:0;padding:8px;width:auto}.weather-sites-table tbody th,.weather-sites-table .work-weather,.weather-sites-table .work-people-total{grid-column:1/-1}.weather-sites-table td[data-label]::before{content:attr(data-label);display:block;font-size:.72rem;color:var(--muted);margin-bottom:5px}.weather-sites-table .work-weather:has(:empty){padding:0}.weather-sites-table .work-weather:empty{display:none}.weather-sites-table tbody td[colspan]{grid-column:1/-1}.weather-meta{max-width:none}.weather-cards{grid-template-columns:repeat(2,minmax(0,1fr))}.weather-cards strong{font-size:.8rem}.weather-cards span:not(.weather-icon){font-size:.75rem}}

.dashboard-table td.work-weather{white-space:normal}.weather-cards span:not(.weather-icon){white-space:normal;overflow-wrap:anywhere}

/* Free scrolling and native pinch zoom; compact content-sized annual grid. */
.dashboard-scroll,#grid-scroll{overscroll-behavior:auto;touch-action:auto}
.shell>main:has(#grid-scroll){max-width:none}
#grid-scroll{width:100%;touch-action:pan-x pan-y pinch-zoom}
#grid-scroll .allocation-grid{table-layout:auto;width:max-content;min-width:100%}
#grid-scroll .allocation-grid td,#grid-scroll .allocation-grid th{min-width:0;max-width:none;width:auto;white-space:nowrap}
#grid-scroll .allocation-grid .grid-cell{width:100%;max-width:none;white-space:nowrap;padding:8px 10px}
#grid-scroll .allocation-grid .grid-name{min-width:220px;width:220px;max-width:260px;white-space:normal}
#grid-scroll .allocation-grid .grid-name button{white-space:normal}
#grid-scroll .allocation-grid th:not(.grid-name) button{white-space:normal;min-width:78px}
.grid-zoom-controls{position:fixed;bottom:18px;right:18px;z-index:50;display:flex;align-items:center;gap:6px;background:var(--surface);padding:5px;border:1px solid var(--line);border-radius:10px;box-shadow:0 2px 8px #0003}
.grid-zoom-controls button{font-size:22px;min-width:44px}.grid-zoom-controls output{font-size:12px}
.weather-warning,.weather-warning span,.weather-warning strong{color:#bb2020!important;font-weight:700}
html[data-theme=dark] .weather-warning,html[data-theme=dark] .weather-warning span,html[data-theme=dark] .weather-warning strong{color:#ff8d8d!important}

#grid-scroll .allocation-grid th:not(.grid-name)>label{display:block;font-size:11px}

#grid-scroll .allocation-grid.virtual-grid{table-layout:fixed;min-width:0}
#grid-scroll .virtual-grid .grid-spacer{padding:0!important;border:0!important;min-width:0!important;pointer-events:none}
#grid-scroll .virtual-grid th:not(.grid-name){overflow:hidden}
#grid-scroll .virtual-grid td:not(.grid-name){overflow:hidden}

#grid-scroll [data-batch-person][aria-pressed="true"],#grid-scroll [data-batch-day][aria-selected="true"]{box-shadow:inset 0 0 0 3px #087f73!important;background-color:#c9eee6!important;color:#123b37!important}

.grid-help{margin:12px 0}.grid-help summary{cursor:pointer}.grid-actions{gap:8px}
.pay-scroll{overflow:auto;max-height:70vh;border:1px solid var(--line);border-radius:12px;background:var(--surface);touch-action:pan-x pan-y pinch-zoom}.pay-table{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:13px}.pay-table th,.pay-table td{padding:9px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;background:var(--surface)}.pay-table thead th{position:sticky;top:0;z-index:3;background:var(--surface-alt);white-space:nowrap}.pay-table .pay-name{position:sticky;left:0;z-index:2;min-width:235px;max-width:260px;width:260px;white-space:normal}.pay-table thead .pay-name{z-index:4}.pay-table .pay-name button{border:0;text-align:left;font-weight:650;padding:4px;background:transparent;white-space:normal}.pay-name .small{display:block}.pay-table .pay-current{background:var(--surface-alt);box-shadow:inset 0 2px #087f73}.pay-group th{background:#143b53;color:white;font-size:13px}.pay-value{min-width:88px;padding:9px 7px;border-color:transparent;font-variant-numeric:tabular-nums}.pay-positive{color:var(--green);font-weight:bold}.pay-value .small{display:block;font-size:10px}.pay-att{display:flex;flex-direction:column;gap:5px;line-height:1.35;min-width:260px;max-width:330px}.pay-att span{font-size:12px;color:var(--muted)}.pay-att-button{border:0;text-align:left;background:transparent;padding:4px}.pay-note{max-width:280px;min-width:160px}.pay-note button{white-space:normal;max-width:270px;overflow-wrap:anywhere;text-align:left}.pay-pdf-people{max-height:35vh;overflow:auto;display:grid;gap:8px;border:1px solid var(--line);padding:12px;border-radius:8px}.pay-pdf-people label{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pay-toolbar .field{min-width:100px}.pay-table td{font-variant-numeric:tabular-nums}.pay-table button:focus-visible{outline:3px solid #169e8b;outline-offset:1px}@media(max-width:600px){.pay-table .pay-name{min-width:160px;max-width:175px;width:175px}.pay-table th,.pay-table td{padding:7px}.pay-att{min-width:235px}.pay-toolbar{align-items:stretch}.pay-toolbar .field{flex:1 1 140px}}
/* Grid: ISO week bar above the days, and team colours on the name column as in the Excel plan. */
.allocation-grid{--week-bar:24px}
.allocation-grid tr.grid-weeks th.grid-week{top:0;box-sizing:border-box;height:var(--week-bar);padding:0 8px;line-height:calc(var(--week-bar) - 1px);font-size:11px;font-weight:700;letter-spacing:.02em;text-align:left;white-space:nowrap;background:#143b53;color:#fff;border-right:2px solid #fff}
.allocation-grid tr.grid-days th{top:var(--week-bar)}
.allocation-grid td.grid-name{background:#fff}
.allocation-grid td.grid-name button{color:#173346}
/* Team colours come from the Equipas settings via --team-bg / --team-fg (also in dark mode). */
.allocation-grid td.grid-name.team-colored{background:var(--team-bg)}
.allocation-grid td.grid-name.team-colored button,.allocation-grid td.grid-name.team-colored small{color:var(--team-fg)}
html[data-theme=dark] .allocation-grid td.grid-name.team-colored{background:var(--team-bg)!important}
html[data-theme=dark] .allocation-grid td.grid-name.team-colored button,html[data-theme=dark] .allocation-grid td.grid-name.team-colored small{color:var(--team-fg)!important}
html[data-theme=dark] .allocation-grid tr.grid-weeks th.grid-week{background:#0b2231!important;color:#d7e7ef}
.map-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:-4px}
.map-links:empty{display:none}
.map-link{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border:1px solid var(--line);border-radius:8px;background:var(--surface-alt);color:var(--text);font-weight:600;text-decoration:none}
.map-link:hover{border-color:var(--green)}
.collab-actions{display:flex;flex-wrap:wrap;gap:8px}
.collab-actions .collab-delete{margin-left:auto;color:#a52323;border-color:#e3b4b4}
.collab-actions .collab-delete:hover{background:#fbeaea}
html[data-theme=dark] .collab-actions .collab-delete{color:#ff9d9d;border-color:#7a3a3a}
html[data-theme=dark] .collab-actions .collab-delete:hover{background:#3a1f1f}
/* Toolbars line controls up on their bottom edge, so a field with its label above the box sits level
   with the buttons beside it. Plain checkbox labels keep the 44 px control height and centre their text. */
.toolbar{align-items:flex-end}
.toolbar>label:not(.field){display:flex;align-items:center;gap:6px;min-height:44px}
button,input:not([type=checkbox]):not([type=radio]),select{box-sizing:border-box}/* Equipas: per-team grid colours and automatic responsible. */
.team-settings{margin-top:14px;padding-top:14px;border-top:1px solid var(--line);display:grid;gap:10px}
.team-preview{padding:10px 12px;border-radius:8px;border:1px solid var(--line);font-weight:600}
.team-settings input[type=color]{padding:4px;height:44px;cursor:pointer}
.team-settings small{color:var(--muted);font-weight:400}/* Automatic backups list (Dados). */
.backup-rows{display:grid;gap:8px;margin-top:12px}
.backup-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:10px 12px;border:1px solid var(--line);border-radius:8px}
.backup-row small{display:block;color:var(--muted)}/* Daily list: "Dividir por horas" sits under the destination select, in the same (last) column,
   on wide and narrow layouts alike. Before, it fell into the 24 px checkbox column. */
.worker [data-split-daily]{grid-column:-2/-1;justify-self:stretch;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}/* Filter rows (Funcionários): same bottom alignment as toolbars; buttons keep their natural width. */
.filters{align-items:flex-end}
.filters>button{flex:0 0 auto}/* Férias (Gantt): sticky name column and month header, one 1-day unit = --leave-day. */
.leave-scroll{overflow:auto;max-height:72vh;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.leave-canvas{--leave-day:11px;--leave-name:230px;position:relative;width:calc(var(--leave-name) + var(--leave-day)*var(--leave-days))}
.leave-row{display:flex;min-height:46px;border-bottom:1px solid var(--line)}
.leave-name{position:sticky;left:0;z-index:3;flex:0 0 var(--leave-name);width:var(--leave-name);padding:4px 10px;background:var(--surface);border-right:1px solid var(--line);display:flex;align-items:center}
.leave-name .person{min-height:38px;width:100%;font-size:.9rem}
.leave-name .person small{font-size:.72rem}
.leave-track{position:relative;flex:0 0 calc(var(--leave-day)*var(--leave-days));cursor:copy}
.leave-head{position:sticky;top:0;z-index:5;background:var(--surface);min-height:44px}
.leave-head .leave-name{z-index:6}
.leave-axis{cursor:default}
.leave-month{position:absolute;top:0;height:24px;line-height:24px;padding-left:6px;font-size:.75rem;font-weight:700;border-left:1px solid var(--line);overflow:hidden;white-space:nowrap}
.leave-week{position:absolute;top:24px;height:20px;line-height:20px;font-size:.62rem;color:var(--muted);border-left:1px solid var(--line);padding-left:2px;white-space:nowrap}
.leave-body{position:relative}
.leave-stripes{position:absolute;top:0;bottom:0;left:var(--leave-name);right:0;pointer-events:none;z-index:0}
.leave-off{position:absolute;top:0;bottom:0;width:var(--leave-day);background:#8aa1b133}
.leave-today{position:absolute;top:0;bottom:0;width:2px;margin-left:calc(var(--leave-day)/2);background:#d9534f}
.leave-bar{position:absolute;top:9px;height:28px;min-height:0;padding:0 4px;border:0;border-radius:6px;font-size:.72rem;font-weight:700;color:#173346;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;z-index:1;cursor:pointer}
.leave-bar.ferias{background:#7ccf9a}.leave-bar.baixa{background:#f2a3a3}.leave-bar.doenca{background:#f6c27a}.leave-bar.falta{background:#c9b3ee}.leave-bar.outra{background:#b9c7d3}
.leave-bar.legacy{background:repeating-linear-gradient(45deg,#7ccf9a66,#7ccf9a66 4px,transparent 4px,transparent 8px);border:2px dashed #3f9a63}
.leave-bar:hover{filter:brightness(1.08);outline:2px solid var(--green)}
.leave-legend{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.leave-chip{display:inline-block;width:18px;height:12px;border-radius:3px;vertical-align:middle}
.leave-chip.ferias{background:#7ccf9a}.leave-chip.baixa{background:#f2a3a3}.leave-chip.doenca{background:#f6c27a}.leave-chip.falta{background:#c9b3ee}.leave-chip.outra{background:#b9c7d3}
.leave-chip.legacy{background:repeating-linear-gradient(45deg,#7ccf9a,#7ccf9a 3px,transparent 3px,transparent 6px);border:1px dashed #3f9a63}
.leave-empty{padding:16px}
@media(max-width:767px){.leave-canvas{--leave-day:8px;--leave-name:150px}.leave-name .person small{display:none}}/* Funcionários cards: small photo (or initials) at the bottom left. */
.card-foot{display:flex;align-items:center;gap:10px;margin-top:auto;padding-top:8px}
.person-thumb{flex:0 0 40px;width:40px;height:40px;border-radius:50%;object-fit:cover;border:1px solid var(--line)}
.person-thumb.initials{display:inline-flex;align-items:center;justify-content:center;background:var(--surface-alt);color:var(--muted);font-size:.8rem;font-weight:700}/* Stoppages (Inverno / Paragem): bars, chips, record table and people picker. */
.leave-bar.inverno{background:#8fb8de}.leave-bar.paragem{background:#a7b0bd}
.leave-bar.inverno.legacy{background:repeating-linear-gradient(45deg,#8fb8de88,#8fb8de88 4px,transparent 4px,transparent 8px);border:2px dashed #4f7fae}
.leave-bar.paragem.legacy{background:repeating-linear-gradient(45deg,#a7b0bd88,#a7b0bd88 4px,transparent 4px,transparent 8px);border:2px dashed #6b7686}
.leave-chip.inverno{background:#8fb8de}.leave-chip.paragem{background:#a7b0bd}
.stoppage-people{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:4px 12px;max-height:40vh;overflow:auto;padding:8px;border:1px solid var(--line);border-radius:8px}
.stoppage-people label{display:flex;align-items:center;gap:8px;min-height:36px}
.stoppage-people small{color:var(--muted)}
.stoppage-legacy{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:12px 0}
.stoppage-legacy p{flex:1 1 100%;margin:0}
.stoppage-table td,.stoppage-table th{padding:8px;text-align:left;border-bottom:1px solid var(--line)}
/* Legal status summary (home page). */
.legal-card{margin-top:16px}
.legal-table{width:100%;border-collapse:collapse}
.legal-table th,.legal-table td{padding:8px;text-align:left;border-bottom:1px solid var(--line)}
.legal-table small{color:var(--muted)}
.legal-table tbody tr:last-child{font-weight:700}/* Full screen width (like the distribution grid) for the Férias e paragens Gantt and wide report tables. */
.shell>main:has(#leave-scroll),.shell>main:has(.report-table-wrap){max-width:none}
/* Reports (Relatórios). */
.report-tabs{margin:12px 0 16px}
.report-table-wrap{overflow:auto;max-height:65vh;border:1px solid var(--line);border-radius:8px}
.report-table{width:100%;border-collapse:separate;border-spacing:0;font-size:.85rem}
.report-table th,.report-table td{padding:7px 8px;text-align:left;border-bottom:1px solid var(--line);white-space:nowrap}
.report-table thead th{position:sticky;top:0;z-index:2;background:var(--surface-alt)}
.report-table tfoot th,.report-table tfoot td{position:sticky;bottom:0;background:var(--surface-alt);font-weight:700}
.report-table .report-group th{background:#143b53;color:#fff}
.report-table .report-sub th,.report-table .report-sub td{font-weight:700;background:var(--surface-alt)}
.report-table .person{min-height:0;font-weight:600}
.prize-matrix td{text-align:right}.prize-matrix td:first-child{text-align:left}
.report-total{margin:12px 0}
.report-people{margin:8px 0}
.report-links .card{display:flex;flex-direction:column;gap:8px}/* Funcionários cards grouped by team: photo, name, team and function only. */
.people-team{margin-top:18px}
.people-team h2{font-size:1.05rem;margin:0 0 10px;display:flex;align-items:center;gap:8px}
.people-team h2 small{font-size:.8rem;color:var(--muted);font-weight:600;background:var(--surface-alt);border-radius:10px;padding:2px 8px}
.person-card{display:flex;align-items:center;gap:12px;padding:12px 14px}
.person-card .person-thumb{flex:0 0 48px;width:48px;height:48px}
.person-card .person{flex:1;min-width:0;min-height:44px}/* Grouped navigation: small group labels and a collapsible Configuração section. */
.shell>nav .nav-group{margin:12px 6px 2px;font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.shell>nav .nav-config{margin-top:10px;border-top:1px solid var(--line);padding-top:6px}
.shell>nav .nav-config summary{cursor:pointer;padding:10px 12px;border-radius:8px;font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);min-height:44px;display:flex;align-items:center}
.shell>nav .nav-config summary:hover{background:var(--surface-alt)}
.shell>nav .nav-config[open] summary{margin-bottom:4px}
.shell>nav .nav-config button{margin-bottom:8px}/* Férias: Easter / Summer periods, next-year months, vacation inside / outside the periods. */
.leave-head{min-height:64px}
.leave-season-label{position:absolute;top:44px;height:18px;line-height:18px;font-size:.66rem;font-weight:700;padding:0 4px;border-radius:4px;overflow:hidden;white-space:nowrap;color:#173346}
.leave-season{position:absolute;top:0;bottom:0;opacity:.28}
.season-pascoa{background:#f2cf4a}.season-verao{background:#f39a4a}.season-natal{background:#7fc4e8}.season-outro{background:#b9a3ea}
.leave-season-label.season-pascoa,.leave-season-label.season-verao,.leave-season-label.season-natal,.leave-season-label.season-outro{opacity:1}
.leave-month.next-year{background:#8aa1b122;font-style:italic}
.leave-newyear{position:absolute;top:0;bottom:0;width:3px;background:#143b53}
.leave-bar.fit-out{box-shadow:inset 0 0 0 3px #c0392b}
.leave-bar.fit-part{box-shadow:inset 0 0 0 3px #e08a1e}
.leave-chip.season-pascoa,.leave-chip.season-verao,.leave-chip.season-natal,.leave-chip.season-outro{opacity:.75}
.leave-chip.fit-out{background:#7ccf9a;box-shadow:inset 0 0 0 2px #c0392b}
.leave-chip.fit-part{background:#7ccf9a;box-shadow:inset 0 0 0 2px #e08a1e}
html[data-theme=dark] .leave-newyear{background:#9fc3dc}/* People pickers: alphabetical top-to-bottom columns, same-size checkboxes. */
.stoppage-people{display:block;columns:220px;column-gap:16px}
.stoppage-people label{break-inside:avoid;padding:2px 0}
.stoppage-people input[type=checkbox]{flex:0 0 auto;width:20px;height:20px}
/* Absence without a return date: striped fade to the right. */
.leave-bar.open-ended{background-image:linear-gradient(90deg,transparent 60%,#ffffff99);box-shadow:inset -4px 0 0 #c0392b;font-weight:800}
.leave-open span{display:flex;align-items:center;gap:8px;min-height:44px}
.leave-missing-team h3{margin:0;flex:1}
/* Férias: sticky header with coverage rows, approval, balance, analysis. */
.leave-sticky{position:sticky;top:0;z-index:5;background:var(--surface)}
.leave-sticky .leave-head{position:static}
.leave-cov{min-height:22px}
.leave-cov .leave-name{font-size:.72rem;font-weight:700;color:var(--muted)}
.leave-cov .leave-name small{font-weight:400}
.leave-cov .leave-track{cursor:default}
.leave-cov-cell{position:absolute;top:2px;bottom:2px;width:var(--leave-day);font-size:.55rem;line-height:18px;text-align:center;font-weight:700;color:#173346;background:rgba(214,88,64,var(--heat));overflow:hidden}
.leave-cov-cell.warn{background:#c0392b;color:#fff;font-size:.65rem}
.leave-cov-cell.stop{background:#8fb8de55}
.leave-bar.requested{background-image:repeating-linear-gradient(135deg,#ffffff88 0 4px,transparent 4px 8px);outline:2px dashed #6b7686;outline-offset:-2px}
.leave-chip.requested{background:repeating-linear-gradient(135deg,#7ccf9a 0 3px,#d5d9de 3px 6px);outline:1px dashed #6b7686}
.leave-toolbar{margin:6px 0}
.leave-toolbar .field input,.leave-toolbar .field select{min-width:120px}
button.leave-warn{border-color:#c0392b;color:#c0392b;font-weight:700}
.leave-chart{display:flex;align-items:flex-end;gap:2px;height:140px;padding:6px 0;border-bottom:1px solid var(--line)}
.leave-chart-col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;height:100%;position:relative}
.leave-chart-col span{display:block;background:#7ccf9a;border-radius:2px 2px 0 0;min-height:1px}
.leave-chart-col.stop span{background:#8fb8de}
.leave-chart-col small{position:absolute;bottom:-16px;font-size:.6rem;color:var(--muted)}
.leave-chart+p{margin-top:20px}
.leave-balance{border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin:10px 0}
.leave-adjust-list{padding-left:18px}.leave-adjust-list li{margin:4px 0}
.leave-badge-requested{background:#f6c27a;color:#173346}.leave-badge-rejected{background:#f2a3a3;color:#173346}
.entry.leave-rejected{opacity:.65}.leave-balance .form-grid{align-items:end}
.leave-balance .form-grid .actions{align-self:end;margin:0}
.leave-inline{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;margin:8px 0}
.leave-inline .field{margin:0;flex:1 1 180px}
.leave-inline button{margin:0}
/* Header weather warnings (instead of the tagline). */
#app-header .header-weather{display:flex;flex-wrap:wrap;gap:6px;min-width:0;max-width:640px}
#app-header .header-weather-item{background:#c0392b;color:#fff;border:0;border-radius:6px;padding:4px 10px;min-height:32px;font-size:.85rem;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
#app-header .header-weather-item strong{color:#fff}
@media(max-width:767px){#app-header .header-weather{max-width:46vw}#app-header .header-weather-item{font-size:.75rem;padding:3px 7px;min-height:28px}}
/* Obra > Horas e faturação */
.schedule-day{flex:0 0 76px!important}
.schedule-day input{width:70px}
.report-table tr.muted td{color:var(--muted)}.works-tabs{margin-bottom:12px}
.invoice-table td small,.invoice-table th small{display:block}
/* Weather warning button next to the alerts bell (only when there are warnings). */
#app-header .weather-alert{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:7px;margin-left:6px;background:#c0392b;border:1px solid #ff8a80;border-radius:8px;color:#fff;cursor:pointer}
#app-header .weather-alert[hidden]{display:none}
.weather-warning{border-left:4px solid #c0392b;padding:6px 10px;margin:8px 0;background:var(--surface-alt)}
/* Estatísticas e faturação: charts (validated categorical slots 1–4; text never in series colors). */
:root{--viz-1:#2a78d6;--viz-2:#eb6834;--viz-3:#1baf7a;--viz-4:#eda100;--viz-other:#9a9893;--viz-pos:#2a78d6;--viz-neg:#e34948;--viz-grid:#e1e6ea;--viz-zero:#8a9aa5}
html[data-theme=dark]{--viz-1:#3987e5;--viz-2:#d95926;--viz-3:#199e70;--viz-4:#c98500;--viz-other:#6f6e69;--viz-pos:#3987e5;--viz-neg:#e66767;--viz-grid:#2a3d4a;--viz-zero:#7f939f}
.ws-filters{margin:6px 0}
.ws-kpis{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.ws-kpis .metric span{font-size:.8rem;line-height:1.35}
.viz-delta{font-weight:700;white-space:nowrap}.viz-delta.up{color:var(--success,#087c56)}.viz-delta.down{color:var(--danger,#b3261e)}
.viz-progress{height:6px;border-radius:3px;background:var(--viz-grid);margin:4px 0;overflow:hidden}.viz-progress i{display:block;height:100%;background:var(--viz-1);border-radius:3px}
.viz-grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(420px,1fr));gap:16px;margin:16px 0}
@media(max-width:767px){.viz-grid2{grid-template-columns:minmax(0,1fr)}}
.viz-card h2{font-size:1rem;margin:0 0 6px}
.viz-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:.8rem;color:var(--muted);margin:4px 0 8px}.viz-legend i{display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:5px;vertical-align:-2px}
.viz-plot{display:flex;gap:6px;height:220px}
.viz-axis{display:flex;flex-direction:column;justify-content:space-between;font-size:.68rem;color:var(--muted);text-align:right;min-width:44px;padding-bottom:18px}
.viz-axis span{transform:translateY(-50%)}.viz-axis span:last-child{transform:translateY(50%)}
.viz-area{position:relative;flex:1;min-width:0}
.viz-grid{position:absolute;left:0;right:0;height:1px;background:var(--viz-grid);margin-bottom:18px}
.viz-cols{position:absolute;inset:0 0 0 0;display:flex;gap:4px;align-items:stretch}
.viz-col{flex:1;min-width:0;display:flex;flex-direction:column}
.viz-col small{height:18px;line-height:18px;font-size:.66rem;color:var(--muted);text-align:center;white-space:nowrap;overflow:hidden}
.viz-bars,.viz-stack{flex:1;display:flex;align-items:flex-end;justify-content:center;gap:2px}
.viz-stack{flex-direction:column-reverse;align-items:center;justify-content:flex-start;gap:2px}
.viz-bar{flex:1;max-width:16px;border-radius:4px 4px 0 0;min-height:0}
.viz-seg{width:60%;max-width:34px;min-height:0}.viz-stack .viz-seg:last-child{border-radius:4px 4px 0 0}
.viz-bar:hover,.viz-seg:hover,.viz-row:hover .viz-hbar{filter:brightness(1.12)}
.viz-rows{display:flex;flex-direction:column;gap:6px}
.viz-row{display:grid;grid-template-columns:minmax(90px,34%) 1fr auto;gap:8px;align-items:center;font-size:.82rem;min-height:24px}
.viz-row-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.viz-row-value{font-variant-numeric:tabular-nums;text-align:right;min-width:62px}
.viz-track{position:relative;height:14px}
.viz-hbar{position:absolute;top:0;bottom:0;left:0;border-radius:0 4px 4px 0;min-width:2px}
.viz-track.div .viz-hbar.pos{background:var(--viz-pos);border-radius:0 4px 4px 0}
.viz-track.div .viz-hbar.neg{background:var(--viz-neg);border-radius:4px 0 0 4px;left:auto}
.viz-zero{position:absolute;left:50%;top:-3px;bottom:-3px;width:1px;background:var(--viz-zero)}
.viz-tip{position:fixed;z-index:200;max-width:280px;background:#143b53;color:#fff;font-size:.8rem;padding:6px 9px;border-radius:6px;box-shadow:0 4px 14px #0004;pointer-events:none}
.ws-sort{background:none;border:0;padding:0;font:inherit;font-weight:700;color:inherit;cursor:pointer;min-height:0;text-align:left}.ws-sort.on{text-decoration:underline}
.ws-table td small{display:block;color:var(--muted)}.ws-plain tbody tr:last-child{font-weight:inherit}
.ws-plain td small{display:block;color:var(--muted)}
.viz-grid2>*{min-width:0}
.viz-grid2 .table-wrap{overflow-x:auto}
.ws-scroll{overflow-x:auto!important;max-width:100%}
.ws-pdf-group{border:1px solid var(--line);border-radius:8px;padding:8px 12px;margin:10px 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:4px 12px}
.ws-pdf-group legend{font-weight:700;padding:0 6px}
.ws-pdf-group label{display:flex;align-items:center;gap:8px;min-height:36px}
.billing-mode{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}
.billing-mode p{flex:1 1 280px;margin:0}
.qty-forms{margin:12px 0;border-top:1px solid var(--line);padding-top:8px}
.qty-forms summary{cursor:pointer;font-weight:700;min-height:40px;display:flex;align-items:center}
.qty-table td small{display:block;color:var(--muted)}
/* Obra > Pessoal e horas: blocks per day and team. */
.hours-day{margin:0 0 14px;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.hours-day h3{margin:0;padding:10px 14px;background:var(--surface-alt);display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;font-size:1rem}
.hours-day h3 span{margin-left:auto;font-size:.85rem;font-weight:600;color:var(--muted)}
.hours-team{padding:6px 14px;font-size:.8rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;border-top:1px solid var(--line)}
.hours-team small{font-weight:400}
.hours-day .count-row{padding-left:14px;padding-right:14px}
.invoice-separate{display:flex;align-items:center;gap:8px;min-height:44px;align-self:flex-end}
.invoice-separate small{color:var(--muted)}
tr.invoice-apart td,tr.invoice-apart th{color:var(--muted);font-style:italic}
.ws-pdf-sites{display:block}
.ws-pdf-sites>label{display:flex;align-items:center;gap:8px;min-height:36px}
.ws-pdf-site-list .stoppage-people{max-height:30vh}
/* Funcionários > Evolução; Obras > Pessoal vs necessário; prizes dialog. */
.trend-plot{height:260px;margin-top:8px}
.crew-table td.crew-cell{text-align:center;white-space:nowrap}
.crew-table td.crew-cell b{display:block;font-size:.8rem}
.crew-table td.crew-cell.over{background:#e3494822;color:inherit}.crew-table td.crew-cell.over b{color:#c0392b}
.crew-table td.crew-cell.under{background:#eda10022}.crew-table td.crew-cell.under b{color:#a66d00}
.crew-table th.today{background:var(--viz-1);color:#fff}
.crew-table th small{display:block;font-weight:400;color:var(--muted)}
.pay-pdf-months{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:4px 12px;margin:8px 0}
.pay-pdf-months label{display:flex;align-items:center;gap:6px;min-height:36px}
#pay-pdf-teams{display:inline-flex;gap:6px;flex-wrap:wrap}.crew-table td.crew-cell.stopped{color:var(--muted);background:#8fb8de22}
.clarify-note{display:block;color:var(--muted);max-width:340px;white-space:normal}
.clarify-site{margin:10px 0}.clarify-site h3{margin:6px 0}
.clarify-people{display:flex;flex-wrap:wrap;gap:6px 18px}
.clarify-person{border-top:1px solid var(--line);padding:8px 0}.clarify-person summary{cursor:pointer;padding:4px 0}
.search-clear-wrap{position:relative;display:flex;flex:1 1 180px;min-width:0;max-width:100%}.field>.search-clear-wrap{width:100%;flex:none}.search-clear-wrap>input{flex:1 1 auto;width:100%;min-width:0;padding-right:40px}.search-clear{position:absolute;right:4px;top:50%;transform:translateY(-50%);min-height:32px;width:32px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;font-size:1.3rem;line-height:1;opacity:.7}.search-clear:hover{opacity:1;background:#8fa6b522}
.regie-field{justify-content:flex-start}.regie-check{display:flex;align-items:center;gap:8px;min-height:44px;font-size:1rem}.regie-check small{color:var(--muted)}
/* Day changed by a collaborator: small corner in the grid, small dot in the daily list (details on hover). */
.grid-cell.collab-edited{background-image:linear-gradient(225deg,#8b5cf6 0 7px,transparent 7px)}
.collab-mark{display:inline-block;width:9px;height:9px;border-radius:50%;background:#8b5cf6;margin-left:6px;vertical-align:middle;flex:none}
/* Wide tables inside cards (Horas e faturação, faturas, equipas…): the table scrolls sideways, never the page.
   Cards are flex columns, whose children would otherwise grow to the table's full width. */
.card,.card>*,#work-content{min-width:0}
.table-wrap{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
.collab-access{display:flex;flex-direction:column;gap:4px}
/* Budget of a work: bar with the 80% alert mark. */
.budget-bar{position:relative;height:10px;border-radius:5px;background:var(--line);overflow:hidden;margin:4px 0 10px;min-width:80px}
.budget-bar span{position:absolute;inset:0 auto 0 0;background:#2a78d6}
.budget-bar.warn span{background:#e0a100}.budget-bar.over span{background:#d64545}
.budget-bar i{position:absolute;top:0;bottom:0;width:2px;background:rgba(0,0,0,.45)}
.budget-warn{color:#a86b00;font-weight:600}
/* Copy distribution: calendar of the two weeks after the source day. */
.copy-cal-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
.copy-cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;margin:8px 0}
.copy-wd{font-size:.75rem;text-align:center;color:var(--muted)}
.copy-day{min-height:48px;padding:4px 2px;display:flex;flex-direction:column;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:8px;background:transparent;color:inherit;font:inherit}
.copy-day b{font-size:1rem}.copy-day small{font-size:.65rem;color:var(--muted);line-height:1.1}
.copy-day.off{opacity:.35;border-style:dashed}
.copy-day.rest{background:repeating-linear-gradient(135deg,transparent 0 6px,rgba(127,127,127,.12) 6px 12px)}
.copy-day.on{background:var(--green,#087f73);border-color:var(--green,#087f73);color:#fff}.copy-day.on small{color:#fff}
/* Budget notes: long text, full width, line breaks kept. */
#budget-form .budget-note{flex:1 1 100%;min-width:min(100%,320px)}
#budget-form .budget-note textarea{width:100%;min-height:96px;resize:vertical;font:inherit}
.budget-note-text{white-space:pre-wrap;min-width:220px;max-width:520px}
/* Work card: who was on the work and when; delete button. */
.work-people summary{cursor:pointer;list-style:none}.work-people summary h2{display:inline}.work-people summary::before{content:'▸ ';}.work-people[open] summary::before{content:'▾ ';}
.work-people-runs{line-height:1.8;min-width:260px}.work-people-runs .link-button.future{font-style:italic;opacity:.75}
.danger-button{color:#b3261e;border-color:#e4a5a1}
/* Employee photo shown large (28-fotografias.js photoZoom). */
dialog.photo-zoom{background:transparent;box-shadow:none;width:auto;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:visible;padding:0;text-align:center;cursor:zoom-out}dialog.photo-zoom img{display:block;max-width:min(640px,calc(100vw - 24px));max-height:calc(100dvh - 90px);width:auto;height:auto;border-radius:12px;background:#fff;margin:auto}dialog.photo-zoom p{color:#fff;margin:10px 0 0;font-weight:600}
/* Obras > Controlo de faturas */
.invoicing-table td{vertical-align:top}.invoicing-table td small{display:block}.invoicing-table td>div{margin:2px 0}
.invoicing-table tr.invoicing-late td{background:#fdf0ee}html[data-theme=dark] .invoicing-table tr.invoicing-late td{background:#3a2422}
.ok-text{color:#1f7a4d}html[data-theme=dark] .ok-text{color:#7fe0b0}
.invoice-saved{background:#e7f5ec;border:1px solid #9fd3b2;border-radius:8px;padding:8px 12px}html[data-theme=dark] .invoice-saved{background:#16352a;border-color:#2d6b51}
/* Typed dates (invoice form) */
.typed-date{display:flex;gap:4px;align-items:center;position:relative}.typed-date input:not([type=date]){width:11ch;flex:1}
.typed-date-pick{padding:6px 8px;line-height:1}.typed-date-native{position:absolute;left:0;bottom:0;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0}
.typed-date input.invalid{border-color:#c0392b;outline-color:#c0392b}
/* Distribuição em grelha: photo dot before the name (tap to enlarge) */
.grid-photo{float:left;width:22px;height:22px;border-radius:50%;object-fit:cover;margin:1px 7px 0 0;border:1px solid #a9b9c4;cursor:zoom-in}
.grid-photo.empty{background:#dbe4ea;cursor:default}
/* Inactive people in the distribution: lighter, dark-grey text */
.person-inactive button,.person-inactive .person,.person-inactive small{color:#6b7780!important}
.grid-name.person-inactive{opacity:.75}
html[data-theme=dark] .person-inactive button,html[data-theme=dark] .person-inactive .person,html[data-theme=dark] .person-inactive small{color:#8a979f!important}
.app-brand img{border-radius:50%!important}
/* Distribution grid: stronger line where Sundays / holidays are not shown */
.allocation-grid .grid-break{border-left:4px solid #143b53!important}
html[data-theme=dark] .allocation-grid .grid-break{border-left-color:#5fd0c6!important}
.grid-rest-toggle{display:inline-flex;align-items:center;gap:6px;margin:6px 12px 6px 0}
.status-switch{display:inline-flex;border:1px solid var(--line);border-radius:12px;overflow:hidden}.status-switch button{border:0;border-radius:0;min-height:40px}.status-switch button[aria-pressed=true]{background:#e7f5ee;color:#198754}
html[data-theme=dark] .status-switch button[aria-pressed=true]{background:rgba(47,163,133,.16);color:#5fd0ac}
.icon-button{min-width:44px;padding:8px 10px;display:inline-flex;align-items:center;justify-content:center}
.allocation-grid td.batch-on{box-shadow:inset 0 0 0 3px #087f73}.allocation-grid td.batch-on button{font-weight:700}
/* Visão geral: two alert buttons (people / works and invoicing) */
.alert-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.alert-group{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:2px 14px;text-align:left;padding:14px 16px;min-height:76px}
.alert-group strong{grid-row:span 2;font-size:1.9rem;line-height:1;color:#c0492f}
.alert-group span{font-weight:600}.alert-group small{color:var(--dn-muted,#597183);font-weight:400}
@media (max-width:600px){.alert-groups{grid-template-columns:1fr}}
/* PDF dialog: tick + name, icon buttons */
.batch-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.batch-pick{display:flex;align-items:center;gap:10px;flex:1 1 240px;cursor:pointer}.batch-pick span{display:flex;flex-direction:column}
.batch-tools{flex-wrap:nowrap}.icon-button span{margin-left:6px}
.batch-bottom{justify-content:flex-end}
/* Distribution: all controls on one line with the date; smaller zoom buttons */
.grid-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:6px 0 10px}
.grid-bar .grid-nav{display:inline-flex;align-items:center;gap:6px;flex-wrap:nowrap}
.grid-bar .grid-find{flex:1 1 200px;display:flex}.grid-bar .grid-find input{width:100%;max-width:340px}
#grid-count{margin:8px 0 0}
.grid-zoom-controls{padding:3px;gap:4px}
.grid-zoom-controls button{font-size:16px;min-width:34px;min-height:34px;padding:2px 6px}
.grid-zoom-controls output{font-size:11px}
/* Date fields: just the width they need (no big gap between the date and the calendar symbol) */
input[type=date]{width:auto;min-width:9.5em;max-width:100%}
.grid-bar .grid-nav{flex-wrap:wrap;max-width:100%}
.grid-bar .grid-nav input[type=date]{width:10.5em;padding-right:6px}
@media (max-width:700px){.grid-bar{gap:6px}.grid-bar .grid-nav{width:100%}.grid-bar .grid-nav select{flex:1 1 auto;min-width:0}.grid-bar .grid-find{flex:1 1 100%}.grid-bar .grid-find input{max-width:none}}
.toolbar input[type=date]{flex:0 0 auto;width:9.5em}
/* Armazém inside the app (armazem.html?embed=1). */
.wh-frame{display:block;width:100%;height:calc(100dvh - 150px);min-height:520px;border:0;border-radius:14px;background:transparent}
@media (max-width:980px){.wh-frame{height:calc(100dvh - 210px)}}
/* Ordenados: name and attendance stay visible while the months scroll sideways. */
.pay-table .pay-att-col{position:sticky;left:var(--pay-name-w,280px);z-index:2;box-shadow:inset -1px 0 var(--line),6px 0 8px -6px #0003}.pay-table thead .pay-att-col{z-index:4}.pay-table .pay-name{box-shadow:inset -1px 0 var(--line)}.pay-group th>span{position:sticky;left:10px}
@media(max-width:600px){.pay-table .pay-name{min-width:120px;max-width:130px;width:130px}.pay-table .pay-att-col .pay-att{min-width:150px;max-width:170px}.pay-table .pay-att-col{white-space:normal}}
/* Inactive people still shown in the grid: whole row in grey. */
.allocation-grid tr.grid-inactive td,.allocation-grid tr.grid-inactive td button,.allocation-grid tr.grid-inactive td small{color:#8a949c!important}
.allocation-grid tr.grid-inactive .grid-name strong,.allocation-grid tr.grid-inactive .grid-name button{font-weight:500!important}
html[data-theme=dark] .allocation-grid tr.grid-inactive td,html[data-theme=dark] .allocation-grid tr.grid-inactive td button{color:#7d8a92!important}
.new-start{border:1px solid var(--line);border-radius:12px;padding:10px 14px;margin:12px 0}.new-start legend{font-weight:650;padding:0 6px}
/* Work page: back, name and tabs fixed under the app bar while scrolling. */
.work-head{position:sticky;top:var(--header-height,64px);z-index:30;background:var(--page,#f5f4ef);padding:10px 0 8px;margin:-10px 0 8px;box-shadow:0 8px 10px -10px #0003}
.work-head .top{margin:10px 0!important}.work-head .tabs{margin:0}
html[data-design=novo] .work-head{background:var(--dn-bg,#f5f4ef)}html[data-design=novo][data-theme=dark] .work-head{background:#0f1413}
@media (max-width:980px){.work-head{top:var(--header-height,56px)}.work-head .tabs{overflow-x:auto;flex-wrap:nowrap}}
@media (max-width:700px){.work-head{padding:6px 0 4px}.work-head h1{font-size:1.25rem;margin:0}.work-head .top{margin:6px 0!important}.work-head #back-works{min-height:36px;padding:4px 10px}}
