.availability-schedule-page {
    margin: 0 auto;
    max-width: 112rem;
    padding: 1rem 0 3rem;
}

.schedule-header {
    margin-bottom: 1.25rem;
}

.schedule-header h1 {
    margin: 0;
    color: #10364f;
    font-size: 3.2rem;
}

.eyebrow {
    margin: 0 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 1.1rem;
    color: #174f78;
    font-weight: 700;
}

.schedule-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 2rem;
    background: #ffffff;
    border: 1px solid #d9e3e8;
    border-radius: 10px;
}

.control-group[hidden] {
    display: none;
}

.control-group {
    display: flex;
    flex-direction: column;
    min-width: 160px;
    flex: 1 1 160px;
}

.control-group label {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: #374151;
    font-weight: 600;
}

.control-group input,
.control-group select {
    box-sizing: border-box;
    width: 100%;
}

.control-group input,
.control-group select,
.primary-button,
.secondary-button {
    min-height: 4.4rem;
    border-radius: 8px;
    border: 1px solid #c9d1de;
    padding: 0.5rem 0.75rem;
    font-size: 1.4rem;
}

.primary-button {
    background: #174f78;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    min-width: 140px;
}

.control-action {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    height: 4rem;
    justify-content: center;
    line-height: 1;
    min-height: 4rem;
    min-width: 14.5rem;
    padding: 0 1.2rem;
    width: 14.5rem;
}

.primary-button:hover {
    background: #10364f;
}

.secondary-button {
    background: #fff;
    color: #374151;
    border: 1px solid #c9d1de;
    cursor: pointer;
    font-weight: 600;
    min-width: 140px;
}

.secondary-button:hover {
    background: #f3f4f6;
}

.schedule-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: #374151;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid #dfe5ef;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
}

.legend-swatch {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 0.25rem;
}

.legend-swatch.available {
    background: #0f6e6a;
}

.legend-swatch.booked {
    background: #b3790f;
}

.legend-swatch.unavailable {
    background: #6b7280;
}

.legend-swatch.off-shift {
    background: #ffffff;
    border: 1px solid #d1d5db;
}

.schedule-status {
    margin-bottom: 1rem;
    color: #374151;
    font-weight: 600;
}

.schedule-wrapper {
    border: 1px solid #dfe5ef;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 0.4rem 1.4rem rgba(16, 54, 79, 0.05);
    position: relative;
}

.schedule-scroll-area {
    overflow-x: auto;
    scrollbar-color: #b7cdd6 transparent;
    scrollbar-width: thin;
}

.schedule-scroll-area::-webkit-scrollbar {
    height: 10px;
}

.schedule-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.schedule-scroll-area::-webkit-scrollbar-thumb {
    background-color: #b7cdd6;
    border-radius: 999px;
    border: 2px solid #fff;
}

.schedule-scroll-nudge {
    align-items: center;
    appearance: none;
    background: #fff;
    border: 1px solid #d5e0e6;
    border-radius: 999px;
    box-shadow: 0 .4rem 1rem rgba(16, 54, 79, .14);
    color: #174f78;
    cursor: pointer;
    display: flex;
    height: 3.2rem;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    padding: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity .15s ease, background .15s ease;
    width: 3.2rem;
    z-index: 5;
}

.schedule-wrapper:hover .schedule-scroll-nudge {
    opacity: 1;
}

.schedule-scroll-nudge:hover {
    background: #eef6f8;
}

.schedule-scroll-nudge.is-prev { left: .8rem; }
.schedule-scroll-nudge.is-next { right: .8rem; }

.schedule-container {
    padding: 1rem;
}

.timeline-grid {
    display: grid;
    gap: 0;
    border: 1px solid #dfe5ef;
    border-radius: 8px;
    background: #fff;
    width: max-content;
    min-width: 100%;
    position: relative;
}

.current-time-indicator {
    background: #d6483f;
    pointer-events: none;
    position: absolute;
    top: 0;
    width: 2px;
    z-index: 6;
}

