html {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    margin: 0;
    font-size: 1rem;
}

body {
    font-family: Arial, sans-serif;
    color: #333;
    margin: 20px;
    background-color: #fff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/*body :has(.middle-bar) {*/
/*    justify-content: center;*/
/*    align-items: center;*/
/*}*/

.main-content {
    flex-grow: 1;
}

/*body :has(.middle-bar) {*/
/*    display: grid;*/
/*    place-items: center;*/
/*}*/

/*body :has(.login-bar) {*/
/*    display: grid;*/
/*    place-items: center;*/
/*}*/

/* Таблица расписания (публичная) */
.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.schedule-table th,
.schedule-table td {
    border: 1px solid black;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

/* Шапка таблицы */
.schedule-table th {
    background-color: #f8f9fa;
    font-weight: normal;
    font-size: 1rem;
}

/* Первый столбец (день недели) */
.schedule-table td:first-child,
.schedule-table th:first-child {
    width: 1px;
    white-space: nowrap;
    text-align: center;
    background-color: #f8f9fa;
}

/* Остальные столбцы (время) распределяются равномерно */
.schedule-table td:not(:first-child),
.schedule-table th:not(:first-child) {
    width: auto;
}

/*Стили для ячеек занятий*/
.time-slot {
    font-size: 0.8rem;
    color: #666;
}

.empty-lesson {
    color: #ddd;
    font-size: 1.2rem;
}

.spoiler {
    width: 210px;
    padding: 4px 4px 4px 6px;

}

.spoiler-elements {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center; /* Центрирует текст по вертикали */
    justify-content: center; /* Центрирует текст по горизонтали */

    width: 2em;
    height: 2em;

    border: 2px solid black;
    border-radius: 0.35em;
    margin: 5px 3px 5px 3px;
    text-decoration: none;
}

details {
    width: 225px;
    text-align: center;
}

div :has(details) {
    display: flex;
    justify-content: center;
}

.bar {
    display: flex;
}


.middle-bar {
    min-width: 75vw;
}

/*.main-content :has(.middle-bar) {*/
/*    display: flex;*/
/*    justify-content: center; !* центр по горизонтали *!*/
/*    align-items: center; !* центр по вертикали *!*/
/*    height: 100vh; !* высота на весь экран *!*/

/*}*/

.main-content :has(.login-bar) {
    display: flex;
    justify-content: center;
}

.bar > div {
    width: 25%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bar > :has(input) {
    width: 50%;
    display: flex;
    justify-content: center;
}

.bar > div > a {
    display: inline-block;
    margin: 0 15px;
}

.search-input {
    min-width: 45vw;
    box-sizing: border-box;
    padding: 12px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.a-button {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
}

.grey-button {
    background-color: #eaeaea;
    color: #000000;
}

.orange-button {
    background-color: #8DBFEB;
    color: #000000;
}

footer {
    text-align: center;
    padding: 20px 0;
}

.debug-hitbox {
    border: darkred solid;
}

/* ========== Стили панели управления ========== */

/* Верхняя панель */
.upper-bar {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.page-title {
    font-size: 1.125rem;
    font-weight: bold;
    color: #333;
}

/* Макет диспетчерской */
.control-layout {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 150px);
}

/* Боковая панель */
.control-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 16px;
}

.control-sidebar h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-link {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #555;
    border-radius: 4px;
    font-size: 1rem;
    transition: background-color 0.15s;
}

.sidebar-link:hover {
    background-color: #e9ecef;
    color: #333;
}

.sidebar-link.active {
    background-color: #8DBFEB;
    color: #000;
    font-weight: bold;
}

.sidebar-info {
    border-top: 1px solid #ddd;
    padding-top: 12px;
}

.sidebar-info h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #666;
}

.sidebar-info p {
    margin: 4px 0;
    font-size: 0.875rem;
    color: #333;
}

/* Основной контент */
.control-content {
    flex-grow: 1;
    min-width: 0;
}

.control-content h2 {
    margin: 0 0 16px 0;
    font-size: 1.375rem;
}

/* Панель инструментов */
.toolbar {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Фильтр по датам */
.date-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.date-filter label {
    font-size: 1rem;
    font-weight: bold;
    color: #555;
}

.date-filter input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: Arial, sans-serif;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.15s, opacity 0.15s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #8DBFEB;
    color: #000;
}

.btn-secondary {
    background-color: #eaeaea;
    color: #333;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-warning {
    background-color: #ffc107;
    color: #000;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.875rem;
    min-width: 32px;
}

/* Таблицы данных */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    table-layout: auto;
}

.data-table th,
.data-table td {
    border: 1px solid #ddd;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    font-size: 1rem;
    color: #555;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: #f5f5f5;
}

.data-table .actions-cell {
    white-space: nowrap;
    text-align: center;
    width: 1px;
}

.data-table .actions-cell .btn {
    margin: 0 2px;
}

/* Архивные группы — жёлтая обводка */
.data-table tr.archived-row td {
    border: 2px solid #ffc107;
}

/* Первый столбец таблиц данных — фиксированная ширина */
.data-table th:first-child,
.data-table td:first-child {
    width: 1px;
    white-space: nowrap;
    text-align: center;
}

/* Остальные столбцы распределяются равномерно */
.data-table th:not(:first-child):not(.actions-cell),
.data-table td:not(:first-child):not(.actions-cell) {
    width: auto;
}

.loading-cell,
.empty-cell,
.error-cell {
    text-align: center;
    padding: 30px !important;
    color: #888;
    font-style: italic;
}

.error-cell {
    color: #dc3545;
}

/* Формы */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #8DBFEB;
    box-shadow: 0 0 0 2px rgba(241, 192, 0, 0.2);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-weight: normal !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Модальные окна */
.modal {
    border: none;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 500px;
    width: 90%;
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.4);
}

