:root {
    --brand-navy: #193f53;
    --brand-teal: #77bbc5;
    --brand-mint: #bce1e0;
    --soft-teal: #eaf6f6;
    --ink: #193f53;
    --muted: #617783;
    --paper: #f3f8fa;
    --white: #fff;
    --line: #dae8ec;
    --accent: #1b465b;
    --accent-dark: #123447;
    --radius: 16px;
    color-scheme: light;
    font-family: Inter,"Segoe UI",Arial,sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,input,select {
    font: inherit;
}

button,a,input,select {
    touch-action: manipulation;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: .55;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible {
    outline: 3px solid #28798a;
    outline-offset: 3px;
}

h1,h2,h3,p {
    margin: 0;
}

h1 {
    font-family: Georgia,"Times New Roman",serif;
    font-size: clamp(30px,3vw,43px);
    font-weight: 400;
    letter-spacing: -1.3px;
    line-height: 1.2;
}

h2 {
    font-size: 18px;
    letter-spacing: -.4px;
}

h3 {
    font-size: 15px;
}

p {
    color: var(--muted);
    line-height: 1.65;
}

small {
    font-weight: 400;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 222px;
    flex-shrink: 0;
    background: #fff;
    padding: 34px 22px 20px;
    border-right: 1px solid var(--line);
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 26px;
    font-weight: 650;
    letter-spacing: -1.4px;
}

.brand-mark {
    width: 43px;
    height: 43px;
    background: linear-gradient(145deg, var(--brand-navy) 40%, #39798c);
    color: #fff;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia,serif;
    font-size: 40px;
    line-height: 1;
    position: relative;
}

.brand-mark span {
    width: 7px;
    height: 7px;
    position: absolute;
    right: 7px;
    top: 8px;
    background: var(--brand-mint);
    border-radius: 50%;
}

.brand-caption {
    display: block;
    font-size: 8px;
    letter-spacing: 2px;
    color: var(--muted);
    margin-top: 3px;
}

.workspace-label {
    font-size: 9px;
    color: #748b97;
    letter-spacing: 1.6px;
    font-weight: 700;
    margin: 53px 12px 16px;
}

nav {
    display: grid;
    gap: 7px;
}

nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 9px;
    padding: 13px 11px;
    font-size: 12px;
    font-weight: 550;
    color: var(--muted);
}

nav a.active {
    background: var(--soft-teal);
    color: var(--brand-navy);
}

nav a:hover {
    background: #f0f7f9;
}

.nav-symbol {
    font-size: 20px;
    width: 22px;
    line-height: 1;
}

.sidebar-note {
    margin-top: auto;
    padding: 28px 13px 20px;
}

.sidebar-note strong {
    font-family: Georgia,serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.45;
    display: block;
    margin: 12px 0;
}

.small-sun {
    font-size: 36px;
    color: #408795;
}

.sidebar-note p {
    font-size: 11px;
}

.sidebar-footer {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    font-size: 9px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 7px;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    background: #39838b;
    border-radius: 50%;
}

.main-shell {
    margin-left: 222px;
    flex: 1;
    min-width: 0;
}

.topbar {
    height: 73px;
    padding: 0 38px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--muted);
    background: rgba(255,255,255,.55);
}

.breadcrumb-slash {
    padding: 0 12px;
    color: #b5cbd4;
}

.workspace-badge {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
}

.workspace-badge span {
    color: var(--ink);
    font-size: 11px;
}

main {
    padding: 39px 38px 28px;
    max-width: 1800px;
    margin: auto;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 31px;
}

.eyebrow {
    display: block;
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--brand-navy);
    font-weight: 700;
    margin-bottom: 13px;
}

