/* ===== Стили загруженности аудиторий ===== */

.workload-grid-container {
    width: 100%;
    max-height: 600px;
    overflow: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-card-border);
    position: relative;
}

.workload-filter-row {
    flex-wrap: wrap;
}

.workload-display-control {
    flex: 1 1 260px;
    min-width: 240px;
}

.workload-target-control {
    flex: 0 1 220px;
    min-width: 200px;
}

.workload-display-select {
    width: 100%;
    min-height: 38px;
    padding: 0.45rem 2.25rem 0.45rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.85rem;
    outline: none;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.workload-display-select:hover {
    background: var(--bg-hover);
}

.workload-display-select:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.workload-overview-filter[hidden],
#workload-overview-block[hidden],
#room-workload-block[hidden] {
    display: none !important;
}

.workload-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    table-layout: fixed;
}

.workload-table th, .workload-table td {
    border: 1px solid var(--bg-card-border);
    padding: 0.5rem;
    vertical-align: top;
    position: relative;
    min-width: 150px;
    height: 86px;
}

.workload-table th {
    background: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 1rem 0.5rem;
    box-shadow: 0 1px 0 var(--bg-card-border);
}

.workload-table th strong,
.workload-table th span,
.workload-table th small {
    display: block;
}

.workload-table th strong {
    color: var(--text-primary);
    font-size: 0.82rem;
    line-height: 1.1;
}

.workload-table th span {
    margin-top: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.1;
}

.workload-table th small {
    width: fit-content;
    margin: 0.35rem auto 0;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.16);
    color: var(--accent-hover);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
}

.workload-table .time-cell,
.workload-table .axis-cell {
    background: var(--bg-input);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
    vertical-align: middle;
    width: 140px;
    min-width: 140px;
    position: sticky;
    left: 0;
    z-index: 5;
    box-shadow: 1px 0 0 var(--bg-card-border);
}

.workload-table .axis-cell strong,
.workload-table .axis-cell span,
.workload-table .axis-cell small {
    display: block;
}

.workload-table .axis-cell strong {
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.15;
}

.workload-table .axis-cell span,
.workload-table .axis-cell small {
    margin-top: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.15;
}

.workload-table .axis-cell.room-unavailable {
    color: var(--error);
    background: color-mix(in srgb, var(--error) 8%, var(--bg-input));
}

.workload-table .top-left-cell {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 20;
    background: var(--bg-input);
    min-width: 140px;
    width: 140px;
    box-shadow: 1px 1px 0 var(--bg-card-border);
}

/* Диагональная линия через linear-gradient */
.workload-table .top-left-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
        to bottom right,
        transparent calc(50% - 1px),
        var(--bg-card-border) 50%,
        transparent calc(50% + 1px)
    );
    pointer-events: none;
}