.modal-content {
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

/* Стили для редактора расписания */
.schedule-editor-controls {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.schedule-editor-controls .form-group {
    margin-bottom: 0;
    min-width: 200px;
}

.schedule-editor-controls .form-group label {
    font-size: 0.875rem;
}

.editor-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
}

.editor-table {
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 100%;
}

.editor-table th,
.editor-table td {
    border: 1px solid black;
    padding: 6px 8px;
    text-align: center;
    vertical-align: middle;
}

.editor-table thead th {
    background-color: #f8f9fa;
    font-weight: bold;
    font-size: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}

.editor-table .day-header {
    background-color: #f1c000;
    color: #000;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 100px;
}

.editor-table .time-cell {
    background-color: #f8f9fa;
    font-size: 0.6875rem;
    color: #666;
    white-space: nowrap;
}

.editor-table .lesson-cell {
    cursor: pointer;
    min-width: 120px;
    max-width: 200px;
    font-size: 0.75rem;
    line-height: 1.3;
    transition: background-color 0.15s;
}

.editor-table .lesson-cell:hover {
    background-color: #fff3cd;
    outline: 2px solid #f1c000;
    outline-offset: -2px;
}

.editor-table .lesson-cell.empty-cell {
    background-color: #fff;
    color: #ccc;
}

.editor-table .lesson-cell .lesson-info {
    display: block;
    text-align: left;
}

.editor-table .lesson-cell .lesson-subject {
    font-weight: bold;
    color: #333;
}

.editor-table .lesson-cell .lesson-details {
    color: #666;
    font-size: 0.6875rem;
}

/* Недельный навигатор */
.week-navigator {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.week-navigator span {
    font-size: 1rem;
    font-weight: bold;
}

.week-btn {
    padding: 4px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
}

.week-btn:hover {
    background: #e9ecef;
}

.week-btn.active {
    background: #8DBFEB;
    border-color: #8DBFEB;
    color: #000;
    font-weight: bold;
}

/* Стили для редактора расписания (schedule-editor) */
.schedule-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    border: 1px solid #ddd;
    border-radius: 6px;
}

.schedule-table {
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 100%;
    table-layout: auto;
}

.schedule-table th,
.schedule-table td {
    border: 1px solid black;
    padding: 6px 8px;
    text-align: center;
    vertical-align: middle;
}

.schedule-table thead th {
    background-color: #f8f9fa;
    font-weight: normal;
    font-size: 1rem;
    position: sticky;
    top: 0;
    z-index: 3;
    white-space: nowrap;
}

.schedule-table .corner-cell {
    background-color: #f1c000;
    color: #000;
    font-weight: bold;
    position: sticky;
    left: 0;
    z-index: 4;
    white-space: nowrap;
    width: 1px;
}

.schedule-table .time-header {
    min-width: 140px;
    font-size: 1rem;
    width: auto;
    white-space: nowrap;
}

.schedule-table .day-cell {
    background-color: #f8f9fa;
    font-weight: bold;
    font-size: 0.875rem;
    position: sticky;
    left: 0;
    z-index: 2;
    white-space: nowrap;
    vertical-align: middle;
    width: 1px;
}

.schedule-table .day-cell small {
    font-weight: normal;
    color: #666;
    font-size: 0.6875rem;
}

.schedule-table .time-cell {
    background-color: #f8f9fa;
    font-size: 0.6875rem;
    color: #666;
    white-space: nowrap;
    width: 1px;
}

.schedule-table .lesson-cell {
    cursor: pointer;
    min-width: 120px;
    font-size: 0.875rem;
    line-height: 1.3;
    transition: background-color 0.15s;
    width: auto;
}

.schedule-table .first-day-row {
    border-top-width: 2px;
    border-top-color: black;
}

.schedule-table .last-day-row {
    border-bottom-width: 2px;
    border-bottom-color: black;
}

.schedule-table .lesson-cell:hover {
    background-color: #fff3cd;
    outline: 2px solid #f1c000;
    outline-offset: -2px;
}

.schedule-table .lesson-cell.empty-lesson-cell {
    background-color: #fff;
    color: #ccc;
}

.schedule-table .lesson-cell.modified {
    outline: 2px solid #f1c000;
    outline-offset: -2px;
    background-color: #fff8e1;
}

.schedule-table .lesson-cell.cabinet-conflict {
    background-color: #fff3cd;
    outline: 2px solid #dc3545;
    outline-offset: -2px;
}

.schedule-table .lesson-cell.cabinet-conflict:hover {
    background-color: #ffe69c;
    outline: 2px solid #dc3545;
    outline-offset: -2px;
}

.schedule-table .lesson-cell .conflict-warning {
    color: #dc3545;
    font-weight: bold;
    font-size: 0.6875rem;
}

/* Предупреждение о конфликте в модальном окне */
.conflict-warning {
    color: #dc3545;
    font-size: 0.875rem;
    font-weight: bold;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #fff3cd;
    border: 1px solid #dc3545;
    border-radius: 4px;
}

select.cabinet-conflict-input {
    border-color: #dc3545;
    background-color: #fff3cd;
}

.schedule-table .lesson-cell .empty-lesson {
    color: #ddd;
    font-size: 16px;
}

.schedule-table .lesson-cell small {
    color: #666;
    font-size: 0.6875rem;
}

/* Широкое модальное окно */
.modal-wide {
    max-width: 700px;
}

/* Статический текст в форме */
.form-static {
    padding: 8px 10px;
}

/* Мульти-селектор групп */
.multi-select-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 28px;
}