.page-heading p {
    font-size: 12px;
    margin-top: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 40px;
    padding: 10px 17px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.button.primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.button.primary:hover {
    background: var(--accent-dark);
}

.button.secondary {
    background: #fff;
    border-color: var(--line);
    color: var(--ink);
}

.button.secondary:hover {
    background: var(--soft-teal);
}

.button.text {
    border: 0;
    background: transparent;
    color: var(--brand-navy);
    padding-left: 8px;
    padding-right: 8px;
}

.button.danger-text {
    color: #b34c3b;
    background: transparent;
    margin-left: auto;
}

.button.danger {
    background: #b44c3c;
    color: white;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 15px;
    margin-bottom: 27px;
}

.metric {
    padding: 21px 22px;
    background: rgba(255,255,255,.6);
    border: 1px solid var(--line);
    border-radius: 13px;
}

.metric>span {
    font-size: 11px;
    color: var(--muted);
}

.metric>strong {
    display: block;
    font-size: 29px;
    font-weight: 550;
    margin: 13px 0 10px;
    letter-spacing: -1px;
}

.metric>strong small {
    font-size: 11px;
    letter-spacing: 0;
    color: #718994;
    margin-left: 3px;
}

.metric p {
    font-size: 9px;
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-toolbar {
    padding: 23px 24px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.panel-toolbar p {
    font-size: 11px;
    margin-top: 8px;
}

.rotation-controls {
    display: flex;
    gap: 13px;
    align-items: flex-end;
}

.week-input {
    font-size: 9px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.week-input input {
    height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    font-size: 11px;
    color: var(--ink);
    background: #fff;
}

.rotation-options {
    padding: 0 24px 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    font-size: 10px;
    color: var(--muted);
}

.rotation-options label {
    display: flex;
    align-items: center;
    gap: 7px;
}

.rotation-options input {
    accent-color: var(--brand-navy);
    width: 14px;
    height: 14px;
    margin: 0;
}

.rotation-meta {
    padding: 18px 24px 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 9px;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    padding: 7px 11px;
    white-space: nowrap;
}

.pill.success {
    background: #e6f4f2;
    color: #24666c;
}

.pill.warning {
    background: #fff2db;
    color: #996522;
}

.muted {
    color: var(--muted);
}

.solve-duration {
    margin-left: auto;
    color: var(--muted);
}

.view-toolbar {
    padding: 17px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.view-tabs {
    display: flex;
    background: #eaf2f5;
    border-radius: 7px;
    padding: 3px;
    gap: 3px;
}

.view-tabs button {
    font-size: 10px;
    font-weight: 550;
    padding: 8px 11px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
}

.view-tabs button.active {
    background: #fff;
    box-shadow: 0 1px 4px #193f5310;
    color: var(--ink);
}

.shift-legend {
    display: flex;
    gap: 14px;
    font-size: 9px;
    color: var(--muted);
}

.shift-legend span {
    display: flex;
    gap: 5px;
    align-items: center;
}

.shift-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.day-dot {
    background: #3b8e82;
}

.evening-dot {
    background: #4386a0;
}

.night-dot {
    background: #355b80;
}

.week-scroll {
    overflow-x: auto;
    padding: 0 24px 20px;
    scrollbar-width: thin;
    scrollbar-color: #b8cdd6 #f0f7f9;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7,minmax(153px,1fr));
    gap: 11px;
    min-width: 1137px;
}

.day-column>header {
    padding: 13px 11px 17px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 5px;
}

.day-column>header>span {
    margin-right: auto;
    font-size: 11px;
    color: var(--muted);
}

.day-column>header strong {
    font-size: 17px;
    font-weight: 500;
}

.day-column>header small {
    font-size: 9px;
    color: var(--muted);
}

.day-column.weekend>header {
    background: #f1f7f9;
    border-radius: 8px;
    color: #477b87;
}

.shift-card {
    padding: 12px 11px;
    margin-bottom: 10px;
    border: 1px solid;
    border-radius: 10px;
    min-height: 223px;
}

.shift-card.day {
    background: #eff9f8;
    border-color: #cde8e4;
    --shift-color: #287467;
}

.shift-card.evening {
    background: #eef7fa;
    border-color: #cfe6eb;
    --shift-color: #326f83;
}

.shift-card.night {
    background: #eef2f7;
    border-color: #d3dee9;
    --shift-color: #254961;
}

.shift-card-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 9px;
    color: var(--shift-color);
    gap: 3px;
}

.shift-card-heading strong {
    font-weight: 650;
    display: flex;
    gap: 5px;
    align-items: center;
    font-size: 10px;
}

.shift-dot {
    width: 5px;
    height: 5px;
    background: var(--shift-color);
    border-radius: 50%;
}

.shift-time {
    font-size: 9px;
    color: var(--muted);
    margin: 8px 0 15px;
}

.shift-people {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 13px;
}

.shift-role-label {
    width: 100%;
    font-size: 7px;
    letter-spacing: .8px;
    color: #6a8390;
    margin-bottom: 3px;
}

.person-chip {
    font-size: 9px;
    padding: 4px 6px;
    background: #ffffffb8;
    border: 1px solid #ffffffdb;
    border-radius: 4px;
    color: #3d5e70;
    overflow-wrap: anywhere;
}

.missing-chip {
    font-size: 9px;
    color: #ac523d;
    background: #fff0e9;
    border-radius: 4px;
    padding: 4px 6px;
}

.panel-footnote {
    border-top: 1px solid var(--line);
    padding: 15px 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 9px;
    color: var(--muted);
    line-height: 1.7;
}

.panel-footnote .status-dot {
    margin-right: 4px;
}

.care-note {
    margin-top: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 8px;
}

.care-note>span {
    color: var(--accent);
    font-size: 30px;
}

.care-note p {
    font-size: 10px;
}

.care-note p strong {
    color: #456d7d;
    font-weight: 550;
}

.care-note a {
    font-size: 10px;
    color: var(--brand-navy);
    margin-left: auto;
    white-space: nowrap;
}

.main-footer {
    display: flex;
    justify-content: space-between;
    padding: 0 38px 25px;
    color: #758e9b;
    font-size: 9px;
    gap: 12px;
}

.notice {
    margin: 0 0 18px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.6;
}

.rotation-panel>.notice {
    margin: 16px 24px;
}

.notice.warning {
    color: #986021;
    background: #fff6e6;
    border: 1px solid #f2dfbd;
}

.notice.success {
    color: #24666c;
    background: #e9f6f4;
    border: 1px solid #cae6e1;
}

.generating-state {
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 190px;
    justify-content: center;
    padding: 28px;
    text-align: left;
}

.generating-state strong {
    font-size: 14px;
}

.generating-state p {
    font-size: 11px;
    margin-top: 5px;
}

.spinner {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 2px solid #dae8ec;
    border-top-color: var(--accent);
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    padding: 65px 25px;
    text-align: center;
}

.empty-state h3 {
    font-family: Georgia,serif;
    font-size: 28px;
    font-weight: 400;
    letter-spacing: -.6px;
}

.empty-state p {
    font-size: 12px;
    max-width: 460px;
    margin: 15px auto 23px;
}

.empty-icon {
    display: block;
    color: var(--accent);
    font-size: 35px;
    margin-bottom: 15px;
}

.table-scroll {
    overflow-x: auto;
}

.hours-table,.requirements-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 11px;
}

.hours-table {
    min-width: 650px;
}

.hours-table th {
    font-weight: 550;
    color: var(--muted);
    background: #f2f7f9;
    padding: 14px 24px;
    font-size: 9px;
    white-space: nowrap;
}

.hours-table td {
    padding: 14px 24px;
    border-top: 1px solid var(--line);
    white-space: nowrap;
}

.hours-table td small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    margin-top: 5px;
}

.positive {
    color: #24666c;
}

.team-summary {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 21px;
    flex-wrap: wrap;
}

.team-summary strong {
    color: var(--ink);
    font-weight: 650;
}

.team-summary .button {
    margin-left: auto;
}

.employee-workspace {
    display: grid;
    grid-template-columns: minmax(245px,340px) minmax(0,1fr);
    gap: 22px;
    align-items: start;
}

.people-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 21px 17px;
}

.count-badge {
    background: #eaf3f6;
    color: var(--brand-navy);
    font-size: 10px;
    padding: 5px 8px;
    border-radius: 6px;
}

.people-filters {
    padding: 0 18px 17px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid var(--line);
}

input[type=search],.people-filters select {
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 10px;
    color: var(--ink);
    font-size: 10px;
    background: #fff;
    width: 100%;
}

input[type=search]::placeholder {
    color: #768e9b;
}

.people-list {
    max-height: 870px;
    overflow-y: auto;
    padding: 7px;
    scrollbar-width: thin;
}

.person-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border-radius: 8px;
    border: 0;
    background: #fff;
    text-align: left;
    color: var(--ink);
}

