.main-wrapper {
    position: fixed;
    top: 50px;
    left: 0;
    width: 100%;
    /*height: 100%;*/
    z-index: -1;
    display: flex;
    height: calc(100vh - 50px); /* высота окна минус navbar */
}

.back-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../image/Mokl_povitrya-1536x863.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0;               /* старт: прозрачный */
    transition: opacity 1.5s ease;
    z-index: -2;               /* фон под всеми элементами */
}

.back-image.show {
    opacity: 1;
}

.content {
    flex: 1;
    padding: 5px;
    padding-bottom: 0;
    margin-left: 0;
    transition: margin-left 0.3s ease, opacity 0.2s ease;
    position: relative;
    overflow: auto;
    scrollbar-width: none;           /* Firefox */
    -ms-overflow-style: none;        /* IE/Edge */
    /*position: relative;
    z-index: 1;
    padding: 20px;
    margin: auto;
    min-height: 1px;*/ 
}

.content.shifted {
    margin-left: 60px;
}

.content::-webkit-scrollbar {
    display: none;                   /* Chrome, Safari, Opera */
}

.transparent-text-block {
    top: 5%;
    position: relative;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
    color: white;
}

.fade-layer {
    position: absolute;
    inset: 0;              /* лучше, чем top/left/width/height */
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* ============================================
   FULLSCREEN MODE
   ============================================ */

body.fullscreen-mode .topnav {
    display: none !important;
}

body.fullscreen-mode .icon-bar {
    display: none !important;
}

body.fullscreen-mode .main-wrapper {
    top: 0;
    height: 100vh;
}

body.fullscreen-mode .content {
    margin-left: 0 !important;
    padding: 0;
    padding-top: 42px;
}

body.fullscreen-mode .department-menu {
    display: flex !important;
    gap: 0;
    margin: 0;
}

body.fullscreen-mode .department-menu > .department-menu-panel {
    display: none !important;
}

body.fullscreen-mode .department-title-panel {
    display: none !important;
}

body.fullscreen-mode .department-content {
    margin-top: 0;
    opacity: 1;
    transform: none;
}

/* ============================================
   FULLSCREEN TOOLBAR
   ============================================ */
.fullscreen-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    padding: 0 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    user-select: none;
    touch-action: manipulation;
}

.fs-toolbar-left,
.fs-toolbar-center,
.fs-toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fs-toolbar-left {
    flex: 1;
    min-width: 0;
}

.fs-toolbar-center {
    flex: 0 0 auto;
}

.fs-toolbar-right {
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.fs-toolbar-title {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
    margin-right: 8px;
    margin-left: auto;
}

.fs-toolbar-title i {
    color: #667eea;
    margin-right: 6px;
}

.fs-toolbar-kbd-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 24px;
    padding: 0 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-right: 4px;
    user-select: none;
}

.fs-toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #aaa;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fs-toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.fs-toolbar-btn:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.93);
}

.fs-toolbar-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.fs-toolbar-btn.active {
    color: #ff6b6b;
}

.fs-toolbar-btn.active:hover {
    background: rgba(255, 107, 107, 0.2);
}

.fs-toolbar-filter-toggle {
    color: #667eea;
}

.fs-toolbar-filter-toggle.active {
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
}

.fs-toolbar-filter-toggle:hover {
    color: #fff !important;
    background: rgba(102, 126, 234, 0.25) !important;
}

/* Навігаційні контролі панелей у тулбарі */
#fsToolbarNavSlot {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    position: relative;
    z-index: 1;
}

#fsToolbarNavSlot .panel-controls,
#fsToolbarNavSlot .operations-controls,
#fsToolbarNavSlot .consult-controls {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    z-index: auto !important;
}

#fsToolbarNavSlot button,
#fsToolbarNavSlot .schedule-nav-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    height: 28px;
    min-width: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

#fsToolbarNavSlot button:hover,
#fsToolbarNavSlot .schedule-nav-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    color: #fff;
}

#fsToolbarNavSlot select {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    height: 28px;
    cursor: pointer;
    -webkit-appearance: auto;
    appearance: auto;
}

#fsToolbarNavSlot select option {
    background: #2d2d44;
    color: #e0e0e0;
}

#fsToolbarNavSlot input[type="date"] {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    height: 28px;
    cursor: pointer;
    color-scheme: dark;
}

#fsToolbarNavSlot .vacation-month-title {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    padding: 0 8px;
}