.group-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #e8f5e9;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 0.875rem;
}

.group-tag .remove-group {
    cursor: pointer;
    color: #999;
    font-weight: bold;
    font-size: 1rem;
    line-height: 1;
    margin-left: 2px;
}

.group-tag .remove-group:hover {
    color: #dc3545;
}

.group-add-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.group-add-row select {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Ряд формы */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Выпадающее меню "Повторить ..." */
.repeat-dropdown {
    position: relative;
    display: inline-block;
}

.repeat-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    margin-top: 4px;
    overflow: hidden;
}

.repeat-menu.show {
    display: block;
}

.repeat-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    color: #333;
    transition: background-color 0.1s;
}

.repeat-menu-item:hover {
    background-color: #e8f0fe;
}

.repeat-menu-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

/* Статус сохранения */
.save-status {
    font-size: 0.875rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.status-warning {
    color: #856404;
    background-color: #fff3cd;
}

.status-success {
    color: #155724;
    background-color: #d4edda;
}

.status-error {
    color: #721c24;
    background-color: #f8d7da;
}

.status-info {
    color: #0c5460;
    background-color: #d1ecf1;
}

/* Пагинация */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    margin-top: 8px;
}

.pagination .page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    user-select: none;
}

.pagination .page-btn:hover:not(:disabled):not(.active) {
    background-color: #f0f0f0;
    border-color: #ccc;
}

