:root {
    color-scheme: light;
    --primary: #2047e7;
    --on-primary: #ffffff;
    --brand-secondary: #0c1a3b;
    --background: #edf1f8;
    --surface: #ffffff;
    --field: #f5f7fb;
    --text: #111a2c;
    --muted: #4c5d77;
    --line: #d7deeb;
    --field-line: #8494ad;
    --focus: #2555d9;
    --shadow: 0 24px 65px #243b6920;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --background: #101626;
    --surface: #192337;
    --field: #111b2d;
    --text: #f0f4ff;
    --muted: #b0bed7;
    --line: #33435c;
    --field-line: #7384a1;
    --focus: #a5baff;
    --shadow: 0 24px 65px #05081052;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        color-scheme: dark;
        --background: #101626;
        --surface: #192337;
        --field: #111b2d;
        --text: #f0f4ff;
        --muted: #b0bed7;
        --line: #33435c;
        --field-line: #7384a1;
        --focus: #a5baff;
        --shadow: 0 24px 65px #05081052;
    }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); line-height: 1.5; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.85rem, 3vw, 2.55rem); letter-spacing: -.035em; line-height: 1.12; margin-bottom: .65rem; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; line-height: 1.25; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}
form, label { display: grid; gap: .5rem; }
form { gap: 1.15rem; }
label { min-width: 0; font-weight: 620; font-size: .92rem; }
input, button, .button { min-height: 44px; border-radius: .65rem; font: inherit; }
input {
    width: 100%;
    min-width: 0;
    padding: .66rem .82rem;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--field-line);
}
input[type="color"] { min-height: 48px; padding: .36rem .5rem; cursor: pointer; }
input[readonly] { color: var(--muted); }
button, .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: 1px solid transparent;
    padding: .65rem 1rem;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}
