/* Fonts, colors, buttons, forms and focus rings come from css/brand.css (the design system). */

h1:focus {
    outline: none;
}

.content {
    padding-top: 24px;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
.weekly-calendar-scroll {
    max-height: 75vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.25rem;
}
.weekly-calendar-week {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.calendar-day {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px 12px 12px;
}
.calendar-day-weekend {
    background-color: #fff8e1;
}
.calendar-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
/* Shift chips follow the design system's card pattern: white card, hairline border, navy
   condensed type, and one 4px accent bar on top. The bar carries the location-frequency color
   (see WeeklyCalendar.FrequencyClass and the "Location visits this month" legend). */
.calendar-day-shifts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.calendar-shift-chip {
    --freq: #6B7688;
    position: relative;
    overflow: hidden;
    background: #fff;
    color: var(--navy-900);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 10px 10px 8px;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.35;
    cursor: pointer;
    transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.calendar-shift-chip::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--freq);
}
.calendar-shift-chip:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.calendar-shift-chip-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.calendar-shift-chip-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--navy-700);
}
.calendar-shift-chip-leg {
    display: flex;
    gap: 6px;
    align-items: baseline;
    min-width: 0;
}
.calendar-shift-chip-time {
    flex: 0 0 auto;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    color: var(--navy-800);
}
.calendar-shift-chip-location {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.calendar-shift-chip-meta {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}
/* Selection is a navy ring, so the accent bar stays visible. */
.calendar-shift-chip-selected {
    outline: 3px solid var(--navy-700);
    outline-offset: 1px;
}
/* Unposted draft -- visible to managers here but not on Available Shifts. */
.calendar-shift-chip-draft {
    background: var(--gray-50);
    border-style: dashed;
    border-color: var(--navy-300);
}

/* How many times the shift's location is on the schedule that month: the accent color. */
.calendar-shift-chip-freq-1 { --freq: #6B7688; }
.calendar-shift-chip-freq-2 { --freq: #1E8E5A; }
.calendar-shift-chip-freq-3 { --freq: #2F6FDB; }
.calendar-shift-chip-freq-4 { --freq: #6F42C1; }
.calendar-shift-chip-freq-5 { --freq: linear-gradient(90deg, #F7E08A 0%, #D4A017 40%, #F2C94C 70%, #B8860B 100%); }
.calendar-shift-chip.calendar-shift-chip-freq-5 {
    border-color: #D4A017;
}
.calendar-legend-swatch {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 0.2rem;
    vertical-align: -0.1rem;
    margin-right: 0.25rem;
    background: var(--freq);
}
.calendar-add-btn {
    flex-shrink: 0;
}

.context-menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1060;
}
.context-menu {
    position: fixed;
    z-index: 1061;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.2);
    min-width: 160px;
    padding: 0.25rem 0;
}
.context-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.4rem 0.75rem;
    border: none;
    background: none;
}
.context-menu button:hover:not(:disabled) {
    background-color: #f1f3f5;
}
.context-menu button:disabled { color: #adb5bd; cursor: default; }
.context-menu button.is-danger:not(:disabled) { color: var(--red-500, #C8102E); }
.context-menu-divider { margin: 4px 0; opacity: 0.15; }

.modal-backdrop-custom {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    overflow-y: auto;
}
.shift-form-dialog {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

/* Scheduling Calendar: a shift's card opened up into the edit form, in place (WeeklyCalendar.ShiftEditor).
   It spans the day's whole width (a row across the week in Grid) and carries the chip's frequency bar. */
.calendar-shift-editor {
    grid-column: 1 / -1;
    border-top: 4px solid transparent;
    border-image: var(--freq) 1;
    border-image-width: 4px 0 0 0;
    border-radius: var(--radius-lg, 10px);
    animation: calendar-shift-editor-open 220ms ease-out;
    transform-origin: top center;
}
@keyframes calendar-shift-editor-open {
    from { opacity: 0; transform: scaleY(0.92); }
    to { opacity: 1; transform: none; }
}
.shift-form-inline:focus { outline: none; }
.shift-form-dialog.is-inline {
    width: 100%;
    max-width: 960px;
    max-height: none;
    overflow: visible;
}
.calendar-shift-chip.calendar-shift-chip-editing {
    outline: 2px solid var(--navy-700, #2A4065);
    outline-offset: 1px;
}
@media (prefers-reduced-motion: reduce) {
    .calendar-shift-editor { animation: none; }
}

.toggle-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    max-width: 420px;
}
.toggle-calendar-col-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: #6c757d;
}
.toggle-calendar-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
}
.toggle-calendar-cell:hover {
    background: #e9ecef;
}
.toggle-calendar-cell-on {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}
.toggle-calendar-cell-blank {
    border: none;
    cursor: default;
}
.toggle-calendar-cell-blank:hover {
    background: transparent;
}

/* Sits above .shift-form-dialog's backdrop (z-index 1050), since it can open from inside it. */
.vet-conflict-backdrop {
    z-index: 1060;
}
.vet-conflict-dialog {
    width: 90%;
    max-width: 480px;
}

/* Export Schedule pop-over on the Scheduling Calendar, anchored under its top-right button. */
.export-panel-anchor {
    position: relative;
}
.export-panel-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1040;
}
.export-panel {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    z-index: 1045;
    width: min(460px, calc(100vw - 2rem));
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.2);
    padding: 1rem;
}

/* ---- Scheduling Calendar views (WeeklyCalendar.View). Cards is the default layout above. ---- */

/* Rows: one line per shift -- name | stops | vet/team -- with the frequency bar down the left edge. */
.weekly-calendar-rows .calendar-day-shifts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.weekly-calendar-rows .calendar-shift-chip {
    display: grid;
    grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) minmax(0, 220px);
    align-items: center;
    column-gap: 16px;
    padding: 6px 10px 6px 14px;
}
.weekly-calendar-rows .calendar-shift-chip::before {
    right: auto;
    bottom: 0;
    width: 4px;
    height: auto;
}
.weekly-calendar-rows .calendar-shift-chip:hover { transform: none; }
.weekly-calendar-rows .calendar-shift-chip-head { margin-bottom: 0; }
.weekly-calendar-rows .calendar-shift-chip-legs {
    display: flex;
    flex-wrap: wrap;
    column-gap: 18px;
    min-width: 0;
}
.weekly-calendar-rows .calendar-shift-chip-metas {
    grid-column: 3;
    min-width: 0;
}
.weekly-calendar-rows .calendar-shift-chip-meta {
    margin-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 700px) {
    .weekly-calendar-rows .calendar-shift-chip { grid-template-columns: minmax(0, 1fr); }
    .weekly-calendar-rows .calendar-shift-chip-metas { grid-column: auto; }
}

/* Grid: a month-style grid, one column per visible weekday (--grid-cols). Scrolls sideways when narrow. */
.weekly-calendar-grid {
    gap: 6px;
    overflow-x: auto;
}
.weekly-calendar-grid .weekly-calendar-week {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols), minmax(130px, 1fr));
    gap: 6px;
}
.calendar-grid-weekdays {
    position: sticky;
    top: var(--app-header-h, 0px);
    z-index: 2;
    background: #fff;
}
.calendar-grid-weekday {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    text-align: center;
    padding: 2px 0;
}
.weekly-calendar-grid .calendar-day {
    min-height: 120px;
    padding: 6px;
    min-width: 0;
}
.weekly-calendar-grid .calendar-day-header {
    font-size: 14px;
    margin-bottom: 4px;
}
.weekly-calendar-grid .calendar-add-btn {
    padding: 0 8px;
    line-height: 1.4;
}
.weekly-calendar-grid .calendar-day-shifts {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
}
.weekly-calendar-grid .calendar-shift-chip {
    padding: 7px 6px 4px;
    font-size: 12px;
}
.weekly-calendar-grid .calendar-shift-chip::before { height: 3px; }
.weekly-calendar-grid .calendar-shift-chip-name {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.weekly-calendar-grid .calendar-shift-chip-head { margin-bottom: 1px; min-width: 0; }
.weekly-calendar-grid .calendar-shift-chip-time { font-size: 12px; }
.weekly-calendar-grid .calendar-shift-chip-more {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--navy-700);
}

/* Audit Log: the old/new JSON is one long token, so let it break anywhere instead of widening the table. */
.audit-json {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.audit-table td:nth-child(5), .audit-table td:nth-child(6) { min-width: 220px; }
.audit-table td:nth-child(-n+4) { white-space: nowrap; }

/* Phone layout for tables marked .table-stack: each row is a card, and each cell shows its column
   heading (data-label, filled in by wwwroot/js/tableStack.js) beside the value. */
@media (max-width: 640.98px) {
    .table-stack > thead { display: none; }
    .table-stack, .table-stack > tbody { display: block; }
    .table-stack > tbody > tr {
        display: block;
        background: #fff;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius-md);
        padding: 8px 12px;
        margin-bottom: 10px;
    }
    .table-stack > tbody > tr > td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        align-items: center;
        border: 0;
        padding: 5px 0;
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .table-stack > tbody > tr > td::before {
        content: attr(data-label);
        font-family: var(--font-display);
        font-weight: 700;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--gray-500);
    }
    /* Unlabeled cells (action buttons) and empty-state rows use the full width. */
    .table-stack > tbody > tr > td[data-label=""],
    .table-stack > tbody > tr > td[colspan] { grid-template-columns: minmax(0, 1fr); }
    .table-stack > tbody > tr > td[data-label=""]::before,
    .table-stack > tbody > tr > td[colspan]::before { display: none; }
    .table-stack .form-control, .table-stack .form-select { width: 100%; min-width: 0; }
    .audit-table td:nth-child(5), .audit-table td:nth-child(6) { min-width: 0; }
}

/* Scheduling Calendar toolbar: the Filters toggle (styled like Available Shifts') and a one-line summary
   of what's shown, so the panel can stay collapsed. */
.calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 0.75rem;
}
.calendar-filter-summary {
    color: var(--gray-500);
    font-size: 0.9rem;
    min-width: 0;
    overflow-wrap: anywhere;
}
.calendar-filters {
    padding: 12px 14px;
    margin-bottom: 0.75rem;
    background: var(--navy-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
}

/* ---- Scheduling Calendar map panel: beside the calendar on wider screens (collapsed to a tab by
   default), and the "Map" view in place of the calendar on phones. ---- */
.calendar-body {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.calendar-body-main {
    flex: 1 1 auto;
    min-width: 0;
}
.calendar-map-panel {
    flex: 0 0 auto;
    position: sticky;
    top: calc(var(--app-header-h, 0px) + 0.5rem);
}
.calendar-body.map-open .calendar-map-panel {
    flex-basis: min(42%, 560px);
}
.calendar-map-tab {
    writing-mode: vertical-rl;
    padding: 12px 6px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    font-weight: 600;
    color: var(--navy-900);
}
.calendar-map-tab:hover { background: var(--gray-100, #F3F4F7); }
.calendar-map-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.calendar-map-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}
.calendar-map-note {
    padding: 6px 10px;
    font-size: 12px;
    color: var(--gray-500);
    border-top: 1px solid var(--gray-200);
}
/* Phone Map view: the card fills the window below its top (--fit-h from shifterLayout.fitToWindow)
   and the map takes whatever the header and note leave. */
.calendar-map-card.is-fit {
    height: var(--fit-h, 70vh);
    display: flex;
    flex-direction: column;
}
.calendar-map-card.is-fit .map-view {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
}
@media (max-width: 767.98px) {
    /* Phones pick the map as a view instead (shifterLayout.isPhone uses the same width). */
    .calendar-map-panel { display: none; }

    /* The view buttons as a 2x2 grid (Cards, Rows / Grid, Map) across the width. */
    .calendar-view-filter { width: 100%; }
    .calendar-view-toggle {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
    }
    .calendar-view-toggle > .btn {
        margin-left: 0 !important;
        border-radius: var(--bs-btn-border-radius) !important;
    }
    .calendar-view-filter > .btn { margin: 6px 0 0 !important; }
}

/* ---- Scheduling Calendar rosters: each shift's stop addresses and Checkin / Tech / Checkout columns
   (Shared/ShiftStaffColumns.razor), and a day's "+ Staff" bank (Shared/StaffBank.razor) beside the
   day's shifts -- below them when the window is narrow, and as a row across the week in Grid. ---- */
.calendar-day-header > span:first-child { margin-right: auto; }

.calendar-shift-chip-leg:has(.calendar-shift-chip-address) { flex-wrap: wrap; }
.calendar-shift-chip-leg:has(.calendar-shift-chip-address) .calendar-shift-chip-location { flex: 1 1 0; }
.calendar-shift-chip-address {
    flex-basis: 100%;
    min-width: 0;
    font-size: 12px;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shift-staff-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}
.shift-staff-col {
    min-width: 0;
    min-height: 2.6rem;
    padding: 4px 6px;
    border: 1px dashed var(--gray-200);
    border-radius: 6px;
    background: #FAFBFC;
    transition: background-color 120ms, border-color 120ms;
}
.shift-staff-col.is-over {
    border-color: var(--navy-700, #2A4065);
    border-style: solid;
    background: #EEF3FB;
}
.shift-staff-col.is-missing { opacity: 0.55; }
/* While a staff name is dragged over a column: drop halves over it -- the role on the left (Tech over
   Tech-Assist in Tech) and In-training on the right. */
.shift-staff-col { position: relative; }
.shift-staff-col.is-splitting { min-height: 4.6rem; }
.shift-staff-split {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "main training";
    gap: 3px;
    padding: 3px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.82);
}
.shift-staff-split.has-assist {
    grid-template-rows: 1fr 1fr;
    grid-template-areas: "main training" "assist training";
}
.shift-staff-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 2px;
    border: 1px dashed var(--navy-700, #2A4065);
    border-radius: 5px;
    background: #F4F7FC;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
    color: var(--navy-700, #2A4065);
}
.shift-staff-zone.is-training { border-color: #B7791F; color: #8A5A12; background: #FFF8EA; }
.shift-staff-zone.is-over { border-style: solid; background: var(--navy-700, #2A4065); color: #fff; }
.shift-staff-zone.is-training.is-over { background: #B7791F; border-color: #B7791F; }
.shift-staff-it {
    flex: 0 0 auto;
    padding: 0 4px;
    border-radius: 3px;
    background: #FFF1D6;
    color: #8A5A12;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}
.shift-staff-col-head {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
    margin-bottom: 2px;
}
.shift-staff-name {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    line-height: 1.3;
    cursor: grab;
    border-radius: 4px;
}
.shift-staff-name:hover { background: #EEF1F5; }
.shift-staff-name-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.shift-staff-name.is-absent .shift-staff-name-text { text-decoration: line-through; color: var(--gray-500); }
.shift-staff-remove {
    flex: 0 0 auto;
    border: 0;
    background: none;
    padding: 0 3px;
    line-height: 1;
    font-size: 15px;
    color: var(--gray-500);
    opacity: 0;
}
.shift-staff-name:hover .shift-staff-remove,
.shift-staff-remove:focus-visible { opacity: 1; }
.shift-staff-remove:hover { color: var(--red-500, #C8102E); }
@media (hover: none) { .shift-staff-remove { opacity: 1; } }
.shift-staff-empty { font-size: 12px; color: var(--gray-500); }
.shift-staff-others { margin-top: 4px; font-size: 12px; color: var(--gray-500); }

/* Rows: the columns get their own line under the shift's row. Grid: stacked, to fit the cell. */
/* The columns and the Send button beside them; Send sits level with the columns' middle. */
.shift-staff-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.shift-staff-main { flex: 1 1 auto; min-width: 0; }
.shift-staff-row > .calendar-send-btn { flex: 0 0 auto; margin-top: 8px; }
.weekly-calendar-rows .shift-staff-row { grid-column: 1 / -1; }
.weekly-calendar-rows .shift-staff-cols { margin-top: 6px; }
/* Grid cells are narrow: Send goes under the stacked columns instead. */
.weekly-calendar-grid .shift-staff-row { flex-direction: column; align-items: stretch; gap: 4px; }
.weekly-calendar-grid .shift-staff-row > .calendar-send-btn { margin-top: 0; }
.weekly-calendar-grid .shift-staff-cols { grid-template-columns: minmax(0, 1fr); gap: 3px; margin-top: 4px; }
.weekly-calendar-grid .shift-staff-col { min-height: 0; padding: 2px 4px; }
.weekly-calendar-grid .shift-staff-name { font-size: 12px; }

.calendar-day-body.has-bank {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.calendar-day-body.has-bank > .calendar-day-shifts {
    flex: 1 1 auto;
    min-width: 0;
}
/* Beside the day's shifts: the staff bank and/or a shift's Send panel, stacked. */
.calendar-day-side {
    flex: 0 0 300px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.calendar-day-side:has(.staff-bank.is-off-open) { flex-basis: 440px; }
.calendar-day-side:has(.shift-send-panel) { flex-basis: 360px; }
.calendar-day-side:has(.shift-send-panel):has(.staff-bank.is-off-open) { flex-basis: 440px; }
.staff-bank {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 460px;
    padding: 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md, 8px);
    background: #fff;
    animation: calendar-shift-editor-open 180ms ease-out;
    transform-origin: top center;
}
.staff-bank-head {
    display: flex;
    align-items: center;
    gap: 8px;
}
.staff-bank-body {
    display: flex;
    gap: 6px;
    min-height: 0;
    flex: 1 1 auto;
}
.staff-bank-list {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 4px;
    overflow-y: auto;
    min-height: 3rem;
    padding: 2px;
    border: 1px dashed transparent;
    border-radius: 6px;
}
.staff-bank-list.is-over,
.staff-bank-off.is-over {
    border-color: var(--navy-700, #2A4065);
    background: #EEF3FB;
}
/* The Off bin: a narrow labelled drop column until opened, then a column of who's off. */
.staff-bank-off {
    flex: 0 0 44px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 3rem;
    border: 1px dashed var(--gray-300, #C9CFD8);
    border-radius: 6px;
    background: #F6F7F9;
    overflow: hidden;
    transition: flex-basis 160ms ease-out;
}
.staff-bank.is-off-open .staff-bank-off { flex-basis: 45%; }
.staff-bank-off-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0;
    background: none;
    padding: 6px 4px;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--navy-700, #2A4065);
}
.staff-bank:not(.is-off-open) .staff-bank-off-toggle {
    flex: 1 1 auto;
    flex-direction: column;
    writing-mode: vertical-rl;
}
.staff-bank-off-toggle:hover { background: #ECEFF3; }
.staff-bank-off-count {
    writing-mode: horizontal-tb;
    min-width: 1.4em;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--navy-700, #2A4065);
    color: #fff;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}
.staff-bank-off-list {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 4px;
    overflow-y: auto;
    padding: 0 4px 4px;
}
.staff-bank-off-list .staff-bank-item { cursor: pointer; }
.staff-bank-item { cursor: grab; max-width: 100%; }
.staff-bank-item .venn-marker { cursor: grab; }
.staff-bank-item.is-busy { opacity: 0.5; }
.staff-bank-hint { font-size: 12px; color: var(--gray-500); }
.calendar-staff-bank-row { grid-column: 1 / -1; }
.calendar-staff-bank-row .staff-bank { max-height: 320px; }
@media (max-width: 991.98px) {
    .calendar-day-body.has-bank { flex-direction: column; align-items: stretch; }
    .calendar-day-side, .calendar-day-side:has(.staff-bank.is-off-open), .calendar-day-side:has(.shift-send-panel) { flex-basis: auto; }
    .staff-bank { max-height: 320px; }
}
@media (prefers-reduced-motion: reduce) { .staff-bank { animation: none; } }

/* A shift's Send panel (Shared/ShiftSendPanel.razor): its staff's phone numbers and a message to copy. */
.calendar-send-btn {
    padding: 0 8px;
    font-size: 12px;
    line-height: 1.5;
}
.shift-send-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md, 8px);
    background: #fff;
    animation: calendar-shift-editor-open 180ms ease-out;
    transform-origin: top center;
}
.shift-send-phones,
.shift-send-message { resize: vertical; font-size: 13px; }
.shift-send-message { min-height: 12rem; }
@media (prefers-reduced-motion: reduce) { .shift-send-panel { animation: none; } }
.shift-send-template {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    border: 1px dashed var(--gray-200);
    border-radius: 6px;
    background: #FAFBFC;
}
.shift-send-token {
    display: inline-block;
    margin: 2px 2px 0 0;
    padding: 0 4px;
    border-radius: 3px;
    background: #EEF1F5;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: var(--navy-700, #2A4065);
    cursor: help;
}

/* Bootstrap's .sticky-top (e.g. the Scheduling Calendar's legend bar) sticks just under the app's top bar. */
.page .sticky-top { top: var(--app-header-h, 0px); }

/* A shift's vet status pill, at the chip's top right (WeeklyCalendar.VetStatus). */
.calendar-shift-chip-head .calendar-shift-chip-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.calendar-vet-pill {
    flex: 0 0 auto;
    padding: 1px 8px;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    border: 1px solid transparent;
}
.calendar-vet-pill.is-draft { background: #EEF0F3; color: #4A5568; border-color: #C9CFD8; border-style: dashed; }
.calendar-vet-pill.is-open { background: #FFF4D6; color: #8A5A00; border-color: #F2D48A; }
.calendar-vet-pill.is-requested { background: #E3EEFF; color: #1F4FA8; border-color: #B7CDF5; }
.calendar-vet-pill.is-filled { background: #E1F5EA; color: #17663E; border-color: #A8DDC0; }
.weekly-calendar-grid .calendar-vet-pill { padding: 0 5px; font-size: 10px; }

/* Shift-click adds to the selection; don't let it also highlight text across the calendar. */
.calendar-shift-chip { user-select: none; -webkit-user-select: none; }
