:root {
    color-scheme: light;
    --surface: #fff;
    --background: #f4f6f3;
    --text: #172922;
    --muted: #53645d;
    --line: #dbe4dc;
    --green: #245a44;
    --deep: #15392d;
    --focus: #387d69;
    --gold: #e9be73;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: var(--text);
    background: var(--background);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; line-height: 1.5; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(1.9rem, 4vw, 2.65rem); letter-spacing: -.035em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
a { color: var(--green); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(100% - 2rem, 75rem); margin-inline: auto; }
.topbar { background: var(--deep); color: white; }
.topbar-content { min-height: 4.5rem; display: flex; align-items: center; gap: 1.5rem; }
.brand { display: inline-flex; gap: .65rem; align-items: center; font-weight: 750; letter-spacing: .09em; }
.brand, .topbar nav a { color: white; text-decoration: none; }
.brand-mark {
    display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: .55rem;
    background: var(--gold); color: var(--deep); font-size: 1rem;
}
.topbar nav { display: flex; flex: 1; gap: .25rem; flex-wrap: wrap; }
.topbar nav a { padding: .55rem .8rem; border-radius: .45rem; font-weight: 600; }
.topbar nav a:hover, .topbar nav [aria-current="page"] { background: #295445; }
.topbar .button.subtle { color: white; background: #295445; }
.topbar .button.subtle:hover { background: #356654; }
.topbar :focus-visible { outline-color: var(--gold); }
.page { padding-block: 2.25rem 3.5rem; display: grid; gap: 1.25rem; }
.page-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .85rem; }
.page-heading p { margin-top: .25rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 21rem); gap: 1.25rem; align-items: start; }
.panel { min-width: 0; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; }
.panel > h2, .schedule > .page-heading { margin-bottom: 1rem; }
.muted { color: var(--muted); }
.fields { display: grid; gap: .8rem; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .925rem; }
.month-picker label { display: block; }
input, select, button { font: inherit; }
input:not([type="checkbox"], [type="hidden"]), select {
    color: var(--text); background: var(--surface); border: 1px solid #aebeb3; border-radius: .45rem;
    min-width: 0; max-width: 100%; padding: .5rem .6rem; min-height: 2.65rem;
}
select {
    appearance: none; padding-right: 2rem;
    background: linear-gradient(45deg, transparent 50%, var(--green) 50%) calc(100% - 17px) 50% / 5px 5px no-repeat,
        linear-gradient(135deg, var(--green) 50%, transparent 50%) calc(100% - 12px) 50% / 5px 5px no-repeat var(--surface);
}
input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--green); }
.checkbox { display: flex; align-items: center; }
.input-row { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-error { color: #9e2d30; font-size: .9rem; }
.field-error:empty { display: none; }
.input-validation-error { border-color: #a83236 !important; }
.actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 2.4rem;
    padding: .4rem .75rem; border: 1px solid transparent; border-radius: .48rem; text-decoration: none;
    font-size: .9rem; font-weight: 650; cursor: pointer; white-space: nowrap;
}
.button.primary { background: var(--green); color: #fff; }
.button.primary:hover { background: var(--deep); }
.button.outline { border-color: #b8cbbf; background: white; color: var(--deep); }
.button.outline:hover, .button.subtle:hover { background: #e2eee7; }
.button.subtle { background: #edf3ef; color: var(--deep); }
.button.danger { color: #8f292e; background: #faeeed; }
.button.danger:hover { background: #f4dbd9; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
thead th { font-size: .88rem; color: var(--muted); }
tbody th { font-weight: 650; }
tbody tr:last-child > * { border-bottom: 0; }
.wrap-anywhere { overflow-wrap: anywhere; }
.notice { padding: .7rem .85rem; border: 1px solid #c9e0d2; background: #eaf5ed; border-radius: .5rem; color: #234c39; }
.notice.error { border-color: #ecc8c7; background: #fcf0ef; color: #822b30; }
.notice.warning { border-color: #ebd9a9; background: #fff7e0; color: #694d16; }
.schedule > .notice { margin-bottom: 1rem; }
.schedule-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(13rem, 1fr); gap: 1.25rem; }
.names { list-style: none; margin: 0; padding: 0; }
.totals { margin-block: .55rem 0; }
.totals div { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.modal {
    border: 1px solid var(--line); border-radius: .9rem; padding: 1.25rem; width: min(100% - 2rem, 43rem);
    max-height: 90dvh; color: var(--text); background: var(--surface); box-shadow: 0 1rem 4rem #142b2355;
}
.modal[open]:not(:modal) { position: fixed; inset: 0; margin: auto; z-index: 1; }
.modal::backdrop { background: #132d23a6; }
.modal-header { display: flex; justify-content: space-between; align-items: start; gap: .5rem; margin-bottom: 1rem; }
.modal-header p { margin-top: .2rem; }
.modal > .notice { margin-bottom: .85rem; }
.availability-form { background: #f4f8f5; padding: 1rem; border-radius: .55rem; margin-bottom: 1.15rem; }
.tag { white-space: nowrap; display: inline-block; font-size: .875rem; border-radius: 1em; padding: .15rem .55rem; }
.tag.available { background: #e6f2e9; color: #23543b; }
.tag.unavailable { background: #f9ecea; color: #842f33; }
.login-shell {
    min-height: 100dvh; display: grid; place-items: center; padding: 1rem;
    background: radial-gradient(ellipse at top, #325e4d, var(--deep) 68%);
}
.login-card {
    width: min(100%, 29rem); background: white; border-radius: 1rem; padding: clamp(1.4rem, 5vw, 2.4rem);
    box-shadow: 0 1.2rem 3.8rem #071c1480; display: grid; justify-items: start; gap: 1rem;
}
.login-card p:not(.notice) { color: var(--muted); }
.brand-mark.large { width: 3rem; height: 3rem; font-size: 1.4rem; }
.login-button { min-height: 2.8rem; }
@media (max-width: 54rem) {
    .workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 38rem) {
    .shell { width: calc(100% - 1.25rem); }
    .page { padding-top: 1.25rem; }
    .topbar-content { gap: .45rem; min-height: 4rem; }
    .topbar nav a { padding: .45rem .35rem; font-size: .875rem; }
    .topbar .brand { gap: .3rem; font-size: .875rem; }
    .topbar .brand-mark { width: 1.6rem; height: 1.6rem; }
    .panel { padding: .85rem; }
    .schedule-grid { grid-template-columns: minmax(0, 1fr); }
    th, td { padding-inline: .35rem; }
}

.scheduled-person { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-block: .2rem; }
.scheduled-person .button { min-height: 1.85rem; padding: .15rem .45rem; }
.replacement-modal form { gap: .9rem; }
.schedule-exports { gap: .5rem; margin-bottom: 1rem; }
.schedule-exports span { font-size: .9rem; font-weight: 650; margin-right: .25rem; }