.person-row:hover {
    background: #f1f7f9;
}

.person-row.selected {
    background: var(--soft-teal);
}

.avatar {
    width: 33px;
    height: 33px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dceff1;
    color: #2d7180;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 650;
}

.avatar.worker {
    background: #e6edf6;
    color: #40617d;
}

.avatar.large {
    width: 48px;
    height: 48px;
    font-size: 14px;
}

.person-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.person-details strong {
    font-size: 11px;
    overflow-wrap: anywhere;
}

.person-details small {
    font-size: 9px;
    color: var(--muted);
}

.position-tag {
    margin-left: auto;
    font-size: 10px;
    text-align: right;
}

.position-tag small {
    display: block;
    margin-top: 5px;
    font-size: 9px;
    color: var(--muted);
}

.row-arrow {
    font-size: 19px;
    color: #9ebbc7;
    margin-left: 4px;
}

.empty-list {
    padding: 25px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}

.editor-panel {
    padding: 25px 28px;
}

.editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.editor-heading .eyebrow {
    font-size: 8px;
    margin-bottom: 7px;
}

.editor-heading h2 {
    font-family: Georgia,serif;
    font-size: 27px;
    font-weight: 400;
}

.editor-fields {
    padding: 0;
    border: 0;
    margin: 0;
    min-width: 0;
}

