/* =========================================================
           PAGE-SPECIFIC STYLES / СТИЛИ ТОЛЬКО ДЛЯ СТРАНИЦЫ РАСПИСАНИЯ
           ========================================================= */

        /* Toolbar container / Контейнер верхней панели управления */
        .schedule-panel {
            --shift-morning-bg: #ecfeff;
            --shift-evening-bg: #fff7ed;
            --shift-night-bg: #eef2ff;
            --shift-status-bg: #f5f3ff;
        }

        .schedule-command-panel {
            border-color: var(--border-strong);
        }

        .schedule-toolbar {
            display: grid;
            grid-template-columns: minmax(520px, 1fr) minmax(420px, 0.95fr);
            gap: 18px;
            align-items: stretch;
        }

        .toolbar-context,
        .toolbar-actions {
            min-width: 0;
        }

        .toolbar-context {
            display: grid;
            grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.15fr) auto;
            gap: 12px;
            align-items: end;
            padding: 14px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: #f8fafc;
        }

        /* Responsive layout blocks / Адаптивные блоки панели */
        .toolbar-field {
            min-width: 0;
        }

        .toolbar-actions {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 12px;
        }

        body.rtl .toolbar-actions {
            direction: rtl;
        }

        .toolbar-command-group {
            display: flex;
            min-width: 0;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: 12px;
            background: #ffffff;
        }

        .toolbar-danger-group {
            background: #fffafa;
            border-color: #ffd5d5;
        }

        .toolbar-group-label {
            color: var(--muted);
            font-size: 0.72rem;
            font-weight: 800;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .toolbar-command-row {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .toolbar-command-row .btn {
            flex: 1 1 auto;
            min-width: max-content;
        }

        .toolbar-modal-btn {
            width: 100%;
            min-height: 48px;
            padding-inline: 10px;
            white-space: normal;
        }

        .schedule-action-modal {
            width: min(520px, 100%);
        }

        .schedule-action-modal-body {
            display: grid;
            gap: 10px;
        }

        .schedule-action-option {
            justify-content: center;
            width: 100%;
            min-height: 46px;
        }

        .schedule-stage-top {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 14px;
        }

        .schedule-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }

        .legend-chip {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            min-height: 30px;
            padding: 6px 10px;
            border-radius: 999px;
            border: 1px solid var(--border);
            background: #fff;
            color: var(--text);
            font-size: 0.78rem;
            font-weight: 800;
        }

        .legend-chip::before {
            content: "";
            width: 8px;
            height: 8px;
            border-radius: 999px;
            background: #94a3b8;
        }

        .legend-chip.morning::before {
            background: var(--shift-morning-bg);
            border: 1px solid #0f766e;
        }

        .legend-chip.evening::before {
            background: var(--shift-evening-bg);
            border: 1px solid #c2410c;
        }

        .legend-chip.night::before {
            background: var(--shift-night-bg);
            border: 1px solid #4338ca;
        }

        .legend-chip.status::before {
            background: var(--shift-status-bg);
            border: 1px solid #7c3aed;
        }

        .schedule-display-control {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 12px;
        }

        body.rtl .schedule-display-control {
            justify-content: flex-start;
        }

        .schedule-display-field {
            width: min(260px, 100%);
        }

        .schedule-status-strip {
            display: none;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 10px;
            margin-bottom: 14px;
        }

        .schedule-status-strip.is-visible {
            display: grid;
        }

        .schedule-status-item {
            min-width: 0;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: #ffffff;
            padding: 10px 12px;
        }

        .schedule-status-label {
            color: var(--muted);
            font-size: 0.72rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-bottom: 4px;
        }

        .schedule-status-value {
            color: var(--text);
            font-size: 0.9rem;
            font-weight: 800;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .schedule-floating-header {
            position: fixed;
            top: 0;
            left: 0;
            z-index: 60;
            display: none;
            pointer-events: none;
        }

        .schedule-floating-header.is-visible {
            display: block;
        }

        .schedule-floating-header-scroller {
            overflow: hidden;
            border: 1px solid #b8c3d4;
            border-radius: 16px 16px 0 0;
            background: #d9e1ec;
            box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
        }

        .schedule-floating-table {
            min-width: 1080px;
        }

        /* Large schedule area / Большая область таблицы расписания */
        .schedule-shell {
            --schedule-date-header-height: 72px;
            --schedule-header-offset: 0px;
            position: relative;
            overflow-x: auto;
            overflow-y: visible;
            border: 1px solid #b8c3d4;
            border-radius: 16px;
            background: #d9e1ec;
            box-shadow:
                0 22px 60px rgba(15, 23, 42, 0.14),
                0 0 0 1px rgba(255, 255, 255, 0.7) inset;
            min-height: 320px;
            max-width: 100%;
            -webkit-overflow-scrolling: touch;
        }

        .schedule-panel {
            border-color: #c7d2e1;
            background: #edf2f8;
            box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
            overflow: visible;
        }

        .schedule-panel .panel-body {
            background: #eef3f8;
        }

        .schedule-loading-overlay {
            position: absolute;
            inset: var(--schedule-header-offset) 0 0 0;
            z-index: 20;
            display: none;
            align-items: flex-start;
            justify-content: center;
            padding: 28px;
            background: rgba(248, 250, 252, 0.86);
            backdrop-filter: blur(4px);
        }

        .schedule-shell.is-generating .schedule-loading-overlay {
            display: flex;
        }

        .generation-card {
            width: min(440px, 100%);
            border: 1px solid #bfdbfe;
            border-radius: 18px;
            background: #ffffff;
            box-shadow: 0 22px 60px rgba(15, 23, 42, 0.16);
            padding: 24px;
            text-align: center;
        }

        .generation-spinner {
            width: 62px;
            height: 62px;
            margin: 0 auto 16px;
            border-radius: 50%;
            border: 5px solid #dbeafe;
            border-top-color: var(--primary);
            animation: generation-spin 0.9s linear infinite;
        }

        .generation-title {
            margin: 0;
            color: var(--text);
            font-size: 1.05rem;
            font-weight: 800;
        }

        .generation-text {
            margin: 8px 0 0;
            color: var(--muted);
            font-size: 0.9rem;
            line-height: 1.45;
        }

        .generation-progress {
            position: relative;
            overflow: hidden;
            height: 8px;
            margin-top: 18px;
            border-radius: 999px;
            background: #e2e8f0;
        }

        .generation-progress::before {
            content: "";
            position: absolute;
            top: 0;
            bottom: 0;
            width: 42%;
            border-radius: inherit;
            background: linear-gradient(90deg, #60a5fa, var(--primary), #22c55e);
            animation: generation-progress 1.4s ease-in-out infinite;
        }

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

        @keyframes generation-progress {
            0% {
                left: -45%;
            }

            50% {
                left: 35%;
            }

            100% {
                left: 105%;
            }
        }

        /* Main schedule table / Основная таблица расписания */
        .schedule-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            min-width: 1080px;
        }

        .schedule-table th,
        .schedule-table td {
            border-bottom: 1px solid #d3dce8;
            border-inline-end: 1px solid #d3dce8;
            vertical-align: top;
            padding: 0;
            background: #fdfefe;
        }

        .schedule-table th:last-child,
        .schedule-table td:last-child {
            border-inline-end: none;
        }

        .schedule-table thead th {
            background: #eaf0f7;
        }

        /* Sticky first column / Липкая первая колонка с именем сотрудника */
        .employee-column {
            min-width: 205px;
            width: 205px;
            position: sticky;
            left: 0;
            z-index: 3;
            background: #f7fafc;
        }

        body.rtl .employee-column {
            left: auto;
            right: 0;
        }

        .schedule-table thead .employee-column {
            z-index: 16;
            background: #eaf0f7;
        }

        /* Header cells / Ячейки заголовка по дням */
        .day-header {
            min-width: 150px;
            min-height: var(--schedule-date-header-height);
            box-sizing: border-box;
            background: #eaf0f7;
            padding: 10px 10px;
        }

        .day-header.has-attention {
            background: #fff7ed;
        }

        .day-header.has-attention.danger {
            background: #fef2f2;
        }

        .day-header-title {
            font-size: 0.9rem;
            font-weight: 800;
            color: var(--text);
        }

        .day-header-date {
            margin-top: 2px;
            font-size: 0.76rem;
            color: var(--muted);
        }

        .day-header-flags {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 8px;
        }

        .day-header-flag {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-height: 22px;
            padding: 0 8px;
            border-radius: 999px;
            font-size: 0.7rem;
            font-weight: 800;
            line-height: 1;
            border: 1px solid transparent;
        }

        .day-header-flag.warning {
            background: #fffbeb;
            border-color: #fde68a;
            color: #92400e;
        }

        .day-header-flag.danger {
            background: #fef2f2;
            border-color: #fecaca;
            color: #991b1b;
        }

        /* Employee cell / Ячейка с именем сотрудника */
        .employee-cell {
            padding: 10px 12px;
            min-height: 126px;
            background: #f7fafc;
        }

        .employee-name {
            font-size: 0.9rem;
            font-weight: 800;
            line-height: 1.25;
            margin-bottom: 6px;
        }

        .employee-meta {
            font-size: 0.76rem;
            color: var(--muted);
            line-height: 1.45;
        }

        /* Schedule day cell / Ячейка одного дня */
        .schedule-day-cell {
            position: relative;
            min-width: 150px;
            background: #fdfefe;
        }

        .schedule-day-inner {
            position: relative;
            padding: 8px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-height: 126px;
        }

        .schedule-day-inner.has-entries .add-box {
            background: #fff;
            border-style: dashed;
        }

        .schedule-day-cell.has-day-status .schedule-day-inner {
            min-height: 126px;
        }

        .cell-status-cover {
            position: absolute;
            inset: 0;
            z-index: 5;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #fecaca;
            border-radius: 10px;
            background: rgba(254, 242, 242, 0.96);
            color: #991b1b;
            font-size: 0.9rem;
            font-weight: 800;
            text-align: center;
            box-shadow: 0 10px 30px rgba(153, 27, 27, 0.12);
        }

        .cell-status-cover.day-off {
            border-color: #c4b5fd;
            background: rgba(245, 243, 255, 0.97);
            color: #5b21b6;
            box-shadow: 0 10px 30px rgba(91, 33, 182, 0.12);
        }

        .status-remove-btn {
            position: absolute;
            top: 6px;
            right: 6px;
            z-index: 6;
            border: none;
            border-radius: 999px;
            width: 26px;
            height: 26px;
            background: #fee2e2;
            color: #991b1b;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 800;
            line-height: 1;
        }

        body.rtl .status-remove-btn {
            right: auto;
            left: 6px;
        }

        /* Add box / Блок добавления смен */
        .add-box {
            border: 1px solid var(--border);
            border-radius: 10px;
            padding: 8px;
            background: #f8fafc;
        }

        .box-label {
            display: block;
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--muted);
            margin-bottom: 8px;
        }

        .small-control {
            width: 100%;
            border: 1px solid var(--border);
            background: #fff;
            border-radius: 12px;
            padding: 10px 12px;
            color: var(--text);
            font-size: 0.88rem;
        }

        .small-control:focus {
            outline: none;
            border-color: #93c5fd;
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
        }

        .cell-actions {
            display: flex;
            flex-direction: row;
            gap: 8px;
            align-items: stretch;
        }

        .cell-btn {
            flex: 1 1 0;
            border: none;
            border-radius: 10px;
            min-height: 32px;
            padding: 7px 10px;
            cursor: pointer;
            font-weight: 700;
            font-size: 0.78rem;
            transition: transform var(--transition), background var(--transition);
        }

        .cell-btn:hover {
            transform: translateY(-1px);
        }

        .cell-btn.primary {
            background: var(--primary);
            color: #fff;
        }

        .cell-btn.secondary {
            background: #eef2f7;
            color: var(--text);
        }

        /* Shift cards list / Список карточек смен */
        .entries-list {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .empty-text {
            font-size: 0.76rem;
            color: var(--muted);
        }

        /* Common shift card / Общая карточка смены */
        .entry-card {
            --entry-accent: #64748b;
            position: relative;
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 6px 34px 6px 12px;
            background: #fff;
            overflow: hidden;
        }

        .entry-card::before {
            content: "";
            position: absolute;
            inset: 0 auto 0 0;
            width: 4px;
            border-radius: 12px 0 0 12px;
            background: var(--entry-accent);
            opacity: 0.9;
        }

        .entry-card.has-no-show {
            opacity: 0.9;
        }

        .entry-card.has-no-show::after {
            content: "";
            position: absolute;
            inset: 0;
            z-index: 1;
            background: rgba(15, 23, 42, 0.72);
        }

        .entry-card.has-no-show .entry-title,
        .entry-card.has-no-show .entry-meta {
            position: relative;
            z-index: 2;
            filter: grayscale(0.3);
        }

        .entry-no-show-label {
            position: absolute;
            inset: 0;
            z-index: 3;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 12px 32px;
            color: #fff;
            font-size: 0.8rem;
            font-weight: 900;
            text-align: center;
            pointer-events: none;
        }

        .entry-status-remove-btn {
            position: absolute;
            top: 5px;
            right: 5px;
            z-index: 4;
            border: none;
            border-radius: 999px;
            width: 24px;
            height: 24px;
            background: #fee2e2;
            color: #991b1b;
            cursor: pointer;
            font-size: 0.95rem;
            font-weight: 800;
            line-height: 1;
        }

        body.rtl .entry-status-remove-btn {
            right: auto;
            left: 5px;
        }

        /* Morning shift / Утренняя смена */
        .entry-card.morning {
            --entry-accent: #0f766e;
            background: var(--shift-morning-bg);
            border-color: color-mix(in srgb, var(--shift-morning-bg) 58%, #0f766e);
            color: #134e4a;
        }

        /* Evening shift / Вечерняя смена */
        .entry-card.evening {
            --entry-accent: #c2410c;
            background: var(--shift-evening-bg);
            border-color: color-mix(in srgb, var(--shift-evening-bg) 58%, #c2410c);
            color: #9a3412;
        }

        /* Night shift / Ночная смена */
        .entry-card.night {
            --entry-accent: #4338ca;
            background: var(--shift-night-bg);
            border-color: color-mix(in srgb, var(--shift-night-bg) 58%, #4338ca);
            color: #312e81;
        }

        .entry-card.night .entry-meta {
            color: #4f46e5;
        }

        .entry-card.is-muted-foreign {
            opacity: 0.48;
            filter: saturate(0.45) contrast(0.94);
            box-shadow: none;
            border-style: dashed;
        }

        .entry-card.is-muted-foreign .entry-title,
        .entry-card.is-muted-foreign .entry-meta {
            position: relative;
            z-index: 1;
        }

        /* Special status card / Карточка особого статуса */
        .entry-card.status {
            background: var(--shift-status-bg);
            border-style: dashed;
        }

        .entry-title {
            position: relative;
            z-index: 1;
            font-size: 0.75rem;
            font-weight: 800;
            line-height: 1.2;
            margin-bottom: 2px;
        }

        .entry-meta {
            position: relative;
            z-index: 1;
            font-size: 0.66rem;
            color: var(--muted);
            line-height: 1.25;
        }

        .schedule-panel.card-display-compact .entry-card {
            padding-top: 5px;
            padding-bottom: 5px;
        }

        .schedule-panel.card-display-compact .entry-title {
            margin-bottom: 0;
        }

        .schedule-panel.card-display-compact .entry-meta {
            display: none;
        }

        .entry-delete {
            position: absolute;
            top: 50%;
            right: 6px;
            z-index: 2;
            transform: translateY(-50%);
            border: none;
            border-radius: 999px;
            width: 22px;
            height: 22px;
            background: #fee2e2;
            color: #b91c1c;
            font-size: 0.9rem;
            font-weight: 700;
            line-height: 1;
            padding: 0;
            cursor: pointer;
        }

        .entry-card.has-no-show .entry-delete {
            top: auto;
            bottom: 6px;
            transform: none;
        }

        body.rtl .entry-delete {
            right: auto;
            left: 6px;
        }

        .shift-picker-overlay {
            position: fixed;
            inset: 0;
            z-index: 100;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 24px;
            background: rgba(15, 23, 42, 0.48);
            backdrop-filter: blur(3px);
        }

        .shift-picker-overlay.is-open {
            display: flex;
        }

        .shift-picker-modal {
            width: min(520px, 100%);
            max-height: min(680px, calc(100vh - 48px));
            overflow: auto;
            border-radius: 16px;
            background: #fff;
            box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
            border: 1px solid var(--border);
        }

        .shift-picker-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            padding: 18px 20px;
            border-bottom: 1px solid var(--border);
            background: #f8fafc;
        }

        .shift-picker-title {
            margin: 0;
            font-size: 1rem;
            font-weight: 800;
            color: var(--text);
        }

        .shift-picker-context {
            margin-top: 4px;
            font-size: 0.82rem;
            color: var(--muted);
        }

        .shift-picker-close {
            border: none;
            border-radius: 999px;
            width: 34px;
            height: 34px;
            background: #e2e8f0;
            color: var(--text);
            cursor: pointer;
            font-size: 1.1rem;
            line-height: 1;
        }

        .shift-picker-body {
            display: grid;
            gap: 16px;
            padding: 18px 20px 20px;
        }

        .shift-picker-group {
            display: grid;
            gap: 8px;
        }

        .shift-picker-group-title {
            font-size: 0.78rem;
            font-weight: 800;
            color: var(--muted);
            text-transform: uppercase;
        }

        .shift-picker-option {
            width: 100%;
            border: 1px solid var(--border);
            border-radius: 10px;
            background: #fff;
            padding: 10px 12px;
            text-align: start;
            cursor: pointer;
            transition: background var(--transition), border-color var(--transition), transform var(--transition);
        }

        .shift-picker-option:hover {
            transform: translateY(-1px);
            border-color: #93c5fd;
            background: #f8fafc;
        }

        .shift-picker-option-title {
            font-size: 0.9rem;
            font-weight: 800;
            color: var(--text);
        }

        .shift-picker-option-meta {
            margin-top: 3px;
            font-size: 0.78rem;
            color: var(--muted);
        }

        .entry-delete:hover {
            background: #fecaca;
        }

        /* Coverage row / Строка покрытия */
        .coverage-header-cell {
            padding: 6px;
            background: #f8fafc;
        }

        .coverage-header-cell.has-attention {
            background: #fff7ed;
        }

        .coverage-header-cell.has-attention.danger {
            background: #fef2f2;
        }

        .coverage-stack {
            display: grid;
            gap: 4px;
        }

        .coverage-pill {
            border-radius: 8px;
            padding: 5px 7px;
            border: 1px solid transparent;
            font-size: 0.68rem;
            line-height: 1.2;
        }

        .coverage-pill.success {
            background: #dcfce7;
            border-color: #bbf7d0;
            color: #166534;
        }

        .coverage-pill.warning {
            background: #fef3c7;
            border-color: #fde68a;
            color: #92400e;
        }

        .coverage-pill.danger {
            background: #fee2e2;
            border-color: #fecaca;
            color: #991b1b;
        }

        .coverage-pill.neutral {
            background: #e2e8f0;
            border-color: #cbd5e1;
            color: #334155;
        }

        .coverage-title {
            font-weight: 800;
            margin-bottom: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .coverage-metrics {
            display: flex;
            flex-wrap: wrap;
            gap: 2px 6px;
            opacity: 0.95;
        }

        .coverage-metric {
            white-space: nowrap;
        }

        .coverage-line {
            opacity: 0.95;
        }

        /* Message box spacing / Отступ для блока сообщений */
        #message-box {
            margin-bottom: 16px;
        }

        .generation-summary-panel {
            margin-bottom: 22px;
            border-color: #cbd5e1;
            background: #f8fafc;
        }

        .generation-summary-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 16px;
        }

        .generation-summary-title {
            margin: 0;
            font-size: 1rem;
            font-weight: 800;
            color: var(--text);
        }

        .generation-summary-subtitle {
            margin: 6px 0 0;
            color: var(--muted);
            font-size: 0.86rem;
            line-height: 1.45;
        }

        .generation-summary-grid {
            display: grid;
            grid-template-columns: repeat(6, minmax(0, 1fr));
            gap: 12px;
            margin-bottom: 16px;
        }

        .generation-stat {
            border: 1px solid #d7dee8;
            border-radius: 10px;
            background: #fff;
            padding: 12px;
            min-height: 84px;
        }

        .generation-stat-label {
            font-size: 0.76rem;
            font-weight: 700;
            color: var(--muted);
            margin-bottom: 6px;
        }

        .generation-stat-value {
            font-size: 1.35rem;
            font-weight: 900;
            color: var(--text);
            line-height: 1;
        }

        .generation-stat-note {
            margin-top: 8px;
            font-size: 0.75rem;
            color: var(--muted);
            line-height: 1.35;
        }

        .generation-sections {
            display: grid;
            gap: 12px;
        }

        .generation-section-card {
            border: 1px solid #d7dee8;
            border-radius: 12px;
            background: #fff;
            padding: 14px;
        }

        .generation-section-card.success {
            border-color: #bbf7d0;
            background: #f0fdf4;
        }

        .generation-section-card.warning {
            border-color: #fde68a;
            background: #fffbeb;
        }

        .generation-section-card.danger {
            border-color: #fecaca;
            background: #fef2f2;
        }

        .generation-section-title {
            margin: 0 0 10px;
            font-size: 0.84rem;
            font-weight: 800;
            color: var(--text);
        }

        .generation-section-list {
            margin: 0;
            padding-left: 18px;
            display: grid;
            gap: 8px;
            font-size: 0.82rem;
            line-height: 1.45;
            color: var(--text);
        }

        body.rtl .generation-section-list {
            padding-left: 0;
            padding-right: 18px;
        }

        .generation-section-list li {
            margin: 0;
        }

        .generation-summary-muted {
            font-size: 0.82rem;
            color: var(--muted);
            line-height: 1.45;
        }

        /* Simple alert replacement / Более аккуратные сообщения */
        .page-message {
            border-radius: 14px;
            padding: 12px 14px;
            border: 1px solid var(--border);
            background: #fff;
            font-size: 0.9rem;
            line-height: 1.45;
        }

        .page-message.success {
            background: #f0fdf4;
            border-color: #bbf7d0;
            color: #166534;
        }

        .page-message.warning {
            background: #fffbeb;
            border-color: #fde68a;
            color: #92400e;
        }

        .page-message.danger {
            background: #fef2f2;
            border-color: #fecaca;
            color: #991b1b;
        }

        .page-message.info {
            background: #eff6ff;
            border-color: #bfdbfe;
            color: #1d4ed8;
        }

        /* Sidebar button placement / Положение кнопки сворачивания меню */
        .sidebar-toggle {
            width: 42px;
            height: 42px;
            border: 1px solid var(--border);
            background: #fff;
            color: var(--text);
            border-radius: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background var(--transition), transform var(--transition);
            margin-top: 12px;
        }

        .sidebar-toggle:hover {
            background: #f8fafc;
            transform: translateY(-1px);
        }

        /* Expanded sidebar top row / Верхний ряд в полном меню */
        .sidebar-top-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
        }

        /* Collapsed sidebar state / Состояние свёрнутого меню */
        body.sidebar-collapsed {
            --sidebar-width: 88px;
        }

        body.sidebar-collapsed .brand-text,
        body.sidebar-collapsed .sidebar-section-title {
            display: none;
        }

        body.sidebar-collapsed .sidebar-top-row {
            justify-content: center;
            flex-direction: column;
        }

        body.sidebar-collapsed .nav-label {
            display: none;
        }

        body.sidebar-collapsed .nav-item {
            justify-content: center;
            padding-inline: 10px;
        }

        body.sidebar-collapsed .nav-icon {
            width: auto;
        }

        /* Responsive / Адаптивность */
        @media (max-width: 1200px) {
            .schedule-toolbar {
                grid-template-columns: 1fr;
            }

            .toolbar-actions {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            .generation-summary-grid {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }

        @media (max-width: 920px) {
            .toolbar-context {
                grid-template-columns: 1fr;
            }

            .toolbar-actions {
                grid-template-columns: 1fr;
            }

            .toolbar-command-row .btn {
                flex: 1 1 160px;
            }

            .schedule-stage-top {
                align-items: stretch;
                flex-direction: column;
            }

            .schedule-display-control {
                justify-content: stretch;
            }

            .schedule-display-field {
                width: 100%;
            }

            .generation-summary-header {
                flex-direction: column;
            }

            .generation-summary-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

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

            .schedule-shell {
                border-radius: 14px;
            }

            .employee-column {
                min-width: 168px;
                width: 168px;
            }

            .day-header,
            .schedule-day-cell {
                min-width: 136px;
            }

            body.mobile-sidebar-hidden .sidebar {
                gap: 0;
                padding-block: 14px;
            }

            body.mobile-sidebar-hidden .sidebar > div:not(.sidebar-top-row),
            body.mobile-sidebar-hidden .sidebar-footer {
                display: none;
            }
        }

        @media (max-width: 640px) {
            .toolbar-command-row {
                flex-direction: column;
            }

            .toolbar-command-row .btn {
                width: 100%;
                min-width: 0;
            }

            .schedule-status-strip {
                grid-template-columns: 1fr;
            }

            .generation-summary-grid {
                grid-template-columns: 1fr;
            }

            .shift-picker-overlay {
                padding: 12px;
            }

            .shift-picker-modal {
                max-height: calc(100vh - 24px);
            }
        }