button:hover, .button:hover { filter: brightness(.91); }
.secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.muted, .optional { color: var(--muted); }
.optional { font-size: .8rem; font-weight: 400; }
[role="alert"], .notice {
    background: var(--field);
    padding: .75rem 1rem;
    border: 1px solid var(--line);
    border-left: .25rem solid var(--focus);
    border-radius: .45rem;
    overflow-wrap: anywhere;
}
[role="alert"] { border-left-color: #d75257; }
.product { display: inline-flex; gap: .7rem; align-items: center; text-decoration: none; font-weight: 800; }
.product-mark {
    display: grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    border-radius: .72rem;
    flex: 0 0 auto;
    font-size: .84rem;
    background: var(--primary);
    color: var(--on-primary);
}

.login-layout { display: grid; grid-template-columns: minmax(0, 45fr) minmax(0, 55fr); min-height: 100vh; min-height: 100svh; }
.login-brand {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    min-width: 0;
    padding: clamp(2rem, 5vw, 5rem);
    color: #fff;
    background: linear-gradient(145deg, #0a142e, #1235b5);
    background: linear-gradient(145deg, color-mix(in srgb, var(--brand-secondary) 55%, #071123), color-mix(in srgb, var(--primary) 64%, #091435));
}
.login-brand::before, .login-brand::after {
    position: absolute;
    z-index: -1;
    width: 33rem;
    height: 33rem;
    border: 1px solid #ffffff1c;
    border-radius: 50%;
    content: "";
    pointer-events: none;
}
.login-brand::before { top: -13rem; right: -13rem; }
.login-brand::after { bottom: -15rem; left: -15rem; }
.login-image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .34;
}
.login-brand-copy { position: relative; min-width: 0; }
.login-brand-copy h1 {
    margin: 0;
    font-size: clamp(2.65rem, 5.2vw, 5.2rem);
    line-height: .99;
    letter-spacing: -.07em;
    font-weight: 850;
}
[data-fit-company-name] { display: block; width: 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-logo { display: block; width: 3rem; height: 2rem; padding: .22rem; object-fit: contain; border-radius: .4rem; flex: 0 0 auto; }
.login-company-logo {
    display: block;
    width: min(100%, 19rem);
    height: 8.75rem;
    margin-bottom: clamp(.8rem, 2vw, 1.45rem);
    object-fit: contain;
    object-position: left center;
}
.login-footer { margin: 0; color: #e0eaff; font-size: .82rem; }
.login-panel { position: relative; display: grid; place-items: center; padding: 5.25rem 1.4rem 3rem; }
.login-panel .theme-toggle { position: absolute; top: 1.2rem; right: 1.4rem; }
.theme-toggle { width: 44px; height: 44px; padding: 0; flex: 0 0 auto; }
.theme-icon { position: relative; display: block; width: 18px; height: 18px; }
.theme-icon::before, .theme-icon::after { content: ""; position: absolute; border-radius: 50%; }
.theme-icon::before { inset: 4px; border: 2px solid currentColor; }
.theme-icon::after {
    width: 2px;
    height: 2px;
    top: 8px;
    left: 8px;
    box-shadow: 0 -8px, 0 8px, -8px 0, 8px 0, -6px -6px, 6px -6px, -6px 6px, 6px 6px;
}
.theme-toggle[aria-pressed="true"] .theme-icon::before {
    inset: 1px;
    border: 0;
    box-shadow: inset 5px -4px currentColor;
}
.theme-toggle[aria-pressed="true"] .theme-icon::after { display: none; }
.login-card, .setup-card, .settings-card {
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: var(--surface);
}
.login-card { width: min(100%, 27.5rem); padding: clamp(1.5rem, 3vw, 2.4rem); box-shadow: var(--shadow); }
.login-card h2 { font-size: clamp(1.55rem, 2.2vw, 2.1rem); margin-bottom: .65rem; }
.login-card form button { margin-top: .45rem; }
.login-link { text-align: center; margin: 1.15rem 0 0; font-size: .86rem; }

.setup-card { width: min(calc(100% - 2rem), 46rem); margin: 2.5rem auto; padding: clamp(1rem, 4vw, 2.5rem); box-shadow: var(--shadow); }
.setup-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.55rem; }
.step-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
    padding: 0;
    margin: 1rem 0 1.55rem;
    list-style: none;
    counter-reset: setup-step;
}
.step-nav li {
    counter-increment: setup-step;
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem .35rem;
    font-size: .82rem;
    color: var(--muted);
    border-bottom: 2px solid var(--line);
}
.step-nav li::before { content: counter(setup-step); display: grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: 50%; background: var(--field); flex: 0 0 auto; }
.step-nav li[aria-current] { color: var(--text); border-color: var(--primary); font-weight: 700; }
.step-nav li[aria-current]::before { background: var(--primary); color: var(--on-primary); }
[data-wizard-step] { display: grid; gap: 1rem; }
[data-wizard-step] h2 { margin: 0; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.server-fields { grid-template-columns: minmax(0, 1fr) minmax(4.5rem, 7rem); }
.setup-tools, .wizard-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.wizard-actions { justify-content: flex-end; }

.admin-page { overflow: hidden; }
.admin-layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}
.admin-workspace { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--line);
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 96%, var(--brand-secondary));
    padding: 1.35rem 1rem .85rem;
}
.sidebar-company {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: start;
    flex: 0 0 auto;
    gap: .6rem;
    padding: 0 .45rem;
    margin-bottom: 1.25rem;
    color: var(--text);
    font-size: 1.16rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-decoration: none;
}
.sidebar-logo {
    width: min(100%, 12rem);
    height: 4.75rem;
    object-fit: contain;
    object-position: left center;
}
.sidebar nav { display: grid; align-content: start; gap: .35rem; min-height: 0; overflow: auto; }
.sidebar-footer {
    margin-top: auto;
    padding: .75rem .45rem 0;
    color: var(--muted);
    font-size: .78rem;
}
.sidebar nav a {
    border-radius: .65rem;
    padding: .65rem .75rem;
    color: var(--muted);
    font-weight: 650;
    text-decoration: none;
}
.sidebar nav a[aria-current], .sidebar nav a:hover { background: var(--field); color: var(--text); }
.sidebar nav a[aria-current] { box-shadow: inset 3px 0 var(--primary); }
.topbar {
    position: relative;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .9rem;
    min-height: 4.3rem;
    padding: .6rem clamp(.85rem, 3vw, 2.1rem);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .55rem; color: var(--muted); font-size: .9rem; }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 650; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
.user-menu { position: relative; flex: 0 0 auto; }
.user-menu summary { padding: .65rem .85rem; cursor: pointer; border: 1px solid var(--line); border-radius: .65rem; }
.user-popover {
    position: absolute;
    top: calc(100% + .45rem);
    right: 0;
    z-index: 4;
    width: min(16rem, 80vw);
    padding: .9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: .9rem;
    box-shadow: var(--shadow);
}
.user-popover p { color: var(--muted); font-size: .83rem; overflow-wrap: anywhere; }
.user-popover button { width: 100%; }
.user-popover form { margin-top: .5rem; }
.admin-content { position: relative; min-height: 0; overflow: auto; padding: clamp(1rem, 3.8vw, 3.4rem); }
.has-actions { padding-bottom: 7rem; scroll-padding-bottom: 7rem; }
.settings-card { width: min(100%, 51rem); padding: clamp(1rem, 3vw, 1.8rem); }
.settings-card section { display: grid; gap: .9rem; }
.settings-card section + section { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.settings-card h2, .settings-card section p { margin-bottom: 0; }
.overview-card { margin-top: 1.5rem; }
.overview-card h2 { margin-bottom: .5rem; }
.image-preview { display: block; width: min(100%, 24rem); max-height: 12rem; object-fit: cover; border-radius: .6rem; }
.logo-preview {
    width: 8rem;
    height: 4.75rem;
    border: 1px solid var(--line);
    background: repeating-conic-gradient(#d7dce4 0% 25%, #f6f7fa 0% 50%) 50% / 14px 14px;
}
.checkbox { display: flex; gap: .6rem; align-items: center; }
.checkbox input { width: 1.15rem; min-height: 1.15rem; }
.action-bar {
    position: fixed;
    right: clamp(.75rem, 3vw, 2.1rem);
    bottom: max(.75rem, env(safe-area-inset-bottom));
    z-index: 3;
    display: flex;
    gap: .65rem;
    padding: .6rem;
    border: 1px solid var(--line);
    border-radius: .9rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}
@media (max-width: 760px) {
    .login-layout { grid-template-columns: minmax(0, 1fr); }
    .login-brand { gap: 1.5rem; padding: 1.5rem; }
    .login-brand-copy h1 { font-size: clamp(2.35rem, 8vw, 3.2rem); }
    .login-company-logo { width: min(100%, 14rem); height: 6.25rem; }
    .login-panel { padding: 4.65rem 1rem 1.5rem; }
    .login-panel .theme-toggle { top: .75rem; right: 1rem; }
    .admin-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
    .sidebar { min-height: 0; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .8rem .85rem; }
    .sidebar-company { gap: .35rem; margin-bottom: .5rem; font-size: 1rem; }
    .sidebar-logo { height: 2.85rem; }
    .sidebar-footer { padding-top: .35rem; }
    .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 410px) {
    .step-nav li { font-size: .7rem; }
    .step-nav li::before { width: 1.22rem; height: 1.22rem; }
    .field-pair:not(.server-fields) { grid-template-columns: minmax(0, 1fr); }
    .setup-card { margin-top: 1rem; }
}

.document-toolbar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .65rem; margin: 1.25rem auto; width: min(calc(100% - 2rem), 46rem); }
.document-sheet { width: min(calc(100% - 2rem), 46rem); min-height: 29rem; margin: 0 auto 2rem; padding: clamp(1.25rem, 5vw, 3.5rem); background: #fff; color: #111827; border: 1px solid var(--line); border-radius: 1rem; }
.document-header { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid #a1adbc; break-inside: avoid; }
.document-header .company-logo { width: 8rem; height: 4rem; }
.document-header div { display: grid; overflow-wrap: anywhere; }
.document-header a { font-size: .85rem; }

@page { size: A4 portrait; margin: 10mm; }
@media print {
    :root { color-scheme: light; }
    body { background: #fff; }
    .document-toolbar { display: none; }
    .document-sheet { width: auto; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 0; }
}

.personnel-card { margin-top: 1.25rem; }
.personnel-filters { grid-template-columns: minmax(0, 1fr) minmax(7rem, auto) auto; align-items: end; margin-bottom: 1.15rem; }
.admin-content select {
    min-height: 44px;
    border: 1px solid var(--field-line);
    border-radius: .65rem;
    padding: .66rem .82rem;
    background: var(--field);
    color: var(--text);
    font: inherit;
}
.admin-content select:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.personnel-table { width: 100%; border-collapse: collapse; text-align: left; }
.personnel-table th, .personnel-table td { padding: .65rem .45rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.personnel-table td:first-child { width: 72%; }
.personnel-pagination { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1rem; }
.role-options { min-width: 0; margin: 0; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: .65rem; }
.role-options .checkbox + .checkbox { margin-top: .5rem; }
.work-role-list { margin-top: 0; padding-left: 1.3rem; }
@media (max-width: 550px) {
    .personnel-filters { grid-template-columns: 1fr; }
}

.catalog-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.catalog-row small { display: block; }
.planning-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.assignment-form { margin-top: 1rem; }
.planning-grid details > summary { cursor: pointer; font-weight: 700; }
.planning-grid details[open] > summary { margin-bottom: 1rem; }
.planning-grid details h2:not(:first-child) { margin-top: 1rem; }

.system-card { margin-bottom: 1.25rem; }
.system-report { padding-left: 1.25rem; }
.system-report li + li { margin-top: .3rem; }
.system-card [data-system-endpoints] { margin-top: 1rem; }

.page-heading-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin: 1rem 0; }
.table-scroll { overflow-x: auto; }
.staff-table td:first-child, .event-lists .personnel-table td:first-child { width: auto; }
.staff-table td:last-child { text-align: right; }
.staff-contact small { display: block; color: var(--muted); }
.staff-status { display: inline-block; background: var(--field); border: 1px solid var(--line); border-radius: .4rem; padding: .18rem .45rem; font-size: .83rem; }
.settings-card textarea { width: 100%; min-width: 0; padding: .66rem .82rem; color: var(--text); background: var(--field); border: 1px solid var(--field-line); border-radius: .65rem; font: inherit; resize: vertical; }
.event-lists h3 { margin-top: 1.2rem; margin-bottom: .25rem; }
.event-lists .personnel-table td:nth-child(-n+2) { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.danger-button { background: #a72131; color: #fff; }

.direct-plan { width: min(100%, 72rem); }
.direct-plan [data-direct-planning] { gap: .65rem; grid-template-columns: minmax(0, 1fr); }
.plan-grid-scroll {
    max-width: 100%;
    overflow: visible;
    border: 1px solid var(--field-line);
    border-radius: .6rem;
}
.plan-grid-scroll:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.plan-grid { width: 100%; min-width: 40rem; border-spacing: 0; border-radius: inherit; text-align: left; font-size: .9rem; }
.plan-grid th, .plan-grid td {
    border-inline-end: 1px solid var(--line);
    border-block-end: 1px solid var(--line);
    padding: .3rem .55rem;
}
.plan-grid :is(th, td):last-child { border-inline-end: 0; }
.plan-grid tbody tr:last-child td { border-block-end: 0; }
.plan-grid th { background: var(--background); }
@media (max-width: 66rem) {
    .plan-grid-scroll { overflow-x: auto; }
}
.plan-grid th[data-plan-column="person"], .plan-grid th[data-plan-column="role"] { width: 29%; }
.plan-grid tbody tr:nth-child(even) { background: var(--field); }
.plan-grid .plan-grid-tools { width: 5.25rem; padding-inline: .35rem; }
.plan-column-heading, .plan-row-tools, .plan-move-controls { display: flex; align-items: center; gap: .15rem; }
.plan-column-heading { justify-content: space-between; gap: .4rem; }
.plan-grid [draggable="true"] { cursor: grab; }
.plan-grid [data-plan-handle="column"] { flex: 1; padding-block: .2rem; }
.plan-grid [data-plan-handle="row"] { padding-inline: .2rem; color: var(--muted); }
.plan-grid button {
    min-height: 1.65rem;
    min-width: 1.55rem;
    border-radius: .25rem;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-weight: 500;
}
.plan-grid button:not([aria-disabled="true"]):hover { background: var(--surface); color: var(--text); }
.plan-grid button[aria-disabled="true"] { opacity: .35; cursor: default; }
.plan-grid :is(.plan-grid-draft, .plan-grid-editing) :is(input, select) {
    display: block;
    min-height: 2.05rem;
    width: 100%;
    margin: 0;
    padding: .2rem .35rem;
    border: 1px solid var(--field-line);
    border-radius: .25rem;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.plan-grid-draft input[type="hidden"] { display: none; }
.plan-grid :is(.plan-grid-draft, .plan-grid-editing) :is(input, select):focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.plan-grid th[data-plan-drop="before"] { box-shadow: inset 3px 0 var(--focus); }
.plan-grid th[data-plan-drop="after"] { box-shadow: inset -3px 0 var(--focus); }
.plan-grid tr[data-plan-drop="before"] td { box-shadow: inset 0 3px var(--focus); }
.plan-grid tr[data-plan-drop="after"] td { box-shadow: inset 0 -3px var(--focus); }
.plan-grid-conflict { color: var(--muted); font-size: .8rem; font-weight: 700; }
.plan-grid-note { margin: 0; font-size: .85rem; }
.direct-plan [data-direct-planning] .page-heading-actions { margin: .2rem 0 0; }

.plan-list-heading, .plan-export-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.plan-list-heading { justify-content: space-between; margin: 1rem 0 .5rem; }
.plan-list-heading h3 { margin: 0; }
.plan-export-actions button { min-height: 2.35rem; padding: .3rem .65rem; font-size: .86rem; }
.plan-export-message { margin: 0 0 .5rem; }
.plan-export-message:empty { display: none; }
.planning-suggestions {
    position: fixed;
    z-index: 100;
    overflow-y: auto;
    margin: 0;
    padding: .25rem;
    list-style: none;
    border: 1px solid var(--field-line);
    border-radius: .45rem;
    box-shadow: var(--shadow);
    background: var(--surface);
    color: var(--text);
    font-size: .9rem;
}
.planning-suggestions li { padding: .45rem .55rem; overflow-wrap: anywhere; }
.planning-suggestions [role="option"] { cursor: pointer; border-radius: .25rem; }
.planning-suggestions [role="option"]:hover,
.planning-suggestions [aria-selected="true"] { background: var(--primary); color: var(--on-primary); }
.plan-print-sheet { display: none; }
@page planning-a4 { size: A4 portrait; margin: 0; }
@media print {
    [data-plan-export-blank] { visibility: hidden; }
    body.printing-plan > :not(.plan-print-sheet) { display: none !important; }
    body.printing-plan { display: block; margin: 0; height: auto; overflow: visible; color: #111827; }
    .plan-print-sheet { display: block; color: #111827; font-family: Arial, sans-serif; }
    .plan-print-page {
        page: planning-a4;
        position: relative;
        box-sizing: border-box;
        width: 210mm;
        min-height: 296mm;
        padding: 10mm;
        background: white;
    }
    .plan-print-page + .plan-print-page { break-before: page; }
    .plan-print-page header { display: flex; align-items: center; gap: 4mm; height: 12mm; }
    .plan-print-page header img { max-width: 39mm; max-height: 12mm; object-fit: contain; }
    .plan-print-page h1, .plan-print-page p, .plan-print-page footer { margin: 0; white-space: nowrap; }
    .plan-print-page h1 { height: 10mm; line-height: 10mm; margin-top: 2mm; }
    .plan-print-page p { height: 8mm; line-height: 8mm; margin-bottom: 4mm; }
    .plan-print-page footer {
        position: absolute;
        inset: auto 10mm 10mm;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 4mm;
        border-top: 0.18mm solid #a1adbc;
        padding-top: 2mm;
    }
    .plan-print-page table { width: 100%; table-layout: fixed; border-collapse: collapse; }
    .plan-print-page thead { background: #e4edf6; }
    .plan-print-page tr { break-inside: avoid; height: 7.5mm; }
    .plan-print-page th, .plan-print-page td {
        box-sizing: border-box;
        border: 0.18mm solid #a1adbc;
        padding: 0 2mm;
        line-height: 1.15;
        text-align: left;
        white-space: nowrap;
    }
}

.plan-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: .75rem 0;
}
.plan-tab {
    display: grid;
    align-content: center;
    min-width: 0;
    min-height: 2.75rem;
    padding: .35rem .75rem;
    border: 1px solid var(--line);
    border-radius: .55rem;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    overflow-wrap: anywhere;
    font-size: .88rem;
}
.plan-tab time { color: var(--muted); font-size: .8rem; }
.plan-tab:hover { background: var(--field); border-color: var(--field-line); }
.plan-tab[aria-current="page"] {
    border-color: var(--primary);
    box-shadow: inset 0 -3px var(--primary);
    background: var(--field);
    font-weight: 700;
}
.plan-tab-step { color: var(--muted); }
.plan-day-lists {
    border-block: 1px solid var(--line);
    margin: .85rem 0;
    padding: .75rem 0;
}
.plan-day-lists h3 { margin: 0; font-size: 1rem; }
.plan-stations { margin: .55rem 0; }
.plan-list-count { color: var(--muted); font-size: .8rem; font-weight: 400; }


[data-plan-edit-form] { display: none; }
.plan-grid tr[id] { scroll-margin-top: .75rem; }
.plan-grid-actions { width: 7rem; }
.plan-row-status { display: block; color: var(--muted); }
.plan-cancelled { margin-top: .85rem; }
.plan-row-actions { display: flex; justify-content: flex-end; gap: .2rem; }
.plan-grid .plan-action-icon {
    display: inline-grid;
    place-items: center;
    min-width: 2rem;
    min-height: 2rem;
    border: 1px solid var(--line);
    border-radius: .3rem;
    color: var(--text);
    background: var(--surface);
    font-size: 1.1rem;
    line-height: 1;
    text-decoration: none;
}
.plan-grid .plan-action-icon:hover { border-color: var(--field-line); background: var(--background); }
.plan-grid-editing td { background: var(--field); }
.plan-grid-editing .plan-action-icon[type="submit"] { border-color: var(--primary); }
.plan-inline-error { margin: .3rem 0 0; font-size: .8rem; }

.plan-list-add {
    align-self: stretch;
    min-width: 2.75rem;
    justify-content: center;
    font-size: 1.45rem;
    line-height: 1;
}
.plan-list-dialog {
    width: min(30rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    margin: auto;
    color: var(--text);
}
.plan-list-dialog::backdrop { background: rgb(0 0 0 / 55%); }
.plan-cancelled .catalog-row form { margin: 0; }
.event-settings-trigger {
    min-width: 2.85rem;
    padding-inline: .65rem;
    font-size: 1.35rem;
    line-height: 1;
}
.event-settings-dialog {
    width: min(42rem, calc(100% - 2rem));
    overflow: auto;
}
.event-settings-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    margin-bottom: .75rem;
}
.event-settings-dialog > details {
    border-top: 1px solid var(--line);
    padding-block: .7rem;
}
.event-settings-dialog > details > summary {
    font-weight: 700;
    cursor: pointer;
}
.event-settings-dialog form + form { margin-top: .75rem; }

.event-overview-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: .8rem; margin-block: 1rem; }
.event-overview-toolbar label { flex: 1 1 16rem; max-width: 28rem; }
.event-overview { width: min(100%, 64rem); display: grid; gap: 1.2rem; }
.event-overview-group { display: grid; gap: .5rem; }
.event-overview-group h2 { margin: 0 0 .25rem; }
.event-overview-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: .8rem;
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
}
.event-overview-row:hover { border-color: var(--primary); }
.event-date-tile { display: grid; place-items: center; min-width: 3rem; padding: .3rem; border-radius: .5rem; background: var(--field); }
.event-date-tile strong { font-size: 1.25rem; line-height: 1.1; }
.event-overview-info { display: grid; gap: .15rem; overflow-wrap: anywhere; }
.event-overview-info span { color: var(--muted); font-size: .9rem; }
.event-settings-trigger { font-size: inherit; }
.event-settings-trigger span { margin-right: .35rem; font-size: 1.2em; }
.plan-action-bar { justify-content: flex-end; flex-wrap: wrap; max-width: calc(100% - 1.5rem); }
@media (max-width: 480px) { .plan-action-bar button, .plan-action-bar a { padding-inline: .55rem; font-size: .8rem; } }
.plan-list-group { display: grid; gap: .3rem; }
.plan-list-group[role="group"] { padding: .5rem; border: 1px solid var(--line); border-radius: .7rem; }
.plan-group-name { font-size: .85rem; font-weight: 700; }
.plan-list-tabs { display: flex; flex-wrap: wrap; gap: .45rem; }
.plan-list-actions { display: flex; gap: .45rem; align-self: end; }
.plan-list-tabs .plan-tab, .plan-list-actions .plan-tab { min-height: 3.5rem; }
.plan-list-actions .plan-tab { align-self: stretch; }

.event-view-switch { display: inline-flex; gap: .35rem; }
.event-view-switch [aria-current="page"] { border-color: var(--primary); box-shadow: inset 0 -2px var(--primary); }
.event-calendar { width: min(100%, 76rem); }
.calendar-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .75rem; }
.calendar-heading h2, .calendar-heading nav { margin: 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; }
.calendar-weekday { text-align: center; color: var(--muted); font-weight: 700; }
.calendar-day, .calendar-spacer { min-width: 0; min-height: 6rem; background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; padding: .35rem; }
.calendar-spacer { background: var(--field); }
.calendar-day-link { display: flex; justify-content: space-between; align-items: center; padding: .25rem .4rem; min-height: 2rem; border-radius: .35rem; text-decoration: none; }
.calendar-day-link:hover, .calendar-day-link[aria-current="date"] { background: var(--field); font-weight: 700; }
.calendar-event { display: block; margin-top: .3rem; padding: .3rem .35rem; border-inline-start: 2px solid var(--primary); border-radius: .3rem; background: var(--field); color: var(--text); text-decoration: none; font-size: .83rem; overflow-wrap: anywhere; }
.calendar-event:hover { text-decoration: underline; }
.calendar-draft { border: 1px dashed var(--field-line); }
.calendar-draft small { display: block; color: var(--muted); }
.calendar-action-bar { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 1.5rem); }
.calendar-mobile-date { display: none; }
@media (max-width: 650px) {
    .calendar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .calendar-weekday, .calendar-spacer { display: none; }
    .calendar-mobile-date { display: inline; }
    .calendar-day { min-height: 3rem; }
    .calendar-day-link { min-height: 2.75rem; }
}

.topbar-location { display: flex; align-items: center; min-width: 0; gap: .65rem; }
.mobile-navigation { display: none; }
@media (max-width: 760px) {
    .mobile-navigation[open] {
        display: flex;
        position: fixed;
        inset: 0 auto 0 0;
        margin: 0;
        width: min(21rem, 88vw);
        max-width: none;
        height: 100dvh;
        max-height: none;
        border: 0;
        padding: 0;
        background: var(--surface);
        color: var(--text);
        box-shadow: var(--shadow);
    }
    .mobile-navigation::backdrop { background: rgb(0 0 0 / 52%); }
    .mobile-navigation .sidebar {
        flex: 1;
        padding: max(.9rem, env(safe-area-inset-top)) 1rem max(.9rem, env(safe-area-inset-bottom));
        border-bottom: 0;
    }
    .mobile-navigation .sidebar nav { grid-template-columns: minmax(0, 1fr); }
    .mobile-navigation .sidebar-company { padding-right: 3rem; }
    .mobile-nav-close { position: absolute; z-index: 1; top: max(.65rem, env(safe-area-inset-top)); right: .65rem; }
    .mobile-nav-trigger, .mobile-nav-close { width: 2.75rem; min-height: 2.75rem; padding: .25rem; font-size: 1.15rem; }
    .topbar { min-height: 3.5rem; gap: .45rem; padding: .4rem .65rem; }
    .topbar .breadcrumbs { min-width: 0; display: block; }
    .topbar .breadcrumbs > :not([aria-current]) { display: none; }
    .topbar .breadcrumbs [aria-current] { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .topbar-actions { gap: .3rem; }
    .user-menu summary { padding-inline: .55rem; }
    .admin-layout:has(> .mobile-navigation > .sidebar) { grid-template-rows: minmax(0, 1fr); }
}

.event-overview-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .6rem;
}
@media (max-width: 540px) {
    .event-overview-entry { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
    .event-report-link { justify-self: end; }
}

.staff-report {
    --report-ink: #142a39;
    --report-muted: #405764;
    --report-line: #ccd8e1;
    --report-tint: #edf4f7;
    padding: clamp(1rem, 4vw, 2.75rem);
    color: var(--report-ink);
}
.staff-report .document-header { margin-bottom: 1.2rem; border-bottom: 2px solid #274b61; }
.staff-report .document-header a { color: #244e66; }
.report-kicker { color: #274b61; font-size: .85rem; font-weight: 700; margin-bottom: .3rem; }
.staff-report h1 { overflow-wrap: anywhere; margin-top: .3rem; }
.report-meta, .report-note { color: var(--report-muted); margin-block: .45rem; }
.report-note { font-size: .87em; }
.report-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-block: 1.25rem .6rem; break-inside: avoid; }
.report-metrics > div, .report-empty { padding: .7rem .8rem; border: 1px solid var(--report-line); border-radius: .55rem; background: var(--report-tint); }
.report-metrics dt { color: var(--report-muted); font-size: .8rem; overflow-wrap: anywhere; }
.report-metrics dd { margin: 0; font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.staff-report h2 { margin-top: 1.3rem; }
.report-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.report-table th, .report-table td { border-bottom: 1px solid var(--report-line); padding: .45rem .35rem; text-align: right; }
.report-table th:first-child { text-align: left; overflow-wrap: anywhere; }
.report-table thead, .report-station { background: var(--report-tint); }
.report-table tbody th { font-weight: 600; }
.report-table meter { display: block; width: min(8rem, 100%); height: .5rem; margin-top: .25rem; accent-color: #274b61; }
@media print {
    .staff-report { page: staff-report-a4; padding: 0; font-size: 10pt; }
    .staff-report h2, .staff-report h3, .report-station { break-after: avoid; }
    .report-table thead { display: table-header-group; }
    .report-table tr { break-inside: avoid; }
    .plan-print-page header { border-bottom: .65mm solid #274b61; }
    .plan-print-label { margin-inline-start: auto; }
    .plan-print-page tbody tr:nth-child(even) { background: #f5f8fa; }
    .plan-print-page th, .plan-print-page td { border-color: #c6d2dc; }
    .plan-print-page, .staff-report { print-color-adjust: exact; }
}

.event-overview-entry { align-items: stretch; }
.event-report-link { display: grid; place-items: center; }
@media (max-width: 540px) {
    .event-overview-entry { grid-template-columns: minmax(0, 1fr) auto; }
    .event-report-link { padding-inline: .65rem; justify-self: stretch; }
    .event-overview-entry .event-overview-row { gap: .45rem; padding-inline: .55rem; }
    .event-overview-entry .event-date-tile { min-width: 2.35rem; }
}
.staff-report { padding: 0; }
.report-page { position: relative; }
.report-metrics { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.report-section h2 { margin-bottom: .4rem; }
.report-section-context { margin: 0 0 .35rem; color: var(--report-muted); font-size: .84em; }
.report-section h2 small { font-weight: normal; color: var(--report-muted); }
.report-table th:not(:first-child), .report-table td { width: 22mm; }
.report-footer { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1rem; border-top: 1px solid var(--report-line); padding-top: .4rem; color: var(--report-muted); font-size: .8em; }
@page staff-report-a4 { size: A4 portrait; margin: 0; }
@media print {
    .staff-report { page: staff-report-a4; }
    .report-page { box-sizing: border-box; width: 210mm; min-height: 296mm; padding: 10mm 10mm 18mm; }
    .report-page + .report-page { break-before: page; }
    .report-page .document-header { min-height: 13mm; margin-bottom: 3mm; padding-bottom: 2mm; }
    .report-page .document-header .company-logo { height: 12mm; width: 39mm; }
    .report-page h1 { font-size: 20pt; }
    .report-page .report-continuation { margin: 1mm 0 3mm; }
    .report-page .report-section h2 { font-size: 12pt; margin: 3mm 0 1mm; }
    .report-page .report-section-context { margin-bottom: 1mm; }
    .report-page .report-table th, .report-page .report-table td { padding: .7mm 1.5mm; font-size: 9pt; line-height: 1.2; }
    .report-page .report-footer { position: absolute; inset: auto 10mm 10mm; }
}

.plan-grid th[data-plan-column="person"], .plan-grid th[data-plan-column="role"] { width: 24%; }
.plan-grid th[data-plan-column="duration"], .plan-grid td[data-plan-column="duration"] {
    min-width: 5.5rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.report-hours-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-hours-metrics > div { text-align: center; display: grid; grid-template-rows: minmax(2.4em, auto) 1fr; }
.report-hours-metrics dt { line-height: 1.2; }
@supports (grid-template-rows: subgrid) {
    .report-hours-metrics { row-gap: 0; }
    .report-hours-metrics > div { grid-row: span 2; grid-template-rows: subgrid; }
}

.report-hours-metrics dd { font-size: 1rem; }
.report-hours-metrics strong { display: block; margin-top: -.65rem; font-size: 1.2rem; }
.report-hours-metrics small { display: block; margin-top: .35rem; color: var(--report-muted); font-size: .7rem; font-weight: 400; line-height: 1.2; }
.report-gauge { display: block; width: min(100%, 4rem); margin: .15rem auto 0; fill: none; stroke: var(--report-line); stroke-width: 7; }
.report-gauge-fill { stroke: #274b61; }
@media screen and (max-width: 540px) {
    .report-hours-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.document-header { border-bottom: 2px solid #274b61; }
.report-table thead, .report-station { background: #e4edf2; }
.report-table tbody tr:nth-child(even) { background: #f5f8fa; }
@media print {
    .report-page .report-footer { border-color: #a1adbc; }
}
@media screen and (max-width: 540px) {
    .report-hours-metrics > div:nth-child(-n+2) { margin-bottom: .65rem; }
}

.profile-avatar { display: inline-grid; place-items: center; vertical-align: middle; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 700; font-size: .83rem; }
.user-menu summary { display: flex; align-items: center; gap: .45rem; list-style: none; padding: .3rem .55rem; }
.user-menu summary::-webkit-details-marker { display: none; }
.account-menu-name { max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .8rem; max-width: 72rem; }
.dashboard-metrics > div { width: 100%; }
.dashboard-metrics dd { margin: .25rem 0 0; font-size: 1.6rem; font-weight: 800; }
.portal-shift { border-top: 1px solid var(--line); padding: .75rem 0; }
.portal-shift summary { cursor: pointer; font-weight: 700; }
@media screen { .timesheet-scroll { overflow-x: auto; } .timesheet-table { min-width: 32rem; } }
.timesheet-table th:not(:first-child), .timesheet-table td { width: auto; }
.timesheet-sign { display: flex; gap: 1rem; margin-top: 1rem; }
.timesheet-sign span { flex: 1; border-top: 1px solid var(--report-line); font-size: .8em; padding-top: .35rem; }
@media (max-width: 760px) { .account-menu-name { display: none; } }
@media print { .report-page .timesheet-table th, .report-page .timesheet-table td { font-size: 8.5pt; } }

.dashboard-month { align-items: end; }

.account-profile { display: grid; gap: 1rem; }
.account-profile .settings-card { min-width: 0; }
.account-profile .profile-create { margin-top: 1rem; }
.profile-create summary { cursor: pointer; font-weight: 700; }
.profile-create form { margin-top: .85rem; }

.dashboard-metrics dd { font-variant-numeric: tabular-nums; }
.dashboard-empty { margin-top: 1.25rem; }
.dashboard-empty p { margin-bottom: 0; }
.dashboard-hours-note { font-size: .9rem; }
.dashboard-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; max-width: 72rem; margin-top: 1rem; }
.dashboard-charts > section { width: 100%; min-width: 0; }
.dashboard-charts h2 { margin: 0 0 .8rem; }
.dashboard-trend { grid-column: 1 / -1; }
.dashboard-day-chart { display: block; width: 100%; max-height: 18rem; overflow: visible; }
.dashboard-day-chart text { fill: var(--muted); font-size: 12px; }
.dashboard-axis { stroke: var(--line); stroke-width: 1; }
.dashboard-day-bar { fill: var(--primary); transform-box: fill-box; transform-origin: center bottom; }
.dashboard-day-values { margin-top: .6rem; }
.dashboard-day-values summary { cursor: pointer; color: var(--muted); }
.dashboard-day-values dl { display: flex; flex-wrap: wrap; gap: .65rem 1.15rem; margin-bottom: 0; }
.dashboard-day-values dd { margin: 0; font-weight: 700; }
.dashboard-bar-list { display: grid; gap: .7rem; margin: 0; padding: 0; list-style: none; }
.dashboard-bar-list li > div { display: flex; justify-content: space-between; gap: .6rem; overflow-wrap: anywhere; }
.dashboard-role-bar { display: block; width: 100%; height: .7rem; margin-top: .2rem; accent-color: var(--primary); transform-origin: left; }
.dashboard-role-bar::-webkit-meter-optimum-value { background: var(--primary); }
.dashboard-role-bar::-moz-meter-bar { background: var(--primary); }
.dashboard-status-chart { display: block; width: min(10rem, 80%); margin: .25rem auto 1rem; }
.dashboard-status-chart circle { fill: none; stroke-width: 9; }
.dashboard-ring-track { stroke: var(--line); }
.dashboard-ring-value { stroke: var(--primary); }
.dashboard-status-chart text { fill: var(--text); font-size: 16px; font-weight: 700; }
.dashboard-status-key { display: grid; gap: .35rem; margin: 0; }
.dashboard-status-key div { display: flex; justify-content: space-between; gap: .6rem; }
.dashboard-status-key dd { margin: 0; font-weight: 700; }
@media (max-width: 650px) { .dashboard-charts { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: no-preference) {
    .dashboard-day-bar { animation: dashboard-grow-y 1.15s cubic-bezier(.2,.75,.2,1) both; }
    .dashboard-role-bar { animation: dashboard-grow-x 1.15s cubic-bezier(.2,.75,.2,1) both; }
    .dashboard-ring-value { animation: dashboard-ring-in 1.15s cubic-bezier(.2,.75,.2,1) both; }
}
@keyframes dashboard-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes dashboard-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dashboard-ring-in { from { stroke-dasharray: 0 100; } }