/* Група навігації по сторінках */
.fs-toolbar-pagination {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

/* Група навігації по рядках */
.fs-toolbar-row-nav {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 6px;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.fs-toolbar-row-info {
    font-size: 11px;
    color: #aaa;
    padding: 0 4px;
    white-space: nowrap;
}

/* Розділювач між групами кнопок редагування */
.fs-toolbar-center {
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 8px;
    margin: 0 4px;
}

.fs-toolbar-page-info {
    font-size: 12px;
    color: #ccc;
    padding: 0 4px;
    white-space: nowrap;
}

.fs-toolbar-rows-info {
    font-size: 11px;
    color: #888;
    padding: 0 6px;
    white-space: nowrap;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    margin-left: 4px;
    padding-left: 10px;
}

.fs-toolbar-exit {
    color: #ff6b6b;
    margin-left: 6px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0 4px 4px 0;
    padding-left: 4px;
}

.fs-toolbar-exit:hover {
    background: rgba(255, 107, 107, 0.25) !important;
    color: #fff !important;
}

/* Навігація по панелях відділення (dropdown у fullscreen toolbar) */
.fs-toolbar-panels {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.fs-toolbar-panels-toggle {
    width: auto !important;
    padding: 0 6px !important;
    gap: 4px;
}

.fs-panels-caret {
    font-size: 10px !important;
    margin-left: 2px;
    opacity: 0.6;
}

.fs-panels-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: linear-gradient(135deg, #1e1e36 0%, #1a2744 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    padding: 4px;
    min-width: 180px;
    z-index: 10010;
}

.fs-panels-dropdown.open {
    display: flex;
    flex-direction: column;
}

.fs-panels-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.fs-panels-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 13px;
}

.fs-panels-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.fs-panels-dropdown-item.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.15);
}

.fs-panels-dropdown-item.active:hover {
    background: rgba(102, 126, 234, 0.25);
}

/* Кнопка "Редагувати" в активному режимі */
.fs-toolbar-btn.fs-edit-active {
    color: #4CAF50 !important;
    background: rgba(76, 175, 80, 0.2) !important;
    box-shadow: inset 0 0 0 1px rgba(76, 175, 80, 0.4);
}

.fs-toolbar-btn.fs-edit-active:hover {
    background: rgba(76, 175, 80, 0.35) !important;
    color: #fff !important;
}

/* Таблиця чергувань у заблокованому стані (режим редагування) */
.schedule-table.schedule-locked tbody tr .col-name {
    cursor: not-allowed;
    opacity: 0.6;
}

.schedule-table.schedule-locked tbody tr.row-selected .col-name {
    opacity: 1;
    cursor: default;
}


/* Мобільний fullscreen */
@media screen and (max-width: 768px) {
    .fullscreen-toolbar {
        height: 36px;
        font-size: 12px;
        padding: 0 5px;
    }

    .fs-toolbar-title {
        font-size: 12px;
        max-width: 150px;
    }

    .fs-toolbar-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .fs-toolbar-rows-info {
        display: none;
    }

    #fsToolbarNavSlot button,
    #fsToolbarNavSlot .schedule-nav-btn {
        height: 32px;
        min-width: 32px;
        padding: 2px 5px;
        font-size: 11px;
        touch-action: manipulation;
    }

    #fsToolbarNavSlot select,
    #fsToolbarNavSlot input[type="date"] {
        height: 24px;
        font-size: 11px;
        padding: 1px 4px;
    }

    body.fullscreen-mode .content {
        padding: 5px;
        padding-top: 38px;
    }

    .fs-toolbar-panels {
        margin-left: 4px;
        padding-left: 4px;
    }

    .fs-panels-dropdown-item {
        font-size: 12px;
        padding: 5px 8px;
    }
}