.top-left-cell span.top-label {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.top-left-cell span.bottom-label {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.workload-summary {
    margin: -0.75rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.workload-filter-empty {
    padding: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.workload-busy-cell {
    background: color-mix(in srgb, var(--accent) 5%, var(--bg-primary));
}

.workload-free-cell {
    background: color-mix(in srgb, var(--success) 4%, var(--bg-primary));
}

.free-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

/* Карточки занятий внутри ячеек сетки */
.lesson-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .lesson-card {
    background: rgba(255, 255, 255, 0.9);
}

.lesson-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    border-color: var(--accent);
}

.lesson-subject {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.lesson-group {
    font-weight: 700; /* Акцент на названии группы */
    color: var(--text-primary);
    margin-bottom: 0.1rem;
    font-size: 0.75rem;
}

.lesson-subgroup {
    color: var(--accent-hover);
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
    line-height: 1.2;
}

.lesson-teacher {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.lesson-meta {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.2;
}

.room-workload-block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.room-workload-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: -0.75rem 0 0.25rem;
    color: var(--text-secondary);
    font-size: 0.86rem;
}

.room-summary-main {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-right: 0.25rem;
}

.room-summary-main strong {
    color: var(--text-primary);
    font-size: 0.98rem;
}

.room-summary-chip,
.room-summary-warning {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    line-height: 1.15;
}

.room-summary-warning {
    color: var(--warning);
    background: color-mix(in srgb, var(--warning) 10%, var(--bg-input));
}

.room-workload-tables {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.room-week-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.room-week-heading h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.2;
}

.room-week-heading span {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.room-week-panel {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 19rem);
}

.room-grid-container {
    flex: 1;
    height: calc(100vh - 24rem);
    min-height: 420px;
    max-height: none;
}

.room-week-table {
    min-width: 1040px;
}

.room-week-table th,
.room-week-table td {
    min-width: 126px;
    height: 172px;
}

.room-week-table .room-time-heading,
.room-week-table .room-time-cell {
    position: sticky;
    left: 0;
    min-width: 128px;
    width: 128px;
    background: var(--bg-input);
    box-shadow: 1px 0 0 var(--bg-card-border);
}

.room-week-table .room-time-heading {
    z-index: 20;
}

.room-week-table .room-time-cell {
    z-index: 5;
    color: var(--text-primary);
    font-weight: 600;
    vertical-align: middle;
}

.room-week-table .room-time-cell strong,
.room-week-table .room-time-cell span,
.room-week-table .room-day-cell strong,
.room-week-table .room-day-cell span,
.room-week-table .room-day-cell small {
    display: block;
}

.room-week-table .room-time-cell strong {
    font-size: 0.86rem;
    line-height: 1.15;
}

.room-week-table .room-time-cell span {
    margin-top: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.15;
}

.room-week-table .room-day-cell strong {
    color: var(--text-primary);
    font-size: 0.84rem;
    line-height: 1.1;
}

.room-week-table .room-day-cell > span {
    margin-top: 0.15rem;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.1;
}

.room-week-table .room-day-cell small {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.68rem;
    line-height: 1.1;
}

.room-day-parity-dates {
    display: grid;
    gap: 0.2rem;
    margin-top: 0.45rem;
}

.room-day-parity-dates span {
    padding: 0.16rem 0.35rem;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.room-combined-cell {
    height: 1px;
    padding: 0 !important;
    background: var(--bg-primary);
}

.room-single-cell {
    padding: 0 !important;
}

.room-week-unified {
    min-height: 172px;
    height: 100%;
    padding: 0.45rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.room-week-unified-busy {
    justify-content: flex-start;
    background: color-mix(in srgb, var(--accent) 5%, var(--bg-primary));
}

.room-week-unified-busy > .lesson-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 0;
}

.room-week-unified-free {
    background: color-mix(in srgb, var(--success) 4%, var(--bg-primary));
}

.room-week-unified-missing,
.room-week-unified-empty {
    background: color-mix(in srgb, var(--warning) 5%, var(--bg-primary));
}

.room-week-half {
    position: relative;
    min-height: 86px;
    padding: 1.4rem 0.45rem 0.45rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.room-week-half + .room-week-half {
    border-top: 1px solid var(--bg-card-border);
}

.room-week-half-busy {
    justify-content: flex-start;
    background: color-mix(in srgb, var(--accent) 5%, var(--bg-primary));
}

.room-week-half-free {
    background: color-mix(in srgb, var(--success) 4%, var(--bg-primary));
}

.room-week-half-missing,
.room-week-half-empty {
    background: color-mix(in srgb, var(--warning) 5%, var(--bg-primary));
}

.room-half-marker {
    position: absolute;
    top: 0.35rem;
    left: 0.45rem;
    display: inline-flex;
    align-items: center;
    max-width: calc(100% - 0.9rem);
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.room-week-half-odd .room-half-marker {
    color: var(--accent-hover);
}

.room-week-half-even .room-half-marker {
    color: var(--success);
}

.slot-unavailable {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 58px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.room-workload-state {
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.schedule-view-shell {
    min-height: calc(100vh - 8.5rem);
    display: grid;
    grid-template-rows: auto auto minmax(420px, 1fr);
    gap: 1rem;
}

.schedule-view-control-card {
    position: relative;
    z-index: 10;
}
.schedule-view-results-card {
    position: relative;
    z-index: 5;
}
.schedule-view-table-card {
    position: relative;
    z-index: 1;
}

.schedule-view-control-card,
.schedule-view-results-card,
.schedule-view-table-card {
    animation-duration: 0.28s;
}

.schedule-view-results-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-view-control-header,
.schedule-view-results-header,
.schedule-view-table-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.schedule-view-control-header h2,
.schedule-view-results-header h2,
.schedule-view-table-header h2 {
    margin-bottom: 0.3rem;
}

.schedule-view-control-grid,
.schedule-view-extra-grid {
    display: grid;
    gap: 1rem;
    align-items: end;
}

.schedule-view-control-grid {
    grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1.25fr) minmax(170px, 0.8fr) minmax(210px, 0.9fr);
    margin-top: 1rem;
}

.schedule-view-extra-grid {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    margin-top: 0.9rem;
}

.schedule-view-period-control {
    min-width: 0;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.schedule-view-period-buttons,
.schedule-view-result-actions,
.schedule-view-day-tabs {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.schedule-view-extra-filters {
    margin-top: 0.9rem;
    border-top: 1px solid var(--bg-card-border);
    padding-top: 0.85rem;
}

.schedule-view-extra-filters summary {
    width: fit-content;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.schedule-view-result-actions {
    min-height: 42px;
    justify-content: flex-end;
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-align: right;
}

.schedule-view-result-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0;
    padding-bottom: 0.1rem;
    overflow-x: visible;
}

.schedule-view-result-tab {
    flex: 0 0 auto;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.18rem;
    min-width: 150px;
    max-width: 240px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.schedule-view-result-tab span,
.schedule-view-result-tab small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-view-result-tab small {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.schedule-view-result-tab:hover,
.schedule-view-result-tab.active {
    background: color-mix(in srgb, var(--accent) 12%, var(--bg-input));
    border-color: var(--accent);
    transform: translateY(-1px);
}

.schedule-view-empty-result {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.schedule-view-table-card {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.schedule-view-table-header {
    flex: 0 0 auto;
    margin-bottom: 1rem;
}

.schedule-view-table-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.schedule-view-week-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.schedule-view-grid-container {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: none;
}

.schedule-view-matrix-table {
    min-width: 980px;
}

.schedule-view-matrix-table th,
.schedule-view-matrix-table td {
    min-width: 150px;
    height: 172px;
}

.schedule-view-lesson-card .lesson-meta + .lesson-meta {
    margin-top: 0.1rem;
}

.schedule-view-lesson-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.schedule-override-badge {
    display: inline-flex;
    width: fit-content;
    margin: 0.35rem 0;
    padding: 0.18rem 0.45rem;
    border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 700;
}

.schedule-override-edit {
    width: 100%;
    margin-top: 0.55rem;
    padding: 0.42rem 0.6rem;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--bg-card-border));
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 10%, var(--bg-input));
    color: var(--text-primary);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.schedule-override-edit:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 18%, var(--bg-input));
}

.schedule-override-count {
    display: inline-grid;
    min-width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.4rem;
    place-items: center;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    font-size: 0.72rem;
}

body.schedule-override-open {
    overflow: hidden;
}

.schedule-override-drawer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: 1fr minmax(520px, 680px);
}

.schedule-override-drawer[hidden] {
    display: none;
}

.schedule-override-backdrop {
    border: 0;
    background: rgba(4, 10, 24, 0.68);
    cursor: default;
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
}

.schedule-override-panel {
    min-width: 0;
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    border-left: 1px solid var(--bg-card-border);
    background: color-mix(in srgb, var(--bg-card) 88%, transparent);
    box-shadow: -24px 0 64px rgba(0, 0, 0, 0.28);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    backdrop-filter: blur(24px) saturate(135%);
    animation: schedule-override-enter 0.22s ease-out;
}

@keyframes schedule-override-enter {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.schedule-override-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.5rem 1rem;
}

.schedule-override-header h2 {
    margin: 0.18rem 0 0;
}

.schedule-override-eyebrow {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.schedule-override-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin: 0 1.5rem;
    padding: 0.3rem;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.schedule-override-tab {
    min-height: 38px;
    border: 0;
    border-radius: calc(var(--radius-sm) - 3px);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.schedule-override-tab.active {
    background: color-mix(in srgb, var(--accent) 16%, var(--bg-card));
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.schedule-override-body {
    min-height: 0;
    padding: 1.25rem 1.5rem 1.5rem;
    overflow-y: auto;
}

.schedule-override-empty {
    display: grid;
    min-height: 180px;
    padding: 1.25rem;
    place-items: center;
    border: 1px dashed var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    text-align: center;
}

.schedule-override-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.schedule-override-comparison article {
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.schedule-override-comparison .schedule-override-after {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--bg-card-border));
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-input));
}

.schedule-override-comparison span,
.schedule-override-comparison strong,
.schedule-override-comparison p {
    display: block;
}

.schedule-override-comparison span {
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.schedule-override-comparison strong {
    font-size: 0.88rem;
}

.schedule-override-comparison p {
    margin: 0.42rem 0 0;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.45;
}

.schedule-override-fieldset {
    min-width: 0;
    margin: 0 0 1.2rem;
    padding: 0;
    border: 0;
}

.schedule-override-fieldset legend {
    margin-bottom: 0.55rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}

.schedule-override-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.35rem;
}

.schedule-override-date {
    min-width: 0;
    min-height: 58px;
    padding: 0.38rem 0.2rem;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
}

.schedule-override-date span,
.schedule-override-date strong {
    display: block;
}

.schedule-override-date span {
    color: var(--text-secondary);
    font-size: 0.68rem;
}

.schedule-override-date strong {
    margin-top: 0.2rem;
    font-size: 0.77rem;
}

.schedule-override-date.active,
.schedule-override-calendar-day.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 18%, var(--bg-input));
    box-shadow: inset 0 0 0 1px var(--accent);
}

.schedule-override-date:disabled,
.schedule-override-calendar-day:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

.schedule-override-calendar-toggle {
    width: 100%;
    margin-top: 0.6rem;
}

.schedule-override-calendar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    max-height: 390px;
    margin-top: 0.65rem;
    padding: 0.65rem;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    overflow-y: auto;
}

.schedule-override-calendar[hidden] {
    display: none;
}

.schedule-override-month {
    padding: 0.55rem;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

.schedule-override-month h4 {
    margin: 0 0 0.55rem;
    font-size: 0.8rem;
    text-align: center;
}

.schedule-override-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.18rem;
}

.schedule-override-calendar-grid > strong {
    padding: 0.2rem 0;
    color: var(--text-secondary);
    font-size: 0.6rem;
    text-align: center;
}

.schedule-override-calendar-day,
.schedule-override-calendar-blank {
    min-width: 0;
    aspect-ratio: 1;
}

.schedule-override-calendar-day {
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.7rem;
    cursor: pointer;
}

.schedule-override-calendar-day:not(:disabled):hover {
    border-color: var(--accent);
}

.schedule-override-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.schedule-override-fields select,
#schedule-override-comment {
    width: 100%;
}

#schedule-override-comment {
    resize: vertical;
}

.schedule-override-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bg-card-border);
}

.schedule-override-registry-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.schedule-override-registry-heading h3 {
    margin: 0 0 0.25rem;
}

.schedule-override-registry {
    display: grid;
    gap: 0.7rem;
}

.schedule-override-registry-item {
    padding: 1rem;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.schedule-override-registry-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.schedule-override-registry-topline time {
    color: var(--text-secondary);
    font-size: 0.76rem;
}

.schedule-override-action {
    display: inline-flex;
    padding: 0.2rem 0.48rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 800;
}

.schedule-override-action.action-cancel {
    background: color-mix(in srgb, var(--danger, #ef4444) 13%, transparent);
    color: var(--danger, #ef4444);
}

.schedule-override-registry-item h4 {
    margin: 0.65rem 0 0.25rem;
}

.schedule-override-registry-item p,
.schedule-override-registry-item blockquote {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.5;
}

.schedule-override-registry-item p {
    margin: 0;
}

.schedule-override-registry-item blockquote {
    margin: 0.65rem 0;
    padding-left: 0.7rem;
    border-left: 2px solid var(--accent);
}

.schedule-override-registry-item .btn {
    margin-top: 0.75rem;
}

.schedule-view-state {
    min-height: 100%;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.schedule-view-state-actionable {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.schedule-view-state-reload {
    min-width: 200px;
}

.schedule-view-day-tabs {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.schedule-view-day-tab {
    min-width: 42px;
    min-height: 34px;
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.schedule-view-day-tab.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 15%, var(--bg-input));
    color: var(--text-primary);
}

.schedule-view-mobile-day {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.schedule-view-mobile-day-heading,
.schedule-view-mobile-slot {
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
}

.schedule-view-mobile-day-heading {
    padding: 0.8rem 0.9rem;
}

.schedule-view-mobile-day-heading strong,
.schedule-view-mobile-day-heading span,
.schedule-view-mobile-slot-time strong,
.schedule-view-mobile-slot-time span {
    display: block;
}

.schedule-view-mobile-day-heading span,
.schedule-view-mobile-slot-time span {
    margin-top: 0.25rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.schedule-view-mobile-slot {
    overflow: hidden;
}

.schedule-view-mobile-slot-time {
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--bg-card-border);
}

.schedule-view-mobile-slot-content .room-week-unified {
    min-height: 124px;
}

/* Настройка scrollbar для контейнера сетки */
.workload-grid-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.workload-grid-container::-webkit-scrollbar-track {
    background: transparent;
}
.workload-grid-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
}
[data-theme="light"] .workload-grid-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

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

@media (max-width: 768px) {
    .workload-target-control,
    .workload-display-control {
        min-width: 100%;
    }

    .room-week-heading {
        align-items: flex-start;
    }

    .room-week-panel {
        min-height: auto;
    }

    .room-grid-container {
        height: 520px;
    }

    .schedule-view-shell {
        min-height: auto;
        grid-template-rows: auto;
    }

    .schedule-view-control-header,
    .schedule-view-results-header,
    .schedule-view-table-header {
        display: grid;
        grid-template-columns: 1fr;
    }

    .schedule-view-control-grid,
    .schedule-view-extra-grid {
        grid-template-columns: 1fr;
    }

    .schedule-view-period-buttons,
    .schedule-view-result-actions,
    .schedule-view-day-tabs {
        width: 100%;
    }

    .schedule-view-period-buttons .btn,
    .schedule-view-result-actions .btn {
        flex: 1;
    }

    .schedule-view-result-actions {
        justify-content: stretch;
        text-align: center;
    }

    .schedule-view-result-actions span {
        flex: 2;
        align-self: center;
    }

    .schedule-view-result-tab {
        min-width: 72%;
    }

    .schedule-view-table-card {
        min-height: 520px;
    }

    .schedule-view-day-tabs {
        justify-content: flex-start;
    }

    .schedule-override-drawer {
        display: block;
    }

    .schedule-override-drawer[hidden] {
        display: none;
    }

    .schedule-override-backdrop {
        display: none;
    }

    .schedule-override-panel {
        width: 100%;
        border-left: 0;
    }

    .schedule-override-header,
    .schedule-override-body {
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .schedule-override-tabs {
        margin-right: 1rem;
        margin-left: 1rem;
    }

    .schedule-override-comparison,
    .schedule-override-fields,
    .schedule-override-calendar {
        grid-template-columns: 1fr;
    }

    .schedule-override-week {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .schedule-override-actions .btn {
        width: 100%;
    }
}