.pagination .page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination .page-btn.active {
    background-color: #8DBFEB;
    border-color: #8DBFEB;
    color: #000;
    font-weight: bold;
}

.pagination .page-info {
    font-size: 1rem;
    color: #666;
    padding: 0 8px;
    white-space: nowrap;
}

/* ========== Стили главной страницы (index) ========== */

.index-bar {
    min-width: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.index-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 36px 44px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.index-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.index-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.index-label {
    font-size: 1rem;
    font-weight: bold;
    color: #555;
}

.index-select {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    color: #333;
    background-color: #fff;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: auto;
}

.index-select:focus {
    outline: none;
    border-color: #8DBFEB;
    box-shadow: 0 0 0 2px rgba(141, 191, 235, 0.25);
}

.index-search-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.index-search-input {
    flex: 1;
    min-width: 0;
}

.index-search-btn {
    white-space: nowrap;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
}

.index-search-wrapper {
    position: relative;
}

.suggestions-container {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 10px 14px;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: background-color 0.1s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #e8f0fe;
}

.suggestion-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-type {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: bold;
    color: #fff;
    background-color: #8DBFEB;
    border-radius: 3px;
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.suggestion-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.index-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.index-links .a-button {
    text-align: center;
    min-width: 120px;
}

/* Адаптивность для index */
@media (max-width: 768px) {
    .index-card {
        padding: 24px 20px;
        max-width: 100%;
        margin: 0 10px;
    }

    .index-search-row {
        flex-direction: column;
    }

    .index-search-btn {
        width: 100%;
    }

    .index-search-input {
        min-width: 0;
        width: 100%;
    }

    .index-links {
        flex-direction: column;
        align-items: stretch;
    }

    .index-links .a-button {
        min-width: unset;
        text-align: center;
    }
}

body:has(.index-bar) {
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
}

.main-content:has(.index-bar) {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}


/* Обёртка поиска на странице расписания */
.schedule-search-wrapper {
    position: relative;
    width: 100%;
}

.schedule-search-wrapper .search-input {
    width: 100%;
    box-sizing: border-box;
}

/* ========== Стили страницы входа ========== */

.login-bar {
    min-width: auto;
    justify-content: center;
}


.login-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 32px 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    min-width: 320px;
    max-width: 400px;
    box-sizing: border-box;
}

.login-title {
    margin: 0 0 24px 0;
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    color: #333;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.login-field input:focus {
    outline: none;
    border-color: #8DBFEB;
    box-shadow: 0 0 0 2px rgba(141, 191, 235, 0.25);
}

.login-field input::placeholder {
    color: #999;
}

.login-actions {
    display: flex;
    justify-content: center;
    margin-top: 4px;
}

.login-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: bold;
}

/* Адаптивность */
@media (max-width: 768px) {
    .login-card {
        min-width: 0;
        width: 90vw;
        padding: 24px 20px;
    }
}

