/* Module navigation and personnel calendars inherit the selected GANZA palette. */
.module-toggle{width:100%;text-align:left;justify-content:flex-start;margin-bottom:8px;flex-shrink:0;cursor:pointer}
a.module-toggle{text-decoration:none}
.module-toggle[aria-expanded="true"]{border-color:var(--scheme-accent,var(--green));background:color-mix(in srgb,var(--scheme-accent,var(--green)) 6%,var(--brand-panel,var(--panel)))}
.module-nav{margin-bottom:15px}.module-nav .nav-caption{margin-top:14px;margin-bottom:8px}
.module-toggle .workspace-chevron{margin-left:auto}
.sidebar{overflow-y:auto;overflow-x:clip}.sidebar-collapse{position:fixed;left:calc(var(--sidebar) - 14px);right:auto}
:root.sidebar-collapsed .sidebar .module-toggle{display:flex;width:43px;height:38px;padding:4px;justify-content:center;border:0;background:none}
:root.sidebar-collapsed .sidebar .module-toggle>div,:root.sidebar-collapsed .sidebar .module-toggle>.workspace-chevron{display:none}
:root.sidebar-collapsed .module-nav{margin-bottom:14px}
:root body[data-module="personnel"] .topbar{grid-template-columns:minmax(0,1fr) max-content;grid-template-areas:"crumb controls"}
.person-actions,.person-period,.person-filters{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.person-overview{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:20px}
.person-overview>div{padding:12px 16px;border:1px solid var(--scheme-line,var(--brand-line));border-radius:8px;background:var(--scheme-panel,var(--panel))}
.person-overview span{display:block;font-size:11px;color:var(--muted)}.person-overview strong{font-size:24px;line-height:1.5;color:var(--ink)}
.person-panel{border:1px solid var(--scheme-line,var(--brand-line));border-radius:10px;background:var(--scheme-panel,var(--panel));overflow:hidden}
.person-toolbar{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 16px;border-bottom:1px solid var(--scheme-line,var(--brand-line))}
.person-toolbar .form-control,.person-period input{font-size:12px;height:34px;padding:5px 9px;background:var(--scheme-head,var(--panel-raised));color:var(--ink);border:1px solid var(--scheme-line,var(--brand-line));border-radius:6px}
.person-filters select{max-width:240px}.person-filters input{max-width:190px}.person-period select{width:96px}.person-period input{max-width:175px}
.person-legend{display:flex;gap:7px 16px;flex-wrap:wrap;padding:12px 16px;font-size:10px;color:var(--muted)}.person-legend>span{display:flex;align-items:center;gap:5px}.person-legend i{font-style:normal;padding:2px 4px;border-radius:3px;min-width:24px;text-align:center}
.person-table-note{font-size:11px;color:var(--muted);padding:0 16px 12px;line-height:1.6}
.person-scroll{overflow:auto;max-height:calc(100vh - 330px);min-height:260px;overscroll-behavior:contain}
.person-table{border-collapse:separate;border-spacing:0;table-layout:fixed;width:max-content;min-width:100%;font-size:11px;color:var(--ink)}
.person-table th,.person-table td{height:36px;min-width:34px;width:34px;padding:2px;border-bottom:1px solid var(--scheme-line,var(--brand-line));border-right:1px solid var(--scheme-line,var(--brand-line));text-align:center;vertical-align:middle}
.person-table thead th{position:sticky;top:0;z-index:3;background:var(--scheme-head,var(--brand-panel));font-weight:600;height:43px}
.person-table thead small{display:block;font-size:9px;color:var(--muted);font-weight:400}
.person-table tr>th:first-child{position:sticky;left:0;z-index:2;width:235px;min-width:235px;text-align:left;padding:4px 10px;background:var(--scheme-panel,var(--brand-panel));box-shadow:1px 0 var(--scheme-line,var(--brand-line))}
.person-table thead tr>th:first-child{z-index:4;background:var(--scheme-head,var(--brand-panel))}
.person-table tr>th button{display:block;padding:0;width:100%;text-align:left;line-height:1.4}
.person-table tr>th strong{font-size:11px;font-weight:600;display:block}.person-table tr>th small{display:block;font-size:9px;color:var(--muted);font-weight:400}
.person-table .weekend{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 5%,var(--scheme-panel,var(--panel)))}
.person-table .today{box-shadow:inset 0 0 0 1px var(--scheme-accent,var(--green))}
.person-mark{width:29px;height:27px;font-size:11px;border-radius:4px;padding:0;font-weight:600;border:1px solid transparent}.person-mark:hover{border-color:var(--scheme-accent,var(--green))}
.person-mark:not([class*="color-"]){color:var(--muted);opacity:.4}.person-table .person-total{width:57px;min-width:57px;font-variant-numeric:tabular-nums;font-weight:600}
.vacation-table td,.vacation-table thead th{width:128px;min-width:128px}.vacation-table tr>th:first-child{width:235px;min-width:235px}
.person-vacation{display:block;font-size:10px;line-height:1.5;padding:5px;border-radius:4px;margin:3px 0;width:100%;text-align:left;white-space:normal}.person-vacation small{display:block;font-size:9px}
.person-unresolved td{text-align:left;padding:8px 12px;white-space:normal;color:var(--muted);font-size:11px;background:color-mix(in srgb,#f2ad64 10%,var(--scheme-panel,var(--panel)))}
.person-footer{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 16px;color:var(--muted);font-size:10px;border-top:1px solid var(--scheme-line,var(--brand-line))}
.person-import{margin-top:18px;border:1px solid var(--scheme-line,var(--brand-line));padding:12px 16px;border-radius:8px;font-size:12px;color:var(--muted)}.person-import summary{cursor:pointer;color:var(--ink)}.person-import p{margin:12px 0}.person-import ul{line-height:1.8;padding-left:20px}.person-import small{font-size:10px}
.person-conflict{padding:16px;margin-top:12px;border:1px solid #e0a660;border-radius:8px;background:var(--panel)}.person-conflict p{margin-bottom:12px}
@media(max-width:800px) and (min-width:561px){:root .sidebar .module-toggle{display:flex;justify-content:center;padding:4px;border:0;background:none;height:38px}.module-toggle>div,.module-toggle>.workspace-chevron{display:none}.module-nav{margin-bottom:10px}}
@media(max-width:700px){.person-overview{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.person-overview>div{padding:8px 12px}.person-actions .button{font-size:11px}.person-scroll{max-height:65vh}.person-table tr>th:first-child{width:180px;min-width:180px}.person-table tr>th small{font-size:8px}.person-filters select,.person-filters input{max-width:100%}}
@media(max-width:560px){.sidebar{height:auto;min-height:58px;padding:8px 12px;gap:6px;flex-wrap:wrap}.sidebar .brand{flex:1}.sidebar .module-toggle{display:flex;width:36px;height:34px;margin:0;padding:3px;justify-content:center;border:0;background:none;order:1}.sidebar .module-toggle>div,.sidebar .module-toggle>.workspace-chevron{display:none}.sidebar .module-toggle .workspace-icon{width:28px;height:28px}.module-nav{order:2;margin:0}.module-nav .nav-caption{display:none}.sidebar .module-nav nav{display:flex}.module-nav .nav-item{width:32px}body[data-module="personnel"] .page-heading{display:block}.person-actions{margin-top:12px}}
@container planner (max-width:460px){:root body[data-module="personnel"] .topbar{grid-template-columns:minmax(0,1fr);grid-template-areas:"crumb" "controls"}}
@media print{.person-actions,.person-toolbar,.person-import{display:none}.person-scroll{max-height:none;overflow:visible}.person-table th,.person-table td{position:static!important}.person-panel{overflow:visible}}

/* A single-screen personnel workspace; only the grid scrolls on small displays. */
body[data-module="personnel"] .app-shell{height:100dvh;display:flex;flex-direction:column;min-height:0}
:root body[data-module="personnel"] .topbar{height:44px;min-height:44px;padding-block:4px;flex-shrink:0}
body[data-module="personnel"] main{flex:1;min-width:0;min-height:0;width:100%;overflow:hidden;padding:6px 14px}
#personnelPage{height:100%;min-height:0}
#personnelRoot{height:100%;min-height:0;display:flex;flex-direction:column;gap:5px;position:relative}
#personnelRoot>.page-heading{display:flex;align-items:center;gap:8px;margin:0;flex-shrink:0;min-height:28px}
#personnelRoot .page-heading .eyebrow,#personSubtitle{display:none}
#personnelRoot .page-heading h1{font-size:18px;line-height:1.2;margin:0}
#personnelRoot .person-actions{margin:0;gap:6px;flex-wrap:nowrap}
#personnelRoot .person-actions .button{min-height:26px;padding:4px 8px;font-size:10px;gap:4px}
#personnelRoot .person-actions .button svg{width:12px;height:12px}
.person-overview{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin:0;flex-shrink:0;min-height:18px}
.person-overview>div{display:flex;align-items:baseline;gap:5px;padding:0;border:0;border-radius:0;background:none}
.person-overview span{font-size:10px;line-height:1.2}.person-overview strong{font-size:13px;line-height:1.2}
.person-panel{flex:1;min-height:0;display:flex;flex-direction:column;border-radius:6px}
.person-toolbar{padding:4px 8px;gap:5px;flex-shrink:0;min-height:32px}
.person-period,.person-filters{gap:5px;flex-wrap:nowrap}
.person-toolbar .form-control,.person-period input{height:25px;padding:2px 6px;font-size:10px;border-radius:4px}
.person-period .icon-button,.person-filters .icon-button{width:24px;height:24px;min-height:24px;padding:4px}
.person-toolbar .icon-button svg{width:14px;height:14px}
.person-filters select{max-width:220px}.person-filters input{max-width:160px}
.person-period input{max-width:150px}.person-period select{width:82px}
.person-help{position:relative;font-size:10px;line-height:1.5;color:var(--muted)}
.person-help summary{cursor:pointer;padding:4px 6px;white-space:nowrap}
.person-help-body{position:absolute;top:100%;right:0;width:min(580px,85vw);max-height:65vh;overflow:auto;background:var(--scheme-panel,var(--brand-panel));border:1px solid var(--scheme-line,var(--brand-line));border-radius:7px;box-shadow:0 8px 25px #0003;z-index:30}
.person-scroll{flex:1;min-height:0;max-height:none;overflow:auto;--person-row:16px}
.person-table{width:100%;min-width:720px}
.person-table th,.person-table td{min-width:0;width:auto;padding:0;height:var(--person-row);line-height:1;font-size:10px}
.person-table tbody tr{height:var(--person-row)}
.person-table thead th{height:26px;font-size:10px;line-height:1.1}
.person-table thead small{font-size:8px;line-height:1.1}
.person-table tr>th:first-child{width:154px;min-width:154px;padding:0 7px}
.person-table tbody tr>th button{line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.person-table tbody tr>th strong{font-size:10px;line-height:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.person-table tbody tr>th small{display:none}
.person-mark{width:100%;height:calc(var(--person-row) - 1px);min-height:0;font-size:10px;line-height:1;padding:0;border-radius:2px}
.person-table .person-total{width:40px;min-width:40px;font-size:9px;line-height:1;overflow-wrap:anywhere}
.vacation-table{min-width:800px}
.vacation-table td,.vacation-table thead th{width:auto;min-width:0}
.vacation-table tr>th:first-child{width:154px;min-width:154px}
.vacation-table .person-total{width:51px;min-width:51px}
.person-vacation{height:calc(var(--person-row) - 1px);min-height:0;display:block;width:100%;padding:0 2px;margin:0;border-radius:2px;font-size:9px;line-height:1;white-space:nowrap;overflow:hidden}
.person-footer{padding:3px 8px;gap:8px;font-size:9px;line-height:1.2;min-height:17px;flex-shrink:0}
.person-import{position:relative;flex-shrink:0;margin:0;padding:0;border:0;font-size:10px;line-height:1.4}
.person-import summary{padding:1px 0}
.person-import[open]>div{position:absolute;bottom:22px;left:0;right:0;max-height:55vh;overflow:auto;padding:8px 14px;border:1px solid var(--scheme-line,var(--brand-line));border-radius:6px;background:var(--scheme-panel,var(--brand-panel));box-shadow:0 8px 25px #0003;z-index:30}
.person-period-options{display:flex;flex-direction:column;gap:10px}
@media(max-width:800px){body[data-module="personnel"] main{padding:5px 8px}.person-overview{gap:5px 12px}.person-overview span{font-size:9px}.person-filters select{max-width:170px}.person-filters input{max-width:130px}}
@media(max-width:560px){body[data-module="personnel"] .app-shell{height:calc(100dvh - 58px)}:root body[data-module="personnel"] .topbar{height:auto;min-height:44px}#personnelRoot .page-heading h1{font-size:15px}#personnelRoot .person-actions .button{font-size:0;width:26px;padding:4px}#personnelRoot .person-actions .button svg{width:14px;height:14px}.person-overview{gap:3px 9px}.person-overview strong{font-size:11px}.person-overview span{font-size:8px}.person-toolbar{flex-wrap:wrap}.person-filters{width:100%}.person-filters select,.person-filters input{min-width:0;max-width:none;flex:1}.person-footer #personSource{display:none}}
@media print{body[data-module="personnel"] .app-shell,#personnelPage,#personnelRoot{height:auto;display:block}body[data-module="personnel"] main{overflow:visible}.person-panel{display:block}.person-scroll{overflow:visible}.person-help{display:none}.person-mark,.person-vacation{height:16px}}
body[data-module="personnel"] .app-footer{display:none}
.person-toolbar .form-control,.person-period input{min-height:25px}
@media(max-height:800px){.person-overview{display:none}:root body[data-module="personnel"] .topbar{height:34px;min-height:34px}body[data-module="personnel"] main{padding-block:4px}}

/* Department bands follow the current roster, initialized from November 2026. */
.person-table .person-department th{position:static;width:auto;min-width:0;height:var(--person-row);padding:0 7px;text-align:left;background:color-mix(in srgb,var(--scheme-accent,var(--green)) 14%,var(--scheme-head,var(--brand-panel)));color:var(--ink);font-size:9px;font-weight:650;line-height:1;box-shadow:none}
.person-department small{display:inline-block!important;margin-left:7px;font-size:8px!important;font-weight:400;opacity:.65}
.person-department em{font-size:8px;font-weight:400;font-style:normal;color:var(--muted);margin-left:14px;opacity:.7}
#personnelRoot[data-view="staff-roster"] .person-period{display:none}
#personRosterSource{font-size:11px;color:var(--muted);align-self:center}
.person-roster-table{min-width:620px}
.person-roster-table thead tr>th:first-child{width:32px;min-width:32px;padding:0 4px;font-size:8px}
.person-roster-table thead th:nth-child(2){width:43%;text-align:left;padding-left:7px}
.person-roster-table thead th:nth-child(3){text-align:left;padding-left:7px}
.person-roster-table thead th:last-child{width:58px}
.person-roster-table td{padding:0 7px;text-align:left;font-size:10px}
.person-roster-table td:first-child{width:32px;padding:0 4px;text-align:center}
.person-roster-table td:last-child{width:58px;text-align:center}
.person-roster-table td>button[data-person-edit-employee]{display:block;max-width:100%;padding:0;font-size:10px;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left}
.person-drag-handle,.person-edit-button{padding:0;width:22px;height:calc(var(--person-row) - 1px);min-height:0;line-height:1}
.person-drag-handle{cursor:grab;touch-action:none}.person-drag-handle svg,.person-edit-button svg{width:11px;height:11px}
.person-roster-table .roster-dragging{opacity:.35}
.person-roster-table .roster-drop{outline:2px solid var(--scheme-accent,var(--green));outline-offset:-2px;background:color-mix(in srgb,var(--scheme-accent,var(--green)) 16%,var(--panel))}
body.person-roster-dragging,body.person-roster-dragging *{cursor:grabbing!important;user-select:none!important}
.person-activate{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:12px}
.person-archive[open]>div{max-height:50vh}
.person-roster-table td>.person-drag-handle,.person-roster-table td>.person-edit-button{display:flex;margin:0 auto;vertical-align:middle}
.person-department em{display:none}body.person-roster-dragging .person-department em{display:inline}

:root body[data-module="personnel"] .topbar{height:auto;grid-template-columns:minmax(0,1fr) max-content max-content;grid-template-areas:"crumb action controls"}
@container planner (max-width:700px){:root body[data-module="personnel"] .topbar{grid-template-columns:minmax(0,1fr) max-content;grid-template-areas:"crumb action" "controls controls"}}
@container planner (max-width:460px){:root body[data-module="personnel"] .topbar{grid-template-columns:minmax(0,1fr);grid-template-areas:"crumb" "action" "controls"}}
[data-person-cell].person-cell-selected{position:relative;z-index:1;box-shadow:inset 0 0 0 2px var(--scheme-accent,#ff913d);outline:1px solid var(--scheme-accent,#ff913d);outline-offset:-1px;opacity:1}
.person-selection{font-size:9px;white-space:nowrap;color:var(--scheme-accent,var(--green));font-weight:600}
.person-cell-menu{width:300px;max-width:calc(100vw - 16px)}
.person-cell-menu button{font-size:11px;padding:6px 8px;line-height:1.4}
.person-menu-code{display:inline-block;width:29px;padding:2px 3px;margin-right:8px;border-radius:3px;text-align:center;font-style:normal;font-size:10px}

.person-cells-dragging,.person-cells-dragging *{user-select:none!important;cursor:cell!important}
body[data-edit-mode="edit"] #personnelRoot [data-person-cell]{touch-action:none;user-select:none;cursor:cell}

.person-vac-empty{color:var(--muted);opacity:.5;text-align:center}
.person-roster-table [data-person-cell]{height:var(--person-row)}
.person-roster-table [data-person-cell].person-cell-selected{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 16%,var(--scheme-panel,var(--panel)))}
.person-batch-months{display:flex;flex-direction:column;gap:10px;max-height:50vh;overflow:auto}
.person-batch-month{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}.person-batch-month strong{grid-column:1/-1;font-size:12px}.person-batch-month label{font-size:11px;color:var(--muted)}.person-batch-month input{width:100%;min-width:0}

.person-roster-table td>button[data-person-cell]{display:block;width:100%;height:calc(var(--person-row) - 1px);padding:0;font-size:10px;line-height:1;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Stable module switch above a single contextual menu. */
.module-switch{display:flex;flex-direction:column;gap:8px;flex-shrink:0;position:relative;z-index:3}
.module-switch .module-toggle{margin:0;width:100%;min-height:58px}
.module-switch .workspace-chevron{display:none}
.module-menus{flex-shrink:0;min-height:159px;margin-top:4px}.module-menus .module-nav{margin:0}.module-menus .nav-caption{margin:12px 0 8px}.module-menus nav{display:flex;flex-direction:column;gap:3px}
.common-nav{padding-top:9px;border-top:1px solid var(--scheme-line,var(--brand-line));flex-shrink:0}.common-nav .nav-item{width:100%}
.journal-module{display:inline-block;margin-left:10px;padding:3px 7px;border-radius:4px;background:var(--scheme-head,var(--panel));font-size:10px;color:var(--muted)}
:root.sidebar-collapsed .module-switch{gap:6px}:root.sidebar-collapsed .module-switch .module-toggle{min-height:38px;margin:0}:root.sidebar-collapsed .module-menus{min-height:145px}
@media(max-width:800px) and (min-width:561px){.module-switch .module-toggle{min-height:38px}.module-menus{min-height:145px}}
@media(max-width:560px){.sidebar .module-switch{display:flex;flex-direction:row;order:1;gap:5px}.sidebar .module-switch .module-toggle{width:36px;min-height:34px}.sidebar .module-menus{order:2;min-height:0;margin:0}.sidebar .module-menus nav{flex-direction:row;gap:3px}.sidebar .common-nav{order:2;padding:0;border:0}.sidebar .common-nav .nav-item{width:32px;font-size:0;padding:0}.sidebar .common-nav .nav-item svg{width:17px;height:17px}}

body[data-edit-mode="view"] :is([data-journal-person-undo],[data-journal-person-redo]){display:none}

/* Department cards replace the roster's technical columns. */
#personnelRoot[data-view="staff-roster"] .person-panel{background:transparent;border:0;overflow:visible}
#personnelRoot[data-view="staff-roster"] .person-toolbar{padding:6px 0 10px;border:0}
#personnelRoot[data-view="staff-roster"] #personRosterSource{font-size:10px;opacity:.7}
#personnelRoot[data-view="staff-roster"] .person-scroll{padding:2px 4px 12px 0}
.roster-cards{columns:3 240px;column-gap:12px}
.roster-department{display:inline-block;width:100%;vertical-align:top;break-inside:avoid;margin:0 0 12px;padding:11px;border:1px solid var(--scheme-line,var(--brand-line));border-radius:12px;background:var(--scheme-panel,var(--panel));transition:border-color calc(.15s / var(--ui-motion-speed,.5))}
.roster-department>header{display:flex;align-items:flex-start;gap:8px;padding:2px 2px 10px}
.roster-department h2{flex:1;min-width:0;margin:0;color:var(--ink);font-size:12px;font-weight:650;line-height:1.45}
.roster-dept-number{color:var(--scheme-accent,var(--green));font-size:10px;line-height:18px;font-variant-numeric:tabular-nums}
.roster-dept-count{display:grid;place-items:center;min-width:21px;height:20px;padding:0 5px;border-radius:6px;background:var(--scheme-head,var(--bg));color:var(--muted);font-size:10px}
.roster-people{display:flex;flex-direction:column;gap:2px}
.roster-person{display:flex;align-items:center;gap:9px;width:100%;padding:4px 6px;min-height:32px;border:1px solid transparent;border-radius:7px;text-align:left;color:var(--ink);background:transparent}
.roster-person:hover{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 7%,transparent)}
.roster-avatar{display:grid;place-items:center;flex-shrink:0;width:23px;height:23px;border-radius:7px;background:var(--scheme-head,var(--bg));color:var(--muted);font-size:9px;letter-spacing:-.5px}
body[data-edit-mode="edit"] .roster-avatar{cursor:grab;touch-action:none}
.roster-person-name{min-width:0;flex:1;font-size:12px;font-weight:500;line-height:1.4;overflow-wrap:anywhere}
.roster-empty{display:flex;flex-direction:column;gap:5px;min-height:64px;justify-content:center;align-items:center;border:1px dashed var(--scheme-line,var(--brand-line));border-radius:8px;color:var(--muted);font-size:12px;text-align:center;padding:12px}.roster-empty span{font-size:10px;line-height:1.5}
.roster-person.person-cell-selected{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 12%,var(--scheme-panel,var(--panel)));border-radius:7px}
.roster-department.roster-drop,.roster-person.roster-drop{outline:2px solid var(--scheme-accent,var(--green));outline-offset:-2px;background:color-mix(in srgb,var(--scheme-accent,var(--green)) 10%,var(--scheme-panel,var(--panel)))}
.roster-person.roster-dragging{opacity:.35}
@media(max-width:560px){.roster-cards{columns:1}.roster-department{padding:10px}.roster-person{min-height:37px}.roster-person-name{font-size:13px}}
@media(prefers-reduced-motion:reduce){.roster-department{transition:none}}
@media print{.roster-cards{columns:3}.roster-department{break-inside:avoid}}
body[data-edit-mode="view"] [data-person-action="department"]{display:none!important}
body[data-edit-mode="view"] .roster-avatar[data-person-drag]{display:grid!important}
@media(min-width:561px){.roster-person{min-height:28px;padding-block:2px}.roster-people{gap:1px}.roster-avatar{width:21px;height:21px}.roster-department{padding:10px;margin-bottom:10px}.roster-department>header{padding-bottom:8px}}

/* Clear roster rows with a stable birthday column. */
.roster-columns{display:flex;align-items:center;gap:9px;padding:0 6px 7px;color:var(--muted);font-size:9px;line-height:1.3}
.roster-column-name{flex:1;min-width:0}.roster-birth-heading,.roster-birth{width:80px;flex-shrink:0;text-align:right;font-variant-numeric:tabular-nums}
.roster-birth{font-size:10px;color:var(--muted);line-height:1.4}
.roster-person{border-radius:4px;border-bottom-color:var(--scheme-line,var(--brand-line));min-height:30px}
.roster-person:nth-child(even){background:color-mix(in srgb,var(--scheme-head,var(--bg)) 45%,transparent)}
.roster-person:hover{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 9%,transparent)}
.roster-person.person-cell-selected{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 15%,var(--scheme-panel,var(--panel)))}
.roster-people{gap:0}.roster-columns .roster-column-name{padding-left:30px}
.person-employee-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.5fr);gap:14px}.person-employee-fields input{width:100%;min-width:0}
@media(max-width:560px){.person-employee-fields{grid-template-columns:1fr;gap:0}.roster-person{min-height:37px}.roster-birth-heading,.roster-birth{width:82px}}
@media(min-width:561px){.roster-person{min-height:27px;padding-block:1px}.roster-department{padding:8px;margin-bottom:8px}.roster-department>header{padding-bottom:6px}.roster-columns{padding-bottom:5px}}

.roster-person.roster-insert-before{box-shadow:inset 0 2px var(--scheme-accent,var(--green));border-top-color:var(--scheme-accent,var(--green))}
.roster-person.roster-insert-after{box-shadow:inset 0 -2px var(--scheme-accent,var(--green));border-bottom-color:var(--scheme-accent,var(--green))}

/* The same brigade accents in the roster and the shift schedule. */
[data-brigade="A"]{--crew-color:#70b79d;--crew-wash:#70b79d15}
[data-brigade="B"]{--crew-color:#86aedd;--crew-wash:#86aedd15}
[data-brigade="C"]{--crew-color:#b19ad2;--crew-wash:#b19ad215}
[data-brigade="D"]{--crew-color:#d2b078;--crew-wash:#d2b07815}
.roster-brigade-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0 3px;padding:6px 8px;border-radius:5px;background:var(--crew-wash);border-left:3px solid var(--crew-color);color:var(--ink)}
.roster-brigade-heading strong{font-size:10px;font-weight:650}.roster-brigade-heading span{font-size:9px;color:var(--muted)}
.roster-person[data-brigade]{border-left:2px solid var(--crew-color);background:var(--crew-wash)}
.roster-person[data-brigade].person-cell-selected{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 15%,var(--scheme-panel,var(--panel)))}
.person-table .person-brigade-band th{position:static;height:var(--person-row);padding:0 9px;border-left:3px solid var(--crew-color);background:color-mix(in srgb,var(--crew-color) 15%,var(--scheme-panel,var(--panel)));color:var(--ink);font-size:9px;font-weight:600;text-align:left;box-shadow:none;line-height:1}
.person-brigade-band small{display:inline!important;margin-left:8px;font-size:8px;font-weight:400;color:var(--muted)}
.person-table .person-brigade-row>th:first-child{border-left:3px solid var(--crew-color);background:color-mix(in srgb,var(--crew-color) 7%,var(--scheme-panel,var(--panel)))}

.roster-brigade-zone{min-height:24px;border-radius:6px}
.roster-brigade-zone.roster-drop{outline:2px dashed var(--scheme-accent,var(--green));outline-offset:2px;background:color-mix(in srgb,var(--scheme-accent,var(--green)) 7%,transparent)}
.roster-brigade-empty{padding:6px 8px 9px;color:var(--muted);font-size:10px;line-height:1.4}
.roster-brigade-heading:not([data-brigade]){border-left-color:var(--scheme-line,var(--brand-line));background:var(--scheme-head,var(--bg))}
body[data-edit-mode="view"] .roster-unassigned-empty{display:none}
body[data-edit-mode="view"] .roster-brigade-empty{display:none}

.person-brigade-band[data-brigade=""]{--crew-color:var(--scheme-line,var(--brand-line));--crew-wash:transparent}

/* Soft department navigation in the vacation calendar; vacation marks keep their meaning. */
.person-table.vacation-table .person-department th{border-left:4px solid var(--department-color);background:color-mix(in srgb,var(--department-color) 22%,transparent);font-weight:700}
.person-table.vacation-table .person-department small{opacity:1;color:var(--muted)}
.person-table.vacation-table .vacation-person-row>th:first-child{border-left:3px solid var(--department-color);background:color-mix(in srgb,var(--department-color) 7%,transparent)}
.person-table.vacation-table .vacation-person-row.person-brigade-row>th:first-child{border-left-color:var(--crew-color);background:color-mix(in srgb,var(--crew-color) 10%,transparent)}
.person-table.vacation-table .person-brigade-band th{background:color-mix(in srgb,var(--crew-color) 18%,transparent)}

/* Personnel shift and absence codes share the same labels in every view. */
:root{--person-green-bg:#344e43;--person-green-text:#d8eee0;--person-amber-bg:#62553c;--person-amber-text:#f6e5c7;--person-blue-bg:#384d69;--person-blue-text:#e0ebfc;--person-rose-bg:#61434f;--person-rose-text:#f3dce4;--person-purple-bg:#514361;--person-purple-text:#eddefa;--person-slate-bg:#434c59;--person-slate-text:#e2e8ef;--person-teal-bg:#33534f;--person-teal-text:#d6eeea}
:root :is(#personnelRoot,#personCellMenu,#personExtendPreview) .color-green{--person-fill:var(--person-green-bg);--person-label:var(--person-green-text)}
:root :is(#personnelRoot,#personCellMenu,#personExtendPreview) .color-amber{--person-fill:var(--person-amber-bg);--person-label:var(--person-amber-text)}
:root :is(#personnelRoot,#personCellMenu,#personExtendPreview) .color-blue{--person-fill:var(--person-blue-bg);--person-label:var(--person-blue-text)}
:root :is(#personnelRoot,#personCellMenu,#personExtendPreview) .color-rose{--person-fill:var(--person-rose-bg);--person-label:var(--person-rose-text)}
:root :is(#personnelRoot,#personCellMenu,#personExtendPreview) .color-purple{--person-fill:var(--person-purple-bg);--person-label:var(--person-purple-text)}
:root :is(#personnelRoot,#personCellMenu,#personExtendPreview) .color-slate{--person-fill:var(--person-slate-bg);--person-label:var(--person-slate-text)}
:root :is(#personnelRoot,#personCellMenu,#personExtendPreview) .color-teal{--person-fill:var(--person-teal-bg);--person-label:var(--person-teal-text)}
:root :is(#personnelRoot,#personCellMenu,#personExtendPreview) :is(.person-mark,.person-vacation,.person-legend i,.person-menu-code)[class*="color-"]{background:var(--person-fill);color:var(--person-label);border-color:transparent}
:root #personnelRoot .person-mark[class*="color-"]:hover{border-color:var(--scheme-accent,var(--green))}


@media screen {
  :is(#personnelRoot, #personCellMenu, #personExtendPreview) {
    --person-green-bg: var(--production-green-bg, #35bc72);
    --person-green-text: var(--production-green-text, #000);
    --person-amber-bg: var(--production-amber-bg, #edaa38);
    --person-amber-text: var(--production-amber-text, #000);
    --person-blue-bg: var(--production-blue-bg, #468df2);
    --person-blue-text: var(--production-blue-text, #000);
    --person-rose-bg: var(--production-rose-bg, #e477b2);
    --person-rose-text: var(--production-rose-text, #000);
    --person-purple-bg: var(--production-purple-bg, #a176ec);
    --person-purple-text: var(--production-purple-text, #000);
    --person-slate-bg: var(--production-slate-bg, #91abcd);
    --person-slate-text: var(--production-slate-text, #000);
    --person-teal-bg: var(--production-teal-bg, #1eb5b0);
    --person-teal-text: var(--production-teal-text, #000);
  }
  #personnelRoot .person-legend i,
  #personnelRoot :is(.roster-shift,.roster-group-summary) .person-shift-code,
  #personCellMenu .person-menu-code {
    --person-code-size: 24px;
    --person-code-font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: var(--person-code-size);
    min-width: var(--person-code-size);
    height: var(--person-code-size);
    aspect-ratio: 1;
    padding: 0;
    flex: 0 0 var(--person-code-size);
    border: 0;
    border-radius: 50%;
    font: normal 600 var(--person-code-font-size)/1 var(--font);
    font-synthesis: none;
    letter-spacing: 0;
    text-indent: 0;
    text-align: center;
    white-space: nowrap;
  }
  #personnelRoot :is(.roster-shift,.roster-group-summary) .person-shift-code {
    background: var(--person-fill, var(--person-slate-bg));
    color: var(--person-label, var(--person-slate-text));
  }
  #personnelRoot .person-table thead th[aria-current="date"] {
    box-shadow: inset 0 -3px var(--scheme-accent, #ff913d);
  }
  #personnelRoot [data-person-cell].person-cell-selected[class*="color-"] {
    box-shadow: inset 0 0 0 2px #131d29, inset 0 0 0 3px #fff;
  }
  #personExtendPreview .person-mark[class*="color-"] { opacity: 1; }
}

body[data-edit-mode="view"] [data-person-action="extend"]{display:none!important}
.modal:has(#personExtendForm){width:min(1120px,calc(100vw - 30px));max-width:1120px}
.person-extend-fields{display:grid;grid-template-columns:minmax(180px,2fr) minmax(125px,1fr) minmax(125px,1fr);gap:12px}
.person-extend-fields label{min-width:0;font-size:12px}.person-extend-fields input,.person-extend-fields select{width:100%;margin-top:5px}
.person-extend-track{margin:16px 0 12px}.person-extend-track label{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:12px}.person-extend-track input{width:100%;margin:12px 0 0;accent-color:var(--scheme-accent,#ff913d);cursor:ew-resize}
.person-extend-template{display:flex;align-items:center;gap:12px;font-size:12px;margin-bottom:12px}.person-extend-template select{flex:1;min-width:0}
#personExtendStatus{font-size:12px;color:var(--muted);margin:12px 0}
.person-extend-preview{overflow:auto;max-height:40vh;border:1px solid var(--scheme-line,var(--brand-line));border-radius:6px;background:var(--scheme-panel,#131d2c)}
.person-extend-preview table{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:11px}
.person-extend-preview th,.person-extend-preview td{border-bottom:1px solid var(--scheme-line,var(--brand-line));border-right:1px solid var(--scheme-line,var(--brand-line));padding:2px;min-width:32px;text-align:center}
.person-extend-preview thead th{position:sticky;top:0;z-index:3;font-weight:500;background:var(--scheme-head,#263447)}
.person-extend-preview th:first-child{position:sticky;left:0;z-index:2;text-align:left;width:184px;min-width:184px;padding:6px;background:var(--scheme-panel,#182336)}
.person-extend-preview thead th:first-child{z-index:4}
.person-extend-preview th strong{display:block;margin-bottom:5px;font-size:11px}.person-extend-preview select{width:100%;height:27px;margin-top:4px;padding:2px 4px;font-size:11px}
.person-extend-preview .person-mark{display:grid;place-items:center;width:29px;height:25px;font-size:11px;opacity:.75}.person-extend-preview .person-extend-protected .person-mark{opacity:1;box-shadow:inset 0 0 0 1px var(--scheme-line,var(--brand-line))}
.person-extend-review th:first-child{box-shadow:inset 3px 0 #e9a35d}
@media(max-width:600px){.person-extend-fields{grid-template-columns:1fr 1fr}.person-extend-fields label:first-child{grid-column:1/-1}.person-extend-template{align-items:stretch;flex-direction:column;gap:5px}.person-extend-preview{max-height:34vh}}

/* Compact monthly continuation: one employee per row, optional controls folded away. */
.modal:has(#personExtendForm){width:min(1440px,calc(100vw - 28px));max-width:1440px;padding:20px 24px}
.person-extend-main{display:flex;align-items:center;gap:22px;margin-bottom:7px}.person-extend-main>label{display:flex;align-items:center;gap:10px;font-size:12px;flex:1;min-width:0}.person-extend-main select{flex:1;min-width:0;max-width:420px;height:32px;font-size:12px}
.person-extend-month{display:flex;flex-direction:column;gap:2px;font-size:12px;min-width:180px}.person-extend-month span{font-size:11px;color:var(--muted)}
.person-extend-settings{margin:5px 0;font-size:11px}.person-extend-settings summary{display:inline-block;cursor:pointer;color:var(--muted);padding:5px 0}.person-extend-settings summary::before{content:'▸ ';}.person-extend-settings[open] summary::before{content:'▾ ';}
.person-extend-settings .person-extend-fields{grid-template-columns:1fr 1fr;max-width:500px;gap:12px;margin-top:6px}.person-extend-settings .person-extend-fields input{height:30px;font-size:12px}.person-extend-settings .person-extend-track{margin:8px 0}.person-extend-settings .person-extend-template{margin:8px 0;max-width:600px}.person-extend-settings .person-extend-template select{height:30px;font-size:12px}
#personExtendStatus{font-size:11px;margin:6px 0 10px;line-height:1.5}
.person-extend-preview{max-height:calc(100dvh - 280px)}
.person-extend-settings[open]~.person-extend-preview{max-height:calc(100dvh - 445px)}
.person-extend-preview table{width:100%;min-width:max-content;font-size:11px}
.person-extend-preview th,.person-extend-preview td{height:24px;padding:1px;min-width:24px;width:24px}
.person-extend-preview th:first-child{width:160px;min-width:160px;max-width:160px;padding:1px 6px;white-space:nowrap}
.person-extend-preview th strong{margin:0;font-size:11px;line-height:20px;font-weight:500;overflow:hidden;text-overflow:ellipsis}
.person-extend-preview th strong small{display:inline-block;padding:0 4px;border-radius:3px;background:var(--crew-wash);color:var(--ink);border-left:2px solid var(--crew-color);font-size:10px;line-height:15px}
.person-extend-preview .person-extend-rule,.person-extend-preview thead th:nth-child(2){width:103px;min-width:103px}
.person-extend-preview .person-extend-phase,.person-extend-preview thead th:nth-child(3){width:56px;min-width:56px}
.person-extend-preview select{height:21px;min-height:0;margin:0;padding:0 3px;border-color:transparent;border-radius:3px;font-size:10px;background:transparent;color:var(--ink)}
.person-extend-preview select:focus,.person-extend-preview select:hover{background:var(--scheme-head,#263447)}
.person-extend-preview select option{background:var(--scheme-panel,#182336);color:var(--ink)}
.person-extend-preview .person-extend-phase span{font-size:10px;color:var(--muted)}
.person-extend-preview .person-mark{width:100%;height:20px;min-height:0;font-size:10px}
.person-extend-preview .person-extend-department th:first-child{position:static;width:auto;max-width:none;height:22px;padding:2px 6px;font-size:10px;color:var(--muted);background:var(--scheme-head,#263447)}
#personExtendForm .modal-footer{gap:8px;margin-top:12px;padding-top:12px}.person-extend-note{margin-right:auto;font-size:10px;color:var(--muted)}
@media(max-width:650px){.modal:has(#personExtendForm){padding:15px}.person-extend-main{align-items:stretch;flex-direction:column;gap:6px}.person-extend-main select{max-width:none}.person-extend-month{min-width:0;flex-direction:row;flex-wrap:wrap;gap:4px 9px}.person-extend-preview{max-height:calc(100dvh - 320px)}.person-extend-note{flex-basis:100%}.person-extend-preview select{height:24px}.person-extend-settings[open]~.person-extend-preview{max-height:30vh}}
/* Keep Apply visible while the employee list scrolls. */
.modal:has(#personExtendForm){display:flex;flex-direction:column;height:calc(100dvh - 40px);max-height:calc(100dvh - 40px);overflow:hidden}
.modal:has(#personExtendForm) #modalBody{display:flex;flex:1;min-height:0;min-width:0}
#personExtendForm{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}
#personExtendForm>.person-extend-preview,.person-extend-settings[open]~.person-extend-preview{flex:1;min-height:100px;max-height:none}
#personExtendForm>:not(.person-extend-preview){flex-shrink:0}
.person-extend-settings[open]{max-height:32vh;overflow:auto}

/* Local reading guide: one employee row, independent of editable cell selection. */
body[data-edit-mode="view"] .person-view-row{--row-halo:color-mix(in srgb,var(--scheme-accent,var(--green)) 42%,transparent);outline:1px solid var(--row-halo);outline-offset:-1px;box-shadow:0 0 9px 1px color-mix(in srgb,var(--scheme-accent,var(--green)) 18%,transparent)}
body[data-edit-mode="view"] .person-table .person-view-row>:is(th,td){position:relative}
body[data-edit-mode="view"] .person-table .person-view-row>:is(th,td)::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:3;background:color-mix(in srgb,var(--scheme-accent,var(--green)) 6%,transparent);box-shadow:inset 0 1px var(--row-halo),inset 0 -1px var(--row-halo)}
body[data-edit-mode="view"] .person-table .person-view-row>:first-child::after{border-left:1px solid var(--row-halo)}
body[data-edit-mode="view"] .person-table .person-view-row>:last-child::after{border-right:1px solid var(--row-halo)}
body[data-edit-mode="view"] .roster-person.person-view-row{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 7%,var(--scheme-panel,var(--panel)));border-radius:6px}

/* Approved reading scale: keep dense personnel grids legible instead of crushing rows. */
@media screen{
  #personnelRoot .person-scroll{--person-row:32px}
  #personnelRoot .person-table :is(th,td){font-size:11px}
  #personnelRoot .person-table thead th{height:32px}
  #personnelRoot .person-table thead small{font-size:9px}
  #personnelRoot .person-table tr>th:first-child{width:166px;min-width:166px}
  #personnelRoot .person-table tbody tr>th strong{font-size:11px}
  #personnelRoot .person-mark{font-size:11px}
  #personnelRoot .person-vacation{font-size:10px}
  #personnelRoot .person-table .person-total{font-size:10px;width:44px;min-width:44px}
  #personnelRoot .vacation-table{min-width:850px}
  #personnelRoot .vacation-table .person-total{width:57px;min-width:57px}
  #personnelRoot .person-table .person-brigade-band th{font-size:10px}
  #personnelRoot .person-brigade-band small{font-size:9px}
  #personnelRoot .roster-person{min-height:30px}
  #personnelRoot .roster-person-name,#personnelRoot .roster-department h2{font-size:13px}
  #personnelRoot .roster-birth,#personnelRoot .roster-columns{font-size:11px}
  #personnelRoot .roster-brigade-heading strong{font-size:11px}
  #personnelRoot .roster-brigade-heading span{font-size:10px}
  #personnelRoot .roster-avatar{width:23px;height:23px;font-size:10px}
  .person-extend-preview :is(th,td){height:26px;min-width:26px;width:26px}
  .person-extend-preview select,.person-extend-preview .person-mark{font-size:11px}
  .person-extend-preview .person-mark{height:22px}
  .person-extend-preview .person-extend-phase span,.person-extend-preview .person-extend-department th:first-child{font-size:11px}
}
@media screen and (max-width:560px){#personnelRoot .roster-person{min-height:37px}}

/* A separate, aligned workplace column inside the existing department lists. */
#personnelRoot .roster-cards{columns:2 460px;min-width:430px}
#personnelRoot .roster-person,#personnelRoot .roster-columns{display:grid;grid-template-columns:23px minmax(125px,1fr) minmax(100px,.8fr) 80px;gap:9px;align-items:center}
#personnelRoot .roster-person>.roster-avatar{grid-column:1}
#personnelRoot .roster-person>.roster-person-name{grid-column:2}
#personnelRoot .roster-person>.roster-workplace{grid-column:3}
#personnelRoot .roster-person>.roster-birth{grid-column:4}
#personnelRoot .roster-columns .roster-column-name{grid-column:1/3;padding-left:32px}
#personnelRoot .roster-workplace-heading{text-align:left}
#personnelRoot .roster-birth,#personnelRoot .roster-birth-heading{width:auto}
#personnelRoot .roster-workplace{display:flex;gap:3px;flex-wrap:wrap;min-width:0;padding-block:2px;text-align:left}
#personnelRoot .roster-workplace-tag{display:inline-block;max-width:100%;padding:2px 5px;border-radius:4px;background:var(--scheme-head,var(--bg));color:var(--ink);font-size:11px;line-height:1.35;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.person-workplace-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 12px;margin:14px 0 6px;padding:10px 0 0;border:0;min-width:0}
.person-workplace-options legend{font-size:12px;color:var(--muted);padding:0;margin-bottom:5px}
.person-workplace-options label{display:flex;align-items:center;gap:7px;min-width:0;padding:5px 0;font-size:12px;overflow-wrap:anywhere}
.person-workplace-options input{flex-shrink:0;accent-color:var(--scheme-accent,var(--green))}
body[data-edit-mode="view"] [data-person-action="workplace"]{display:none!important}
@media(max-width:560px){.person-workplace-options{grid-template-columns:1fr}}
@media print{#personnelRoot .roster-cards{columns:1;min-width:0}}

.person-vacation-list{margin:0;padding:0;list-style:none}
.person-vacation-list>li{border-bottom:1px solid var(--scheme-line,var(--brand-line))}
.person-vacation-entry{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;min-height:52px;padding:8px 10px;text-align:left}
.person-vacation-name{min-width:0;overflow-wrap:anywhere}
.person-vacation-name strong,.person-vacation-name small{display:block}
.person-vacation-name small{color:var(--muted);margin-top:2px}
.person-vacation-dates{flex:none;color:var(--person-purple-text);background:var(--person-purple-bg);padding:4px 6px;border-radius:4px;font-size:12px}
.person-help-icon{display:none}

@media screen and (max-width:640px){
  #personnelPage,#personnelRoot,#personnelRoot :is(.person-panel,.person-scroll){min-width:0;max-width:100%}
  #personnelRoot[data-view] .person-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;padding:6px}
  #personnelRoot[data-view] .person-toolbar :is(.person-period,.person-filters,.person-actions){width:100%;margin:0;gap:5px;min-width:0}
  #personnelRoot[data-view] .person-toolbar .person-filters{flex-wrap:wrap}
  #personnelRoot .person-filters :is(input,select){flex:1 1 110px;min-width:0;max-width:none}
  #personnelRoot .person-filters .person-selection{flex-basis:100%}
  #personnelRoot .person-toolbar :is(.form-control,input[type="month"]){height:44px;min-width:0;padding:4px 6px;font-size:14px}
  #personnelRoot #personSearch{font-size:16px}
  #personnelRoot .person-toolbar .icon-button{width:44px;height:44px;min-height:44px;flex:none}
  #personnelRoot .person-toolbar .icon-button svg{width:18px;height:18px}
  #personnelRoot .person-toolbar .person-actions :is(.button,summary){min-height:44px;display:inline-flex;align-items:center;gap:5px;padding:4px 7px;font-size:12px;width:auto;white-space:normal}
  #personnelRoot .person-toolbar .person-actions [hidden]{display:none}
  #personnelRoot .person-toolbar .person-period input{flex:1;max-width:none}
  #personnelRoot #personWeek{flex:1;min-width:0;text-align:center;font-weight:650;line-height:1.2}
  #personnelRoot #personPeriodScale{width:auto;max-width:38%}
  #personnelRoot .person-help-body{width:min(460px,calc(100vw - 36px))}
  #personnelRoot .person-scroll{--person-row:32px}
  #personnelRoot .person-table thead th{height:38px;background:var(--panel);z-index:5}
  #personnelRoot .person-table thead .weekend{background:color-mix(in srgb,var(--scheme-accent,var(--green)) 10%,var(--panel))}
  #personnelRoot .person-table thead tr>th:first-child{z-index:6}
  #personnelRoot .person-table tbody tr:not(.person-department,.person-brigade-band)>th:first-child{background-color:var(--panel)}
  body[data-edit-mode="view"] #personnelRoot .person-table .person-view-row>th:first-child{position:sticky}
  body[data-edit-mode="edit"] #personnelRoot .person-table [data-person-cell]{touch-action:manipulation}
  #personnelRoot .person-week{min-width:270px}
  #personnelRoot .person-week tr>th:first-child:not([colspan]){width:clamp(95px,29vw,156px);min-width:0;padding-inline:5px}
  #personnelRoot .person-week .person-workplace-badge{display:none}
  #personnelRoot .person-week tbody tr>th strong,#personnelRoot .person-week .person-mark{font-size:12px}
  body[data-edit-mode="view"] #personnelRoot .person-toolbar{grid-template-columns:minmax(0,1fr) 44px;grid-template-areas:"period period" "filters help"}
  body[data-edit-mode="view"] #personnelRoot :is(.person-period,#personRosterSource){grid-area:period}
  body[data-edit-mode="view"] #personnelRoot .person-filters{grid-area:filters}
  body[data-edit-mode="view"] #personnelRoot .person-filters :is(input,select){flex-basis:92px}
  body[data-edit-mode="view"] #personnelRoot .person-actions{display:contents}
  body[data-edit-mode="view"] #personnelRoot .person-help{grid-area:help}
  body[data-edit-mode="view"] #personnelRoot .person-toolbar .person-help summary{display:grid;place-items:center;width:44px;padding:0;list-style:none}
  body[data-edit-mode="view"] #personnelRoot .person-help summary::-webkit-details-marker{display:none}
  body[data-edit-mode="view"] #personnelRoot .person-help-label{position:absolute;clip-path:inset(50%);overflow:hidden;width:1px;height:1px}
  body[data-edit-mode="view"] #personnelRoot .person-help-icon{display:block}
  body[data-edit-mode="view"] #personnelRoot .person-help-icon svg{display:block;width:18px;height:18px}
}

/* Approved personnel workspace: shared tabs, readable tables and three-day shifts. */
#personnelRoot .person-page-title{display:flex;align-items:center;min-height:34px;margin:0;padding:4px 2px}
#personnelRoot .person-page-title h1{margin:0;font-size:20px;font-weight:650;color:var(--ink)}
#personnelRoot .person-panel,#personnelRoot[data-view="staff-roster"] .person-panel{border:1px solid var(--scheme-line,var(--brand-line));border-radius:10px;background:var(--scheme-panel,var(--panel));overflow:hidden}
#personnelRoot .person-tabs{display:flex;flex-shrink:0;gap:5px;padding:0 12px;border-bottom:1px solid var(--scheme-line,var(--brand-line));overflow-x:auto}
#personnelRoot .person-tabs button{position:relative;flex-shrink:0;min-height:44px;padding:11px 13px;border:0;background:transparent;color:var(--muted);font:inherit;font-size:13px;white-space:nowrap}
#personnelRoot .person-tabs button[aria-current="page"]{color:var(--ink);font-weight:600;background:color-mix(in srgb,var(--scheme-accent,#cc753d) 8%,transparent)}
#personnelRoot .person-tabs button[aria-current="page"]:after{content:"";position:absolute;bottom:0;left:12px;right:12px;height:3px;border-radius:3px;background:var(--scheme-accent,#cc753d)}
#personnelRoot .person-tabs button:focus-visible{outline:2px solid var(--scheme-accent,#cc753d);outline-offset:-3px}
#personnelRoot .person-toolbar,#personnelRoot[data-view="staff-roster"] .person-toolbar{gap:8px 12px;padding:10px 12px;border-bottom:1px solid var(--scheme-line,var(--brand-line));align-items:center}
#personnelRoot .person-toolbar .form-control,#personnelRoot .person-period input{min-height:32px;font-size:12px;background:var(--scheme-panel,var(--panel));color:var(--ink)}
#personnelRoot .person-period select{width:auto;max-width:180px}
#personnelRoot #personWeek{font-size:12px;color:var(--ink);font-weight:550;white-space:nowrap}
#personnelRoot .person-actions{gap:6px;flex-wrap:wrap;margin:0}
#personnelRoot .person-actions .button{font-size:12px;min-height:32px;width:auto;padding:6px 10px}
#personnelRoot .person-actions .button svg{width:15px;height:15px}
#personnelRoot .person-scroll,#personnelRoot[data-view="staff-roster"] .person-scroll{padding:0;min-height:140px}
#personnelRoot .person-table{font-size:12px}
#personnelRoot .person-table thead th{height:42px;color:var(--ink);background:var(--scheme-head,var(--panel-raised));font-size:12px}
#personnelRoot .person-table thead th small{color:var(--muted);font-size:11px;line-height:1.5}
#personnelRoot .person-table tbody tr>th strong{font-size:12px;line-height:1.4}
#personnelRoot .person-table tr:not(.person-department):not(.person-brigade-band)>th:first-child{min-width:180px;width:220px}
#personnelRoot .person-table .person-department th,#personnelRoot .person-table .person-brigade-band th{height:28px;padding:5px 10px;font-size:11px;line-height:1.4}
#personnelRoot .person-table:not(.person-three-days) .person-mark{min-height:26px;font-size:11px}
#personnelRoot .person-table .person-vacation{height:auto;min-height:28px;padding:5px 3px;font-size:11px}
#personnelRoot .person-table.person-three-days{min-width:580px;table-layout:fixed;width:100%}
#personnelRoot .person-three-days tr>th:first-child:not([colspan]){width:230px;min-width:230px}
#personnelRoot .person-three-days th,#personnelRoot .person-three-days td{width:auto;min-width:0}
#personnelRoot .person-three-days tbody tr:not(.person-department):not(.person-brigade-band)>th small{display:block;color:var(--muted);font-size:11px;line-height:1.4;margin-top:4px}
#personnelRoot .person-three-days .person-mark{height:auto;min-height:53px;padding:6px;font-size:13px;border-radius:5px;line-height:1.4}
#personnelRoot .person-three-days .person-mark small{display:block;margin-top:3px;font-weight:400;font-size:11px;line-height:1.4;color:inherit}
#personnelRoot .person-mark:not([class*="color-"]){opacity:1;color:var(--muted)}
/* Compact department lists form two balanced columns on wide workspaces. */
#personnelRoot .roster-cards.person-roster-table {
  columns: 2;
  column-gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px 0;
}
#personnelRoot .person-roster-table .roster-department {
  display: block;
  vertical-align: top;
  width: 100%;
  break-inside: avoid;
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid var(--scheme-line,var(--brand-line));
  border-radius: 8px;
  background: var(--scheme-panel,var(--panel));
  box-shadow: none;
}
#personnelRoot .person-roster-table .roster-department > header {
  padding: 0;
  margin: 0;
  align-items: center;
  border: 0;
  border-radius: 7px 7px 0 0;
  background: var(--scheme-head,var(--panel-raised));
}
#personnelRoot .person-roster-table .roster-department > header h2 {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}
#personnelRoot .person-roster-table .roster-dept-number {
  display: none;
}
:root body[data-module="personnel"] #personnelRoot .person-roster-table .roster-person {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  min-width: 0;
  min-height: 44px;
  height: auto;
  padding: 4px 10px;
  border-radius: 0;
}
#personnelRoot .person-roster-table .roster-person > .roster-avatar {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
}
#personnelRoot .person-roster-table .roster-person > .roster-person-name {
  grid-column: 2;
  grid-row: 1;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
}
#personnelRoot .person-roster-table .roster-person-details {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-width: 0;
}
#personnelRoot .person-roster-table .roster-person > .roster-presence {
  display: none;
}
#personnelRoot .person-roster-table .roster-person > .roster-shift {
  grid-column: 3;
  grid-row: 1 / 3;
  justify-self: end;
  max-width: 170px;
  min-width: 0;
  text-align: left;
}
#personnelRoot .person-roster-table .roster-shift small {
  display: block;
  overflow-wrap: anywhere;
}
#personnelRoot .person-roster-table .roster-person-details .roster-workplace {
  padding: 0;
}
#personnelRoot .person-roster-table .roster-person-details .roster-workplace-tag {
  padding: 0;
  font-size: 12px;
  line-height: 1.25;
}
#personnelRoot .person-roster-table .roster-person-details .roster-birth {
  width: auto;
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
}
#personnelRoot .person-roster-table .roster-person-details .roster-birth::before {
  content: "Д.р. ";
  color: var(--muted);
}
#personnelRoot .person-roster-table .roster-person:last-child {
  border-bottom-color: transparent;
}
#personnelRoot .roster-shift strong{font-size:11px;color:var(--ink);font-weight:600}
#personnelRoot .roster-shift small{display:block;margin-top:3px;font-size:11px;line-height:1.4;color:var(--muted)}
#personnelRoot .person-presence{display:inline-block;padding:4px 7px;border-radius:5px;font-size:11px;line-height:1.4;background:var(--scheme-head,var(--panel-raised));color:var(--muted);white-space:nowrap}
#personnelRoot .person-presence-working{background:var(--person-green-bg);color:var(--person-green-text)}
#personnelRoot .person-presence-vacation{background:var(--person-purple-bg);color:var(--person-purple-text)}
#personnelRoot .person-presence-sick{background:var(--person-rose-bg);color:var(--person-rose-text)}
#personnelRoot .person-roster-table .roster-brigade-heading{border-radius:0;margin:0;padding:0;min-height:32px}
#personnelRoot .person-roster-table .roster-brigade-empty{padding:8px 12px}

/* The registry fills the same workspace as the personnel calendars. */
#personnelRoot[data-view="staff-roster"] .ganza-page-search{display:flex;align-items:center;gap:12px}
#personnelRoot[data-view="staff-roster"] .ganza-top-search{flex:1;min-width:0}
#personnelRoot[data-view="staff-roster"] .ganza-page-search [data-person-action="employee"]{flex:none;min-height:36px;white-space:nowrap}
#personnelRoot .person-roster-table .roster-department>header h2{width:100%;margin:0}
#personnelRoot .roster-group-toggle{display:flex;align-items:center;gap:8px;width:100%;min-width:0;min-height:32px;padding:6px 12px;border:0;border-radius:0;background:transparent;color:var(--ink);font:inherit;text-align:left;cursor:pointer}
#personnelRoot .roster-group-toggle .roster-group-name{flex:1;min-width:0;color:var(--ink);font-size:12px;font-weight:600;overflow-wrap:anywhere}
#personnelRoot .roster-group-toggle:disabled{cursor:default}
#personnelRoot .roster-group-toggle:hover{background:color-mix(in srgb,var(--scheme-accent,#ffad62) 6%,transparent)}
#personnelRoot .roster-group-toggle:focus-visible{outline:2px solid var(--scheme-accent,#ffad62);outline-offset:-3px}
#personnelRoot .roster-group-chevron{width:6px;height:6px;flex:none;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg)}
#personnelRoot .roster-group-toggle[aria-expanded="false"] .roster-group-chevron{transform:translateX(-2px) rotate(-45deg)}
#personnelRoot .roster-brigade-heading .roster-group-toggle{min-height:28px;padding-block:4px;font-size:11px}
#personnelRoot .roster-group-toggle .roster-dept-count{margin-left:auto;flex:none;white-space:nowrap}
#personnelRoot .roster-group-toggle:has(.roster-group-summary) {
  flex-wrap: wrap;
}
#personnelRoot .roster-group-toggle:has(.roster-group-summary) .roster-dept-count {
  margin-inline-end: 8px;
}
#personnelRoot .roster-group-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-inline-start: auto;
}
#personnelRoot .roster-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
#personnelRoot .roster-group-summary .roster-summary-count {
  color: var(--muted);
  font: 400 11px/1.35 var(--font);
  font-variant-numeric: tabular-nums;
}
:root #personnelRoot .person-table .person-mark.person-day-off {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
#personnelRoot .person-roster-table .roster-person:focus-visible{outline:2px solid var(--scheme-accent,#ffad62);outline-offset:-3px}
@media(prefers-reduced-motion:no-preference){#personnelRoot .roster-group-chevron{transition:transform calc(.14s / var(--ui-motion-speed,.5)) cubic-bezier(.23,1,.32,1)}#personnelRoot .roster-person{transition:background-color calc(.12s / var(--ui-motion-speed,.5)) ease-out}}


/* Compact registry hierarchy, with color reserved for shift codes and feedback. */
#personnelRoot[data-view] .person-tabs {
  gap: 4px;
  padding-inline: 12px;
}
#personnelRoot[data-view] .person-tabs button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 12px;
}
#personnelRoot[data-view] .person-toolbar {
  min-height: 42px;
  padding: 4px 12px;
  gap: 6px 12px;
}
#personnelRoot[data-view] .person-toolbar .person-filters {
  margin: 0;
}
#personnelRoot[data-view] .person-toolbar .person-actions {
  margin-inline-start: auto;
  gap: 4px;
}
#personnelRoot[data-view] .person-toolbar :is(.form-control,.button) {
  min-height: 30px;
  padding-block: 4px;
}
#personnelRoot[data-view] .ganza-page-search {
  gap: 12px;
  padding: 6px 12px;
}
#personnelRoot[data-view] .ganza-page-search .ganza-top-search {
  max-width: 26rem;
}
#personnelRoot[data-view="staff-roster"] .ganza-page-search [data-person-action="employee"] {
  min-height: 32px;
  margin-inline-start: auto;
}
#personnelRoot .person-roster-table .roster-person[data-brigade] {
  border-left-color: transparent;
  background: transparent;
}
#personnelRoot .person-roster-table .roster-avatar[data-person-drag] {
  display: grid !important;
}
#personnelRoot .person-roster-table .roster-person.person-cell-selected {
  background: color-mix(in srgb,var(--scheme-accent,#ffad62) 12%,var(--scheme-panel,var(--panel)));
}
#personnelRoot .person-roster-table .roster-person.person-view-row {
  background: color-mix(in srgb,var(--scheme-accent,#ffad62) 7%,var(--scheme-panel,var(--panel)));
}
#personnelRoot .person-roster-table .roster-brigade-heading {
  min-height: 28px;
  border-left: 0;
  background: color-mix(in srgb,var(--scheme-head,var(--panel-raised)) 38%,var(--scheme-panel,var(--panel)));
}
#personnelRoot .person-roster-table .roster-shift {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
}
#personnelRoot .person-roster-table :is(.roster-shift,.roster-group-summary) .person-shift-code {
  --person-code-size: 22px;
  --person-code-font-size: 11px;
  margin: 0;
}
#personnelRoot .person-roster-table .roster-shift small {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}
#personnelRoot .person-roster-table .person-presence {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  line-height: 1.35;
}
#personnelRoot .person-roster-table .roster-presence {
  display: none;
}
#personnelRoot .person-roster-table .person-presence::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--muted);
}
#personnelRoot .person-roster-table .person-presence-working::before {
  background: var(--person-green-bg);
}
#personnelRoot .person-roster-table .person-presence-vacation::before {
  background: var(--person-purple-bg);
}
#personnelRoot .person-roster-table .person-presence-sick::before {
  background: var(--person-rose-bg);
}
#personnelRoot .person-roster-table .roster-group-toggle .roster-dept-count {
  min-width: 18px;
  height: 18px;
  margin-inline: 0 auto;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--scheme-panel,var(--panel));
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
#personnelRoot .person-roster-table .roster-group-toggle .roster-group-name {
  flex: 0 1 auto;
}
#personnelRoot .person-roster-table .roster-brigade-heading .roster-group-name {
  font-size: 11px;
  font-weight: 550;
  color: var(--muted);
}
#personnelRoot .person-roster-table .roster-workplace-tag {
  padding: 1px 0;
  background: transparent;
  font-size: 12px;
}
#personnelRoot .person-roster-table .roster-workplace {
  gap: 3px 8px;
}
#personnelRoot .person-roster-table .roster-birth {
  font-size: 11px;
}
@media (hover:hover) and (pointer:fine) {
  #personnelRoot .person-roster-table .roster-person:not(.person-cell-selected,.person-view-row):hover {
    background: color-mix(in srgb,var(--scheme-accent,#ffad62) 5%,var(--scheme-panel,var(--panel)));
  }
}
@media (pointer:coarse) {
  #personnelRoot .person-roster-table :is(.roster-group-toggle,.roster-brigade-heading .roster-group-toggle) {
    min-height: 44px;
  }
  :root body[data-module="personnel"] #personnelRoot .person-roster-table .roster-person {
    min-height: 44px;
  }
  #personnelRoot[data-view] .person-toolbar :is(.form-control,.button) {
    min-height: 44px;
  }
}

@container planner (max-width:900px) {
  #personnelRoot .roster-cards.person-roster-table {
    column-count: 1;
  }
  #personnelRoot[data-view="staff-roster"] .ganza-page-search [data-person-action="employee"] {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
  #personnelRoot[data-view="staff-roster"] .ganza-page-search [data-person-action="employee"] > span {
    display: none;
  }
}
@container planner (max-width:500px) {
  #personnelRoot .roster-cards.person-roster-table {
    padding-inline: 8px;
  }
  #personnelRoot .person-roster-table .roster-person > .roster-shift {
    max-width: 125px;
  }
}
@media screen and (max-width:640px){
  body[data-module="personnel"] .app-shell{height:100dvh}
  #personnelRoot[data-view] .person-tabs{padding-inline:4px;gap:0;scrollbar-width:none}
  #personnelRoot[data-view] .person-tabs button{min-height:44px;padding-inline:8px}
  body[data-edit-mode="view"] #personnelRoot[data-view="staff-roster"] .person-toolbar{grid-template-areas:"filters help";grid-template-rows:auto}
  #personnelRoot[data-view] .person-toolbar :is(.form-control,.button){min-height:44px}
  #personnelRoot[data-view="staff-roster"] .ganza-page-search{gap:8px}
  #personnelRoot[data-view="staff-roster"] .ganza-page-search [data-person-action="employee"]{width:44px;height:44px}
}
@media screen and (min-width:801px) {
  #personnelPage, #personnelRoot, #personnelRoot > .person-panel {
    min-width: 0;
    max-width: 100%;
  }
  #personnelRoot .person-panel > .ganza-page-search { flex: none; }
  #personnelRoot[data-view] .ganza-page-search > .ganza-top-search {
    flex: 1 1 26rem;
    width: 26rem;
    min-width: 0;
  }
  #personnelRoot #personGrid { min-width: 0; overflow: auto; }
}
/* Employee names and form values retain contrast in either selected theme. */
body[data-module="personnel"] :is(#personEmployeeForm,#personPeriodForm,#personDepartmentForm,#personWorkplaceForm) {color:var(--ink)}
body[data-module="personnel"] :is(#personEmployeeForm,#personPeriodForm,#personDepartmentForm,#personWorkplaceForm) :is(input,select,textarea){color:var(--ink);-webkit-text-fill-color:currentColor;background:var(--scheme-panel,var(--panel));caret-color:var(--ink)}
body[data-module="personnel"] #modalTitle{color:var(--ink);-webkit-text-fill-color:currentColor}
body[data-module="personnel"] .modal:has(#personEmployeeForm) .modal-header{background:var(--scheme-head,var(--panel-raised))}
.person-employee-card {
  display: grid;
  margin: 0;
}
.person-employee-card > div {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr);
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--scheme-line,var(--brand-line));
}
.person-employee-card dt {
  color: var(--muted);
  font-size: 12px;
}
.person-employee-card dd {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}
@media(max-width:400px) {
  .person-employee-card > div {
    grid-template-columns: 100px minmax(0,1fr);
    gap: 8px;
  }
}
@media(max-width:640px){
 #personnelRoot .person-page-title{min-height:28px}#personnelRoot .person-page-title h1{font-size:18px}
 #personnelRoot .person-tabs{padding:0 4px;gap:0}#personnelRoot .person-tabs button{flex:1;min-height:42px;padding:9px 8px;font-size:12px}
 #personnelRoot .person-toolbar{padding:8px;gap:8px}#personnelRoot .person-actions{width:100%}
 #personnelRoot .person-actions .button{font-size:11px;min-height:32px;padding:5px 8px;width:auto}
 #personnelRoot .person-three-days{min-width:560px}#personnelRoot .person-period{flex-wrap:wrap}
 #personnelRoot .person-filters{width:100%}#personnelRoot .person-filters select{flex:1;max-width:none}
}
@media print{#personnelRoot .roster-cards.person-roster-table{columns:1;padding:0}#personnelRoot .person-tabs{display:none}#personnelRoot .roster-cards.person-roster-table{min-width:0}#personnelRoot .person-roster-table .roster-person{break-inside:avoid}}
