/* mobile.css — мобильная адаптация для ширины экрана до 768px */

@media (max-width: 1024px) {
    
    /* ===== ОСНОВНЫЕ НАСТРОЙКИ ===== */
    body {
        overflow: auto;
    }
    
    .main-content {
        margin-left: 0;
        height: auto;
        min-height: 100vh;
    }
    
    .main-content .container {
        overflow: visible;
    }
    
    /* ===== НАВИГАЦИЯ ===== */
    .nav-panel {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 0 16px;
        margin: 10px 0;
    }
    
    .nav-panel .month-title {
        margin: 0;
        flex: 1;
        text-align: center;
        font-size: 20px;
    }
    
    .nav-panel .nav-btn {
        padding: 6px 12px;
        font-size: 12px;
        height: 32px;
    }
    
    /* ===== САЙДБАР — БУРГЕР ===== */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        display: none;
    }
    
    /* Шапка с учётом бургера */
.page-header {
    width: calc(100vw - 84px);  /* 68px (левый отступ) + 16px (правый отступ) */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 16px 0 68px;
    height: 60px;
    min-height: 60px;
    margin: 0 auto;
}

.page-title {
    font-size: 18px;
    margin: 0;
    text-align: center;
}

/* Бургер-кнопка позиционируется абсолютно слева */
.burger-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1002;
    background: var(--accent-dark);
    border: none;
    color: white;
    font-size: 24px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

    /* ===== ПАНЕЛИ ===== */
    .control-panel {
        padding: 0 16px;
        height: auto;
        min-height: auto;
        gap: 10px;
        margin: 10px 0;
    }
    
    /* ===== ТАБЛИЦЫ — ГОРИЗОНТАЛЬНЫЙ СКРОЛЛ ===== */
    .table-wrapper {
        padding: 0 16px;
    }
    
    .table-container {
        overflow-x: auto;
        max-height: calc(100vh - 200px);
    }
    
    .data-table,
    .schedule-table,
    .personal-table,
    .employees-table,
    .today-table,
    .history-table {
        font-size: 12px;
        min-width: 600px;
    }
    
    .data-table th,
    .data-table td,
    .schedule-table th,
    .schedule-table td,
    .personal-table th,
    .personal-table td,
    .employees-table th,
    .employees-table td,
    .today-table th,
    .today-table td,
    .history-table th,
    .history-table td {
        padding: 4px 6px;
    }
    
    /* ===== СТРАНИЦА МЕСЯЦА ===== */
    .month-footer {
        padding: 0 16px;
    }
    
    .add-employee-under-btn {
        font-size: 12px;
    }
    
    .schedule-legend {
        margin: 16px;
        padding: 12px;
    }
    
    .schedule-legend .legend-title {
        font-size: 12px;
    }
    
    .schedule-legend .legend-item {
        font-size: 11px;
        gap: 6px;
    }
    
    .legend-badge {
        width: 28px;
        height: 22px;
        line-height: 22px;
        font-size: 10px;
    }
    
    .month-content .schedule-table td.data-cell {
        font-size: 11px;
    }
    
    /* ===== ВСЕ ТАБЛИЦЫ — УМЕНЬШЕННЫЙ ШРИФТ ===== */
    .month-content .schedule-table th:first-child,
    .month-content .schedule-table th:last-child,
    .month-content .schedule-table td:first-child,
    .month-content .schedule-table td:last-child,
    .month-content .schedule-table th.day-header,
    .admin-content .schedule-table th:first-child,
    .admin-content .schedule-table th:nth-child(2),
    .admin-content .schedule-table th:last-child,
    .admin-content .schedule-table td:first-child,
    .admin-content .schedule-table td:nth-child(2),
    .admin-content .schedule-table td:last-child,
    .admin-content .schedule-table th.day-header,
    .personal-table th:first-child,
    .personal-table td:first-child,
    .personal-table th:last-child,
    .personal-table td:last-child,
    .personal-table th.day-header {
        font-size: 11px !important;
    }
    
    .month-content .schedule-table th.day-header small,
    .admin-content .schedule-table th.day-header small,
    .personal-table th.day-header small {
        font-size: 9px !important;
    }
    
    .personal-table td.personal-data-cell,
    .admin-content .schedule-table td.admin-data-cell {
        font-size: 11px !important;
    }
    
    /* ===== УПРАВЛЕНИЕ СОТРУДНИКАМИ ===== */
    .employees-table th {
        font-size: 11px !important;
        padding: 4px 4px !important;
        white-space: nowrap;
    }
    
    .employees-table td {
        font-size: 11px !important;
        padding: 4px 4px !important;
    }
    
    .status-badge {
        font-size: 10px !important;
        padding: 2px 4px !important;
        min-height: 24px !important;
    }
    
    .check-mark,
    .cross-mark {
        font-size: 12px !important;
    }
    
    /* ===== СТРАНИЦА СЕГОДНЯ ===== */
    .today-table th {
        font-size: 11px !important;
        padding: 6px 4px !important;
    }
    
    .today-table td {
        font-size: 11px !important;
        padding: 4px 4px !important;
    }
    
    #todayContent .table-wrapper {
        overflow-x: auto !important;
        display: block !important;
    }
    
    #todayContent .table-container {
        overflow-x: auto !important;
        width: auto !important;
        min-width: 100%;
    }
    
    .today-table {
        min-width: 600px !important;
        width: auto !important;
    }
    
    .today-table td:last-child,
    .today-table th:last-child {
        position: static !important;
        box-shadow: none !important;
    }
    
    .today-table td:first-child,
    .today-table th:first-child {
        box-shadow: inset -1px 0 0 0 #b3b3b3 !important;
    }
    
    /* ===== СТРАНИЦА ИСТОРИИ ===== */
    .history-tabs {
        padding: 0 16px;
        flex-wrap: wrap;
    }
    
    .history-tab {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .history-table th {
        font-size: 11px !important;
        padding: 6px 4px !important;
    }
    
    .history-table td {
        font-size: 11px !important;
        padding: 4px 4px !important;
    }
    
    .revoke-session-btn {
        padding: 2px 8px !important;
        font-size: 10px !important;
    }
    
    /* История графика — столбцы 1-5 без переноса */
    .history-table.schedule-table td:nth-child(1),
    .history-table.schedule-table td:nth-child(2),
    .history-table.schedule-table td:nth-child(3),
    .history-table.schedule-table td:nth-child(4),
    .history-table.schedule-table td:nth-child(5),
    .history-table.schedule-table th:nth-child(1),
    .history-table.schedule-table th:nth-child(2),
    .history-table.schedule-table th:nth-child(3),
    .history-table.schedule-table th:nth-child(4),
    .history-table.schedule-table th:nth-child(5) {
        white-space: nowrap !important;
        width: auto !important;
        min-width: auto !important;
    }
    
    .history-table.schedule-table td:nth-child(6),
    .history-table.schedule-table th:nth-child(6) {
        white-space: normal !important;
        word-break: break-word !important;
    }
    
    /* Тени для последних столбцов */
    .history-table.sessions-table td:last-child,
    .history-table.sessions-table th:last-child,
    .history-table.schedule-table td:last-child,
    .history-table.schedule-table th:last-child {
        box-shadow: inset 1px 0 0 0 #b3b3b3 !important;
    }
    
    /* ===== КАСТОМНЫЕ СЕЛЕКТОРЫ ===== */
    .custom-select,
    .custom-select-employee {
        width: 100%;
        max-width: 320px;
    }
    
    .custom-select-trigger .custom-select-option-title {
        font-size: 13px !important;
    }
    
    .custom-select-option-address {
        font-size: 10px !important;
    }
    
    .custom-select-dropdown .custom-select-option-title,
    .custom-select-employee .custom-select-dropdown .custom-select-option-title {
        font-size: 13px !important;
    }
    
    .custom-select-dropdown .custom-select-option-address {
        font-size: 10px !important;
    }
    
    .custom-select .custom-arrow,
    .custom-select-employee .custom-arrow {
        font-size: 10px !important;
        opacity: 0.6;
    }
    
    /* ===== МОДАЛЬНЫЕ ОКНА ===== */
    .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        height: 95vh !important;
        max-height: 95vh !important;
        margin: 0 !important;
        border-radius: 12px !important;
    }
    
    .modal-body {
        overflow-y: auto !important;
        flex: 1 !important;
        padding: 12px !important;
    }
    
    .modal {
        align-items: center !important;
    }
    
    .form-row {
        flex-direction: column;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }
    
    .form-group {
        margin-bottom: 8px !important;
    }
    
    .modal-footer {
        padding: 10px 12px !important;
        gap: 6px !important;
    }
    
    .modal-header {
        padding: 8px 10px !important;
    }
    
    /* ===== УВЕДОМЛЕНИЯ ===== */
    .notification-container {
        top: auto;
        bottom: 20px;
        right: 20px;
    }
    
    .notification-top {
        font-size: 12px;
        padding: 10px 16px;
    }
    
    /* ===== КАСТОМНОЕ ПОДТВЕРЖДЕНИЕ ===== */
    .custom-confirm {
        min-width: 280px;
        padding: 20px;
    }
    
    .custom-confirm-title {
        font-size: 16px;
    }
    
    .custom-confirm-message {
        font-size: 13px;
    }
    
    .custom-confirm-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
}

/* ===== ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ (до 480px) ===== */
@media (max-width: 480px) {
    .page-title {
        font-size: 16px;
    }
    
    .nav-btn {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    .nav-panel .month-title {
        font-size: 18px;
    }
    
    .history-tab {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .data-table th,
    .data-table td {
        padding: 3px 4px;
    }
    
    .legend-item {
        font-size: 10px;
    }
}