@media (max-width: 768px) {

    .control-layout {
        flex-direction: column;
    }

    .control-sidebar {
        width: 100%;
    }

    .schedule-editor-controls {
        flex-direction: column;
    }

    .schedule-editor-controls .form-group {
        min-width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===================== Редактор расписания (групповая версия) ===================== */

/* Кнопки недель */
.week-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
    padding: 8px;
    background: #f5f5f5;
    border-radius: 6px;
}

.week-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.week-btn:hover {
    background: #e8f0fe;
    border-color: #4a90d9;
}

.week-btn.active {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}

/* Таблица групп */
.groups-table-wrapper {
    margin: 12px 0;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

.groups-table-wrapper .data-table {
    width: 100%;
    border-collapse: collapse;
}

.groups-table-wrapper .data-table th,
.groups-table-wrapper .data-table td {
    border: 1px solid black;
    padding: 8px 12px;
    text-align: left;
}

.groups-table-wrapper .data-table tr.selected-row {
    background-color: #e8f0fe;
}

.groups-table-wrapper .data-table tr:hover {
    background-color: #f5f5f5;
}

/* Широкое модальное окно */
.modal-wide .modal-content {
    max-width: 700px;
}

/* Статичный текст в форме */
.form-static {
    margin: 4px 0;
    padding: 6px 10px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 1rem;
}

/* Секция совместных занятий */
.joint-lesson-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.joint-lesson-panel {
    margin-top: 12px;
    padding: 12px;
    background: #f9f9ff;
    border: 1px solid #dde;
    border-radius: 6px;
}

.joint-lessons-list {
    margin-top: 10px;
}

.joint-lesson-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.joint-lesson-item .btn-sm {
    padding: 2px 8px;
    font-size: 0.75rem;
}

.empty-text {
    color: #999;
    font-style: italic;
    font-size: 0.875rem;
}

/* Секция потока и разделения группы */
.stream-split-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.stream-split-panel {
    margin-top: 12px;
    padding: 12px;
    background: #f9f9ff;
    border: 1px solid #dde;
    border-radius: 6px;
}

.stream-groups-list {
    margin-top: 10px;
}

.stream-group-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
}

.stream-group-item .btn-sm {
    padding: 2px 8px;
    font-size: 0.75rem;
}

/* Панели потока и разделения группы */
.stream-panel,
.split-panel {
    margin-top: 12px;
    padding: 12px;
    background: #f9f9ff;
    border: 1px solid #dde;
    border-radius: 6px;
}

.panel-hint {
    margin: 0 0 10px 0;
    font-size: 0.875rem;
    color: #666;
}

.split-subgroups-list {
    margin-top: 10px;
}

.split-subgroup-item {
    padding: 10px;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.split-subgroup-item .form-row {
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 8px;
}

.split-subgroup-item .form-group {
    margin-bottom: 0;
    flex: 1 1 200px;
    min-width: 180px;
}

.split-subgroup-item select.form-select {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.875rem;
}

.split-subgroup-item .autocomplete input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.875rem;
}


/* ===================== Автодополнение (Autocomplete) ===================== */



.autocomplete {
    position: relative;
    width: 100%;
}

.autocomplete input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: Arial, sans-serif;
    color: #333;
    background-color: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.autocomplete input[type="text"]:focus {
    outline: none;
    border-color: #8DBFEB;
    box-shadow: 0 0 0 2px rgba(141, 191, 235, 0.25);
}

.autocomplete-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-list:not(:empty) {
    display: block;
}

.autocomplete-item {
    padding: 8px 12px;
    font-size: 1rem;
    color: #333;
    cursor: pointer;
    transition: background-color 0.1s;
}

.autocomplete-item:hover {
    background-color: #e8f0fe;
}

.autocomplete-item:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item.best-match {
    font-weight: bold;
}

/* Предупреждение о конфликте кабинета */
.cabinet-conflict-input {
    border-color: #e74c3c !important;
    background-color: #fff5f5 !important;
}


.conflict-warning {
    color: #e74c3c;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ===================== Drag & Drop стили ===================== */

/* Состояние активного перетаскивания */
.drag-active .lesson-cell {
    cursor: default;
}

.drag-active .lesson-cell.has-lesson {
    cursor: grab;
}

.drag-active .lesson-cell.has-lesson:active {
    cursor: grabbing;
}

/* Перетаскиваемая ячейка */
.drag-source {
    opacity: 0.4;
    outline: 3px dashed #f1c000 !important;
    outline-offset: -3px !important;
}

/* Зоны Drop внутри пустых ячеек */
.drop-zone {
    display: none;
    height: 50%;
    box-sizing: border-box;
    border: 2px dashed transparent;
    border-radius: 4px;
    transition: all 0.15s ease;
    position: relative;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: bold;
    color: transparent;
    user-select: none;
    pointer-events: auto;
    min-height: 24px;
}

.drag-active .drop-zone {
    display: flex;
    flex-direction: column;
}

.drop-zone .drop-zone-label {
    display: none;
}

.drag-active .drop-zone .drop-zone-label {
    display: block;
    font-size: 0.625rem;
    line-height: 1.2;
    text-align: center;
}

/* Зона копирования */
.drop-copy.drag-over {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.12);
    color: #2e7d32;
}

.drop-copy.drag-over .drop-zone-label {
    color: #2e7d32;
}

/* Зона перемещения */
.drop-move.drag-over {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.12);
    color: #1565c0;
}