.current-time-indicator::before {
    background: #d6483f;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 .1rem .4rem rgba(16, 54, 79, .3);
    content: '';
    height: .9rem;
    left: 50%;
    position: absolute;
    top: -.15rem;
    transform: translateX(-50%);
    width: .9rem;
}

.grid-cell,
.grid-header-cell {
    border-right: 1px solid #eef1f5;
    border-bottom: 1px solid #eef1f5;
    min-height: 72px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    overflow: hidden;
}

.grid-cell.is-hour-start,
.grid-header-cell.is-hour-start {
    border-right-color: #d7e2e8;
}

.grid-header-cell {
    background: #f3f8fa;
    color: #6d8089;
    font-weight: 600;
    font-size: 1.15rem;
    min-height: 52px;
}

.grid-header-cell.is-hour-start {
    color: #16394f;
    font-weight: 700;
}

.resource-header,
.resource-name {
    text-align: left;
    justify-content: flex-start;
    gap: .7rem;
    font-weight: 700;
    color: #16394f;
    background: #f9fbfc;
}

.resource-name,
.resource-header {
    position: sticky;
    left: 0;
    z-index: 4;
    box-shadow: 2px 0 0 #eef1f5;
}

.resource-header {
    background: #f3f8fa;
}

.resource-icon {
    align-items: center;
    background: #e3f7f6;
    border-radius: 50%;
    color: #0f6e6a;
    display: flex;
    flex: 0 0 auto;
    height: 2.6rem;
    justify-content: center;
    width: 2.6rem;
}

.resource-icon svg {
    height: 1.4rem;
    width: 1.4rem;
}

.resource-name-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.resource-name.grid-row-alt {
    background: #f4f7f8;
}

.off-shift-cell.grid-row-alt {
    background-color: #f7fafb;
}

button.grid-cell.slot-cell {
    appearance: none;
    border: 2px solid transparent;
    width: 100%;
    cursor: pointer;
}

.slot-cell {
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    min-height: 82px;
    padding: 0.6rem 0.5rem;
    transition: filter .1s ease;
}

.slot-cell.available {
    background: #e3f7f6;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
    color: #0f6e6a;
}

.slot-cell.booked {
    background: #ffedc7;
    color: #8a5a12;
}

.slot-cell.unavailable {
    background: #eef2f7;
    color: #374151;
}

.slot-cell.off-shift-cell {
    background-image: repeating-linear-gradient(135deg, transparent, transparent 7px, rgba(16,54,79,.025) 7px, rgba(16,54,79,.025) 8px);
}

.slot-cell small {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.9;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.release-allocation {
    appearance: none;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(138, 90, 18, 0.35);
    border-radius: 999px;
    color: #8a5a12;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.3;
    margin-top: 0.1rem;
    max-width: 100%;
    opacity: 0;
    padding: 0.22rem 0.65rem;
    transition: background 0.12s ease, color 0.12s ease, opacity .12s ease;
    white-space: nowrap;
}

.booking-block:hover .release-allocation,
.booking-block:focus-within .release-allocation {
    opacity: 1;
}

.release-allocation:hover,
.release-allocation:focus-visible {
    background: #8a5a12;
    color: #fff;
    opacity: 1;
}

.schedule-placeholder {
    padding: 4rem 2rem;
    text-align: center;
    color: #586174;
    background: #ffffff;
    border: 1px dashed #d8dee9;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .schedule-controls {
        padding: 0.75rem;
    }

    .control-group {
        flex-basis: 100%;
    }

    .control-action {
        min-width: 0;
        width: 100%;
    }

    .schedule-header h1 {
        font-size: 1.5rem;
    }
}

/* Clean Flow visual refresh */
.availability-schedule-page {
    max-width: 118rem;
    padding-top: 0;
}

.schedule-header {
    align-items: flex-end;
    background:
        radial-gradient(circle at 86% 30%, rgba(141, 225, 228, .25), transparent 16rem),
        #102d40;
    border-radius: 1.2rem;
    box-shadow: 0 1.5rem 4rem rgba(16, 45, 64, .14);
    color: #fff;
    display: flex;
    gap: 3rem;
    justify-content: space-between;
    margin-bottom: 2.4rem;
    min-height: 22rem;
    overflow: hidden;
    padding: 4rem;
}

