:root {
    color-scheme: light;
    --vb-bg: var(--bs-body-bg, #f6f7f9);
    --vb-surface: var(--bs-tertiary-bg, #ffffff);
    --vb-surface-muted: var(--bs-secondary-bg, #eef0f3);
    --vb-text: var(--bs-body-color, #171a20);
    --vb-text-muted: var(--bs-secondary-color, #5b6270);
    --vb-border: var(--bs-border-color, #e3e6eb);
    --vb-input-border: var(--bs-border-color, #e3e6eb);
    --vb-primary: var(--bs-primary, #2f6fe4);
    --vb-primary-hover: var(--bs-link-hover-color, #1d54b8);
    --vb-on-primary: #ffffff;
    --vb-disabled-bg: #d8dde6;
    --vb-disabled-text: #6f7785;
    --vb-disabled-border: #c4cad4;
    --vb-focus: #e99c19;
    --vb-success: var(--bs-success, #15803d);
    --vb-warning: var(--bs-warning, #b45309);
    --vb-error: var(--bs-danger, #b91c1c);
    --vb-header-bg: #161d33;
    --vb-header-border: #2a3352;
    --vb-header-text: #eef1f8;
    --vb-header-muted: #9aa4c4;
    --vb-backdrop: rgba(23, 26, 32, .48);
    --vb-shadow: rgba(23, 26, 32, .24);
    --vb-sidebar-bg: #102a56;
    --vb-sidebar-text: #eef4ff;
    --vb-sidebar-muted: #aebed8;
    --vb-sidebar-control: #284675;
}

.admin-frame { display:grid; grid-template-columns:220px minmax(0,1fr); min-height:calc(100vh - 3rem); margin:1.5rem; border-radius:14px; background:var(--vb-bg); }
.gateway { max-width:680px; margin:9vh auto; padding:2.5rem; border:1px solid var(--vb-border); border-radius:14px; background:var(--vb-surface); text-align:center; }.gateway-mark { display:grid; place-items:center; width:48px; height:48px; margin:auto; border-radius:12px; color:#fff; background:var(--vb-primary); font-weight:800; font-size:1.4rem; }.gateway-kicker { margin:1.2rem 0 .3rem; color:var(--vb-text-muted); font-size:.75rem; letter-spacing:.08em; }.gateway h1 { margin:0; font-size:1.8rem; }.gateway h2 { margin:.35rem 0 1rem; font-size:1rem; font-weight:500; color:var(--vb-text-muted); }.gateway>p:not(.gateway-kicker) { max-width:31rem; margin:0 auto 1.2rem; color:var(--vb-text-muted); }.gateway-status { display:grid; gap:.35rem; padding:1rem; margin:1.5rem 0; border-radius:9px; color:var(--vb-success); background:color-mix(in srgb,var(--vb-success) 9%,transparent); text-align:left; font-size:.88rem; }.gateway-status span { color:var(--vb-text-muted); }.gateway-cta { display:block; padding:.72rem 1rem; border-radius:8px; color:var(--vb-on-primary); background:var(--vb-primary); text-decoration:none; }.gateway footer { margin-top:1.4rem; color:var(--vb-text-muted); font-size:.78rem; }
.login-screen { display:grid; min-height:calc(100vh - 8rem); place-items:center; }.login-card { width:min(100%,420px); padding:2rem; border:1px solid var(--vb-border); border-radius:14px; background:var(--vb-surface); }.login-brand { display:flex; gap:.6rem; align-items:center; color:var(--vb-text); text-decoration:none; font-weight:650; }.login-brand span { display:grid; place-items:center; width:30px; height:30px; border-radius:8px; color:#fff; background:var(--vb-primary); }.login-card h1 { margin:1.5rem 0 .2rem; }.login-card>p { color:var(--vb-text-muted); }.login-form { display:grid; gap:.55rem; }.login-form label { margin-top:.5rem; font-size:.86rem; }.login-form input { min-height:2.55rem; border:1px solid var(--vb-input-border); border-radius:7px; padding:.5rem .65rem; background:var(--vb-surface); color:var(--vb-text); }.password-field { display:flex; }.password-field input { flex:1; border-radius:7px 0 0 7px; }.password-field button { border:1px solid var(--vb-input-border); border-left:0; border-radius:0 7px 7px 0; background:var(--vb-surface-muted); color:var(--vb-primary); }.login-form .remember { display:flex; gap:.5rem; align-items:center; color:var(--vb-text-muted); }.login-form .remember input { min-height:auto; }.login-form>button { margin-top:.8rem; min-height:2.55rem; border:0; border-radius:8px; color:var(--vb-on-primary); background:var(--vb-primary); }.login-links { margin-top:1rem; font-size:.85rem; }.login-links button { border:0; padding:0; color:var(--vb-primary); background:transparent; }
.admin-sidebar { display:flex; flex-direction:column; min-width:0; padding:20px 14px 16px; border-radius:14px 0 0 14px; background:var(--vb-sidebar-bg); color:var(--vb-sidebar-text); }
.admin-sidebar-main { min-width:0; }
.admin-sidebar-heading { display:flex; align-items:flex-start; justify-content:space-between; }
.admin-brand { display:flex; align-items:center; gap:10px; padding:0 8px 22px; color:var(--vb-sidebar-text); font-size:1.05rem; font-weight:650; text-decoration:none; }.admin-brand span { display:grid; place-items:center; width:34px; height:34px; border-radius:9px; color:var(--vb-sidebar-bg); background:var(--vb-sidebar-text); font-weight:800; }
.admin-sidebar nav { display:grid; gap:4px; }.admin-sidebar nav small { padding:11px 10px 5px; color:var(--vb-sidebar-muted); font-size:.72rem; }.admin-sidebar nav a { display:block; padding:8px 10px; border-radius:8px; color:var(--vb-sidebar-text); text-decoration:none; }.admin-sidebar nav a.active { background:color-mix(in srgb,var(--vb-sidebar-text) 14%,transparent); color:var(--vb-sidebar-text); }
.admin-sidebar-footer { display:grid; gap:.75rem; margin-top:auto; padding:1rem 6px 0; border-top:1px solid color-mix(in srgb,var(--vb-sidebar-text) 18%,transparent); }
.admin-theme-control { display:flex; align-items:center; justify-content:space-between; gap:.5rem; min-height:42px; padding:0 4px; color:var(--vb-sidebar-text); font-size:.86rem; }
button.theme-slider { position:relative; display:flex; align-items:center; justify-content:space-between; flex:0 0 auto; width:76px; height:36px; padding:0 8px; border:1px solid color-mix(in srgb,var(--vb-sidebar-text) 22%,transparent); border-radius:999px; background:var(--vb-sidebar-control); color:var(--vb-sidebar-muted); }
button.theme-slider:hover:not(:disabled) { background:color-mix(in srgb,var(--vb-sidebar-text) 16%,var(--vb-sidebar-control)); }
.theme-icon { position:relative; z-index:1; width:17px; height:17px; }
.theme-slider-thumb { position:absolute; top:3px; left:3px; width:28px; height:28px; border-radius:50%; background:var(--vb-sidebar-text); transition:transform .18s ease; }
.theme-slider.is-dark .theme-slider-thumb { transform:translateX(40px); }
.theme-slider:not(.is-dark) .theme-icon.sun { color:var(--vb-sidebar-bg); }.theme-slider.is-dark .theme-icon.moon { color:var(--vb-sidebar-bg); }
button.admin-logout { display:flex; align-items:center; gap:.6rem; width:100%; padding:.65rem .7rem; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--vb-sidebar-text); text-align:left; font-size:.9rem; }
button.admin-logout:hover:not(:disabled) { background:color-mix(in srgb,var(--vb-sidebar-text) 14%,transparent); }
.admin-workspace { min-width:0; border-radius:0 14px 14px 0; background:var(--vb-bg); }
.admin-workspace .app-main { max-width:none; padding:24px 24px 2rem; }
.admin-menu-open,.admin-nav-close,.admin-nav-scrim { display:none; }
@media (max-width: 820px) {
    .admin-frame { display:block; min-height:100vh; margin:0; border-radius:0; }
    .admin-sidebar { position:fixed; inset:0 auto 0 0; z-index:42; width:min(260px,calc(100vw - 3rem)); box-sizing:border-box; height:100dvh; overflow-y:auto; border-radius:0; transform:translateX(-100%); visibility:hidden; transition:transform .18s ease,visibility .18s ease; }
    .admin-sidebar.open { transform:translateX(0); visibility:visible; }
    .admin-workspace { min-height:100vh; border-radius:0; }
    .admin-workspace .app-main { padding:0 16px 1.5rem; }
    button.admin-menu-open { display:inline-flex; align-items:center; gap:.55rem; margin:12px 16px 0; padding:.5rem .75rem; border:1px solid var(--vb-border); background:var(--vb-surface); color:var(--vb-text); }
    button.admin-menu-open:hover:not(:disabled) { background:var(--vb-surface-muted); }
    button.admin-nav-close { display:block; padding:.25rem .5rem; background:transparent; color:var(--vb-sidebar-text); font-size:1.5rem; line-height:1; }
    button.admin-nav-close:hover:not(:disabled) { background:color-mix(in srgb,var(--vb-sidebar-text) 14%,transparent); }
    button.admin-nav-scrim { display:block; position:fixed; inset:0; z-index:41; width:100%; height:100%; border:0; border-radius:0; background:var(--vb-backdrop); }
}
@media (prefers-reduced-motion: reduce) { .admin-sidebar,.theme-slider-thumb { transition:none; } }

/* M5.3 personnel workspace: follows the supplied administration reference. */
.personnel-modern { width:100%; min-width:0; }
.personnel-view-links { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:1rem; font-size:.86rem; }
.personnel-view-links a,.personnel-view-links span { display:inline-flex; align-items:center; min-height:2.2rem; padding:.35rem .7rem; border:1px solid var(--vb-border); border-radius:7px; color:var(--vb-text); text-decoration:none; background:var(--vb-surface); }
.personnel-view-links [aria-current="page"] { color:var(--vb-primary); border-color:var(--vb-primary); font-weight:600; }
.business-role-options { grid-column:1 / -1; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.45rem .8rem; border:1px solid var(--vb-border); border-radius:8px; padding:.6rem .8rem; }
.business-role-options legend { color:var(--vb-text-muted); font-size:.84rem; }
.business-role-options label { display:flex; align-items:center; gap:.45rem; color:var(--vb-text); }
.personnel-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin:0 0 1.1rem; }
.personnel-heading h1 { margin:0 0 .25rem; font-size:1.45rem; color:var(--vb-text); }
.personnel-heading p { margin:0; color:var(--vb-text-muted); }
.personnel-primary { border:0; border-radius:8px; padding:.6rem 1rem; background:var(--vb-primary); color:var(--vb-on-primary); white-space:nowrap; }
.personnel-toolbar { display:flex; align-items:end; gap:.7rem; flex-wrap:wrap; width:100%; max-width:none; margin-bottom:0; padding:.8rem 1rem; border:1px solid var(--vb-border); border-radius:10px 10px 0 0; background:var(--vb-surface); }
.personnel-toolbar label { display:grid; gap:.3rem; font-size:.78rem; color:var(--vb-text-muted); }
.personnel-toolbar input,.personnel-toolbar select,.personnel-form input,.personnel-form select { min-height:2.35rem; border:1px solid var(--vb-input-border); border-radius:7px; padding:.45rem .6rem; color:var(--vb-text); background:var(--vb-surface); }
.personnel-toolbar label:first-child { flex:1; min-width:13rem; }
.personnel-table-panel { overflow:hidden; border:1px solid var(--vb-border); border-top:0; border-radius:0 0 10px 10px; background:var(--vb-surface); }
.table-caption { display:flex; justify-content:space-between; align-items:center; padding:.7rem 1rem; color:var(--vb-text-muted); font-size:.82rem; }
.table-wrap { overflow-x:auto; }
.personnel-modern table { width:100%; min-width:1100px; table-layout:fixed; border-collapse:collapse; }
.personnel-modern th:nth-child(1) { width:8%; }.personnel-modern th:nth-child(2) { width:13%; }.personnel-modern th:nth-child(3) { width:18%; }.personnel-modern th:nth-child(4) { width:13%; }.personnel-modern th:nth-child(5) { width:19%; }.personnel-modern th:nth-child(6) { width:11%; }.personnel-modern th:nth-child(7) { width:18%; }
.personnel-modern th { padding:.7rem .85rem; text-align:left; color:var(--vb-text-muted); background:var(--vb-surface-muted); border-bottom:1px solid var(--vb-border); font-size:.78rem; font-weight:500; }
.personnel-modern td { padding:.9rem .85rem; border-bottom:1px solid var(--vb-border); vertical-align:middle; font-size:.86rem; overflow-wrap:anywhere; }
.personnel-modern td small { display:block; margin-top:.2rem; color:var(--vb-text-muted); }
.employment-status { display:inline-flex; align-items:center; border-radius:999px; padding:.3rem .65rem; font-size:.78rem; }
.employment-status.working { color:var(--vb-success); background:color-mix(in srgb,var(--vb-success) 14%,var(--vb-surface)); }.employment-status.resigned { color:var(--vb-error); background:color-mix(in srgb,var(--vb-error) 12%,var(--vb-surface)); }
.personnel-row-actions { display:flex; align-items:center; gap:.35rem; flex-wrap:nowrap; white-space:nowrap; }
.personnel-row-actions button { flex:none; padding:.42rem .62rem; font-size:.78rem; line-height:1.2; }
.table-message { padding:2rem 1rem; color:var(--vb-text-muted); }.pagination { display:flex; justify-content:flex-end; align-items:center; gap:.8rem; padding:.8rem 1rem; color:var(--vb-text-muted); font-size:.84rem; }
.personnel-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.9rem; }.personnel-form label { display:grid; gap:.35rem; color:var(--vb-text-muted); font-size:.84rem; }.personnel-detail h3 { margin-top:0; }.personnel-detail dl { display:grid; grid-template-columns:10rem 1fr; gap:.65rem 1rem; }.personnel-detail dt { color:var(--vb-text-muted); }.personnel-detail dd { margin:0; }
@media (max-width: 700px) { .personnel-heading { align-items:stretch; flex-direction:column; }.personnel-primary { width:100%; }.personnel-toolbar { align-items:stretch; flex-direction:column; border-radius:10px; }.personnel-toolbar label:first-child { min-width:0; }.personnel-table-panel { margin-top:.8rem; border-top:1px solid var(--vb-border); border-radius:10px; }.personnel-form { grid-template-columns:1fr; }.personnel-detail dl { grid-template-columns:1fr; gap:.2rem; }.personnel-detail dd { margin-bottom:.7rem; } }

html[data-bs-theme="dark"] {
    color-scheme: dark;
    --vb-on-primary: #071a2d;
    --vb-focus: #ffcf66;
    --vb-backdrop: rgba(0, 0, 0, .64);
    --vb-shadow: rgba(0, 0, 0, .48);
}

html { font-family: system-ui, sans-serif; color: var(--vb-text); background: var(--vb-bg); }
body { margin: 0; background: var(--vb-bg); }
body.dialog-open { overflow: hidden; }
.site-header { background: var(--vb-header-bg); color: var(--vb-header-text); border-bottom: 1px solid var(--vb-header-border); padding: 1rem 5%; display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.brand-block, .top-nav, .auth-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { color: var(--vb-header-text); font-size: 1.5rem; font-weight: 700; text-decoration: none; }
.brand-block span { color: var(--vb-header-muted); }
.top-nav a { color: var(--vb-header-text); font-weight: 700; text-decoration: none; border-radius: 6px; padding: .55rem .7rem; }
.top-nav a.active, .top-nav a:hover { background: rgba(255, 255, 255, .1); }
.auth-actions { margin-left: auto; justify-content: flex-end; }
.mock-data-badge { background: color-mix(in srgb, var(--vb-warning) 24%, var(--vb-header-bg)); color: #ffd88a; border-color: var(--vb-warning); }
.auth-button { color: var(--vb-header-text); border: 1px solid var(--vb-header-text); border-radius: 6px; padding: .8rem 1.2rem; text-decoration: none; font-weight: 700; }
.theme-select { display: flex; align-items: center; gap: .5rem; }
.theme-select span { font-size: .9rem; font-weight: 700; }
.theme-select select { color: var(--vb-header-text); background: rgba(255, 255, 255, .08); border-color: var(--vb-header-border); padding: .55rem .7rem; }
.theme-select option { color: var(--vb-text); background: var(--vb-surface); }
.app-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 1.25rem; width: min(1380px, calc(100% - 2rem)); margin: 2rem auto; }
.app-shell.public-shell { display: block; width: min(800px, calc(100% - 2rem)); }
.app-shell.no-sidebar-shell { grid-template-columns: minmax(0, 1fr); }
.app-main { min-width: 0; }
main { max-width: 800px; margin: 3rem auto; padding: 0 1.25rem; }
.app-main { max-width: none; margin: 0; padding: 0; }
h1 { font-size: 2rem; }
section { background: var(--vb-surface); border: 1px solid var(--vb-border); border-radius: 8px; padding: 1.5rem; margin-top: 2rem; }
h2 { margin-top: 0; }
dl { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr; gap: .8rem; }
dd { margin: 0; overflow-wrap: anywhere; }
button { background: var(--vb-primary); color: var(--vb-on-primary); border: 0; border-radius: 6px; padding: .8rem 1.2rem; font: inherit; cursor: pointer; }
button:hover:not(:disabled), .auth-button:hover { background: var(--vb-primary-hover); }
button.secondary { color: var(--vb-text); background: var(--vb-surface); border: 1px solid var(--vb-border); }
button.danger { background: var(--vb-error); color: #fff; }
button.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--vb-error) 82%, #000); }
button:disabled, button.secondary:disabled {
    color: var(--vb-disabled-text);
    background: var(--vb-disabled-bg);
    border-color: var(--vb-disabled-border);
    opacity: 1;
    cursor: not-allowed;
}
:is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--vb-focus); outline-offset: 3px; }
.success { color: var(--vb-success); font-weight: 700; }
.error { color: var(--vb-error); }
.note { color: var(--vb-text-muted); line-height: 1.6; }
#blazor-error-ui { display: none; background: var(--vb-surface-muted); color: var(--vb-text); padding: 1rem; position: fixed; bottom: 0; width: 100%; }

form { display: grid; gap: .65rem; max-width: 540px; margin-bottom: 1.5rem; }
input, select, textarea { box-sizing: border-box; color: var(--vb-text); background: var(--vb-surface); padding: .65rem; border: 1px solid var(--vb-input-border); border-radius: 5px; font: inherit; max-width: 100%; }
.checkbox { display: inline-flex; gap: .5rem; margin: .4rem; align-items: center; }
.validation-errors, .validation-message { color: var(--vb-error); }
.table-scroll { overflow-x: auto; margin-top: 1rem; }
.notification-table { min-width: 760px; }
.notification-table td:first-child { min-width: 220px; }
.notification-table td:last-child { min-width: 190px; }
.notification-table button { text-align: left; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--vb-border); padding: .7rem; }
th { color: var(--vb-text-muted); }
main:has(table) { max-width: 1100px; }
.app-main:has(table) { max-width: none; }
.site-header button { border: 1px solid var(--vb-header-text); }
.section-heading, .dialog-heading, .form-actions, .section-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.section-heading, .dialog-heading { justify-content: space-between; margin-bottom: 1rem; }
.section-heading h2, .dialog-heading h2 { margin: 0; }
.dialog-backdrop { position: fixed; inset: 0; z-index: 20; background: var(--vb-backdrop); display: grid; place-items: center; padding: 1rem; }
.dialog-panel { width: min(640px, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: var(--vb-surface); border-radius: 8px; border: 1px solid var(--vb-border); box-shadow: 0 24px 64px var(--vb-shadow); padding: 1.5rem; }
.dialog-panel form { max-width: none; margin-bottom: 0; }
.dialog-panel:has(.document-editor-form) { width: min(820px, 100%); }
.document-editor-form { display: grid; gap: 1.1rem; }
.document-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.document-editor-grid label { display: grid; align-content: start; gap: .35rem; color: var(--vb-text-muted); font-size: .84rem; font-weight: 500; }
.document-editor-grid label.document-editor-wide { grid-column: 1 / -1; }
.document-editor-grid input,.document-editor-grid select,.document-editor-grid textarea { width: 100%; min-width: 0; margin: 0; padding: .6rem .7rem; color: var(--vb-text); background: var(--vb-surface); border: 1px solid var(--vb-input-border); border-radius: 7px; font: inherit; }
.document-editor-grid textarea { min-height: 4.5rem; resize: vertical; }
.document-editor-actions { display: flex; justify-content: flex-end; padding-top: .8rem; border-top: 1px solid var(--vb-border); }
.document-overview { margin-top: 1rem; }
.document-overview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--vb-border); }
.document-overview-label { margin: 0 0 .4rem; color: var(--vb-text-muted); font-size: .8rem; }
.document-overview-heading h2 { margin: 0; max-width: 70ch; color: var(--vb-text); font-size: clamp(1.3rem, 2vw, 1.75rem); line-height: 1.35; }
.document-overview-code { margin: .5rem 0 0; color: var(--vb-text-muted); font-size: .88rem; }
.document-overview-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .55rem; flex: none; }
.document-overview-actions button { margin: 0; }
.document-overview-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .85fr); gap: 2rem; padding-top: 1.25rem; }
.document-overview-group { min-width: 0; }
.document-overview-group h3 { margin: 0 0 1rem; color: var(--vb-text); font-size: 1rem; }
.document-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.document-field-grid div { min-width: 0; }
.document-field-grid dt { margin: 0 0 .3rem; color: var(--vb-text-muted); font-size: .78rem; }
.document-field-grid dd { margin: 0; color: var(--vb-text); font-size: .93rem; font-weight: 550; overflow-wrap: anywhere; }
.document-overview-note { margin-top: 1.25rem; padding: 1rem; border-radius: 8px; background: var(--vb-surface-muted); }
.document-overview-note strong { font-size: .8rem; color: var(--vb-text-muted); }
.document-overview-note p { margin: .4rem 0 0; color: var(--vb-text); white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 850px) { .document-overview-grid { grid-template-columns: 1fr; gap: 1.5rem; } }
@media (max-width: 620px) { .document-overview-heading { display: block; }.document-overview-actions { justify-content: flex-start; margin-top: 1rem; }.document-field-grid,.document-editor-grid { grid-template-columns: 1fr; }.document-editor-grid label.document-editor-wide { grid-column: auto; } }
.button-link { display: inline-block; background: var(--vb-primary); color: var(--vb-on-primary); border-radius: 6px; padding: .8rem 1.2rem; text-decoration: none; font-weight: 700; }
.button-link:hover { background: var(--vb-primary-hover); }
.secondary-link { color: var(--vb-text); background: var(--vb-surface); border: 1px solid var(--vb-border); }
.secondary-link:hover { color: var(--vb-text); background: var(--vb-surface-muted); }
.page-topbar { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.page-topbar h1 { margin: .15rem 0; }
.page-kicker { margin: 0; color: var(--vb-primary); font-weight: 700; }
.page-subtitle { margin: 0; color: var(--vb-text-muted); line-height: 1.5; }
.page-actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.metric-card { background: var(--vb-surface); border: 1px solid var(--vb-border); border-radius: 8px; padding: 1rem; }
.metric-card p, .metric-card span { margin: 0; color: var(--vb-text-muted); }
.metric-card strong { display: block; margin: .35rem 0; font-size: 1.6rem; }
.status-badge, .role-badge { display: inline-flex; align-items: center; min-height: 1.6rem; border-radius: 999px; padding: .15rem .55rem; font-size: .88rem; font-weight: 700; border: 1px solid var(--vb-border); background: var(--vb-surface-muted); color: var(--vb-text); white-space: nowrap; }
.status-success { background: color-mix(in srgb, var(--vb-success) 12%, var(--vb-surface)); color: var(--vb-success); border-color: color-mix(in srgb, var(--vb-success) 35%, var(--vb-border)); }
.status-warning { background: color-mix(in srgb, var(--vb-warning) 14%, var(--vb-surface)); color: var(--vb-warning); border-color: color-mix(in srgb, var(--vb-warning) 35%, var(--vb-border)); }
.status-danger { background: color-mix(in srgb, var(--vb-error) 12%, var(--vb-surface)); color: var(--vb-error); border-color: color-mix(in srgb, var(--vb-error) 35%, var(--vb-border)); }
.badge-list { display: flex; gap: .35rem; flex-wrap: wrap; }
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; border-bottom: 1px solid var(--vb-border); }
.tab-button { color: var(--vb-text); background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; }
button.tab-button.active, button.tab-button:hover:not(:disabled) { color: var(--vb-primary); background: color-mix(in srgb, var(--vb-primary) 10%, var(--vb-surface)); border-bottom-color: var(--vb-primary); }
.inline-control { display: inline-flex; align-items: center; gap: .5rem; color: var(--vb-text-muted); font-weight: 700; }
.inline-control select { min-width: 5rem; }
.person-cell { display: flex; gap: .7rem; align-items: center; min-width: 14rem; }
.person-cell small { display: block; color: var(--vb-text-muted); margin-top: .1rem; }
.avatar { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: color-mix(in srgb, var(--vb-primary) 16%, var(--vb-surface)); color: var(--vb-primary); font-weight: 800; flex: 0 0 auto; }
.permission-cell { max-width: 26rem; line-height: 1.45; }
.permission-matrix th:first-child { min-width: 13rem; }
.personnel-filters { max-width: none; grid-template-columns: minmax(14rem, 2fr) minmax(11rem, 1fr) auto; align-items: end; padding: .9rem; margin: 0 0 1rem; background: var(--vb-surface-muted); border: 1px solid var(--vb-border); border-radius: 8px; }
.personnel-filters label { display: grid; gap: .35rem; font-weight: 700; color: var(--vb-text-muted); }
.personnel-filter-action { padding-bottom: 0; }
.org-workbench { display: grid; grid-template-columns: minmax(15rem, .85fr) minmax(0, 1.5fr); gap: 1rem; }
.org-admin-tree { border-right: 1px solid var(--vb-border); padding-right: 1rem; max-height: 32rem; overflow: auto; }
.org-admin-tree h2 { font-size: 1rem; }
.org-admin-node { padding-left: calc(var(--level) * .85rem); }
.org-admin-node button, .text-button { color: var(--vb-text); background: transparent; border: 0; padding: .42rem .5rem; text-align: left; }
.org-admin-node button { width: 100%; }
.org-admin-node button:hover, .org-admin-node button.active { color: var(--vb-primary); background: color-mix(in srgb, var(--vb-primary) 10%, var(--vb-surface)); }
.text-button { text-decoration: underline; text-underline-offset: .15em; }
.org-facts { margin: 1.25rem 0 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.form-grid label { display: grid; gap: .35rem; }
.org-sidebar { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; background: var(--vb-surface); border: 1px solid var(--vb-border); border-radius: 8px; padding: 1rem; }
.org-sidebar-heading { display: flex; justify-content: space-between; gap: .75rem; align-items: flex-start; margin-bottom: .75rem; }
.org-sidebar-heading h2 { margin: 0; font-size: 1rem; }
.org-sidebar-heading p { margin: .2rem 0 0; color: var(--vb-text-muted); font-size: .9rem; }
.org-tree { display: grid; gap: .2rem; }
.org-node-row { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr); align-items: start; padding-left: calc(var(--level) * .85rem); }
.org-node, .org-toggle { color: var(--vb-text); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.org-node { display: grid; gap: .1rem; width: 100%; padding: .45rem .55rem; text-align: left; }
.org-node small { color: var(--vb-text-muted); }
.org-node.active, .org-node:hover { background: color-mix(in srgb, var(--vb-primary) 12%, var(--vb-surface)); color: var(--vb-primary); }
.org-node.active small { color: var(--vb-primary); }
.org-toggle { width: 1.5rem; min-height: 1.5rem; padding: 0; margin-top: .35rem; font-weight: 700; }
.org-toggle-placeholder { width: 1.5rem; }
.sidebar-open, .drawer-close, .drawer-scrim { display: none; }

/* Dashboard: a quiet operational ledger, not a generic KPI wall. */
.welcome-panel { max-width: 40rem; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 1.5rem 0; border-block: 1px solid var(--vb-border); }
.dashboard-metric { min-width: 0; padding: 1.1rem 1.2rem; border-left: 1px solid var(--vb-border); }
.dashboard-metric:first-child { border-left: 0; padding-left: 0; }
.dashboard-metric span, .dashboard-metric small { display: block; color: var(--vb-text-muted); font-size: .78rem; line-height: 1.45; }
.dashboard-metric strong { display: block; margin: .35rem 0 .15rem; color: var(--vb-text); font-size: 2rem; font-weight: 700; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.dashboard-metric.metric-overdue strong { color: var(--vb-error); }
.dashboard-metric.metric-completed strong { color: var(--vb-success); }
.dashboard-panel { margin-top: 1.15rem; padding: 0; overflow: hidden; }
.dashboard-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; }
.workbench-panel .dashboard-panel-head { flex-wrap: wrap; }
.dashboard-panel-head h2 { font-size: 1rem; margin: 0; }
.dashboard-panel-head p { margin: .2rem 0 0; color: var(--vb-text-muted); font-size: .84rem; }
.dashboard-table-scroll { margin-top: 0; border-top: 1px solid var(--vb-border); }
.dashboard-table { min-width: 690px; font-size: .85rem; }
.dashboard-table th { padding: .7rem 1rem; font-size: .72rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; background: var(--vb-surface-muted); }
.dashboard-table td { padding: .8rem 1rem; vertical-align: middle; }
.dashboard-table td:first-child { min-width: 18rem; }
.dashboard-table a { color: var(--vb-text); font-weight: 700; text-decoration: none; }
.dashboard-table a:hover { color: var(--vb-primary); text-decoration: underline; text-underline-offset: .15em; }
.dashboard-table small { display: block; margin-top: .2rem; color: var(--vb-text-muted); font-size: .76rem; }
.deadline { font-variant-numeric: tabular-nums; white-space: nowrap; }
.deadline-overdue { color: var(--vb-error); font-weight: 700; }
.deadline-overdue small { color: var(--vb-error); font-weight: 400; }
.dashboard-empty { padding: 1.25rem; margin: 0; color: var(--vb-text-muted); text-align: center; }
.dashboard-message { max-width: 38rem; }
.dashboard-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(18rem, .85fr); gap: 1.15rem; }
.dashboard-bottom-grid .dashboard-panel { min-height: 15rem; }
.unit-progress-list { display: grid; gap: 1rem; padding: .25rem 1.2rem 1.25rem; }
.unit-progress > div:first-child { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .38rem; font-size: .82rem; }
.unit-progress strong { color: var(--vb-text-muted); font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.unit-progress-track { height: .42rem; overflow: hidden; background: var(--vb-surface-muted); border-radius: 99px; }
.unit-progress-track span { display: block; height: 100%; background: var(--vb-primary); border-radius: inherit; }
.activity-list { display: grid; gap: .9rem; margin: 0; padding: .35rem 1.2rem 1.25rem 2.25rem; }
.activity-list li { padding-left: .1rem; color: var(--vb-text); }
.activity-list li::marker { color: var(--vb-primary); }
.activity-list strong, .activity-list span, .activity-list small { display: block; }
.activity-list strong { font-size: .82rem; }
.activity-list span { margin-top: .15rem; font-size: .82rem; overflow-wrap: anywhere; }
.activity-list small { margin-top: .2rem; color: var(--vb-text-muted); font-size: .75rem; }

@media (max-width: 720px) {
    .site-header { align-items: stretch; }
    .brand-block, .top-nav, .auth-actions { width: 100%; }
    .auth-actions { margin-left: 0; justify-content: flex-start; }
    .theme-select { flex: 1 1 180px; }
    .app-shell { display: block; width: min(100% - 1rem, 100%); margin: 1rem auto; }
    .app-main { padding: 0 .25rem; }
    .org-sidebar { display: none; position: fixed; inset: 0 auto 0 0; z-index: 31; width: min(340px, calc(100vw - 2rem)); max-height: none; border-radius: 0; }
    .org-sidebar.open { display: block; }
    .sidebar-open, .drawer-close { display: inline-block; margin-bottom: 1rem; }
    .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 30; padding: 0; border: 0; border-radius: 0; background: var(--vb-backdrop); }
    .page-topbar { display: grid; }
    .page-actions { justify-content: flex-start; }
    .metric-grid { grid-template-columns: 1fr; }
    .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-metric:nth-child(3) { border-left: 0; padding-left: 0; }
    .dashboard-bottom-grid { grid-template-columns: 1fr; }
    .personnel-filters { grid-template-columns: 1fr; }
    .org-workbench { grid-template-columns: 1fr; }
    .org-admin-tree { border-right: 0; border-bottom: 1px solid var(--vb-border); padding: 0 0 1rem; max-height: 18rem; }
    .form-grid { grid-template-columns: 1fr; }
}