.drop-move.drag-over .drop-zone-label {
    color: #1565c0;
}

/* Контейнер для маркеров конфликтов в ячейке с занятием */
.conflict-markers-container {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    gap: 4px;
}

/* Метки конфликтов */
.conflict-marker {
    display: none;
    font-size: 0.5625rem;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 3px;
    color: #fff;
    line-height: 1.4;
    margin-top: 1px;
}

.conflict-marker.show {
    display: inline-block;
}

.drag-active .conflict-marker.show {
    display: inline-block;
}

.conflict-marker.cabinet {
    background: #dc3545;
}

.conflict-marker.teacher {
    background: #dc3545;
}

/* Подсветка кнопок недель при DnD */
.week-btn.drag-over {
    background: #4a90d9 !important;
    color: #fff !important;
    border-color: #4a90d9 !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.4);
}

/* Маленькие кнопки */
.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 3px;
    border: 1px solid #ccc;
    cursor: pointer;
}

.btn-sm.btn-danger {
    background: #e74c3c;
    color: #fff;
    border-color: #c0392b;
}

.btn-sm.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-sm.btn-primary {
    background: #4a90d9;
    color: #fff;
    border-color: #357abd;
}

/* ========== Стили для печати ========== */

/* Печатный заголовок с датой и временем */
.print-header {
    display: none;
}

@page {
    size: landscape;
    margin: 15mm;
}

@media print {
    /* Скрываем элементы, не нужные при печати */
    .upper-bar,
    details,
    #print-button,
    .suggestions-container {
        display: none !important;
    }

    body {
        margin: 0;
        padding: 0;
        color: #000;
        background: #fff;
        font-size: 0.6875rem;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    /* Показываем печатный заголовок */
    .print-header {
        display: block;
        text-align: center;
        font-size: 1rem;
        font-weight: bold;
        margin-bottom: 15px;
        padding: 10px 0;
        border-bottom: 2px solid #000;
        color: #000;
    }

    /* Таблица — чёрно-белая */
    .schedule-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.625rem;
    }

    .schedule-table th,
    .schedule-table td {
        border: 1px solid #000 !important;
        padding: 4px 6px;
        color: #000 !important;
        background: #fff !important;
    }

    .schedule-table th {
        background: #fff !important;
        font-weight: bold;
    }

    .schedule-table td:first-child,
    .schedule-table th:first-child {
        background: #fff !important;
    }

    .time-slot {
        color: #000 !important;
        font-size: 0.625rem;
    }

    .empty-lesson {
        color: #999 !important;
        font-size: 0.75rem;
    }

    /* Убираем цветные фоны у ссылок недель */
    .spoiler-elements {
        border-color: #000;
        color: #000;
    }

    /* Убираем hover-эффекты */
    .schedule-table .lesson-cell:hover {
        background-color: #fff !important;
        outline: none !important;
    }

    /* Скрываем элементы управления редактора при печати */
    .control-sidebar,
    .toolbar,
    .week-buttons,
    #print-btn,
    .drop-zone,
    .drop-zone-label {
        display: none !important;
    }

    /* Таблица редактора — в одну ширину, чёрно-белая */
    .schedule-table-wrapper {
        overflow: visible !important;
    }

    #schedule-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 0.625rem;
    }

    #schedule-table th,
    #schedule-table td {
        border: 1px solid #000 !important;
        padding: 4px 6px;
        color: #000 !important;
        background: #fff !important;
    }

    #schedule-table th {
        font-weight: bold;
    }
}