.schedule-header .eyebrow {
    color: #8de1e4;
    letter-spacing: .16em;
}

.schedule-header h1 {
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: clamp(3rem, 4vw, 4.8rem);
    font-weight: 600;
    letter-spacing: -.04em;
    line-height: 1.1;
    max-width: 70rem;
}

.schedule-header-intro {
    color: #d7e7ed;
    font-size: 1.45rem;
    line-height: 1.6;
    margin: 1.2rem 0 0;
    max-width: 62rem;
}

.schedule-header-mark {
    border-left: 1px solid rgba(255,255,255,.2);
    display: grid;
    flex: 0 0 auto;
    gap: .4rem;
    padding: 1rem 0 1rem 2.5rem;
}

.schedule-header-mark span {
    color: #8de1e4;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .14em;
}

.schedule-header-mark strong { font-size: 1.35rem; }

.schedule-controls,
.schedule-wrapper {
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 .8rem 2.6rem rgba(16, 54, 79, .08);
}

.schedule-controls {
    gap: 1.2rem;
    margin-bottom: 1.8rem;
    padding: 2.6rem;
}

.schedule-filter-groups {
    display: grid;
    flex: 1 1 100%;
    gap: 2rem;
    width: 100%;
}

.schedule-filter-label {
    color: #3b899c;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .08em;
    margin: 0 0 .9rem;
    text-transform: uppercase;
}

.schedule-filter-fields {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.schedule-filter-fields-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.schedule-filter-fields .control-group {
    flex: none;
    min-width: 0;
}

.schedule-filter-actions {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: .4rem;
}

@media (max-width: 1100px) {
    .schedule-filter-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.schedule-filter-advanced {
    margin: 0;
}

.schedule-filter-advanced-summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.7rem;
    list-style: none;
    margin: 0 0 0.9rem;
    user-select: none;
}

.schedule-filter-advanced-summary::-webkit-details-marker {
    display: none;
}

.schedule-filter-advanced-summary::before {
    color: #3b899c;
    content: '\25B8';
    display: inline-block;
    font-size: 0.95rem;
    transition: transform 0.15s ease;
}

.schedule-filter-advanced[open] > .schedule-filter-advanced-summary::before {
    transform: rotate(90deg);
}

.schedule-filter-advanced-hint {
    color: #6b7e88;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: normal;
    text-transform: none;
}

.schedule-filter-advanced .schedule-filter-fields {
    margin: 0;
}

.schedule-section-heading {
    align-items: flex-start;
    display: flex;
    flex: 1 1 100%;
    gap: 1.2rem;
    margin-bottom: .8rem;
}

.schedule-section-heading > span {
    color: #3b899c;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .1em;
    padding-top: .35rem;
}

.schedule-section-heading h2 {
    color: #102d40;
    font-family: Arial, sans-serif;
    font-size: 2rem;
    margin: 0;
}

.schedule-section-heading p {
    color: #6b7e88;
    font-size: 1.2rem;
    margin: .35rem 0 0;
}

.control-group input,
.control-group select {
    background: #f8fbfc;
    border-color: #ccdce3;
}

.primary-button {
    background: #174f78;
    border-radius: .55rem;
}

.secondary-button { border-radius: .55rem; }

.schedule-results {
    margin-bottom: 1.8rem;
}

.schedule-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin: 2.2rem 0 1rem;
}

.schedule-results .schedule-toolbar {
    margin-top: 0;
}

.schedule-toolbar .schedule-legend,
.schedule-toolbar .schedule-status { margin: 0; }