.form-section {
    border-top: 1px solid var(--line);
    padding-top: 23px;
    margin-top: 23px;
}

.form-section:first-child {
    margin-top: 0;
}

.form-section h3 {
    margin-bottom: 17px;
    font-size: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 18px 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 10px;
    color: #506f80;
}

.field input,.field select {
    width: 100%;
    height: 40px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    color: var(--ink);
    font-size: 12px;
}

.field-hint {
    font-size: 9px;
    line-height: 1.6;
    color: #718b98;
}

.contract-explainer {
    padding: 13px 16px;
    background: #edf5f8;
    border-radius: 8px;
    margin-top: 18px;
}

.contract-explainer strong {
    font-size: 11px;
    color: var(--brand-navy);
}

.contract-explainer p {
    font-size: 9px;
    margin-top: 5px;
}

.section-description {
    font-size: 10px;
    margin-top: -6px;
    margin-bottom: 15px;
}

.requirements-table {
    min-width: 360px;
}

.requirements-table th {
    font-size: 9px;
    color: var(--muted);
    font-weight: 550;
    padding: 11px 7px;
    white-space: nowrap;
}

.requirements-table td {
    padding: 7px;
    border-top: 1px solid #e9f1f4;
}

.requirements-table tbody th {
    border-top: 1px solid #e9f1f4;
    color: var(--ink);
    font-weight: 600;
}

.requirements-table input[type=checkbox] {
    width: 15px;
    height: 15px;
    accent-color: var(--brand-navy);
}

.requirements-table select {
    font-size: 10px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 5px;
    padding: 7px;
    color: var(--ink);
    width: 100%;
    min-width: 115px;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.editor-actions .button {
    font-size: 10px;
    padding: 10px 13px;
}

.editor-footnote {
    font-size: 9px;
    line-height: 1.7;
    color: var(--muted);
    margin-top: 20px;
}

.delete-confirmation {
    margin-top: 15px;
    padding: 18px;
    border: 1px solid #f2d6cc;
    border-radius: 8px;
    background: #fff6f2;
}

.delete-confirmation strong {
    font-size: 12px;
}

.delete-confirmation p {
    font-size: 10px;
    margin: 8px 0 12px;
}

.delete-confirmation .button {
    font-size: 10px;
    margin-right: 5px;
}

.validation-message,.validation-errors {
    font-size: 10px;
    color: #b2533e;
}

.validation-errors {
    padding: 15px 15px 15px 29px;
    border: 1px solid #f2d6cc;
    background: #fff6f2;
    border-radius: 7px;
    line-height: 1.7;
    margin-bottom: 15px;
}

.field input.invalid {
    border-color: #cc795f;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff3cf;
    border-top: 1px solid #edcf83;
    padding: 14px 22px;
    z-index: 1000;
    font-size: 13px;
    box-shadow: 0 -2px 8px #0001;
}

#blazor-error-ui a {
    font-weight: 650;
    text-decoration: underline;
    margin-left: 6px;
}

#blazor-error-ui .dismiss {
    float: right;
    border: 0;
    background: transparent;
    font-size: 18px;
    color: var(--ink);
}

.skip-link {
    position: fixed;
    top: -80px;
    left: 20px;
    background: var(--brand-navy);
    color: white;
    padding: 12px 20px;
    z-index: 2000;
    border-radius: 7px;
}

.skip-link:focus {
    top: 10px;
}

@media(min-width:1600px) {
    .week-grid {
        min-width: 0;
    }
    .shift-card {
        min-height: 238px;
    }
    .shift-card .person-chip {
        font-size: 10px;
    }
}