/* Ландшафтний режим на мобільних */
@media screen and (max-height: 500px) {
    .main-wrapper {
        top: 32px;
        height: calc(100vh - 32px);
    }
    
    .content {
        padding: 3px;
        padding-bottom: 50px;
    }
    
    body.fullscreen-mode .main-wrapper {
        top: 0;
        height: 100vh;
    }
    
    body.fullscreen-mode .content {
        padding: 2px;
        padding-top: 38px;
        padding-bottom: 5px;
        height: calc(100vh - 7px);
        overflow-y: auto;
        overflow-x: auto;
    }

    .fullscreen-toolbar {
        height: 34px;
        font-size: 11px;
    }

    .fs-toolbar-title {
        font-size: 11px;
        max-width: 200px;
    }

    .fs-toolbar-btn {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .fs-toolbar-center {
        display: none;
    }
}

/* Стилі для таблиць перенесено до tableutil.css */

/* ====== Панель розширених фільтрів медкарт ====== */
.mcard-container {
    width: 100%;
}

.btn-toggle-filters {
    background: #fff !important;
    border: 2px solid #667eea !important;
    color: #667eea !important;
    padding: 8px 14px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: all 0.2s;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    visibility: visible !important;
    opacity: 1 !important;
}

.btn-toggle-filters:hover {
    background: #667eea !important;
    color: white !important;
}

.btn-toggle-filters.active {
    background: rgba(255,255,255,0.4);
}

.mcard-filters-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-group {
    flex: 1 1 120px;
    min-width: 120px;
    max-width: 180px;
}

.filter-group-patient {
    flex: 1 1 250px;
    min-width: 250px;
    max-width: 320px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 3px;
    font-weight: 500;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.8rem;
    background: white;
    box-sizing: border-box;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.filters-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.btn-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.btn-clear {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #ced4da;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

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

/* Loading overlay для mcard */
.mcard-loading-overlay,
.patients-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #667eea;
    z-index: 100;
    border-radius: 8px;
}

/* ====== Панель пошуку пацієнтів ====== */
.patients-container {
    width: 100%;
}

.patients-filters-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.filter-group-wide {
    flex: 2 1 180px !important;
    min-width: 180px !important;
    max-width: 250px !important;
}

.patients-info {
    padding: 15px;
    text-align: center;
    color: #6c757d;
    font-size: 0.95rem;
}

.patients-info .fa-exclamation-triangle {
    color: #dc3545;
}

.no-data {
    padding: 30px;
    text-align: center;
    color: #6c757d;
    font-size: 1rem;
}

.no-data i {
    margin-right: 8px;
}

/* ====== Панель фільтрів співробітників ====== */
.employees-container {
    width: 100%;
}

/* ====== Стиль DataTable-панелей (в стилі графіку чергувань) ====== */

/* Обгортка таблиці — як schedule-table-wrapper */
.employees-container .table-details,
.mcard-container .table-details,
.patients-container .table-details {
    padding: 0;
}

.employees-container .data-table-wrapper,
.mcard-container .data-table-wrapper,
.patients-container .data-table-wrapper {
    padding: 0;
}

.employees-container .data-table-wrapper:hover,
.mcard-container .data-table-wrapper:hover,
.patients-container .data-table-wrapper:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Таблиця — як schedule-table */
.employees-container .data-table,
.mcard-container .data-table,
.patients-container .data-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    border: none;
}

/* Заголовки — світло-сірі як у графіку чергувань */
.employees-container .data-table th,
.mcard-container .data-table th,
.patients-container .data-table th {
    background-color: #f5f5f5;
    color: #333;
    padding: 8px 6px;
    font-weight: 600;
    border: 1px solid #e0e0e0;
}

.employees-container .data-table th:first-child,
.mcard-container .data-table th:first-child,
.patients-container .data-table th:first-child {
    background-color: #f5f5f5;
}

/* Сортування — пастельні відтінки для світлого фону */
.employees-container .data-table th.sortable:hover,
.mcard-container .data-table th.sortable:hover,
.patients-container .data-table th.sortable:hover {
    background-color: #e8e8e8;
}

.employees-container .data-table th.sort-asc,
.mcard-container .data-table th.sort-asc,
.patients-container .data-table th.sort-asc {
    background-color: #e8f5e9;
    border-color: #c8e6c9;
    color: #2e7d32;
}

.employees-container .data-table th.sort-asc:hover,
.mcard-container .data-table th.sort-asc:hover,
.patients-container .data-table th.sort-asc:hover {
    background-color: #c8e6c9;
}

.employees-container .data-table th.sort-desc,
.mcard-container .data-table th.sort-desc,
.patients-container .data-table th.sort-desc {
    background-color: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
}

.employees-container .data-table th.sort-desc:hover,
.mcard-container .data-table th.sort-desc:hover,
.patients-container .data-table th.sort-desc:hover {
    background-color: #ffcdd2;
}

.employees-container .data-table th .sort-icon,
.mcard-container .data-table th .sort-icon,
.patients-container .data-table th .sort-icon {
    color: #999;
}

.employees-container .data-table th.sort-asc .sort-icon,
.employees-container .data-table th.sort-desc .sort-icon,
.mcard-container .data-table th.sort-asc .sort-icon,
.mcard-container .data-table th.sort-desc .sort-icon,
.patients-container .data-table th.sort-asc .sort-icon,
.patients-container .data-table th.sort-desc .sort-icon {
    color: inherit;
    opacity: 1;
}

/* Фільтр — блакитний відтінок для світлого фону */
.employees-container .data-table th.has-filter,
.mcard-container .data-table th.has-filter,
.patients-container .data-table th.has-filter {
    background-color: #e0f7fa;
    border-color: #b2ebf2;
    color: #00838f;
}

.employees-container .data-table th.has-filter:hover,
.mcard-container .data-table th.has-filter:hover,
.patients-container .data-table th.has-filter:hover {
    background-color: #b2ebf2;
}

.employees-container .data-table th.has-filter.sort-asc,
.mcard-container .data-table th.has-filter.sort-asc,
.patients-container .data-table th.has-filter.sort-asc {
    background: linear-gradient(135deg, #e0f7fa 50%, #e8f5e9 50%);
}

.employees-container .data-table th.has-filter.sort-desc,
.mcard-container .data-table th.has-filter.sort-desc,
.patients-container .data-table th.has-filter.sort-desc {
    background: linear-gradient(135deg, #e0f7fa 50%, #ffebee 50%);
}

.employees-container .data-table th .filter-badge,
.mcard-container .data-table th .filter-badge,
.patients-container .data-table th .filter-badge {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.employees-container .data-table th .filter-badge:hover,
.mcard-container .data-table th .filter-badge:hover,
.patients-container .data-table th .filter-badge:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Ресайзер колонок для світлої теми */
.employees-container .data-table th .resizer:hover,
.employees-container .data-table th .resizer.resizing,
.mcard-container .data-table th .resizer:hover,
.mcard-container .data-table th .resizer.resizing,
.patients-container .data-table th .resizer:hover,
.patients-container .data-table th .resizer.resizing {
    background: rgba(0, 0, 0, 0.15);
}

/* Комірки — компактніші як у графіку */
.employees-container .data-table td,
.mcard-container .data-table td,
.patients-container .data-table td {
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
}

/* Рядки — без "парящого" ефекту */
.employees-container .data-table tbody tr:hover,
.mcard-container .data-table tbody tr:hover,
.patients-container .data-table tbody tr:hover {
    transform: none;
    box-shadow: none;
    z-index: auto;
}

/* Перша sticky-колонка — без синього бордера */
.employees-container .data-table td:first-child,
.mcard-container .data-table td:first-child,
.patients-container .data-table td:first-child {
    border-right: 1px solid #e0e0e0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

/* Підсвічування інтернів (place=3) — блідо-рожевий як у графіку чергувань */
.data-table tbody tr.place-3 td:first-child {
    background: #FCE4EC;
}

.data-table tbody tr.place-3:nth-child(even) td:first-child {
    background: #FCE4EC;
}

.data-table tbody tr.place-3:hover td:first-child {
    background: #F8BBD0;
}

/* Виділення рядка — як у графіку (box-shadow замість outline) */
.employees-container .data-table tbody tr.selected,
.mcard-container .data-table tbody tr.selected,
.patients-container .data-table tbody tr.selected {
    outline: none;
}

.employees-container .data-table tbody tr.selected td,
.mcard-container .data-table tbody tr.selected td,
.patients-container .data-table tbody tr.selected td {
    box-shadow: inset 0 2px 0 0 #1976D2, inset 0 -2px 0 0 #1976D2;
}

.employees-container .data-table tbody tr.selected td:first-child,
.mcard-container .data-table tbody tr.selected td:first-child,
.patients-container .data-table tbody tr.selected td:first-child {
    box-shadow: inset 2px 2px 0 0 #1976D2, inset 0 -2px 0 0 #1976D2;
}

.employees-container .data-table tbody tr.selected td:last-child,
.mcard-container .data-table tbody tr.selected td:last-child,
.patients-container .data-table tbody tr.selected td:last-child {
    box-shadow: inset 0 2px 0 0 #1976D2, inset -2px -2px 0 0 #1976D2;
}

/* Пагінація — без "парящого" ефекту */
.employees-container .data-table-pagination:hover,
.mcard-container .data-table-pagination:hover,
.patients-container .data-table-pagination:hover {
    transform: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Кнопка фільтрів на активній панелі меню */
.department-menu-panel.active .panel-filter-btn {
    margin-left: auto;
    background: rgba(255,255,255,0.2) !important;
    border-color: rgba(255,255,255,0.6) !important;
    color: white !important;
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
}

.department-menu-panel.active .panel-filter-btn:hover {
    background: rgba(255,255,255,0.35) !important;
    border-color: white !important;
    color: white !important;
}

.department-menu-panel.active .panel-filter-btn.active {
    background: rgba(255,255,255,0.4) !important;
}

/* Навігаційні елементи на панелі меню */
.panel-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.department-menu-panel.active .panel-controls .schedule-nav-btn {
    width: 30px;
    height: 30px;
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.15);
    color: white;
}

.department-menu-panel.active .panel-controls .schedule-nav-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: white;
}

.department-menu-panel.active .panel-controls .schedule-select {
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.department-menu-panel.active .panel-controls .schedule-select option {
    color: #333;
    background: white;
}

.department-menu-panel.active .panel-controls .operations-date-picker {
    padding: 4px 8px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.department-menu-panel.active .panel-controls .operations-date-picker::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.department-menu-panel.active .panel-controls .operations-today-btn {
    padding: 4px 10px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.department-menu-panel.active .panel-controls .operations-today-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: white;
}

.department-menu-panel.active .panel-controls .vacation-month-title {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Пагінація всередині панелі меню */
.department-menu-panel .panel-pagination {
    margin-top: 0;
    margin-left: auto;
}

.department-menu-panel .panel-pagination .data-table-pagination {
    background: transparent;
    box-shadow: none;
    padding: 0;
    gap: 10px;
    flex-wrap: nowrap;
}

.department-menu-panel .panel-pagination .data-table-pagination:hover {
    transform: none;
    box-shadow: none;
}

.department-menu-panel.active .panel-pagination .pagination-info {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    white-space: nowrap;
}

.department-menu-panel.active .panel-pagination .pagination-size {
    display: flex;
    align-items: center;
}

.department-menu-panel.active .panel-pagination .pagination-size label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    white-space: nowrap;
}

.department-menu-panel.active .panel-pagination .page-size-select {
    padding: 3px 6px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 13px;
    border-radius: 4px;
}

.department-menu-panel.active .panel-pagination .page-size-select option {
    color: #333;
    background: white;
}

.department-menu-panel.active .panel-pagination .pagination-btn {
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 13px;
}

.department-menu-panel.active .panel-pagination .pagination-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.35);
    border-color: white;
    color: white;
}

.department-menu-panel.active .panel-pagination .pagination-btn:disabled {
    opacity: 0.4;
}

.department-menu-panel.active .panel-pagination .pagination-btn.active {
    background: rgba(255, 255, 255, 0.4);
    border-color: white;
    color: white;
    font-weight: 600;
}

.department-menu-panel.active .panel-pagination .pagination-ellipsis {
    color: rgba(255, 255, 255, 0.6);
}

/* Лічильник на панелі */
.panel-count {
    font-weight: 400;
    opacity: 0.9;
}

.employees-filters-panel {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Loading overlay для employees */
.employees-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #667eea;
    z-index: 100;
    border-radius: 8px;
}

/* Адаптивність фільтрів */
@media screen and (max-width: 768px) {
    .content {
        padding: 1px;
        padding-bottom: 0;
    }

    .content.shifted {
        margin-left: 50px;
    }

    .filter-group {
        min-width: 100%;
        max-width: 100%;
    }
    
    .filters-actions {
        flex-direction: column;
    }
    
    .btn-search, .btn-clear {
        width: 100%;
    }
    
    .panel-controls {
        flex-wrap: wrap;
        gap: 4px;
    }

    .mcard-filters-panel,
    .patients-filters-panel,
    .employees-filters-panel {
        padding: 6px 4px;
        margin-bottom: 4px;
        border-radius: 4px;
    }

    /* На мобільних ховаємо пагінацію в панелі, щоб не перевантажувати */
    .department-menu-panel .panel-pagination .pagination-nav,
    .department-menu-panel .panel-pagination .pagination-size {
        display: none;
    }

    .department-menu-panel .panel-pagination .data-table-pagination {
        gap: 6px;
    }
}