.schedule-status { color: #102d40; }

.legend-item {
    border: 0;
    box-shadow: 0 .3rem 1rem rgba(16, 54, 79, .06);
}

.schedule-scroll-area { overflow-x: auto; overflow-y: hidden; }

.day-view-controls .day-view-date-row {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.day-date-picker {
    flex: 1 1 240px;
    max-width: 280px;
}

.day-nav-button {
    min-width: 13rem;
}

.selected-date-display {
    color: #102d40;
    font-size: 1.25rem;
    font-weight: 700;
}

.schedule-tabs {
    display: flex;
    gap: .8rem;
    margin-bottom: 1rem;
}

.schedule-tab {
    align-items: center;
    appearance: none;
    background: #e6edf2;
    border: 1px solid #c7d6df;
    border-radius: 999px;
    color: #174f78;
    cursor: pointer;
    display: inline-flex;
    font-size: 1.3rem;
    font-weight: 700;
    justify-content: center;
    line-height: 1;
    padding: .75rem 1.4rem;
}

.schedule-tab.is-active {
    background: #174f78;
    border-color: #174f78;
    color: #fff;
}

.day-timeline-grid .slot-cell {
    min-height: 68px;
    padding: 0;
}

.day-timeline-grid .grid-cell,
.day-timeline-grid .grid-header-cell {
    min-height: 68px;
}

.off-shift-cell {
    background: #fcfdfe;
    background-image: repeating-linear-gradient(135deg, transparent, transparent 7px, rgba(16,54,79,.025) 7px, rgba(16,54,79,.025) 8px);
}

.booked-cell-bg {
    background: #fff9ec;
}

.booking-block {
    align-items: center;
    appearance: none;
    border: 0;
    border-left: .3rem solid #c9871c;
    border-radius: .5rem;
    box-shadow: 0 .25rem .7rem rgba(138, 90, 18, .18);
    cursor: pointer;
    display: flex;
    font-size: 1.2rem;
    font-weight: 700;
    gap: .5rem;
    justify-content: space-between;
    margin: .6rem .3rem;
    overflow: hidden;
    padding: .5rem .8rem .5rem .65rem;
    text-align: left;
    transition: box-shadow .12s ease, transform .12s ease;
    white-space: nowrap;
    z-index: 3;
}

.booking-block:hover {
    box-shadow: 0 .5rem 1.1rem rgba(138, 90, 18, .26);
    transform: translateY(-1px);
}

.booking-block-booked,
.booking-block-job {
    background: #ffedc7;
    color: #8a5a12;
}

.open-job-details {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    flex: 1 1 auto;
    font-size: inherit;
    font-weight: inherit;
    overflow: hidden;
    padding: 0;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.open-job-details:hover,
.open-job-details:focus,
.open-job-details:focus-visible {
    background: transparent;
    color: inherit;
    text-decoration: underline;
}

.job-details-modal {
    inset: 0;
    position: fixed;
    z-index: 40;
}

.job-details-backdrop {
    background: rgba(0, 0, 0, .45);
    inset: 0;
    position: absolute;
}

.job-details-dialog {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2rem 5rem rgba(0, 0, 0, .35);
    left: 50%;
    max-height: 85vh;
    max-width: 56rem;
    overflow: auto;
    padding: 2rem;
    position: relative;
    top: 7vh;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
}

.job-details-close {
    appearance: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 3rem;
    line-height: 1;
    position: absolute;
    right: 1rem;
    top: .4rem;
}

.job-details-list {
    display: grid;
    gap: .9rem;
    margin: 1.2rem 0 0;
}

.job-details-list div {
    border-bottom: 1px solid #e5e7eb;
    display: grid;
    gap: .25rem;
    padding-bottom: .6rem;
}

.job-details-list dt {
    color: #6b7280;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
}

.job-details-list dd {
    color: #102d40;
    font-size: 1.3rem;
    margin: 0;
}

@media (max-width: 768px) {
    .schedule-header { align-items: flex-start; flex-direction: column; min-height: 0; padding: 3rem 2.2rem; }
    .schedule-header h1 { font-size: 3.1rem; }
    .schedule-header-mark { border-left: 0; border-top: 1px solid rgba(255,255,255,.2); padding: 1.5rem 0 0; width: 100%; }
    .schedule-controls { padding: 2rem; }
    .schedule-filter-fields,
    .schedule-filter-fields-2 { grid-template-columns: 1fr; }
    .schedule-toolbar { align-items: flex-start; flex-direction: column; }
    .day-view-controls .day-view-date-row { align-items: stretch; }
    .day-date-picker { max-width: none; }
    .day-nav-button { min-width: 0; width: 100%; }
}