@media(max-width:1200px) {
    .sidebar {
        width: 190px;
        padding: 28px 17px 20px;
    }
    .main-shell {
        margin-left: 190px;
    }
    main {
        padding: 30px 24px;
    }
    .topbar {
        padding: 0 24px;
    }
    .main-footer {
        padding: 0 24px 25px;
    }
    .page-heading {
        align-items: flex-start;
    }
    .page-heading h1 {
        font-size: 32px;
    }
    .metrics {
        gap: 10px;
    }
    .metric {
        padding: 17px 15px;
    }
    .employee-workspace {
        grid-template-columns: 270px minmax(0,1fr);
        gap: 16px;
    }
    .editor-panel {
        padding: 22px 20px;
    }
    .rotation-options>span {
        display: none;
    }
}

@media(max-width:900px) {
    .sidebar {
        position: relative;
        width: 100%;
        padding: 17px 22px;
        border-bottom: 1px solid var(--line);
        border-right: 0;
        flex-direction: row;
        align-items: center;
        gap: 22px;
    }
    .app-shell {
        display: block;
    }
    .brand {
        font-size: 23px;
    }
    .brand-mark {
        width: 36px;
        height: 36px;
        font-size: 33px;
    }
    .brand-caption {
        font-size: 7px;
    }
    .workspace-label,.sidebar-note,.sidebar-footer {
        display: none;
    }
    nav {
        display: flex;
        margin-left: auto;
        gap: 5px;
    }
    nav a {
        font-size: 10px;
        padding: 11px 12px;
    }
    .nav-symbol {
        display: none;
    }
    .main-shell {
        margin-left: 0;
    }
    .topbar {
        height: 54px;
    }
    .page-heading h1 {
        font-size: 35px;
    }
    .employee-workspace {
        grid-template-columns: 250px minmax(0,1fr);
    }
    .form-grid {
        gap: 15px;
    }
    .editor-actions .danger-text {
        margin-left: 0;
    }
    .rotation-meta {
        flex-wrap: wrap;
    }
    .metrics {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media(max-width:640px) {
    .sidebar {
        padding: 16px;
        gap: 10px;
    }
    .brand-caption {
        display: none;
    }
    .brand {
        font-size: 22px;
        gap: 8px;
    }
    nav a {
        font-size: 9px;
        padding: 10px 8px;
        max-width: 115px;
        line-height: 1.5;
    }
    .topbar {
        padding: 0 18px;
        font-size: 10px;
    }
    .workspace-badge span {
        display: none;
    }
    main {
        padding: 26px 16px;
    }
    .page-heading {
        display: block;
        margin-bottom: 23px;
    }
    .page-heading h1 {
        font-size: 34px;
        max-width: 340px;
    }
    .page-heading p {
        font-size: 11px;
    }
    .page-heading>.button {
        margin-top: 18px;
    }
    .eyebrow {
        font-size: 8px;
        letter-spacing: 1.5px;
    }
    .metric {
        padding: 16px;
    }
    .metric>strong {
        font-size: 26px;
    }
    .metric>span {
        font-size: 10px;
    }
    .metric p {
        font-size: 8px;
    }
    .panel-toolbar {
        padding: 19px 17px;
        display: block;
    }
    .rotation-controls {
        margin-top: 16px;
        justify-content: space-between;
        gap: 10px;
    }
    .rotation-controls .button {
        font-size: 10px;
        padding: 10px 12px;
    }
    .rotation-options {
        padding: 0 17px 15px;
    }
    .rotation-meta {
        padding: 16px 17px 3px;
        gap: 10px;
    }
    .solve-duration {
        margin-left: 0;
    }
    .view-toolbar {
        padding: 15px 17px;
        display: block;
    }
    .shift-legend {
        margin-top: 13px;
    }
    .week-scroll {
        padding: 0 17px 17px;
    }
    .week-grid {
        gap: 9px;
    }
    .panel-footnote {
        padding: 13px 17px;
        display: block;
        font-size: 8px;
    }
    .panel-footnote>span {
        display: block;
    }
    .care-note {
        gap: 9px;
        align-items: flex-start;
    }
    .care-note p {
        font-size: 9px;
    }
    .care-note a {
        display: none;
    }
    .main-footer {
        padding: 0 17px 20px;
        font-size: 8px;
    }
    .employee-workspace {
        grid-template-columns: 1fr;
    }
    .people-list {
        max-height: 275px;
    }
    .employee-workspace .people-panel-heading {
        padding-top: 18px;
    }
    .people-filters {
        flex-direction: row;
    }
    .people-filters input {
        min-width: 0;
    }
    .people-filters select {
        max-width: 145px;
    }
    .editor-panel {
        padding: 22px 19px;
    }
    .team-summary {
        gap: 12px 17px;
        font-size: 10px;
    }
    .team-summary .button {
        margin-left: 0;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .editor-actions {
        gap: 8px;
    }
    .editor-actions .button {
        flex: 1;
    }
    .editor-actions .danger-text {
        flex-basis: 100%;
    }
    .hours-table th,.hours-table td {
        padding: 13px 16px;
    }
    .generating-state {
        padding: 25px 17px;
        flex-wrap: wrap;
    }
    .generating-state p {
        font-size: 10px;
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto!important;
    }
    .spinner {
        animation: none;
    }
}

h1:focus {
    outline: none;
}

.wizard-progress { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 24px; }
.rotation-range-selector { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; padding: 20px 24px; margin: 24px 0 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.range-options { grid-column: 2; grid-row: 1; text-align: center; }
.range-label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; }
.range-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.range-start { grid-column: 1; grid-row: 1; justify-self: start; width: 160px; max-width: 100%; }
.range-edit { grid-column: 3; grid-row: 1; justify-self: end; }
.visible-range { grid-column: 1 / -1; text-align: center; font-size: 12px; }
.visible-range span { margin-left: 12px; color: var(--ink); }
.saved-rotation .rotation-range-selector { margin: 0; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.saved-rotation-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 24px; margin-top: 20px; font-size: 12px; line-height: 1.7; }
.period-summaries { text-align: center; }
.period-summaries p + p { margin-top: 8px; }
.coverage-note { text-align: right; }
.multiple-months .period-calendar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
.landing-calendar-preview { padding: 0 24px 24px; }
.preview-day-shifts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media(max-width:1100px) {
    .rotation-range-selector { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .range-options { grid-column: 1 / -1; justify-self: center; }
    .range-start { grid-column: 1; grid-row: 2; }
    .range-edit { grid-column: 2; grid-row: 2; }
}
@media(max-width:900px) {
    .multiple-months .period-calendar { grid-template-columns: 1fr; }
    .saved-rotation-summary { grid-template-columns: 1fr; gap: 12px; }
    .period-summaries, .coverage-note { text-align: left; }
}
@media(max-width:640px) {
    .rotation-range-selector { padding: 18px 14px; gap: 14px; }
    .range-buttons { gap: 6px; }
    .range-buttons .button { padding: 10px 12px; }
    .range-start { width: 160px; }
    .visible-range span { display: block; margin: 5px 0 0; }
    .landing-calendar-preview { padding: 0 17px 17px; }
    .preview-day-shifts { grid-template-columns: 1fr; }
}
.wizard-progress button { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.wizard-progress button.active { background: var(--brand-navy); color: #fff; }
.wizard-progress button:disabled { opacity: .5; }
.wizard-progress button span { font-size: 11px; }
.wizard-fields { padding: 0; margin: 0; border: 0; min-width: 0; }
.wizard-panel { padding: 26px; margin-bottom: 24px; min-width: 0; }
.wizard-panel h2 { margin-bottom: 14px; }
.wizard-panel > p { font-size: 12px; line-height: 1.7; margin-bottom: 20px; }
.wizard-panel .editor-actions > span { font-size: 12px; }
.preset-options { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.staffing-table, .wizard-employees { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; min-width: 570px; }
.staffing-table th, .staffing-table td, .wizard-employees th, .wizard-employees td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.staffing-table thead, .wizard-employees thead { background: #f1f7f9; }
.staffing-table caption { text-align: left; padding: 12px 0; font-size: 11px; color: var(--muted); }
.staffing-table input { width: 65px; }
.staffing-table input, .wizard-employees input:not([type=checkbox]) { padding: 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; font: inherit; }
.wizard-employees input:not([type=checkbox]) { width: 100%; min-width: 85px; }
.wizard-employees small { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.calendar-month { margin-top: 24px; }
.calendar-month > h3 { text-transform: capitalize; margin-bottom: 16px; font-size: 18px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendar-weekday { font-size: 11px; color: var(--muted); text-align: center; padding: 8px 0; overflow: hidden; }
.calendar-date { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; text-align: left; min-width: 0; padding: 12px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.calendar-date span { font-size: 10px; overflow-wrap: anywhere; }
.calendar-date strong { font-size: 18px; margin-bottom: 4px; }
.calendar-date.weekend { background: #f1f7f9; }
.calendar-date.selected { border-color: var(--brand-navy); background: var(--soft-teal); box-shadow: 0 0 0 1px var(--brand-navy); }
.calendar-date.has-shortage { background: #faeeee; border-color: #e5c7cc; }
.calendar-date.has-shortage.selected { border-color: var(--brand-navy); }
.calendar-date.draft-date { border-style: dashed; border-width: 2px; }
.calendar-date.draft-date.selected { box-shadow: none; }
.draft-legend { display: flex; align-items: center; gap: 8px; }
.draft-legend > span { flex: 0 0 18px; height: 18px; border: 2px dashed var(--muted); border-radius: 4px; }
.rotation-choice { display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.rotation-choice:hover { background: var(--soft-teal); border-color: var(--brand-navy); }
.rotation-choice > div { flex: 1; }
.rotation-choice strong, .rotation-choice div > span { display: block; }
.rotation-choice div > span { margin-top: 8px; font-size: 12px; color: var(--muted); }
.rotation-choice.draft-choice { border-style: dashed; }
.day-column.has-shortage { background: #faeeee; border-radius: 8px; }
.day-column.has-shortage > header { background: #faeeee; }
.day-requirements { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.day-requirements > h3 { margin-bottom: 18px; text-transform: capitalize; }
.vacation-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding: 18px 0; margin-bottom: 16px; font-size: 12px; }
.vacation-row .field { flex: 1; min-width: 150px; }
.preference-person { border-bottom: 1px solid var(--line); padding: 18px 0; }
.preference-person summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.preference-person summary span { color: var(--muted); display: inline-block; margin-left: 14px; font-size: 11px; font-weight: 400; }
.preference-person .form-grid { margin-top: 20px; align-items: center; font-size: 12px; }
.coverage-option { display: block; font-size: 12px; margin-top: 24px; }
.roster-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.roster-heading h2 { margin-bottom: 0; }
.roster-editor, .saved-day-shifts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.roster-editor section, .saved-day-shifts section { background: #f1f7f9; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.roster-editor label { display: block; margin-top: 10px; font-size: 12px; }
.roster-editor small { display: block; margin-left: 22px; color: var(--muted); font-size: 9px; }
.roster-editor p, .saved-day-shifts p { font-size: 11px; margin: 10px 0; }
.assigned-employees { margin-top: 20px; }
.available-employees { margin-top: 16px; padding: 14px; border: 1px solid #b2d4d9; border-radius: 8px; background: var(--white); }
.assigned-employees h4, .available-employees h4 { font-size: 12px; margin-bottom: 12px; }
.assignment-person { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }
.assignment-person > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.roster-editor .assignment-person small { display: block; margin: 4px 0 0; }
.assignment-button { display: grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--soft-teal); color: var(--brand-navy); font: inherit; font-size: 20px; cursor: pointer; }
.assignment-button:hover { border-color: var(--brand-navy); }
.assignment-button.remove { background: #faeeee; color: #814d57; border-color: #e5c7cc; }
.saved-day-shifts .person-chip { display: inline-block; margin: 3px; font-size: 11px; }
.wizard-panel input[type=checkbox] { accent-color: var(--brand-navy); }
@media(max-width:640px) {
    .wizard-panel { padding: 18px 14px; }
    .wizard-progress { gap: 6px; }
    .wizard-progress button { padding: 10px; font-size: 10px; }
    .calendar-grid { gap: 3px; }
    .calendar-date { padding: 8px 3px; border-radius: 5px; }
    .calendar-date span { font-size: 8px; }
    .calendar-date strong { font-size: 15px; }
    .calendar-weekday { font-size: 8px; }
    .roster-editor, .saved-day-shifts { grid-template-columns: 1fr; }
    .preference-person summary span { display: block; margin: 7px 0 0; }
}


h1[tabindex]:focus-visible {
    outline: none;
}
.day-requirements { scroll-margin-top: 24px; }
.add-shift { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); align-items: end; }
.staffing-table th small { display: block; font-weight: normal; min-width: 150px; }

/* Coverage status applies to both dates and individual shifts. */
.staffing-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; font-size: 12px; }
.staffing-legend > span { padding: 6px 10px; border-radius: 6px; border: 1px solid; }
.calendar-date.staffing-below-minimum, .staffing-legend .staffing-below-minimum, .calendar-shift.staffing-below-minimum { background: #fcebed; border-color: #ce7d88; color: #822637; }
.calendar-date.staffing-minimum-met, .staffing-legend .staffing-minimum-met, .calendar-shift.staffing-minimum-met { background: #fff5d6; border-color: #c59a31; color: #725309; }
.calendar-date.staffing-preferred-met, .staffing-legend .staffing-preferred-met, .calendar-shift.staffing-preferred-met { background: #e7f5ec; border-color: #72a989; color: #245f3b; }
.calendar-date.selected { outline: 2px solid var(--brand-navy); outline-offset: 2px; }
.calendar-shift { width: 100%; padding: 4px; border-left: 3px solid transparent; border-radius: 3px; }
.calendar-shift .staffing-status { display: block; font-size: 9px; }
.staffing-input-label { display: block; font-size: 10px; margin: 4px 0; color: var(--muted); }
.staffing-fields { margin-bottom: 12px; }
.calendar-shift .shift-label-compact { display: none; }
@media (max-width: 600px) {
    .calendar-shift { padding: 3px 1px; border-left-width: 2px; }
    .calendar-shift .shift-label-full, .calendar-shift .staffing-status { display: none; }
    .calendar-shift .shift-label-compact { display: block; font-size: 8px; line-height: 1.5; }
}
/* Shared perspective switch and employee workspace. */
.topbar { height: auto; min-height: 72px; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.perspective-controls { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.perspective-switch { display: flex; padding: 3px; gap: 3px; border: 1px solid var(--line); background: #fff; border-radius: 8px; }
.perspective-switch button { border: 0; border-radius: 5px; padding: 9px 12px; background: transparent; color: var(--brand-navy); font: inherit; font-size: 12px; cursor: pointer; }
.perspective-switch button[aria-pressed="true"] { background: var(--brand-navy); color: #fff; }
.perspective-switch button:disabled { cursor: wait; opacity: .65; }
.perspective-person { display: grid; gap: 4px; font-size: 10px; color: var(--muted); }
.perspective-person select { min-width: 130px; max-width: 200px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff; color: var(--brand-navy); font: inherit; font-size: 12px; }
.employee-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.employee-shortcuts { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.own-shift-legend { font-size: 12px; color: var(--brand-navy); }
.own-shift-legend > span { display: inline-block; padding: 3px 7px; border-radius: 5px; background: var(--brand-navy); color: #fff; margin-right: 6px; }
.calendar-date.own-work-day { border-color: var(--brand-navy); border-width: 2px; }
.calendar-date .own-day-label { background: var(--brand-navy); color: #fff; border-radius: 4px; padding: 3px 5px; font-size: 10px; }
.calendar-shift.own-shift { box-shadow: inset 0 0 0 2px var(--brand-navy); border-radius: 4px; }
.own-shift-note, .person-chip.own-person { color: var(--brand-navy); font-weight: 700; background: var(--soft-teal); border-radius: 5px; padding: 5px 8px; }
.employee-request-card { padding: 18px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.employee-request-card:last-child { border-bottom: 0; }
.request-card-heading, .request-filter { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.request-card-heading h3 { margin: 0; font-size: 17px; }
.request-message { white-space: pre-wrap; }
.weekday-choices { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.weekday-choices label { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--soft-teal); border-radius: 6px; }
@media (max-width: 900px) {
    .sidebar { flex-wrap: wrap; }
    .sidebar nav { flex-wrap: wrap; min-width: 0; }
    .topbar { flex-wrap: wrap; }
    .perspective-controls { gap: 10px; }
}
@media (max-width: 640px) {
    .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: 1 1 100%; margin-left: 0; }
    .sidebar nav a { min-width: 0; max-width: none; text-align: center; }
    .topbar > span { display: none; }
    .perspective-controls { width: 100%; justify-content: space-between; gap: 8px; }
    .perspective-switch button { padding: 8px; font-size: 11px; }
    .perspective-person select { min-width: 105px; max-width: 125px; }
    .employee-metrics { grid-template-columns: 1fr; }
    .calendar-date .own-day-label { font-size: 8px; padding: 2px 1px; }
}
