/* assets/css/style.css */

/* --- CSS ЗМІННІ --- */
:root {
    /* Кольори */
    --primary-color: #2c5aa0;
    --primary-hover: #1e3a8a;
    --primary-light: rgba(44, 90, 160, 0.08);
    --primary-medium: rgba(44, 90, 160, 0.12);
    --primary-shadow: rgba(44, 90, 160, 0.25);
    
    --secondary-color: #4a6fa5;
    --secondary-hover: #3b5a8a;
    
    --text-primary: #2c3e50;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --text-light: #adb5bd;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f0f2f5;
    --bg-accent: #e9ecef;
    
    --border-color: #e0e0e0;
    --border-light: rgba(0,0,0,.075);
    --border-medium: #ced4da;
    --border-dark: #dee2e6;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 20px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 28px rgba(0,0,0,0.15);
    
    /* Розміри */
    --border-radius: 0.5rem;
    --border-radius-sm: 0.375rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-radius-pill: 50rem;
    
    /* Переходи */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1); /* Пришвидшено з 0.35s */
    --transition-slow: 0.5s ease;
    
    /* Типографія */
    --font-primary: 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Montserrat', sans-serif;

    /* Кольори для сповіщень */
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    
    /* Sidebar розміри */
    --sidebar-width-collapsed: 60px;
    --sidebar-width-expanded: 240px;
    --header-height: 64px;
}

/* --- ЗАГАЛЬНІ СТИЛІ --- */
* {
    box-sizing: border-box;
}

html {
    /* Ensure the viewport/background behind the document is neutral */
    background-color: var(--bg-tertiary);
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

/* --- СТРУКТУРА СТОРІНКИ --- */
.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- ПОКРАЩЕНА НАВІГАЦІЯ З ГРУПУВАННЯМ --- */
.nav-section {
    margin: 0.5rem 0;
}

.nav-section-header {
    padding: 0.5rem 1rem 0.25rem 1rem;
    margin: 0.5rem 0 0.25rem 0;
    border-bottom: 1px solid var(--border-light);
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Анімація для заголовків груп */
.nav-section-header {
    transition: var(--transition-fast);
}

.nav-section:hover .nav-section-header {
    opacity: 1;
}

/* Стилі для згорнутого стану */
body.sidebar-collapsed .nav-section-header {
    display: none;
}

body.sidebar-collapsed .nav-section {
    margin: 0.25rem 0;
}

/* --- КОМПАКТНІ BREADCRUMBS --- */
.breadcrumbs-container {
    padding: 0;
    background: none;
    border: none;
    margin-bottom: 0.25rem;
}
.breadcrumb-nav {
    margin: 0 0 0.25rem 0;
    padding: 0;
}
.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 0.93rem;
    color: var(--text-muted);
    align-items: center;
}
.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    font-size: 0.93rem;
    color: var(--text-muted);
}
.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--border-medium);
    font-weight: 600;
    margin: 0 0.4rem;
    font-size: 1.05rem;
    line-height: 1;
}
.breadcrumb-text, .breadcrumb-link {
    color: var(--text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: var(--transition-fast);
}
.breadcrumb-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}
.breadcrumb-link i, .breadcrumb-text i {
    margin-right: 0.3rem;
    font-size: 0.93rem;
    opacity: 0.7;
}

/* Інтеграція у заголовок сторінки */
.page-title-row {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    margin-bottom: 1.2rem;
}
.page-title-row h1, .page-title-row h2 {
    margin-bottom: 0.1rem;
    font-size: 2.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
@media (max-width: 768px) {
    .breadcrumb, .breadcrumb-item {
        font-size: 0.85rem;
    }
    .page-title-row h1, .page-title-row h2 {
        font-size: 1.3rem;
    }
}

/* --- ПОКРАЩЕНИЙ ХЕДЕР --- */
.top-header {
    position: fixed; /* "Липкий" хедер до верху */
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    justify-content: space-between; /* Розподіляє простір між лівою та правою частиною */
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1 1 auto; /* Займає весь доступний простір зліва */
    min-width: var(--sidebar-width-collapsed); /* Мінімальна ширина = ширина sidebar */
    max-width: calc(50% - 100px); /* Обмежуємо з урахуванням половини ширини згорнутого пошуку (200px / 2) */
    overflow: hidden; /* Запобігає переповненню за межі */
    padding-right: 0.5rem; /* Відступ від центрованого пошуку */
    transition: max-width var(--transition-normal); /* Плавна зміна при розширенні пошуку */
}

/* --- ВИПРАВЛЕНА КНОПКА МЕНЮ (рівна з іконками бічної панелі) --- */
.sidebar-toggle-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto; /* Центруємо кнопку в контейнері */
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.sidebar-toggle-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.sidebar-toggle-btn:active {
    transform: scale(0.95);
}

.sidebar-toggle-btn i {
    font-size: 1.25rem;
    transition: var(--transition-fast);
}

/* Анімація для кнопки при відкритті бічної панелі */
body:not(.sidebar-collapsed) .sidebar-toggle-btn {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

body:not(.sidebar-collapsed) .sidebar-toggle-btn i {
    transform: rotate(90deg);
}

/* --- БРЕНД (логотип + назва) --- */
.header-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 600;
    margin-left: 1.5rem; /* Відступ від кнопки меню */
    transition: var(--transition-fast);
    min-width: 0; /* Дозволяє flex-елементу стискатися */
    flex: 1 1 auto; /* Може зростати та стискатися */
    overflow: hidden; /* Приховує переповнення назви */
}

.header-brand:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.header-icon {
    font-size: 1.75rem;
    margin-right: 0.625rem;
    color: var(--primary-color);
    transition: var(--transition-fast);
}

.header-logo {
    height: 36px;
    margin-right: 0.625rem;
    transition: var(--transition-fast);
}

.header-title {
    font-size: 1.375rem;
    white-space: nowrap;
    font-weight: 600;
    letter-spacing: -0.025em;
    overflow: hidden; /* Приховує переповнення */
    text-overflow: ellipsis; /* Показує трьохкрапку при обрізанні */
    max-width: 100%; /* Займає весь доступний простір в header-brand */
    display: inline-block; /* Забезпечує правильну роботу text-overflow в flex-контейнері */
    vertical-align: middle; /* Вирівнювання з іконкою */
}

/* --- ВІДЦЕНТРОВАНИЙ ГЛОБАЛЬНИЙ ПОШУК --- */
.header-center {
    position: absolute; /* Абсолютне позиціювання для центрування */
    left: 50%; /* Центруємо по горизонталі */
    transform: translateX(-50%); /* Точне центрування */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10; /* Вище за інші елементи */
}

.global-search-wrapper {
    position: relative;
    width: 200px; /* Базова ширина (компактна) */
    max-width: 600px; /* Максимальна ширина при розширенні */
    transition: width var(--transition-normal);
}

.global-search-input {
    width: 100%;
    height: 42px;
    padding: 0 1.25rem 0 2.75rem;
    border: 1px solid var(--border-medium);
    border-radius: var(--border-radius-pill);
    background: var(--bg-secondary);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.global-search-input::placeholder {
    color: var(--text-muted);
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Розширення поля пошуку при фокусі */
.global-search-wrapper:focus-within {
    width: 500px; /* Фіксована ширина при розширенні для стабільності */
    max-width: 600px; /* Обмежуємо максимальну ширину при розширенні */
}

/* Альтернативний варіант через клас (якщо потрібно більше контролю) */
.global-search-wrapper.expanded {
    width: 100%;
    max-width: 600px;
}

.global-search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    transform: none;
}

.global-search-input:hover:not(:focus) {
    border-color: var(--border-dark);
    background: var(--bg-primary);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    transition: var(--transition-fast);
}

.global-search-input:focus ~ .search-icon { /* Змінено з + на ~ для ширшої сумісності, якщо структура DOM трохи зміниться */
    color: var(--primary-color);
}

.global-search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
}

.search-result-item {
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--bg-secondary);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active { /* Додано .active для узгодженості */
    background-color: var(--primary-light); /* Використання var(--primary-light) замість var(--bg-secondary) для hover для кращого зворотного зв'язку */
    color: var(--primary-color);
}

.search-result-item i {
    margin-right: 0.75rem;
    font-size: 1rem;
}

/* --- Підказки для згадок --- */
.mentions-dropdown {
    position: fixed !important;
    background: white !important;
    border: 1px solid #d1d5db !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    max-height: 240px !important;
    overflow-y: auto !important;
    z-index: 99999 !important;
    display: none !important;
    min-width: 260px !important;
    backdrop-filter: blur(8px) !important;
    max-width: 280px !important;
    visibility: visible !important;
    opacity: 1 !important;
    animation: fadeInScale 0.15s ease-out !important; /* Швидша анімація */
    font-size: 0.78rem !important; /* Ще менший шрифт */
    /* Додаткові властивості для кращого позиціонування */
    transform-origin: top left !important;
    will-change: transform, opacity !important;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Стиль для видимого стану dropdown */
.mentions-dropdown[style*="display: block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}



.mentions-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 8px 12px !important;
    cursor: pointer !important;
    border-bottom: 1px solid #e5e7eb !important;
    color: #374151 !important;
    border-radius: 4px !important;
    margin: 2px 4px !important;
}

.mentions-item:last-child {
    border-bottom: none;
}

.mentions-item:hover,
.mentions-item.active {
    background-color: #f8fafc !important;
    color: #1e40af !important;
}

.mentions-info {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.4rem;
    width: 100%;
    min-width: 0;
}

.mentions-fullname {
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: #1f2937 !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 1 auto !important;
}

.mentions-username {
    font-size: 0.75rem !important;
    color: #6b7280 !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
}

/* Стилі для повідомлень в dropdown */
.mentions-dropdown .p-2 {
    padding: 8px 12px !important; /* Менший padding */
    text-align: center !important;
    font-size: 0.8rem !important; /* Менший шрифт */
}

.mentions-dropdown .text-muted {
    color: #9ca3af !important; /* Сучасний сірий */
}

.mentions-dropdown .text-danger {
    color: #ef4444 !important; /* Сучасний червоний */
}

/* --- ПРАВА ЧАСТИНА ХЕДЕРА --- */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: auto; /* Притискає до правого краю */
    z-index: 10; /* Вище за інші елементи */
}

.header-action-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
}

.header-action-btn:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.header-action-btn:active {
    transform: scale(0.95);
}

.header-action-btn i {
    font-size: 1.2rem;
}

/* --- ПОКРАЩЕНИЙ DROPDOWN КОРИСТУВАЧА --- */
.user-dropdown {
    position: relative;
}

.user-dropdown .dropdown-toggle {
    border: none;
    background: none;
    padding: 0;
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
    border-radius: var(--border-radius);
}

.user-dropdown .dropdown-toggle:hover {
    transform: scale(1.05);
}

.user-dropdown .dropdown-toggle::after {
    display: none; /* Прибираємо стандартну стрілку */
}

.user-avatar-header {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: var(--transition-fast);
}

/* Стилі для фото користувача */
.user-avatar-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Індикатор онлайн статусу (опціонально) */
.user-avatar-header::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #28a745;
    border: 2px solid white;
    border-radius: 50%;
}

/* --- ПОКРАЩЕНЕ DROPDOWN МЕНЮ --- */
.user-dropdown .dropdown-menu {
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    background: white;
    margin-top: 0.75rem;
    overflow: hidden;
    min-width: 220px;
    padding: 0.5rem 0;
}

.user-dropdown .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: white;
    border: 1px solid var(--border-light);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

.user-dropdown .dropdown-item {
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.user-dropdown .dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.user-dropdown .dropdown-item i {
    margin-right: 0.75rem;
    width: 18px;
    text-align: center;
    font-size: 1rem;
}

.user-dropdown .dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

/* Профіль інформація в dropdown */
.user-profile-info {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.user-profile-info .fw-bold {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.user-profile-info .text-muted {
    font-size: 0.8rem;
    color: var(--text-muted); /* Переконайтеся, що використовується змінна */
}

/* --- АДАПТИВНІСТЬ ХЕДЕРА (частина виправлених стилів) --- */
@media (max-width: 768px) {
    .top-header {
        padding: 0 1rem;
    }
    
    .header-left {
        width: auto; /* Дозволити зменшуватися на мобільних пристроях, якщо бічна панель там не має фіксованої ширини */
    }
    
    .sidebar-toggle-btn {
        margin: 0 1rem 0 0; /* Налаштовано для мобільних */
    }
    
    .header-brand {
        margin-left: 0; /* Без лівого відступу, коли кнопка бічної панелі зліва від нього */
    }
    
    .header-title {
        display: none; /* Ховаємо назву на мобільних */
    }
    
    .header-center {
        /* Абсолютне центрування працює на всіх екранах */
    }
    
    .global-search-wrapper {
        width: 180px; /* Менша базова ширина на планшетах */
    }
    
    .global-search-wrapper:focus-within {
        width: 450px; /* Менша ширина при розширенні на планшетах */
        max-width: 500px;
    }
    
    /* Адаптація header-left для планшетів */
    .header-left {
        max-width: calc(50% - 90px) !important;
    }
    
    .top-header:has(.global-search-wrapper:focus-within) .header-left {
        max-width: calc(50% - 225px) !important;
    }
    
    .global-search-input {
        height: 38px;
        font-size: 0.85rem;
        padding: 0 1rem 0 2.5rem;
    }
    
    .search-icon {
        left: 0.875rem;
        font-size: 1rem;
    }
    
    .header-right {
        gap: 0.5rem;
    }
    
    .header-action-btn,
    .user-avatar-header {
        width: 36px;
        height: 36px;
    }
    
    .user-avatar-header {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .header-center { /* Тільки для хедера */
        padding: 0 0.5rem;
    }
    
    .global-search-wrapper {
        width: 150px; /* Ще менша базова ширина на мобільних */
    }
    
    .global-search-wrapper:focus-within {
        max-width: calc(100vw - 2rem); /* На повну ширину мінус відступи */
    }
    
    .global-search-input { /* Тільки для хедера */
        height: 36px;
        font-size: 0.8rem;
    }
    
    .user-dropdown .dropdown-menu { /* Тільки для хедера */
        min-width: 200px;
        right: 0;
        left: auto;
    }
}

@media (max-width: 480px) {
    .header-brand { /* Тільки для хедера */
        margin-left: 0; /* Узгоджено з 576px, якщо потрібно */
    }
    
    .header-center { /* Тільки для хедера */
        padding: 0 0.25rem;
    }
    
    .global-search-wrapper {
        width: 120px; /* Мінімальна базова ширина на маленьких екранах */
    }
}

/* --- ВИПРАВЛЕННЯ ДЛЯ РОЗШИРЕНОЇ SIDEBAR --- */
body:not(.sidebar-collapsed) .header-left {
    min-width: var(--sidebar-width-expanded);
    max-width: calc(50% - 100px); /* Обмежуємо з урахуванням згорнутого пошуку */
}

/* Динамічне обрізання назви залежно від стану пошуку */
/* Коли пошук розширений (500px), назва має менше простору */
.top-header:has(.global-search-wrapper:focus-within) .header-left {
    max-width: calc(50% - 250px); /* Віднімаємо половину ширини розширеного пошуку (500px / 2) */
}

/* Альтернативний варіант для браузерів без підтримки :has() */
body:has(.global-search-wrapper:focus-within) .header-left {
    max-width: calc(50% - 250px);
}

/* Додаткове обмеження для середніх екранів */
@media (max-width: 1200px) {
    .header-left,
    body:not(.sidebar-collapsed) .header-left {
        max-width: calc(50% - 90px) !important;
    }
    
    .top-header:has(.global-search-wrapper:focus-within) .header-left,
    body:not(.sidebar-collapsed) .top-header:has(.global-search-wrapper:focus-within) .header-left {
        max-width: calc(50% - 225px) !important;
    }
}

@media (max-width: 992px) {
    .header-left,
    body:not(.sidebar-collapsed) .header-left {
        max-width: calc(50% - 80px) !important;
    }
    
    .top-header:has(.global-search-wrapper:focus-within) .header-left,
    body:not(.sidebar-collapsed) .top-header:has(.global-search-wrapper:focus-within) .header-left {
        max-width: calc(50% - 200px) !important;
    }
}

body:not(.sidebar-collapsed) .sidebar-toggle-btn { /* Цей стиль повторювався, забезпечено одне визначення */
    margin: 0 auto;
}

/* --- БІЧНА ПАНЕЛЬ --- */
.main-content-wrapper {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: var(--sidebar-width-collapsed);
    background: white;
    border-right: 1px solid var(--border-color);
    transition: width var(--transition-normal);
    flex-shrink: 0;
    position: fixed; /* Змінюємо з sticky на fixed для стабільного позиціонування */
    top: var(--header-height); /* Вказуємо "прилипнути" до верхньої частини, одразу під хедером */
    left: 0; /* Фіксуємо зліва */
    height: calc(100vh - var(--header-height)); /* Встановлюємо висоту, рівну видимій частині екрану */
    overflow-y: auto; /* Додаємо вертикальну прокрутку, якщо контент не поміщається */
    overflow-x: hidden; /* Приховуємо горизонтальну прокрутку */
    z-index: 1001; /* Забезпечуємо, що sidebar завжди поверх контенту, але нижче хедера */
    max-height: calc(100vh - var(--header-height)); /* Обмежуємо максимальну висоту */
}

/* Стилі для скролбару в sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Розширена панель */
body:not(.sidebar-collapsed) .sidebar {
    width: var(--sidebar-width-expanded);
}

/* Оновлюємо відступ контенту при розширеному sidebar */
body:not(.sidebar-collapsed) #content-wrapper {
    margin-left: var(--sidebar-width-expanded);
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar .nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    border-radius: 0;
    position: relative;
    overflow: hidden;
    margin: 0 0.5rem;
    border-radius: var(--border-radius-sm);
}

/* Лівий індикатор для активного стану */
.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-color);
}

.sidebar .nav-link i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar .nav-label {
    margin-left: 0;
    opacity: 0;
    transform: translateX(-10px);
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    transition: max-width 0.3s ease-in-out, opacity 0.2s ease-in-out, transform 0.2s ease-in-out, margin-left 0.3s ease-in-out;
    /* За замовчуванням застосовуємо затримку для ЗНИКАННЯ */
    transition-delay: var(--delay-out, 0s);
}

/* --- Визначаємо змінні затримок для кожного елемента --- */
.sidebar .nav-item:nth-child(1) { --delay-in: 0.08s; --delay-out: 0.18s; }
.sidebar .nav-item:nth-child(2) { --delay-in: 0.10s; --delay-out: 0.16s; }
.sidebar .nav-item:nth-child(3) { --delay-in: 0.12s; --delay-out: 0.14s; }
.sidebar .nav-item:nth-child(4) { --delay-in: 0.14s; --delay-out: 0.12s; }
.sidebar .nav-item:nth-child(5) { --delay-in: 0.16s; --delay-out: 0.10s; }
.sidebar .nav-item:nth-child(6) { --delay-in: 0.18s; --delay-out: 0.08s; }
.sidebar .nav-item:nth-child(7) { --delay-in: 0.20s; --delay-out: 0.06s; }
.sidebar .nav-item:nth-child(8) { --delay-in: 0.22s; --delay-out: 0.04s; }
.sidebar .nav-item:nth-child(9) { --delay-in: 0.24s; --delay-out: 0.02s; }
.sidebar .nav-item:nth-child(10),
.sidebar .nav-item:nth-child(11),
.sidebar .nav-item:nth-child(12) { --delay-in: 0.26s; --delay-out: 0s; }


/* --- Стилі та анімація для РОЗГОРНУТОГО стану --- */
body:not(.sidebar-collapsed) .sidebar .nav-label {
    opacity: 1;
    transform: translateX(0);
    max-width: 150px;
    margin-left: 0.75rem;
    /* При розгортанні використовуємо затримку для ПОЯВИ */
    transition-delay: var(--delay-in, 0s);
}

/* START MODIFICATION: Remove the unnecessary nav-divider rule */
/* END MODIFICATION */

/* Показуємо підписи при розширенні */
body:not(.sidebar-collapsed) .sidebar .nav-label {
    opacity: 1;
    transform: translateX(0);
    max-width: 150px; /* Кінцева ширина */
    margin-left: 0.75rem; /* Кінцевий відступ */
}

/* --- Анімація "Драбинка" для міток --- */

/* Затримки при РОЗГОРТАННІ (зверху вниз) */
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(1) .nav-label  { transition-delay: 80ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(2) .nav-label  { transition-delay: 100ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(3) .nav-label  { transition-delay: 120ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(4) .nav-label  { transition-delay: 140ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(5) .nav-label  { transition-delay: 160ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(6) .nav-label  { transition-delay: 180ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(7) .nav-label  { transition-delay: 200ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(8) .nav-label  { transition-delay: 220ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(9) .nav-label  { transition-delay: 240ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(10) .nav-label { transition-delay: 260ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(11) .nav-label { transition-delay: 280ms; }
body:not(.sidebar-collapsed) .sidebar .nav-item:nth-child(12) .nav-label { transition-delay: 300ms; }

/* Затримки при ЗГОРТАННІ (знизу вверх) */
body.sidebar-collapsed .sidebar .nav-item:nth-child(1) .nav-label  { transition-delay: 180ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(2) .nav-label  { transition-delay: 160ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(3) .nav-label  { transition-delay: 140ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(4) .nav-label  { transition-delay: 120ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(5) .nav-label  { transition-delay: 100ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(6) .nav-label  { transition-delay: 80ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(7) .nav-label  { transition-delay: 60ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(8) .nav-label  { transition-delay: 40ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(9) .nav-label  { transition-delay: 20ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(10) .nav-label { transition-delay: 0ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(11) .nav-label { transition-delay: 0ms; }
body.sidebar-collapsed .sidebar .nav-item:nth-child(12) .nav-label { transition-delay: 0ms; }


/* Повністю ховаємо підписи у згорнутому стані, щоб вони не займали місце */
/* Цей блок більше не потрібен, оскільки базовий стан .nav-label вже згорнутий */


/* Стилі для розширеного меню - забезпечуємо, що фон активного стану показується */
body:not(.sidebar-collapsed) .sidebar .nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 500;
}

body:not(.sidebar-collapsed) .sidebar .nav-link:hover {
    background-color: var(--bg-secondary);
    color: var(--primary-color);
}

/* Згорнуте меню - приховуємо фон активної кнопки */
body.sidebar-collapsed .sidebar .nav-link.active {
    background-color: transparent;
    color: var(--primary-color);
}

/* Залишаємо тільки лівий індикатор у згорнутому стані */
body.sidebar-collapsed .sidebar .nav-link.active::before {
    width: 3px;
    background: var(--primary-color);
}

/* Приховуємо фон при hover у згорнутому стані, але залишаємо зміну кольору іконки */
body.sidebar-collapsed .sidebar .nav-link:hover {
    background-color: transparent;
    color: var(--primary-color);
}

/* Забезпечуємо зміну кольору іконки при hover у згорнутому стані */
body.sidebar-collapsed .sidebar .nav-link:hover i {
    color: var(--primary-color);
}

/* Обмежуємо клікабельну область у згорнутому стані */
body.sidebar-collapsed .sidebar .nav-link {
    width: 48px;
    padding: 0.75rem 0.5rem;
    margin: 0 0.5rem;
    justify-content: center;
}

/* Приховуємо розділювачі у згорнутому стані */
body.sidebar-collapsed .nav-divider {
    display: none;
}

/* --- ОСНОВНИЙ КОНТЕНТ --- */
#content-wrapper {
    flex: 1;
    padding: 1rem 1.5rem; /* Зменшено padding-top з 1.5rem до 1rem */
    background: var(--bg-tertiary);
    min-height: calc(100vh - var(--header-height));
    margin-left: var(--sidebar-width-collapsed); /* Додаємо відступ зліва для компенсації фіксованого sidebar */
    transition: margin-left var(--transition-normal); /* Плавна анімація при зміні ширини sidebar */
}

.main-content-area {
    /* Основна область контенту */
}

/* Заголовки використовують Montserrat для кращої виразності */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.75rem;
    letter-spacing: -0.025em;
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.875rem; font-weight: 650; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Базові посилання */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

/* Покращена типографія для основного тексту */
p {
    margin-bottom: 1rem;
    line-height: 1.65;
}

small, .small {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* --- НАВІГАЦІЯ --- */
.navbar {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
    transition: var(--transition-normal);
    z-index: 99; /* Нижче хедера */
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.navbar .navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-primary) !important;
    letter-spacing: -0.02em;
    transition: var(--transition-normal);
}

.navbar .navbar-brand:hover {
    color: var(--primary-color) !important;
    transform: scale(1.02);
}

.navbar .nav-link {
    font-family: var(--font-primary);
    font-weight: 500;
    padding: 0.625rem 1rem;
    margin: 0 0.125rem;
    color: var(--text-secondary) !important;
    transition: all var(--transition-normal);
    border-radius: var(--border-radius-sm);
    position: relative;
    overflow: hidden;
}

.navbar .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
}

.navbar .nav-link:hover::before {
    left: 100%;
}

.navbar .nav-link:hover {
    color: var(--primary-color) !important;
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.navbar .nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
    background-color: var(--primary-medium);
    box-shadow: inset 0 1px 2px rgba(102, 126, 234, 0.2);
}

/* Покращені випадаючі меню (загальні) */
.dropdown-menu {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    background-color: rgba(255, 255, 255, 0.95);
    margin-top: 0.5rem;
    overflow: hidden;
    z-index: 9999; /* Високий z-index для загальних випадаючих меню */
    position: relative; /* Може бути абсолютним залежно від контексту */
}

.dropdown-item {
    padding: 0.75rem 1.25rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    transition: left 0.3s;
}

.dropdown-item:hover::before {
    left: 100%;
}

.dropdown-item:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.dropdown-item:active, .dropdown-item.active {
    background-color: var(--primary-color);
    color: white;
}

.dropdown-item i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition-fast);
}

.dropdown-item:hover i, 
.dropdown-item:active i, 
.dropdown-item.active i {
    color: inherit;
    transform: scale(1.1);
}

.dropdown-divider {
    border-top: 1px solid var(--border-color);
    margin: 0.5rem 0;
}

/* --- ЗАГАЛЬНІ ЕЛЕМЕНТИ СТОРІНКИ --- */
.page-header-custom {
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    padding: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    position: relative;
    overflow: hidden;
}

.page-header-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

/* --- ФОРМИ --- */
.form-control,
.form-select {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-medium);
    padding: 0.625rem 1rem;
    transition: all var(--transition-normal);
    background-color: white;
    font-weight: 400;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem var(--primary-shadow);
    background-color: white;
    transform: translateY(-1px);
}

.form-control:hover:not(:focus),
.form-select:hover:not(:focus) {
    border-color: var(--primary-color); /* Залишаємо узгоджений hover як фокус без тіні */
    box-shadow: var(--shadow-sm); /* Або використовуємо ледь помітну тінь, якщо бажано */
}

.form-control-lg, .form-select-lg {
    font-size: 1rem;
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
}

.form-control-sm, .form-select-sm {
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--border-radius-sm) * 0.8);
}

.input-group-text {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-accent) 100%);
    border: 2px solid var(--border-medium);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
}

/* Покращена стилізація Select2 */
.select2-container--bootstrap-5 .select2-selection {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-medium);
    padding: 0.5rem 0.875rem; /* Налаштовано для узгодженості з form-control */
    min-height: calc(1.5em + 1.25rem + 4px); /* Приблизно відповідає висоті .form-control */
    transition: all var(--transition-normal);
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem var(--primary-shadow);
    transform: translateY(-1px);
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-radius: var(--border-radius);
    border: 1px solid var(--border-medium); /* Узгоджено рамку з select2-selection */
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 9999; /* Високий z-index для відображення поверх інших елементів */
}

.select2-container--bootstrap-5 .select2-results__option {
    font-size: 0.9rem;
    padding: 0.625rem 1rem;
    transition: var(--transition-fast);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted { /* Bootstrap 5 використовує --highlighted, а не --highlighted[aria-selected] */
    background-color: var(--primary-color);
    color: white;
}

/* --- КНОПКИ --- */
.btn {
    font-family: var(--font-primary);
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-normal);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    border: none; /* Припускаємо, що більшість кнопок за замовчуванням не мають рамки */
    letter-spacing: 0.025em;
}

.btn::before { /* Ефект хвилі */
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px; /* Достатньо великий, щоб покрити більшість кнопок */
    height: 300px;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.05rem;
    border-radius: var(--border-radius);
    font-weight: 600;
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.8rem;
    border-radius: calc(var(--border-radius-sm) * 0.8);
}

.btn-primary {
    background: #495057; /* Схоже на темний/вторинний колір, а не основний */
    /* color: white; Вже успадковується або має бути явним */
    font-weight: 500;
    border-radius: 0.75rem; /* Спеціальний радіус */
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    color: white; /* Явно білий */
}

.btn-primary:hover, .btn-primary:focus {
    background: #343a40;
    box-shadow: 0 4px 12px rgba(73, 80, 87, 0.25);
    color: white; /* Залишаємо колір узгодженим */
}

.btn-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-gradient-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--secondary-hover) 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-outline-secondary {
    color: var(--text-muted);
    border: 2px solid var(--border-medium);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--text-muted);
    color: white;
    border-color: var(--text-muted);
}

/* --- КАРТКИ --- */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    background: white;
    transition: all var(--transition-normal);
    overflow: hidden; /* Добре для узгодженості */
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, white 100%);
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    padding: 1.25rem;
    position: relative;
}

.card-header::after { /* Декоративна нижня рамка */
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* --- БЕЙДЖІ --- */
.badge {
    font-family: var(--font-primary);
    font-weight: 500;
    padding: 0.375em 0.75em;
    border-radius: var(--border-radius-pill);
    font-size: 0.75em; /* Відносно розміру шрифту батьківського елемента */
    letter-spacing: 0.025em;
    -webkit-text-fill-color: initial;
}

.badge-primary { /* Використання фактичної змінної основного кольору */
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.badge-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: #212529; /* Темний текст для світлого фону */
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: white;
}

/* --- ПАГІНАЦІЯ --- */
.pagination {
    gap: 0.25rem;
}

.pagination .page-link {
    color: var(--primary-color);
    border: 2px solid var(--border-medium);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.75rem;
    transition: all var(--transition-normal);
    font-weight: 500;
    background: white;
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.pagination .page-link:hover { /* Для неактивних елементів */
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.pagination .page-item.disabled .page-link {
    color: var(--text-light);
    border-color: var(--border-color);
    background: var(--bg-secondary);
}

/* --- ФУТЕР --- */
.footer {
    font-size: 0.875rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0; /* Додано відступ для кращого інтервалу */
    text-align: center; /* Зазвичай для футерів */
    margin-top: 3rem; /* Переконайтеся, що він опущений вниз */
    margin-left: var(--sidebar-width-collapsed); /* Додаємо відступ зліва для компенсації фіксованого sidebar */
    transition: margin-left var(--transition-normal); /* Плавна анімація при зміні ширини sidebar */
}

/* Статус індикатор для десктопних пристроїв */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-status 2s infinite;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
}


/* Стилі для посилань у футері */
.footer-link {
    transition: all var(--transition-fast);
}

.footer-link:hover {
    color: var(--primary-color) !important;
    text-decoration: none !important;
    transform: translateY(-1px);
}

.footer-brand a:hover {
    transform: translateY(-1px);
    transition: transform 0.2s ease;
}

.footer-brand a:hover .text-primary {
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* Покращення для badges у футері */
.badge.bg-secondary-subtle {
    font-weight: 500;
    letter-spacing: 0.025em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Плавна анімація появи футера */
.footer {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Оновлюємо відступ футера при розширеному sidebar */
body:not(.sidebar-collapsed) .footer {
    margin-left: var(--sidebar-width-expanded);
}

/* --- СПЕЦІАЛЬНІ СТИЛІ ДЛЯ КЛІЄНТІВ --- */
.search-bar {
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    padding: 2rem;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
}

.search-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.search-bar .form-control, 
.search-bar .form-select {
    border-radius: var(--border-radius-pill);
    font-size: 0.95rem;
    border: 2px solid var(--border-medium);
    padding: 0.75rem 1.25rem;
}

.search-bar .input-group-text {
    border-radius: var(--border-radius-pill) 0 0 var(--border-radius-pill);
    border-right: none; /* Для безшовного з'єднання з полем вводу */
}

.search-bar .btn {
    border-radius: var(--border-radius-pill);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
}

.client-card {
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color); /* Додано рамку для узгодженості */
    box-shadow: var(--shadow-md); /* Додано тінь для узгодженості */
}

.client-card::before { /* Ефект підкреслення при наведенні */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.client-card:hover::before {
    transform: scaleX(1);
}

.client-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.client-card-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    position: relative;
}

.client-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    margin-right: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: var(--transition-normal);
}

.client-card:hover .client-avatar {
    transform: scale(1.05) rotate(5deg);
}

.client-card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.client-card-title a {
    color: inherit;
    text-decoration: none; /* Переконайтеся, що за замовчуванням немає підкреслення */
    transition: var(--transition-normal);
}

.client-card-title a:hover {
    color: var(--primary-color);
}

.client-card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.client-type-badge {
    font-size: 0.7rem;
    padding: 0.25em 0.75em;
    border-radius: var(--border-radius-pill);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    /* Потрібні background-color та color, наприклад, залежно від типу клієнта */
}

.client-card-body {
    padding: 1.5rem;
    flex-grow: 1;
}

.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.info-item:hover {
    color: var(--primary-color);
}

.info-item i {
    width: 20px; /* Забезпечуємо узгоджену ширину */
    text-align: center; /* Центруємо іконку, якщо ширина фіксована */
    color: var(--primary-color);
    margin-right: 0.75rem;
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.info-item:hover i {
    transform: scale(1.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.stat-item {
    text-align: center;
    padding: 1rem 0.75rem;
    background: linear-gradient(135deg, #f8f9fa 0%, white 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-item::before { /* Ефект мерехтіння */
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    transition: left 0.5s;
}

.stat-item:hover::before {
    left: 100%;
}

.stat-item:hover {
    box-shadow: var(--shadow-sm);
}

.stat-item-value {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.stat-item-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.client-card-footer {
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, white 100%);
    border-top: 1px solid var(--border-color);
}

.client-card-footer .btn {
    font-size: 0.85rem;
    font-weight: 600;
}

.empty-state-custom {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.empty-state-custom i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

.empty-state-custom h3 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.empty-state-custom p {
    color: var(--text-light); /* Було --text-light, у користувача --text-muted. Використовуємо light для підтексту порожнього стану. */
    font-size: 0.95rem;
}

/* --- Додаткові картки статистики та кнопки --- */
.stat-card-enhanced{border:1px solid var(--border-color);border-radius:var(--border-radius-lg);background:linear-gradient(135deg,var(--bg-secondary) 0%,var(--bg-primary) 100%);box-shadow:var(--shadow-xs);transition:var(--transition-fast);}
.stat-card-enhanced:hover{box-shadow:var(--shadow-sm);}
.stat-icon-enhanced{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;}
.stat-value-enhanced{font-family:var(--font-display);font-weight:600;font-size:1.35rem;}

.stat-label-enhanced{text-transform:uppercase;font-size:0.75rem;letter-spacing:0.05em;}
.stat-details-enhanced{font-size:0.8rem;}

.action-btn{display:inline-flex;align-items:center;gap:0.25rem;padding:0.375rem 0.75rem;font-size:0.875rem;font-weight:500;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:var(--border-radius-sm);color:var(--text-secondary);text-decoration:none;transition:var(--transition-fast);}
.action-btn i{font-size:1rem;}
.action-btn:hover{background:var(--primary-light);color:var(--primary-color);box-shadow:var(--shadow-sm);}
.action-btn.primary{background:var(--primary-color);border-color:var(--primary-color);color:#fff;}
.action-btn.primary:hover{background:var(--primary-hover);color:#fff;}
.action-btn.neutral:hover{background:var(--bg-secondary);color:var(--text-primary);}
.action-btn.danger{background:var(--danger-color);border-color:var(--danger-color);color:#fff;}
.action-btn.danger:hover{background:#c82333;color:#fff;}

.empty-state{text-align:center;padding:3rem 1rem;background:linear-gradient(135deg,var(--bg-secondary) 0%,var(--bg-primary) 100%);border:1px solid var(--border-color);border-radius:var(--border-radius-xl);}
.empty-state i{font-size:3rem;color:var(--text-light);}
.empty-state h5{color:var(--text-muted);margin-top:1rem;}
.table-rounded-wrapper{border:1px solid var(--border-color);border-radius:var(--border-radius-lg);overflow:hidden;box-shadow:var(--shadow-sm);}

/* --- МОДАЛЬНІ ВІКНА --- */
/* Вимкнення подій вказівника на фонових елементах, коли модальне вікно відкрите */
body.modal-open .page-container > *:not(.modal):not(script):not(style):not(:has(.modal)), /* Налаштований селектор */
body.modal-open .navbar:not(.modal .navbar):not(:has(.modal)),
body.modal-open .top-header:not(.modal .top-header):not(:has(.modal)), /* Переконайтеся, що хедер також вимкнено */
body.modal-open .sidebar:not(.modal .sidebar):not(:has(.modal)), /* Переконайтеся, що бічна панель також вимкнена */
body.modal-open .card:not(.modal .card):not(:has(.modal)),
body.modal-open .client-card:not(.modal .client-card):not(:has(.modal)) {
    filter: blur(3px); /* Опціонально: розмиття фону */
    pointer-events: none !important;
}

body.modal-open .modal,
body.modal-open .modal * { /* Дозволити події всередині модального вікна */
    pointer-events: auto !important;
}

/* Запобігання ефектам наведення на вимкнених фонових елементах */
body.modal-open .card:not(.modal .card):hover,
body.modal-open .client-card:not(.modal .client-card):hover,
body.modal-open .btn:not(.modal .btn):hover {
    transform: none !important;
    background-color: initial !important; /* Скидання фону */
    box-shadow: none !important; /* Скидання тіні */
}

/* Запобігання анімаційним ефектам на вимкнених фонових елементах */
body.modal-open .btn:not(.modal .btn)::before,
body.modal-open .dropdown-item:not(.modal .dropdown-item)::before,
body.modal-open .navbar .nav-link::before,
body.modal-open .stat-item:not(.modal .stat-item)::before {
    transition: none !important;
    left: -100% !important; /* Скидання позиції для ефектів мерехтіння/ковзання */
}

/* Переконайтеся, що модальні елементи зберігають свої інтерактивні стилі */
.modal .btn {
    pointer-events: auto !important;
    transition: all var(--transition-normal) !important;
}

.modal .btn:hover {
    transform: translateY(-1px) !important;
}

.modal .btn-primary:hover { /* Специфічний hover для основної кнопки в модальному вікні */
    transform: translateY(-2px) !important; /* Припускаємо, що btn-primary має інший hover */
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

.modal .btn::before { /* Хвиля кнопки модального вікна */
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 0 !important;
    height: 0 !important;
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    transform: translate(-50%, -50%) !important;
    transition: width 0.6s, height 0.6s !important;
}

.modal .btn:active::before {
    width: 300px !important;
    height: 300px !important;
}

.modal .form-control,
.modal .form-select {
    pointer-events: auto !important;
    transition: all var(--transition-normal) !important;
}

.modal .form-control:focus,
.modal .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem var(--primary-shadow) !important;
    transform: translateY(-1px) !important;
}

.modal .form-control:hover:not(:focus),
.modal .form-select:hover:not(:focus) {
    border-color: var(--primary-color) !important; /* Залишаємо узгоджений hover */
    box-shadow: var(--shadow-sm) !important; /* Залишаємо узгоджений hover */
}

/* Запобігання backdrop filter на фонових елементах, якщо він у них є */
body.modal-open .navbar:not(.modal .navbar),
body.modal-open .dropdown-menu:not(.modal .dropdown-menu) {
    backdrop-filter: none !important;
}

/* Запобігання специфічним анімаціям ::before/::after на фонових елементах */
body.modal-open .search-bar::before,
body.modal-open .page-header-custom::before,
body.modal-open .card-header:not(.modal .card-header)::after,
body.modal-open .client-card:not(.modal .client-card)::before {
    transform: none !important;
    transition: none !important;
}

/* Покращення продуктивності рендерингу для модальних вікон */
.modal-dialog {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.modal-content { /* Застосувати також до вмісту */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px; /* Для 3D-трансформацій, якщо такі є */
    -webkit-perspective: 1000px;
}

/* --- ТАБЛИЦІ --- */
.table {
    font-size: 0.9rem;
    width: 100%; /* Переконайтеся, що таблиця займає повну ширину */
    margin-bottom: 1rem; /* Стандартний відступ Bootstrap */
    background-color: transparent; /* За замовчуванням */
    border-collapse: collapse; /* Стандартно */
}

.table th,
.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light); /* Змінено на світлу для меншого акценту */
    border-top: 1px solid var(--border-light); /* Стиль Bootstrap */
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-dark); /* Сильніша нижня рамка для заголовків */
    background-color: var(--bg-secondary);
    text-align: inherit; /* Стандартно */
}

.table-hover tbody tr:hover {
    background-color: var(--bg-secondary); /* Ледь помітний hover */
    color: var(--text-primary); /* Затемнення тексту при наведенні */
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02); /* Дуже світлі смуги */
}

/* Специфічні таблиці для рахунків */
.invoices-table {
    font-size: 0.9rem; /* Узгоджено з .table */
}

.invoices-table th,
.invoices-table td {
    padding: 0.875rem 1rem; /* Узгоджено */
    vertical-align: middle;
    white-space: nowrap; /* Запобігання перенесенню для даних рахунку */
}

.invoices-table .badge {
    font-size: 0.75em; /* Узгоджено із загальним бейджем */
}

/* Ширина колонок для таблиці invoices-table */
.checkbox-column { width: 40px; text-align: center; }
.number-column { width: 120px; }
.client-column { min-width: 200px; } /* Дозволити рости */
.date-column { width: 110px; }
.amount-column { width: 120px; text-align: right; } /* Вирівнювання сум праворуч */
.status-column { width: 100px; text-align: center; }
.paid-column { width: 100px; text-align: center; }

th.sortable a {
    text-decoration: none;
    color: inherit;
    display: inline-flex; /* Для вирівнювання іконки */
    align-items: center;
    transition: color var(--transition-fast);
}

th.sortable a:hover {
    color: var(--primary-color);
}

th.sortable .bi { /* Іконка Bootstrap для сортування */
    margin-left: 5px;
    font-size: 0.85em;
}

.invoice-row { /* Застосовується до <tr> */
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--bg-secondary); /* Використання bg-secondary як світлого роздільника */
}

.invoice-row:hover {
    background-color: var(--bg-secondary); /* Ледь помітний hover */
    box-shadow: 0 2px 4px rgba(0,0,0,0.04); /* Легке підняття */
}

.table-separator-row td {
    background-color: var(--bg-tertiary);
    text-align: center;
    font-weight: bold;
    color: var(--text-muted);
    padding: 0.75rem !important; /* Забезпечення відступу */
    border-top: 2px solid var(--border-dark);
    border-bottom: 2px solid var(--border-dark);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

/* Контекстні фони рядків таблиці */
.table-danger-light { background-color: rgba(220, 53, 69, 0.05); }

/* Прибираємо рожевий фон з прострочених завдань */
.table-danger,
.table-danger > td,
.table-danger > th,
tr.table-danger,
tr.table-danger > td,
tr.table-danger > th {
    background-color: transparent !important;
    background: transparent !important;
}

.table-warning,
.table-warning > td,
.table-warning > th,
tr.table-warning,
tr.table-warning > td,
tr.table-warning > th {
    background-color: transparent !important;
    background: transparent !important;
}
.table-success-light { background-color: rgba(40, 167, 69, 0.05); }
.table-secondary-light { background-color: rgba(108, 117, 125, 0.05); }
.table-ready-light { background-color: rgba(13, 110, 253, 0.07); } /* Припускаємо, що це схоже на primary-light */

#bulkActionsBar {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    /* Потрібні позиціонування та стилізація для цієї панелі, наприклад, фіксована внизу */
}

#bulkActionsBar.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Таблиця елементів всередині іншого компонента, наприклад, деталі рахунку */
.items-table th,
.items-table td {
    font-size: 0.8rem; /* Менший шрифт для внутрішніх таблиць */
    vertical-align: middle;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.card-footer.bg-light .table, /* Клас Bootstrap, що забезпечує прозорість */
.card-footer.bg-light .table td,
.card-footer.bg-light .table th {
    background-color: transparent !important;
}

/* --- СПЕЦИФІЧНІ СТИЛІ ДЛЯ ЗАВДАНЬ --- */
.task-comment-item {
    background: var(--bg-primary); /* Білий фон для коментарів */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.75rem;
    margin-bottom: 0.5rem; /* Відстань між коментарями */
}

.task-comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.task-comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 0.5rem;
    object-fit: cover; /* Переконайтеся, що зображення аватара покриває */
}

.task-comment-author {
    font-weight: 600;
    margin-right: 0.5rem;
    color: var(--text-primary);
}

.task-comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.task-comment-text {
    color: var(--text-secondary);
    line-height: 1.4;
    word-wrap: break-word; /* Дозволити перенесення довгих слів */
}

.task-comment-actions {
    margin-top: 0.5rem;
    text-align: right;
}

.task-comment-actions .btn-link { /* Для ледь помітних кнопок дій */
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    color: var(--primary-color); /* Колір посилання */
    text-decoration: none;
}
.task-comment-actions .btn-link:hover {
    text-decoration: underline;
}


.task-edit-link:hover { /* Припускаємо, що це тег <a> */
    text-decoration: underline !important;
    color: var(--primary-hover);
}

.task-comments-display-container {
    max-height: 250px; /* Обмеження висоти та дозвіл прокрутки */
    overflow-y: auto;
    background-color: var(--bg-secondary); /* Світлий фон для контейнера */
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.btn-action-icon { /* Маленькі кнопки-іконки */
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.9rem;
    border-radius: var(--border-radius-sm); /* Узгоджений радіус */
    /* Додайте стилі рамки/фону за потреби, наприклад, .btn-light */
}

.task-name-cell .task-name-content-wrapper {
    display: flex;
    align-items: center;
    padding-left: calc(var(--task-indent-level, 0) * 25px); /* CSS-змінна для відступу */
}

.task-name-cell .task-indent-icon {
    margin-right: 0.5rem;
    font-size: 1em; /* Відносно батьківського елемента */
    color: var(--text-muted);
    flex-shrink: 0; /* Запобігання зменшенню іконки */
}

.task-name-cell .task-indent-icon.main-level-indicator { /* Для завдань верхнього рівня */
    color: var(--primary-color);
}

.task-name-text {
    word-break: break-word; /* Дозволити перенесення назв завдань */
}

.task-sub-info { /* Додаткова інформація під назвою завдання */
    display: block;
    padding-left: calc(var(--task-indent-level, 0) * 25px + 24px); /* Вирівнювання з текстом після іконки */
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.4;
}

.task-sub-info i {
    margin-right: 0.4rem;
    font-size: 0.9em; /* Відносно батьківського елемента */
}

/* Спеціальне стилізування списку визначень */
.dl-horizontal-custom dt {
    font-weight: 500;
    color: var(--text-muted);
    /* float: left; width: 160px; clear: left; text-align: right; margin-bottom: 0.5rem; Для справжнього горизонтального розташування */
}

.dl-horizontal-custom dd {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    /* margin-left: 180px; Для справжнього горизонтального розташування */
}

/* Мінімалістичний дизайн деталей судової справи */
.claim-subject-minimal {
    padding-bottom: 0.75rem;
}

.claim-subject-minimal .claim-text-minimal {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.case-details-minimal {
    font-size: 0.875rem;
}

.detail-row {
    display: flex;
    padding: 0.5rem 0;
    align-items: flex-start;
}

.detail-key {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.detail-key i {
    font-size: 0.75rem;
    margin-right: 0.5rem;
    opacity: 0.8;
    color: var(--primary-color);
}

.detail-val {
    color: var(--text-primary);
    flex: 1;
    word-break: break-word;
    padding-left: 0.5rem;
}

.modal-title {
    font-family: var(--font-display);
    font-weight: 600;
}

.modal-title i {
    font-size: 1.1em; /* Відносно розміру шрифту заголовка */
    margin-right: 0.5rem;
    vertical-align: text-bottom; /* Гарне вирівнювання іконки з текстом */
}

.modal-body {
    padding: 1.25rem;
}

.modal-body hr {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    border-top: 1px solid var(--border-color); /* Світліша горизонтальна лінія */
}

.modal-file-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0; /* Видалення стандартного відступу */
}

.modal-file-list .list-group-item { /* Припускаємо структуру Bootstrap list-group */
    padding: 0.5rem 0; /* Мінімальний відступ, налаштуйте за потреби */
    border: none;
    border-bottom: 1px solid var(--border-light); /* Світлий роздільник */
}

.modal-file-list .list-group-item:last-child {
    border-bottom: none;
}

.modal-file-list .list-group-item-sm .btn-action-icon { /* Менші іконки для компактних списків */
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
}

.task-comment-input-group .form-control { /* Для приєднання кнопки до поля вводу */
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.task-comment-input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.task-comment-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 1.1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    box-shadow: 0 6px 14px rgba(44, 90, 160, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.task-comment-submit-btn i {
    line-height: 1;
}

.task-comment-submit-btn:hover,
.task-comment-submit-btn:focus {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
    box-shadow: 0 8px 18px rgba(44, 90, 160, 0.24);
}

.task-comment-submit-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(44, 90, 160, 0.18);
}

.form-label .text-danger { /* Для індикаторів обов'язкових полів */
    font-weight: bold;
    margin-left: 0.2rem;
}

.nav-tabs-custom {
    border-bottom: 1px solid var(--border-color);
}
.nav-tabs-custom .nav-link {
    font-weight: 500;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    margin-right: 0.25rem;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    background: var(--bg-primary);
    transition: var(--transition-fast);
}
.nav-tabs-custom .nav-link:hover {
    color: var(--primary-color);
}
.nav-tabs-custom .nav-link.active {
    color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: var(--shadow-xs);
    border-bottom: 2px solid var(--primary-color);
}

.breadcrumb-item a {
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* --- FAB (Плаваюча кнопка дії) --- */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000; /* Потенційно нижче хедера/модальних вікон, налаштуйте за потреби */
}

.fab-main {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative; /* Для контексту z-index */
    z-index: 2; /* Вище .fab-actions */
}

.fab-main:hover {
    transform: scale(1.1) rotate(90deg); /* Приклад анімації при наведенні */
    box-shadow: var(--shadow-xl);
}

.fab-container.active .fab-main { /* Коли дії видимі */
    transform: rotate(45deg); /* Приклад активної анімації (наприклад, '+' до 'x') */
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color)); /* Можна змінити колір */
}

.fab-actions {
    position: absolute;
    bottom: 70px; /* Розташування над основною FAB */
    right: 0; /* Вирівнювання з основною FAB */
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    opacity: 0;
    pointer-events: none; /* Приховано за замовчуванням */
    transition: all var(--transition-normal);
}

.fab-container.active .fab-actions {
    opacity: 1;
    pointer-events: auto; /* Видимі та інтерактивні */
}

.fab-action {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color); /* Або використовуйте легку тінь */
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    transform: translateY(20px); /* Початок за межами екрана для анімації */
}

.fab-container.active .fab-action {
    transform: translateY(0); /* Анімація появи */
}

.fab-action:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1); /* Легке збільшення при наведенні */
}

/* Послідовна анімація для дій FAB */
.fab-container.active .fab-action:nth-child(1) { transition-delay: 0.05s; }
.fab-container.active .fab-action:nth-child(2) { transition-delay: 0.1s; }
.fab-container.active .fab-action:nth-child(3) { transition-delay: 0.15s; }
.fab-container.active .fab-action:nth-child(4) { transition-delay: 0.2s; }

/* Tooltip для FAB дій */
.fab-action {
    position: relative;
}

.fab-tooltip {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--text-primary);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    white-space: nowrap;
    margin-right: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.fab-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--text-primary);
}

.fab-action:hover .fab-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Кольори для FAB дій */
.fab-primary {
    background: var(--primary-color);
    color: white;
}

.fab-primary:hover {
    background: var(--primary-hover);
    color: white;
}

.fab-success {
    background: var(--success-color);
    color: white;
}

.fab-success:hover {
    background: #218838;
    color: white;
}

.fab-warning {
    background: var(--warning-color);
    color: #212529;
}

.fab-warning:hover {
    background: #e0a800;
    color: #212529;
}

.fab-info {
    background: #17a2b8;
    color: white;
}

.fab-info:hover {
    background: #138496;
    color: white;
}

.fab-secondary {
    background: #6c757d;
    color: white;
}

.fab-secondary:hover {
    background: #5a6268;
    color: white;
}

/* --- STICKY SIDEBAR (Прилипаюча бічна панель) --- */
.sticky-sidebar { /* Для компонента, який прилипає при прокручуванні */
    position: sticky;
    top: calc(var(--header-height) + 20px); /* Прилипання нижче фіксованого хедера + невеликий відступ */
    /* Переконайтеся, що батьківський контейнер дозволяє позиціонування sticky */
}

/* --- СТИЛІ ДЛЯ ПЛАТЕЖІВ --- */
.payment-summary-card {
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    background: white;
    /* Потенційно додати тінь var(--shadow-md) */
}

.payment-progress .progress { /* Прогрес-бар Bootstrap */
    height: 10px;
    border-radius: var(--border-radius-pill);
    background-color: var(--bg-accent);
    overflow: hidden;
}

.payment-progress .progress-bar {
    transition: width 1s ease-in-out; /* Анімація зміни прогресу */
}

.invoice-status-badge .badge { /* Для бейджів, що вказують статус */
    animation: fadeIn 0.5s ease-out; /* Плавна поява статусу */
}

/* Усередині кастомного заголовка текст бейджа повинен бути видимим */
.page-header-custom .invoice-status-badge .badge {
    -webkit-text-fill-color: initial;
}

.overdue-alert { /* Для прострочених елементів */
    animation: pulse 2s infinite; /* Пульсуюча анімація */
    /* Наприклад, червона рамка або фон на простроченому елементі */
}

.payment-history {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem; /* Місце для смуги прокрутки */
}

/* Спеціальна смуга прокрутки для історії платежів */
.payment-history::-webkit-scrollbar {
    width: 6px;
}

.payment-history::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-pill);
}

.payment-history::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--border-radius-pill);
}

.payment-item {
    padding: 1rem;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    margin-bottom: 0.75rem;
    transition: all var(--transition-normal);
}

.payment-item:hover {
    background: var(--bg-accent); /* Трохи темніше при наведенні */
}

.payment-item:last-child {
    margin-bottom: 0;
}

.revenue-chart-container {
    height: 200px; /* Налаштуйте за потреби для бібліотеки діаграм */
    position: relative; /* Для підказок діаграм тощо */
}

.copy-on-click {
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative; /* Для позиціонування іконки */
}

.copy-on-click:hover {
    color: var(--primary-color) !important; /* Примусова зміна кольору */
}

.copy-icon { /* Іконка, що з'являється при наведенні для копіювання */
    opacity: 0;
    transition: opacity var(--transition-fast);
    margin-left: 0.5rem; /* Відстань від тексту */
}

.copy-on-click:hover .copy-icon {
    opacity: 1;
}

.toast-notification { /* Загальне стилізування сповіщень */
    position: fixed;
    top: calc(var(--header-height) + 20px); /* Нижче хедера */
    right: 20px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--success-color); /* За замовчуванням успіх */
    opacity: 0;
    transform: translateX(100%); /* Початково за межами екрана */
    transition: all var(--transition-normal);
    z-index: 2000; /* Високий z-index */
    max-width: 350px;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(0); /* В'їзд */
}

.toast-notification.error { border-left-color: var(--danger-color); }
.toast-notification.warning { border-left-color: var(--warning-color); }

.revenue-card { /* Картки, що відображають показники доходу */
    transition: all var(--transition-normal);
    /* Припускається, що клас .card також застосований для базового стилю */
}

.revenue-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm); /* Більш ледь помітна тінь для цих карток */
}

.revenue-group {
    margin-bottom: 1rem;
}

.revenue-group-title {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-size: 0.8rem; /* Менший заголовок для груп */
    font-weight: 600;
    color: var(--text-muted);
}

.revenue-item { /* Окремі елементи в групі доходу */
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
    padding: 0.75rem 1rem; /* Відступ для елементів */
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
}

.revenue-item:hover {
    background: var(--bg-accent);
}

.expense-fields-container { /* Для динамічно відображуваних полів витрат */
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease-out;
}

.table-row-hover { /* Загальний hover для рядків таблиці, якщо потрібно */
    transition: all var(--transition-fast);
}

.table-row-hover:hover {
    background-color: var(--primary-light) !important; /* Світлий основний hover */
}

.company-details p { /* Для тексту, який може бути копійованим */
    transition: all var(--transition-fast);
    position: relative; /* Для потенційних іконок копіювання */
}

.company-details p:hover {
    color: var(--primary-color) !important;
}

/* --- АНІМАЦІЇ --- */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


.fade-in { animation: fadeIn 0.4s ease-out forwards; }

/* --- УТИЛІТИ --- */
.text-gradient {
    background: linear-gradient(135deg, #374151, #111827);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.glass-effect { /* Для матових скляних фонів */
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9); /* Налаштуйте альфа-канал для прозорості */
}

.hover-lift { /* Загальна утиліта підняття при наведенні */
    transition: var(--transition-normal);
}

.hover-lift:hover {
    box-shadow: var(--shadow-lg); /* Сильніша тінь при піднятті */
}

/* Контейнери для сповіщень (альтернатива єдиному .toast-notification) */
#toastContainer { /* Для сповіщень Bootstrap або подібних */
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: 1100; /* Переконайтеся, що вище більшості вмісту */
}

#toastPlacement { /* Якщо використовується розміщення сповіщень Bootstrap */
    position: fixed;
    top: 1rem; /* Або var(--header-height) + 1rem */
    right: 1rem;
    z-index: 1090; /* Нижче toastContainer, якщо використовуються разом */
}

/* --- СКРОЛБАР --- */
/* Загальне стилізування смуги прокрутки */
::-webkit-scrollbar {
    width: 8px;
    height: 8px; /* Для горизонтальних смуг прокрутки */
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary); /* Світла доріжка */
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--border-radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--secondary-hover));
}

/* --- АДАПТИВНІСТЬ (загальна, крім хедера) --- */
@media (max-width: 768px) {
    :root { /* Налаштування базових значень для менших екранів */
        --border-radius: 0.375rem;
        --border-radius-lg: 0.5rem;
        --border-radius-xl: 0.75rem;
    }
    
    /* Поведінка бічної панелі на мобільних (фіксована, висувається) */
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--header-height); /* Нижче фіксованого хедера */
        height: calc(100vh - var(--header-height));
        max-height: calc(100vh - var(--header-height)); /* Обмежуємо максимальну висоту */
        z-index: 1001; /* Оновлюємо z-index для консистентності */
        transform: translateX(-100%); /* Приховано за межами екрана */
        width: var(--sidebar-width-expanded); /* Повна ширина при відкритті */
        box-shadow: var(--shadow-lg); /* Додавання тіні при відкритті над вмістом */
        overflow-y: auto; /* Додаємо вертикальну прокрутку */
        overflow-x: hidden; /* Приховуємо горизонтальну прокрутку */
    }
    
    body:not(.sidebar-collapsed) .sidebar {
        transform: translateX(0); /* Висування */
    }
    
    /* Накладення для відкритої мобільної бічної панелі */
    body:not(.sidebar-collapsed)::before {
        content: '';
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999; /* Нижче бічної панелі, вище вмісту */
    }
    
    #content-wrapper {
        padding: 1rem; /* Зменшений відступ на мобільних */
        margin-left: 0; /* На мобільних пристроях не потрібен відступ зліва */
    }
    
    .footer {
        margin-left: 0; /* На мобільних пристроях не потрібен відступ зліва */
        padding: 1rem 0; /* Зменшений відступ на мобільних */
    }
    
    .footer .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .footer-links {
        margin-bottom: 0.5rem;
    }
    
            .footer-links .footer-link {
            display: inline-block;
            margin: 0.25rem;
            padding: 0.25rem 0.5rem;
            background: rgba(var(--bs-primary-rgb), 0.1);
            border-radius: 6px;
        }
        
        .status-indicator {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            animation: pulse-status 2s infinite;
            box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
        }
        
        @keyframes pulse-status {
            0% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
            }
            70% {
                transform: scale(1);
                box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
            }
            100% {
                transform: scale(0.95);
                box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
            }
        }
    
    .page-header-custom {
        padding: 1.5rem;
    }

    .page-header-custom > .d-flex {

        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }
    
    .card-body { /* Загальний відступ тіла картки */
        padding: 1rem;
    }
    
    /* Специфічні відступи для карток клієнтів */
    .client-card-header {
        padding: 1rem;
    }
    .client-card-body {
        padding: 1rem;
    }
    
    .search-bar { /* Панель пошуку клієнтів */
        padding: 1.5rem;
    }
    
    .stats-grid { /* Статистика клієнтів */
        grid-template-columns: 1fr; /* Складання статистики вертикально */
        gap: 0.5rem;
    }
    
    .client-avatar { /* Менший аватар клієнта */
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    /* Налаштування FAB для мобільних */
    .fab-container {
        bottom: 1rem;
        right: 1rem;
    }
    .fab-main {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    .fab-action {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .sticky-sidebar {
        position: static; /* Вимкнення прилипання на мобільних */
    }
    
    .payment-history {
        max-height: none; /* Дозволити повну прокрутку на мобільних */
    }
    .payment-summary-card {
        padding: 1rem;
    }
    .revenue-chart-container {
        height: 150px; /* Менша висота діаграми */
    }
    
    .toast-notification { /* Сповіщення на повну ширину на маленьких екранах */
        right: 10px;
        left: 10px;
        max-width: none;
        top: calc(var(--header-height) + 10px);
    }

    .items-table th,
    .items-table td { /* Менший шрифт для внутрішніх таблиць */
        font-size: 0.75rem;
        padding-top: 0.4rem;
        padding-bottom: 0.4rem;
    }

    /* Оптимізація таблиці рахунків для мобільних - вигляд карток */
    .table-responsive.invoices-table-mobile-cards { /* Додайте клас для ввімкнення цього вигляду */
        display: block;
        border: 0;
    }
    .invoices-table-mobile-cards .invoices-table {
        border: 0;
    }
    .invoices-table-mobile-cards .invoices-table thead {
        display: none; /* Приховати заголовок таблиці */
    }
    .invoices-table-mobile-cards .invoices-table tbody {
        display: block;
    }
    .invoices-table-mobile-cards .invoices-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: 1rem;
        background: white;
        box-shadow: var(--shadow-sm);
        position: relative;
        cursor: pointer;
    }
    .invoices-table-mobile-cards .invoices-table tbody tr:hover {
        box-shadow: var(--shadow-md);
    }
    .invoices-table-mobile-cards .table-separator-row { /* Приховати рядки-роздільники у вигляді карток */
        display: none;
    }
    .invoices-table-mobile-cards .invoices-table td {
        display: flex; /* Використання flex для пар мітка-значення */
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        text-align: left; /* Переконайтеся, що текст вирівняний ліворуч */
        font-size: 0.875rem;
        white-space: normal; /* Дозволити перенесення */
    }
    .invoices-table-mobile-cards .invoices-table td[data-label]:before { /* Мітки даних як псевдоелементи */
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        margin-right: 1rem;
        min-width: 100px; /* Налаштуйте за потреби */
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    /* Оптимізація таблиці завдань для мобільних - вигляд карток */
    .table-responsive.tasks-table-mobile-cards {
        display: block;
        border: 0;
    }
    .tasks-table-mobile-cards .tasks-table {
        border: 0;
    }
    .tasks-table-mobile-cards .tasks-table thead {
        display: none;
    }
    .tasks-table-mobile-cards .tasks-table tbody {
        display: block;
    }
    .tasks-table-mobile-cards .tasks-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--border-radius);
        padding: 1rem;
        background: white;
        box-shadow: var(--shadow-sm);
        position: relative;
        cursor: pointer;
    }
    .tasks-table-mobile-cards .tasks-table tbody tr:hover {
        box-shadow: var(--shadow-md);
    }
    .tasks-table-mobile-cards .table-separator-row {
        display: none;
    }
    .tasks-table-mobile-cards .tasks-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        text-align: left;
        font-size: 0.875rem;
        white-space: normal;
    }
    .tasks-table-mobile-cards .tasks-table td[data-label]:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        margin-right: 1rem;
        min-width: 100px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }
    .invoices-table-mobile-cards .invoices-table .checkbox-column {
        position: absolute;
        top: 1rem;
        right: 1rem;
        padding: 0;
        justify-content: flex-end; /* Вирівнювання прапорця праворуч */
    }
    .invoices-table-mobile-cards .invoices-table .checkbox-column:before {
        display: none; /* Приховати мітку для прапорця */
    }
    .invoices-table-mobile-cards .invoices-table td[data-label="Номер"] { /* Номер рахунку виділений */
        font-size: 1rem;
        font-weight: 600;
        color: var(--primary-color);
        margin-bottom: 0.5rem;
        padding-top: 0;
        width: 100%; /* Зайняти повну ширину */
        justify-content: flex-start;
    }
    .invoices-table-mobile-cards .invoices-table td[data-label="Номер"]:before {
        min-width: auto; /* Налаштування для номера */
    }
    .invoices-table-mobile-cards .invoices-table td[data-label="Статус"] { /* Позиціонування бейджа статусу */
        position: absolute;
        top: 1rem;
        left: 1rem;
        padding: 0;
        justify-content: flex-start; /* Вирівнювання бейджа ліворуч */
    }
    .invoices-table-mobile-cards .invoices-table td[data-label="Статус"]:before {
        display: none;
    }
    .invoices-table-mobile-cards .invoices-table td[data-label="Сплачено"] {
        display: none; /* Приклад: приховати менш важливу колонку */
    }
    .invoices-table-mobile-cards .invoices-table td[data-label="Сума"],
    .invoices-table-mobile-cards .invoices-table td[data-label="Залишок"] {
        font-weight: 600;
        font-size: 0.95rem;
    }
    
    #bulkActionsBar { /* Повна ширина внизу на мобільних */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 100; /* Переконайтеся, що вище вмісту */
    }

    .dl-horizontal-custom dt { /* Складання списку визначень на мобільних */
        float: none;
        width: auto;
        text-align: left;
        margin-bottom: 0.25rem;
    }
    .dl-horizontal-custom dd {
        margin-left: 0;
        margin-bottom: 0.75rem;
    }
    
    /* Мобільні стилі для деталей судової справи */
    .detail-row {
        flex-direction: column;
        padding: 0.5rem 0;
    }
    
    .detail-key {
        min-width: auto;
        margin-bottom: 0.25rem;
        font-size: 0.65rem;
    }
    
    .detail-val {
        font-size: 0.85rem;
    }
    
    .claim-subject-minimal {
        padding-bottom: 0.5rem;
    }
}

/* Специфічні налаштування для планшетів */
@media (min-width: 768px) and (max-width: 992px) {
    .invoices-table { /* Трохи менший шрифт для планшетів */
        font-size: 0.85rem;
    }
    
    .invoices-table th,
    .invoices-table td {
        padding: 0.625rem 0.75rem; /* Зменшений відступ */
    }
    
    .paid-column { /* Приклад: приховати колонку на планшетах */
        display: none;
    }
    
    .client-column { min-width: 150px; }
    .amount-column { width: 100px; }
    
    /* Стилі для деталей судової справи на планшетах */
    .detail-key {
        min-width: 100px;
        font-size: 0.65rem;
    }
    
    .detail-row {
        padding: 0.5rem 0;
    }
}

/* Менші мобільні екрани (налаштування з оригіналу, специфічні для таблиці рахунків) */
    @media (max-width: 576px) {
        /* Ці стилі застосовуються, якщо НЕ використовується вигляд карток для таблиці рахунків */
        .invoices-table:not(.invoices-table-mobile-cards tbody tr) { /* Цільові рядки, що не є картками */
             /* Тут не потрібні спеціальні стилі, якщо вигляд карток є стандартним на <768px */
        }

        /* Стилі для вигляду карток рахунків на <576px, якщо вигляд карток активний */
        .invoices-table-mobile-cards .invoices-table tbody tr {
            padding: 0.875rem;
            margin-bottom: 0.75rem;
        }
        .invoices-table-mobile-cards .invoices-table td {
            padding: 0.375rem 0;
            font-size: 0.8rem;
        }
        .invoices-table-mobile-cards .invoices-table td[data-label]:before {
            min-width: 80px;
            font-size: 0.75rem;
        }

        .tasks-table-mobile-cards .tasks-table tbody tr {
            padding: 0.875rem;
            margin-bottom: 0.75rem;
        }
        .tasks-table-mobile-cards .tasks-table td {
            padding: 0.375rem 0;
            font-size: 0.8rem;
        }
        .tasks-table-mobile-cards .tasks-table td[data-label]:before {
            min-width: 80px;
            font-size: 0.75rem;
        }
    }

/* -------------------------------------------------------------------------
   [1] ТЕМА ОФОРМЛЕННЯ (СВІТЛА/ТЕМНА)
------------------------------------------------------------------------- */

/* Атрибут `data-theme` буде додаватися до тегу <body> за допомогою JavaScript */
body[data-theme="dark"] {
    /* Основні кольори для темної теми */
    --primary-color: #7f8cff; /* Світліший фіолетовий для кращого контрасту */
    --primary-hover: #9fa8ff;
    --primary-light: rgba(127, 140, 255, 0.15);
    --primary-shadow: rgba(127, 140, 255, 0.25);
    
    --secondary-color: #8c7ae6;
    
    --bg-primary: #1a202c;       /* Дуже темний фон (майже чорний) */
    --bg-secondary: #2d3748;     /* Темно-сірий для карток, панелей */
    --bg-tertiary: #171923;      /* Ще темніший основний фон */
    --bg-accent: #4a5568;        /* Акцентний фон для hover ефектів */

    --text-primary: #edf2f7;     /* Майже білий текст */
    --text-secondary: #e2e8f0;   /* Світло-сірий текст */
    --text-muted: #a0aec0;       /* Приглушений сірий текст */
    
    --border-color: #4a5568;     /* Темно-сіра рамка */
    --border-light: #2d3748;
    --border-medium: #718096;
    --border-dark: #a0aec0;

    --success-color: #48bb78;    /* Зелений */
    --danger-color: #f56565;     /* Червоний */
    --warning-color: #ecc94b;    /* Жовтий */
}

/* Перевизначення стилів для темної теми */
body[data-theme="dark"] .top-header,
body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .modal-content,
body[data-theme="dark"] .card,
body[data-theme="dark"] .dropdown-menu {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

/* === Shared: compact stats panel (used by cases/invoices) === */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
/* Make stats look like cases.php cards */
.stats-container .stat-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, white 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
}
.stats-container .stat-item::before { /* shimmer */
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    transition: left 0.5s;
}
.stats-container .stat-item:hover::before { left: 100%; }
.stats-container .stat-item:hover { box-shadow: var(--shadow-sm); }
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary-color);
    margin-right: 1rem;
    font-size: 1.2rem;
}
.stat-number {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}
.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}
@media (max-width: 992px) { .stats-container { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 576px) { .stats-container { grid-template-columns: 1fr; } }

/* === Shared: quick filter groups (used by cases/invoices) === */
.filter-groups { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.filter-group { display: flex; flex-direction: column; gap: 0.5rem; }
.filter-group-label { font-size: 0.75rem; font-weight: 600; color: #6c757d; text-transform: uppercase; letter-spacing: 0.05em; }
.filter-group .d-flex { gap: 0.5rem; }
.filter-group .btn { border-radius: 6px; font-size: 0.875rem; font-weight: 500; padding: 0.5rem 0.75rem; transition: all 0.2s ease; border-width: 1px; }
.filter-group .btn:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.filter-group .btn.active { background-color: #495057; border-color: #495057; color: #fff; box-shadow: 0 2px 4px rgba(73,80,87,0.2); }
@media (max-width: 576px) { .filter-groups { flex-direction: column; gap: 1rem; } }

/* === Shared: advanced filters panel (used by cases/invoices) === */
.advanced-filters-panel { background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); overflow: hidden; }
.advanced-filters-header { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-dark); }
.advanced-filters-body { padding: 1.5rem; }
.advanced-filters-actions { display: flex; gap: 0.5rem; }
.advanced-filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; align-items: end; }
.filter-field { display: flex; flex-direction: column; gap: 0.5rem; }
.filter-label { font-size: 0.875rem; font-weight: 600; color: #495057; display: flex; align-items: center; }
.filter-input, .filter-select { border: 1px solid var(--border-dark); border-radius: 8px; padding: 0.6rem 0.75rem; font-size: 0.875rem; transition: var(--transition-fast); background-color: #fff; }
.filter-input:focus, .filter-select:focus { border-color: #495057; box-shadow: 0 0 0 0.2rem rgba(73,80,87,0.15); outline: none; }
.filter-actions .btn { padding: 0.75rem 1.5rem; font-weight: 600; border-radius: 8px; }
@media (max-width: 768px) { .advanced-filters-grid { grid-template-columns: 1fr; } }

body[data-theme="dark"] .page-header-custom,
body[data-theme="dark"] .dropdown-menu::before,
body[data-theme="dark"] .table-light,
body[data-theme="dark"] .card-header,
body[data-theme="dark"] .modal-header,
body[data-theme="dark"] .modal-footer {
    background: #364257 !important; /* Трохи світліший фон для заголовків */
    border-color: var(--border-color);
}

body[data-theme="dark"] h1, body[data-theme="dark"] h2, body[data-theme="dark"] h3,
body[data-theme="dark"] h4, body[data-theme="dark"] h5, body[data-theme="dark"] h6,
body[data-theme="dark"] .form-label,
body[data-theme="dark"] .dropdown-item,
body[data-theme="dark"] .client-card-title,
body[data-theme="dark"] .sidebar .nav-link {
    color: var(--text-primary);
}

body[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

body[data-theme="dark"] .dropdown-item:hover,
body[data-theme="dark"] .sidebar .nav-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

body[data-theme="dark"] .sidebar .nav-link.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

body[data-theme="dark"] .form-control,
body[data-theme="dark"] .form-select,
body[data-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted);
}

body[data-theme="dark"] .btn-outline-secondary {
    color: var(--text-light);
    border-color: var(--text-light);
}

body[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: var(--text-light);
    color: var(--bg-primary);
}

body[data-theme="dark"] .global-search-results {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body[data-theme="dark"] .mentions-dropdown {
    background: #1f2937 !important; /* Темніший фон */
    border-color: #374151 !important; /* Темніший border */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important; /* Темніша тінь */
}

body[data-theme="dark"] .mentions-item {
    color: #f3f4f6 !important; /* Світлий текст */
    border-bottom-color: #374151 !important;
}

body[data-theme="dark"] .mentions-item:hover,
body[data-theme="dark"] .mentions-item.active {
    background-color: #374151 !important; /* Темніший hover */
    color: #60a5fa !important; /* Світліший блакитний */
}

body[data-theme="dark"] .mentions-fullname {
    color: #f3f4f6 !important;
}

body[data-theme="dark"] .mentions-username {
    color: #9ca3af !important; /* Сірувато-світлий */
}

body[data-theme="dark"] .mentions-dropdown .text-muted {
    color: #9ca3af !important;
}

body[data-theme="dark"] .mentions-dropdown .text-danger {
    color: #f87171 !important; /* Світліший червоний */
}

/* Стилізація scrollbar для mentions dropdown */
.mentions-dropdown::-webkit-scrollbar {
    width: 4px !important; /* Тонкий scrollbar */
}

.mentions-dropdown::-webkit-scrollbar-track {
    background: transparent !important;
}

.mentions-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db !important; /* Світло-сірий */
    border-radius: 2px !important;
}

.mentions-dropdown::-webkit-scrollbar-thumb:hover {
    background: #9ca3af !important; /* Темніший при hover */
}

/* Scrollbar для темної теми */
body[data-theme="dark"] .mentions-dropdown::-webkit-scrollbar-thumb {
    background: #4b5563 !important;
}

body[data-theme="dark"] .mentions-dropdown::-webkit-scrollbar-thumb:hover {
    background: #6b7280 !important;
}

/* Адаптивні стилі для mentions dropdown */
@media (max-width: 768px) {
    .mentions-dropdown {
        min-width: 200px !important;
        max-width: calc(100vw - 20px) !important;
        max-height: 150px !important;
        font-size: 0.8rem !important;
    }
    
    .mentions-item {
        padding: 6px 10px !important;
    }
    
    .mentions-fullname {
        font-size: 0.8rem !important;
    }
    
    .mentions-username {
        font-size: 0.7rem !important;
    }
}

@media (max-width: 480px) {
    .mentions-dropdown {
        min-width: 180px !important;
        max-width: calc(100vw - 16px) !important;
        max-height: 120px !important;
    }
    
    .mentions-item {
        padding: 5px 8px !important;
    }
}

/* Стилі для різних орієнтацій екрану */
@media (orientation: landscape) and (max-height: 500px) {
    .mentions-dropdown {
        max-height: 100px !important;
    }
}

@media (orientation: portrait) and (max-width: 768px) {
    .mentions-dropdown {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* Стилізація згадок в тексті */
.mentions-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.mentions-overlay {
    /* Мінімальні стилі, все інше встановлюється через JavaScript */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    pointer-events: none !important;
    z-index: 1 !important;
    overflow: hidden !important;
}

.mentions-overlay .mention {
    background: #fecaca !important; /* Світло-червоний фон */
    color: #dc2626 !important; /* Темно-червоний текст */
    text-shadow: 0 0 0 #dc2626 !important; /* Додаткове виділення без зміни розмірів */
    box-decoration-break: clone !important; /* Для багаторядкових згадок */
    padding: 0 !important;
}



.mentions-textarea {
    background: transparent !important;
    position: relative !important;
    z-index: 2 !important;
    color: transparent !important;
    resize: vertical !important;
    outline: none !important;
    caret-color: #000 !important;
    margin: 0 !important;
    border-radius: inherit !important;
}

/* Темна тема для курсора */
body[data-theme="dark"] .mentions-textarea {
    caret-color: #fff !important;
}

/* Темна тема для згадок */
body[data-theme="dark"] .mentions-overlay .mention {
    background: #7f1d1d !important; /* Темно-червоний фон */
    color: #fca5a5 !important; /* Світло-червоний текст */
    text-shadow: 0 0 0 #fca5a5 !important; /* Додаткове виділення без зміни розмірів */
}

body[data-theme="dark"] .search-bar {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

/* -------------------------------------------------------------------------
   [2] ЩІЛЬНІСТЬ ТА МАКЕТ
------------------------------------------------------------------------- */

/* Компактний режим */
body.layout-compact .card-body,
body.layout-compact .page-header-custom {
    padding: 1rem;
}
body.layout-compact .table td,
body.layout-compact .table th {
    padding: 0.5rem 0.75rem;
}
body.layout-compact .btn {
    padding: 0.375rem 0.875rem;
    font-size: 0.85rem;
}
body.layout-compact .form-control,
body.layout-compact .form-select {
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
}

/* "Рідкий" макет */
body.layout-fluid #content-wrapper {
    padding-left: 2rem;
    padding-right: 2rem;
}
body.layout-fluid .container-xl {
    max-width: none; /* Знімаємо обмеження по ширині */
}

/* --- СТИЛІ ДЛЯ СПОВІЩЕНЬ --- */
/* --- КОНТЕЙНЕР ДЛЯ ТОСТІВ --- */
#toastContainer {
    position: fixed;
    top: calc(var(--header-height) + 1rem);
    right: 1rem;
    z-index: 1100;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

#toastContainer .toast {
    pointer-events: auto;
    margin-bottom: 0.75rem;
    animation: toastSlideIn 0.3s ease-out;
    background: white;
    border: 3px solid #9ca3af;
    border-radius: 12px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(8px);
    transform: translateZ(0);
}

/* Контрастні кольори для різних типів */
#toastContainer .toast.text-bg-success {
    border: 3px solid #059669;
    border-left: 8px solid #047857;
    box-shadow: 
        0 8px 32px rgba(16, 185, 129, 0.15),
        0 4px 16px rgba(16, 185, 129, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#toastContainer .toast.text-bg-error,
#toastContainer .toast.text-bg-danger {
    border: 3px solid #dc2626;
    border-left: 8px solid #b91c1c;
    box-shadow: 
        0 8px 32px rgba(239, 68, 68, 0.15),
        0 4px 16px rgba(239, 68, 68, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#toastContainer .toast.text-bg-warning {
    border: 3px solid #d97706;
    border-left: 8px solid #b45309;
    box-shadow: 
        0 8px 32px rgba(245, 158, 11, 0.15),
        0 4px 16px rgba(245, 158, 11, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#toastContainer .toast.text-bg-info {
    border: 3px solid #2563eb;
    border-left: 8px solid #1d4ed8;
    box-shadow: 
        0 8px 32px rgba(59, 130, 246, 0.15),
        0 4px 16px rgba(59, 130, 246, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#toastContainer .toast.text-bg-primary {
    border: 3px solid #4f46e5;
    border-left: 8px solid #4338ca;
    box-shadow: 
        0 8px 32px rgba(99, 102, 241, 0.15),
        0 4px 16px rgba(99, 102, 241, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Іконка в toast */
#toastContainer .toast .bi {
    font-size: 1rem;
    margin-right: 0.75rem;
    opacity: 0.8;
}

#toastContainer .toast.text-bg-success .bi {
    color: #10b981;
}

#toastContainer .toast.text-bg-error .bi,
#toastContainer .toast.text-bg-danger .bi {
    color: #ef4444;
}

#toastContainer .toast.text-bg-warning .bi {
    color: #f59e0b;
}

#toastContainer .toast.text-bg-info .bi {
    color: #3b82f6;
}

#toastContainer .toast.text-bg-primary .bi {
    color: #6366f1;
}

/* Текст в toast */
#toastContainer .toast .toast-body {
    padding: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #374151;
    background: white;
}

/* Кнопка закриття */
#toastContainer .toast .btn-close {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    position: relative;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.08);
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Іконка X в кнопці закриття */
#toastContainer .toast .btn-close::before,
#toastContainer .toast .btn-close::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 12px !important;
    height: 2px !important;
    background: #6c757d !important;
    border-radius: 1px !important;
    transition: all 0.2s ease !important;
    margin-left: -6px !important;
    margin-top: -1px !important;
    display: block !important;
}

#toastContainer .toast .btn-close::before {
    transform: rotate(45deg) !important;
}

#toastContainer .toast .btn-close::after {
    transform: rotate(-45deg) !important;
}

/* Hover ефекти */
#toastContainer .toast .btn-close:hover {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    border-color: #bd2130;
    transform: translateY(-1px) scale(1.05);
    box-shadow: 
        0 4px 12px rgba(220, 53, 69, 0.3),
        0 2px 6px rgba(220, 53, 69, 0.2);
}

#toastContainer .toast .btn-close:hover::before,
#toastContainer .toast .btn-close:hover::after {
    background: #6c757d !important; /* Залишаємо той самий колір */
    width: 14px !important;
    margin-left: -7px !important;
}

/* Active ефект */
#toastContainer .toast .btn-close:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 
        0 2px 6px rgba(220, 53, 69, 0.4),
        0 1px 3px rgba(220, 53, 69, 0.3);
}

/* Focus ефект для доступності */
#toastContainer .toast .btn-close:focus {
    outline: none;
    box-shadow: 
        0 0 0 3px rgba(220, 53, 69, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Псевдоелемент ::after використовується для другої лінії X */

/* Додатковий тест для відображення іконки */
#toastContainer .toast .btn-close {
    /* Перевизначаємо Bootstrap стилі */
    background-image: none !important;
    opacity: 1 !important;
}

/* Переконуємося, що псевдоелементи відображаються */
#toastContainer .toast .btn-close::before,
#toastContainer .toast .btn-close::after {
    visibility: visible !important;
    z-index: 1 !important;
}

/* Анімація появи */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
        filter: blur(4px);
    }
    50% {
        opacity: 0.8;
        transform: translateX(10%) scale(1.02);
        filter: blur(1px);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
}

/* Анімація зникнення */
@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
        filter: blur(0);
    }
    50% {
        opacity: 0.5;
        transform: translateX(10%) scale(0.98);
        filter: blur(1px);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.95);
        filter: blur(4px);
    }
}

/* Додаткова анімація для привернення уваги */
@keyframes toastPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

#toastContainer .toast.fade-out {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* Hover ефект */
#toastContainer .toast:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 6px 20px rgba(0, 0, 0, 0.1),
        0 3px 10px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

/* Пульсація для критичних повідомлень */
#toastContainer .toast.text-bg-error,
#toastContainer .toast.text-bg-danger {
    animation: toastSlideIn 0.4s ease-out, toastPulse 2s ease-in-out 0.5s 2;
}

#toastContainer .toast.text-bg-warning {
    animation: toastSlideIn 0.4s ease-out, toastPulse 1.5s ease-in-out 0.3s 1;
}

/* Адаптивність */
@media (max-width: 768px) {
    #toastContainer {
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
    
    #toastContainer .toast {
        border-radius: 6px;
    }
}

/* --- ПОКРАЩЕНИЙ ВМІСТ ТОСТІВ --- */
#toastContainer .toast .toast-body {
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 500;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

#toastContainer .toast .bi {
    font-size: 1.1rem;
    margin-top: 0.125rem;
    flex-shrink: 0;
    opacity: 0.9;
}



/* --- АДАПТИВНІСТЬ --- */
@media (max-width: 768px) {
    #toastContainer {
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
    
    #toastContainer .toast {
        border-radius: 12px;
        margin-bottom: 0.5rem;
    }
    
    #toastContainer .toast .toast-body {
        padding: 0.875rem 1rem;
        font-size: 0.8125rem;
    }
    
    #toastContainer .toast .bi {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    #toastContainer {
        right: 0.25rem;
        left: 0.25rem;
        top: calc(var(--header-height) + 0.5rem);
    }
    
    #toastContainer .toast {
        border-radius: 10px;
    }
    
    #toastContainer .toast .toast-body {
        padding: 0.75rem;
        font-size: 0.8rem;
        gap: 0.5rem;
    }
    
    #toastContainer .toast .btn-close {
        width: 20px;
        height: 20px;
        margin: 0.5rem;
    }
    
    #toastContainer .toast .btn-close::before,
    #toastContainer .toast .btn-close::after {
        width: 10px !important;
        margin-left: -5px !important;
    }
}

/* --- ТЕМНА ТЕМА --- */
body[data-theme="dark"] #toastContainer .toast {
    background-color: rgba(30, 41, 59, 0.95);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
}

/* Контрастні кольори для темної теми */
body[data-theme="dark"] #toastContainer .toast.text-bg-success {
    border: 3px solid #10b981;
    border-left: 8px solid #059669;
    box-shadow: 
        0 12px 40px rgba(16, 185, 129, 0.2),
        0 8px 24px rgba(16, 185, 129, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] #toastContainer .toast.text-bg-error,
body[data-theme="dark"] #toastContainer .toast.text-bg-danger {
    border: 3px solid #ef4444;
    border-left: 8px solid #dc2626;
    box-shadow: 
        0 12px 40px rgba(239, 68, 68, 0.2),
        0 8px 24px rgba(239, 68, 68, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] #toastContainer .toast.text-bg-warning {
    border: 3px solid #f59e0b;
    border-left: 8px solid #d97706;
    box-shadow: 
        0 12px 40px rgba(245, 158, 11, 0.2),
        0 8px 24px rgba(245, 158, 11, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] #toastContainer .toast.text-bg-info {
    border: 3px solid #3b82f6;
    border-left: 8px solid #2563eb;
    box-shadow: 
        0 12px 40px rgba(59, 130, 246, 0.2),
        0 8px 24px rgba(59, 130, 246, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] #toastContainer .toast.text-bg-primary {
    border: 3px solid #6366f1;
    border-left: 8px solid #4f46e5;
    box-shadow: 
        0 12px 40px rgba(99, 102, 241, 0.2),
        0 8px 24px rgba(99, 102, 241, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] #toastContainer .toast .btn-close {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    border-color: #6b7280;
}

body[data-theme="dark"] #toastContainer .toast .btn-close::before,
body[data-theme="dark"] #toastContainer .toast .btn-close::after {
    background: #e5e7eb !important;
}

body[data-theme="dark"] #toastContainer .toast .btn-close:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: #991b1b;
    box-shadow: 
        0 4px 12px rgba(220, 38, 38, 0.4),
        0 2px 6px rgba(220, 38, 38, 0.3);
}

body[data-theme="dark"] #toastContainer .toast .btn-close:hover::before,
body[data-theme="dark"] #toastContainer .toast .btn-close:hover::after {
    background: #e5e7eb !important; /* Залишаємо той самий колір */
    width: 14px !important;
    margin-left: -7px !important;
}

/* --- АНІМАЦІЇ ДЛЯ ЗМЕНШЕННЯ РУХУ --- */
@media (prefers-reduced-motion: reduce) {
    #toastContainer .toast,
    #toastContainer .toast .btn-close {
        animation: none;
        transition: none;
    }
    
    #toastContainer .toast.hiding {
        animation: none;
    }
}

/* --- ПОКРАЩЕНИЙ КОНТРАСТ --- */
@media (prefers-contrast: high) {
    #toastContainer .toast {
        border-width: 2px;
    }
    
    #toastContainer .toast .btn-close {
        border: 1px solid currentColor;
    }
}

/* --- ПАНЕЛЬ ПЕРЕХОДУ ДО ЦЕНТРУ СПОВІЩЕНЬ --- */
.notification-header-panel {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover)) !important;
    border-bottom: 2px solid rgba(255,255,255,0.2) !important;
}

.notification-header-panel h6 {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.notification-header-panel .btn-outline-light {
    border-color: rgba(255,255,255,0.3);
    color: white;
    transition: all 0.3s ease;
}

.notification-header-panel .btn-outline-light:hover {
    background-color: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    color: white;
}

.notification-header-panel .btn-light {
    background-color: rgba(255,255,255,0.95);
    border-color: rgba(255,255,255,0.5);
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.notification-header-panel .btn-light:hover,
.notification-header-panel .btn-light:focus,
.notification-header-panel .btn-light:active {
    background-color: rgba(255,255,255,0.95) !important;
    border-color: rgba(255,255,255,0.5) !important;
    color: var(--primary-color) !important;
}

.notification-header-panel .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 2;
}

.notification-header-panel .btn-light:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Панель дозволу на сповіщення */
#notification-permission-panel {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
}

#notification-permission-panel .btn-primary {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}

/* --- СПИСОК СПОВІЩЕНЬ --- */
#notification-items-list {
    max-height: 350px; /* Зменшено через додавання панелі */
    overflow-y: auto;
    overflow-x: hidden;
}

/* Кастомний скролбар для списку сповіщень */
#notification-items-list::-webkit-scrollbar {
    width: 6px;
}

#notification-items-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

#notification-items-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

#notification-items-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* --- ОКРЕМІ СПОВІЩЕННЯ --- */
.notification-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    white-space: normal;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-secondary);
}

/* Стилі для розділення непрочитаних та прочитаних сповіщень */
.notification-section-header {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
}

.notification-section-header.unread-section {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(var(--primary-rgb), 0.05) 100%);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.notification-section-header.read-section {
    background: linear-gradient(135deg, var(--success-light) 0%, rgba(var(--success-rgb), 0.05) 100%);
    color: var(--success-color);
    border-bottom-color: var(--success-color);
}

.notification-section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-color) 20%, var(--border-color) 80%, transparent 100%);
    margin: 0.5rem 0;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item:hover {
    background-color: var(--bg-secondary);
    transform: translateX(1px);
}

.notification-item.unread {
    background-color: var(--primary-light);
    border-left: 4px solid var(--primary-color);
}

.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulseNotification 2s infinite;
}

/* --- ІКОНКИ СПОВІЩЕНЬ --- */
.notification-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    margin-top: 0.25rem;
}

.notification-icon.info { background: linear-gradient(135deg, #17a2b8, #20c997); }
.notification-icon.success { background: linear-gradient(135deg, #28a745, #20c997); }
.notification-icon.warning { background: linear-gradient(135deg, #ffc107, #fd7e14); }
.notification-icon.danger { background: linear-gradient(135deg, #dc3545, #e83e8c); }

/* --- КОНТЕНТ СПОВІЩЕННЯ --- */
.notification-content {
    flex: 1;
    min-width: 0; /* Дозволити скорочення тексту */
}

.notification-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
    font-size: 0.9rem;
}

.notification-message {
    color: var(--text-secondary);
    line-height: 1.4;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.notification-time i {
    font-size: 0.7rem;
}

/* --- ДІЇ З СПОВІЩЕННЯМИ --- */
.notification-actions {
    padding: 0.75rem 1.25rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

#mark-all-as-read-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    text-decoration: none;
}

#mark-all-as-read-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-hover);
}

#view-all-notifications-link {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}

#view-all-notifications-link:hover {
    background-color: var(--primary-light);
    color: var(--primary-hover);
    text-decoration: none;
}

/* --- ПОРОЖНІЙ СТАН --- */
.notifications-empty {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-muted);
}

.notifications-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.notifications-empty h6 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.notifications-empty p {
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* --- СТАНИ ЗАВАНТАЖЕННЯ --- */
.notifications-loading {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-muted);
}

.notifications-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    margin-bottom: 1rem;
}

/* --- СТИЛІ ДЛЯ ТЕМНОЇ ТЕМИ --- */
body[data-theme="dark"] .notifications-dropdown .dropdown-menu {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body[data-theme="dark"] .notifications-dropdown .dropdown-header {
    background: var(--bg-accent);
    border-bottom-color: var(--border-color);
}

body[data-theme="dark"] .notification-item {
    border-bottom-color: var(--border-color);
}

body[data-theme="dark"] .notification-item:hover {
    background-color: var(--bg-accent);
}

body[data-theme="dark"] .notification-item.unread {
    background-color: rgba(127, 140, 255, 0.15);
    border-left-color: var(--primary-color);
}

body[data-theme="dark"] .notification-actions-right .btn {
    background-color: transparent;
    border-color: #4a5568;
}

body[data-theme="dark"] .notification-actions-right .btn:hover {
    /* Без hover ефектів */
}

body[data-theme="dark"] .notification-actions-right .mark-read-btn:focus {
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

body[data-theme="dark"] .notification-actions-right .btn-outline-primary:focus {
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3);
}

body[data-theme="dark"] .notification-actions-right .btn:focus {
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.3);
}

body[data-theme="dark"] .notification-actions {
    background: var(--bg-accent);
    border-top-color: var(--border-color);
}

body[data-theme="dark"] #toastContainer .toast {
    border-color: rgba(255, 255, 255, 0.1);
}

/* Темна тема для розділів сповіщень */
body[data-theme="dark"] .notification-section-header.unread-section {
    background: linear-gradient(135deg, rgba(127, 140, 255, 0.2) 0%, rgba(127, 140, 255, 0.1) 100%);
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

body[data-theme="dark"] .notification-section-header.read-section {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.2) 0%, rgba(40, 167, 69, 0.1) 100%);
    color: var(--success-color);
    border-bottom-color: var(--success-color);
}

body[data-theme="dark"] .notification-section-divider {
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 20%, rgba(255, 255, 255, 0.1) 80%, transparent 100%);
}

/* --- АДАПТИВНІСТЬ --- */
@media (max-width: 768px) {
    .notifications-dropdown .dropdown-menu {
        width: 340px;
        max-height: 400px;
    }
    
    #toastContainer {
        right: 0.75rem;
        left: 0.75rem;
        max-width: none;
    }
    
    .notification-item {
        padding: 0.875rem 1rem;
        gap: 0.5rem;
    }
    
    .notification-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .notification-title {
        font-size: 0.85rem;
    }
    
    .notification-message {
        font-size: 0.8rem;
    }
    
    .notification-actions {
        padding: 0.625rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #mark-all-as-read-btn,
    #view-all-notifications-link {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .notifications-dropdown .dropdown-menu {
        width: 300px;
        right: -80px; /* Зміщення для кращого позиціонування */
    }
    
    .notification-item {
        padding: 0.75rem 0.875rem;
    }
    
    .notification-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* --- ДОСТУПНІСТЬ --- */
@media (prefers-reduced-motion: reduce) {
    #toastContainer .toast,
    .notification-item,
    #notification-count {
        animation: none !important;
        transition: none !important;
    }
}

/* --- СТИЛІ ДЛЯ ВИСОКОГО КОНТРАСТУ --- */
@media (prefers-contrast: high) {
    .notification-item {
        border-bottom: 2px solid var(--border-dark);
    }
    
    .notification-item.unread {
        border-left-width: 6px;
    }
    
    #notification-count {
        border-width: 3px;
        font-weight: 700;
    }
}

/* --- СПЕЦІАЛЬНІ ТИПИ СПОВІЩЕНЬ --- */
.notification-item.system {
    background: linear-gradient(90deg, rgba(0, 123, 255, 0.05) 0%, transparent 100%);
}

.notification-item.urgent {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.1) 0%, transparent 100%);
    border-left: 4px solid var(--danger-color);
}

.notification-item.task-reminder {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.1) 0%, transparent 100%);
    border-left: 4px solid var(--warning-color);
}

/* --- АНІМАЦІЇ ПОЯВИ ПРИ ОНОВЛЕННІ --- */
.notification-item.new {
    /* Без анімації */
}

/* --- КОМПАКТНЕ МЕНЮ --- */
.nav-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 0.25rem 0 0.25rem 0.5rem;
    width: 85%;
    opacity: 0.7;
}

body.sidebar-collapsed .sidebar .nav-label {
    transition-delay: var(--delay-out);
}

/* Видалено, оскільки розділювачі прибрані з HTML */

/* Цей блок більше не потрібен, оскільки логіка обробляється базовим станом і перевизначенням */

/* Custom Styles */
.mention {
    background-color: #e0f0ff;
    color: #0056b3;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Collapsible list on case view */
.collapsible-list .collapsible-item {
    /* display: none; */ /* Замінюємо на анімацію */
}

.collapsible-list.is-expanded .collapsible-item {
    /* display: table-row; */ /* Замінюємо на анімацію */
}

/* Нові стилі для плавної анімації */
.collapsible-item td {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border: none;
    transition: padding-top 0.35s ease, padding-bottom 0.35s ease;
}

.is-expanded .collapsible-item td {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

.collapsible-item td .collapsible-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out, opacity 0.2s ease-out;
}

.is-expanded .collapsible-item td .collapsible-content {
    max-height: 5em; /* Достатньо для вмісту комірки */
    opacity: 1;
    transition: max-height 0.35s ease-in, opacity 0.35s ease-in;
}

.mention {
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-radius: 4px;
    padding: 1px 4px;
    font-weight: 500;
}

/* --- СТИЛІ ДЛЯ БЛОКУ, ЩО РОЗГОРТАЄТЬСЯ --- */
.collapsible-list .collapsible-item td {
    padding-top: 0;
    padding-bottom: 0;
    border: none; /* Прибираємо межі під час анімації */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out;
}

.collapsible-list.is-expanded .collapsible-item td {
    max-height: 100px; /* Достатньо велика висота */
    padding-top: .5rem; 
    padding-bottom: .5rem;
    border-top: 1px solid var(--bs-table-border-color, #dee2e6); /* Повертаємо межу */
}

.mention {
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-radius: 4px;
    padding: 1px 4px;
    font-weight: 500;
}

/* --- СТИЛІ ДЛЯ БЛОКУ, ЩО РОЗГОРТАЄТЬСЯ --- */
.collapsible-item .collapsible-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.35s ease-out;
    will-change: max-height, padding, margin, opacity;
}

.collapsible-list.is-expanded .collapsible-item .collapsible-content {
    max-height: 100px; /* Достатньо велике значення */
    opacity: 1;
}

.collapsible-item td {
    border: none;
    transition: padding 0.35s ease-out;
}

.collapsible-list.is-expanded .collapsible-item td {
    border-top: 1px solid var(--bs-table-border-color, #dee2e6);
}

/* --- СТИЛІ ДЛЯ БЛОКУ, ЩО РОЗГОРТАЄТЬСЯ (оновлено) --- */
.collapsible-item .collapsible-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    transition: all 0.4s ease-in-out;
}

.collapsible-list.is-expanded .collapsible-item .collapsible-content {
    max-height: 150px; /* Достатньо для вмісту */
    opacity: 1;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.collapsible-item td {
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
    transition: border-color 0.4s ease-in-out;
}

.collapsible-list.is-expanded .collapsible-item td {
     border-top: 1px solid var(--border-light);
}

/* --- СТИЛІ ДЛЯ БЛОКУ, ЩО РОЗГОРТАЄТЬСЯ (ФІНАЛЬНА ВЕРСІЯ) --- */
.collapsible-item .collapsible-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s ease-out;
}

.collapsible-list.is-expanded .collapsible-item .collapsible-content {
    grid-template-rows: 1fr;
}

.collapsible-item .collapsible-content > div {
    overflow: hidden;
}

.collapsible-item td {
    padding-top: 0;
    padding-bottom: 0;
    border-top: none;
}

.collapsible-list.is-expanded .collapsible-item td {
     border-top: 1px solid var(--border-light);
     padding-top: .5rem;
     padding-bottom: .5rem;
}
/* Кінець стилів для блоку, що розгортається */

/* Специфічні таблиці для рахунків */
.invoices-table {
    font-size: 0.9rem; /* Узгоджено з .table */
}

.invoices-table th,
.invoices-table td {
    padding: 0.875rem 1rem; /* Узгоджено */
    vertical-align: middle;
    white-space: nowrap; /* Запобігання перенесенню для даних рахунку */
}

.invoices-table .badge {
    font-size: 0.75em; /* Узгоджено із загальним бейджем */
}

/* Компактні стилі для таблиці завдань */
.tasks-table {
    font-size: 0.8rem; /* Зменшений шрифт */
}

.tasks-table th,
.tasks-table td {
    padding: 0.5rem 0.75rem; /* Зменшені відступи */
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

.tasks-table th {
    font-size: 0.7rem; /* Ще менший шрифт для заголовків */
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-medium);
}

.tasks-table .badge {
    font-size: 0.65em; /* Менші бейджі */
    padding: 0.25rem 0.5rem;
    font-weight: 500;
}

.tasks-table .btn-action-icon {
    padding: 0.25rem;
    font-size: 0.8rem;
    width: 28px;
    height: 28px;
}

.tasks-table .task-name-cell { max-width: 520px; }

.tasks-table .task-name-text {
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.3;
}

.tasks-table .task-sub-info {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.tasks-table .task-indent-icon {
    font-size: 0.75rem;
    margin-right: 0.3rem;
}

/* Компактні стилі для заголовка розділу завдань */
.tasks-section-header h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tasks-section-header .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
}

/* Компактний прогрес-бар */
.tasks-progress {
    height: 16px;
    margin-bottom: 0.75rem;
}

.tasks-progress .progress-bar {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Компактні стилі для мобільних карток завдань */
@media (max-width: 768px) {
    .tasks-table-mobile-cards .tasks-table {
        font-size: 0.75rem;
    }
    
    .tasks-table-mobile-cards .tasks-table td {
        padding: 0.4rem 0.6rem;
    }
    
    .tasks-table-mobile-cards .tasks-table .badge {
        font-size: 0.6em;
        padding: 0.2rem 0.4rem;
    }
    
    .tasks-table-mobile-cards .tasks-table .btn-action-icon {
        padding: 0.2rem;
        font-size: 0.75rem;
        width: 24px;
        height: 24px;
    }
}

/* Додаткові покращення для таблиці завдань */
.tasks-table {
    border-collapse: collapse;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

/* Мінімалістичний thead без градієнта */
.tasks-table thead {
    background: #f5f5f5;
}

.tasks-table tbody tr {
    transition: all var(--transition-fast);
    border-bottom: 1px solid var(--border-light);
}

.tasks-table tbody tr:last-child {
    border-bottom: none;
}

.tasks-table tbody tr:hover {
    background-color: #fafafa;
    box-shadow: none;
}

/* Покращені стилі для статусів та пріоритетів */
.tasks-table .badge {
    border-radius: var(--border-radius-pill);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none; /* маленькі літери */
    font-size: 0.7em;
    padding: 0.25rem 0.5rem;
    border: 1px solid transparent;
}

/* Стилі для прострочених завдань */
.tasks-table .task-overdue {
    background-color: rgba(220, 53, 69, 0.03);
    border-left: 3px solid var(--danger-color);
}

.tasks-table .task-overdue:hover {
    background-color: rgba(220, 53, 69, 0.08);
}

/* Стилі для виконаних завдань */
.tasks-table .task-completed {
    background-color: rgba(40, 167, 69, 0.03);
    border-left: 3px solid var(--success-color);
}

.tasks-table .task-completed:hover {
    background-color: rgba(40, 167, 69, 0.08);
}

/* Стилі для завдань в очікуванні */
.tasks-table .task-pending-review {
    background-color: rgba(255, 193, 7, 0.03);
    border-left: 3px solid var(--warning-color);
}

.tasks-table .task-pending-review:hover {
    background-color: rgba(255, 193, 7, 0.08);
}

/* Стилі для готових завдань */
.tasks-table .task-ready {
    background-color: rgba(13, 110, 253, 0.03);
    border-left: 3px solid var(--primary-color);
}

.tasks-table .task-ready:hover {
    background-color: rgba(13, 110, 253, 0.08);
}

/* Покращені стилі для назв завдань */
.tasks-table .task-name-text {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
    font-size: inherit;
}

.tasks-table .task-name-text:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Компактні стилі для іконок */
.tasks-table .task-indent-icon {
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.tasks-table tbody tr:hover .task-indent-icon {
    opacity: 1;
}

/* Покращені стилі для кнопок дій */
.tasks-table .btn-action-icon {
    border: 1px solid var(--border-medium);
    transition: all var(--transition-fast);
    background: var(--bg-primary);
}

.tasks-table .btn-action-icon:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.tasks-table .btn-outline-primary.btn-action-icon:hover {
    background-color: var(--primary-color);
    color: white;
}

.tasks-table .btn-outline-info.btn-action-icon:hover {
    background-color: #17a2b8;
    color: white;
}

.tasks-table .btn-outline-danger.btn-action-icon:hover {
    background-color: var(--danger-color);
    color: white;
}

/* Стилі для термінів завдань */
.tasks-table td[data-label="Термін"],
.tasks-table td[data-label="Дедлайн"],
.tasks-table td[data-label="Термін оплати"],
.tasks-table td:nth-child(6) { font-weight: 600; }

.tasks-table .task-overdue td[data-label="Термін"] {
    color: var(--danger-color);
    font-weight: 600;
}

/* Стилі для відповідальних осіб */
.tasks-table td[data-label="Відповідальний"] {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Компактні стилі для порожнього стану */
.tasks-table tbody tr td[colspan] {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.tasks-table tbody tr td[colspan] i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* Покращені стилі для заголовків колонок */
/* Заголовки колонок прості, без uppercase та літер-спейсингу */
.tasks-table th {
    position: relative;
    background: #f5f5f5;
    border-bottom: 1px solid var(--border-light);
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
    padding: 0.65rem 0.75rem;
}

.tasks-table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-medium) 50%, transparent 100%);
}

/* Адаптивні стилі для різних розмірів екрану */
@media (max-width: 1200px) {
    .tasks-table {
        font-size: 0.75rem;
    }
    
    .tasks-table th,
    .tasks-table td {
        padding: 0.4rem 0.6rem;
    }
    
    .tasks-table .task-name-cell {
        max-width: 250px;
    }
}

@media (max-width: 992px) {
    .tasks-table .task-name-cell {
        max-width: 200px;
    }
    
    .tasks-table .btn-action-icon {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }
}

/* Стилі для компактних карток інформації */
.case-info-cards .card {
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.case-info-cards .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.case-info-cards .card-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.case-info-cards .card-body {
    padding: 0.75rem;
}

.case-info-cards .card-body p {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0;
    color: var(--text-primary);
    line-height: 1.3;
}

.case-info-cards .card-body a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.case-info-cards .card-body a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.case-info-cards .badge {
    font-size: 0.7em;
    padding: 0.2rem 0.4rem;
    font-weight: 500;
}

/* Адаптивні стилі для карток інформації */
@media (max-width: 768px) {
    .case-info-cards .card-body {
        padding: 0.5rem;
    }
    
    .case-info-cards .card-title {
        font-size: 0.75rem;
    }
    
    .case-info-cards .card-body p {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .case-info-cards .row {
        margin: 0 -0.25rem;
    }
    
    .case-info-cards .col-md-6 {
        padding: 0 0.25rem;
    }
    
    .case-info-cards .card-body {
        padding: 0.4rem;
    }
}

/* Стилі для блоків на головній сторінці */
.dashboard-tasks-list .list-group-item,
.dashboard-hearings-list .list-group-item {
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 0.75rem 1rem;
    transition: all var(--transition-fast);
}

/* Глобальні стилі для посилань на справи */
.case-title-link,
.case-link,
.case-number-link,
.task-title,
.task-name-text,
.hearing-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 700;
    transition: color var(--transition-fast);
}

.case-title-link:hover,
.case-link:hover,
.case-number-link:hover,
.task-title:hover,
.task-name-text:hover,
.hearing-link:hover {
    color: var(--text-primary);
    text-decoration: none;
}

/* Додаткові стилі для посилань на справи з іншими класами */
a.fw-medium.text-decoration-none[href*="case_view.php"],
a.text-decoration-none[href*="case_view.php"] {
    color: var(--text-secondary) !important;
    transition: color var(--transition-fast);
}

a.fw-medium.text-decoration-none[href*="case_view.php"]:hover,
a.text-decoration-none[href*="case_view.php"]:hover {
    color: var(--text-primary) !important;
}

.dashboard-tasks-list .list-group-item:last-child,
.dashboard-hearings-list .list-group-item:last-child {
    border-bottom: none;
}

.dashboard-tasks-list .list-group-item:hover,
.dashboard-hearings-list .list-group-item:hover {
    background-color: var(--primary-light);
    transform: translateX(2px);
}

/* Стилі для прострочених завдань */
.dashboard-tasks-list .overdue-task {
    background-color: rgba(220, 53, 69, 0.03);
    border-left: 3px solid var(--danger-color);
}

.dashboard-tasks-list .overdue-task:hover {
    background-color: rgba(220, 53, 69, 0.08);
}

.dashboard-tasks-list .overdue-task .task-link {
    color: var(--text-primary);
    font-weight: 500;
}

.dashboard-tasks-list .overdue-task .task-link:hover {
    color: var(--danger-color);
}

/* Стилі для поточних завдань */
.dashboard-tasks-list .current-task {
    background-color: rgba(40, 167, 69, 0.02);
    border-left: 3px solid var(--success-color);
}

.dashboard-tasks-list .current-task:hover {
    background-color: rgba(40, 167, 69, 0.06);
}

.dashboard-tasks-list .current-task .task-link {
    color: var(--text-primary);
    font-weight: 500;
}

.dashboard-tasks-list .current-task .task-link:hover {
    color: var(--primary-color);
}

/* Стилі для засідань */
.dashboard-hearings-list .hearing-item {
    background-color: rgba(13, 110, 253, 0.02);
    border-left: 3px solid var(--primary-color);
}

.dashboard-hearings-list .hearing-item:hover {
    background-color: rgba(13, 110, 253, 0.06);
}

.dashboard-hearings-list .hearing-link {
    color: var(--text-primary);
    font-weight: 500;
}

.dashboard-hearings-list .hearing-link:hover {
    color: var(--primary-color);
}

/* Стилі для бейджів */
.task-badges .badge,
.hearing-badges .badge {
    font-size: 0.65em;
    padding: 0.2rem 0.4rem;
    font-weight: 500;
    border-radius: var(--border-radius-pill);
}

/* Стилі для заголовків секцій */
.dashboard-tasks-list .list-group-item.bg-danger-subtle,
.dashboard-tasks-list .list-group-item.bg-success-subtle {
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-tasks-list .list-group-item.bg-danger-subtle {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
}

.dashboard-tasks-list .list-group-item.bg-success-subtle {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
}

/* Покращені стилі для карток */
.card.hover-lift {
    transition: all var(--transition-fast);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-lg);
}

.card.hover-lift:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card.hover-lift .card-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-medium);
}

.card.hover-lift .card-header h6 {
    font-weight: 600;
    color: var(--text-primary);
}

/* Адаптивні стилі для дашборду */
@media (max-width: 768px) {
    .dashboard-tasks-list .list-group-item,
    .dashboard-hearings-list .list-group-item {
        padding: 0.6rem 0.8rem;
    }
    
    .task-badges .badge,
    .hearing-badges .badge {
        font-size: 0.6em;
        padding: 0.15rem 0.3rem;
    }
    
    .dashboard-tasks-list .list-group-item.bg-danger-subtle,
    .dashboard-tasks-list .list-group-item.bg-success-subtle {
        padding: 0.4rem 0.8rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .dashboard-tasks-list .list-group-item,
    .dashboard-hearings-list .list-group-item {
        padding: 0.5rem 0.6rem;
    }
    
    .card.hover-lift .card-header {
        padding: 0.75rem;
    }
    
    .card.hover-lift .card-header h6 {
        font-size: 0.9rem;
    }
}

/* Стилі для обрізання довгих назв завдань на дашборді */
.dashboard-tasks-list .task-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* Важливо для flexbox */
    flex: 1;
}

.dashboard-tasks-list .task-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    line-height: 1.4;
}

.dashboard-tasks-list .task-case-info {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* Важливо для flexbox */
    flex: 1;
}

.dashboard-tasks-list .case-title {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60%;
    vertical-align: bottom;
}

/* Додаткові стилі для flexbox контейнера */
.dashboard-tasks-list .d-flex.justify-content-between {
    min-width: 0; /* Важливо для flexbox */
}

.dashboard-tasks-list .flex-grow-1 {
    min-width: 0; /* Важливо для flexbox */
    overflow: hidden;
}

/* Адаптивні стилі для обрізання на мобільних пристроях */
@media (max-width: 768px) {
    .dashboard-tasks-list .task-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .dashboard-tasks-list .case-title {
        max-width: 50%;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .dashboard-tasks-list .task-title {
        font-size: 0.85rem;
        line-height: 1.2;
    }
    
    .dashboard-tasks-list .case-title {
        max-width: 40%;
        font-size: 0.75rem;
    }
}

/* --- ПОКРАЩЕНА АНІМАЦІЯ СПОВІЩЕНЬ --- */

/* Нова більш яскрава анімація для іконки дзвінка */


@keyframes bellShake {
    0%, 100% { 
        transform: translateX(0); 
    }
    25% { 
        transform: translateX(-2px); 
    }
    75% { 
        transform: translateX(2px); 
    }
}
/* Анімація для іконки дзвінка коли є непрочитані сповіщення */
.notifications-dropdown .header-action-btn.has-notifications i {
    animation: bellRing 1s ease-in-out infinite;
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(var(--primary-color-rgb), 0.6);
}

/* Альтернативна анімація для менш агресивного ефекту */
.notifications-dropdown .header-action-btn.has-notifications.soft i {
    animation: bellShake 2s ease-in-out infinite;
}

/* Покращена анімація для бейджа кількості */
#notification-count {
    position: absolute;
    top: 8px;
    right: 5px;
    font-size: 0.6em;
    padding: .25em .5em;
    display: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border: 2px solid white;
    animation: pulseNotification 2s infinite;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #dc3545, #e83e8c);
    color: white;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
}

/* Додаткова анімація для критичних сповіщень */
#notification-count.critical {
    animation: pulseNotification 1s infinite;
    background: linear-gradient(135deg, #dc3545, #fd7e14);
    box-shadow: 0 0 12px rgba(220, 53, 69, 0.6);
}

/* Анімація появи нового сповіщення */
.notification-item.new {
    /* Без анімації */
}

/* Видалено анімацію notificationAppear */

/* Покращена анімація для непрочитаних сповіщень */
.notification-item.unread::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    /* Видалено анімацію pulseNotification */
}

/* Ефект мерехтіння для нових сповіщень */
.notification-item.unread {
    background-color: var(--primary-light);
    border-left: 4px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.notification-item.unread::after {
    /* Видалено анімацію shimmer */
}

/* --- СТИЛІ ДЛЯ ЦЕНТРУ СПОВІЩЕНЬ --- */
.notification-item {
    border-left: 4px solid transparent;
}

.notification-item:hover {
    background-color: var(--bg-secondary);
}

.notification-item.unread {
    background-color: var(--primary-light);
    border-left-color: var(--primary-color);
}

.notification-item.unread:hover {
    background-color: var(--primary-light);
}

/* Групи сповіщень */
.notification-group-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--text-muted);
}

.notification-group-header h6 {
    margin: 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Кнопки дій для сповіщень - справа */
.notification-actions-right {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    margin-left: 1rem;
    align-items: center;
}

.notification-actions-right .btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 0.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-width: 1px;
    background-color: transparent;
}

.notification-actions-right .btn:hover {
    /* Без hover ефектів */
}

.notification-actions-right .mark-read-btn {
    color: #28a745;
    border-color: #28a745;
}

.notification-actions-right .mark-read-btn:hover {
    /* Без hover ефектів */
}

.notification-actions-right .mark-read-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.25);
}

.notification-actions-right .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.notification-actions-right .btn-outline-primary:hover {
    /* Без hover ефектів */
}

.notification-actions-right .btn-outline-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.25);
}

.notification-actions-right .btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.25);
}

/* Іконка сповіщення */
.notification-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    margin-right: 1rem;
}

.mark-read-btn {
    color: var(--success-color);
    border-color: var(--success-color);
}

.mark-read-btn:hover {
    background-color: var(--success-color);
    color: white;
}

/* Фільтри та пошук */
.notification-filters {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

.notification-filters .form-control,
.notification-filters .form-select {
    border-color: #ced4da;
    transition: all 0.3s ease;
}

.notification-filters .form-control:focus,
.notification-filters .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
}

.notification-filters .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    transition: all 0.3s ease;
}

.notification-filters .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
}

/* Статистика */
.notification-stats {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border: 1px solid #bbdefb;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.notification-stats .stat-item {
    text-align: center;
    padding: 0.5rem;
}

.notification-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.notification-stats .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Адаптивність для мобільних пристроїв */
@media (max-width: 768px) {
    .notification-filters .row {
        margin: 0;
    }
    
    .notification-filters .col-md-4,
    .notification-filters .col-md-2,
    .notification-filters .col-md-3,
    .notification-filters .col-md-1 {
        padding: 0.25rem;
    }
    
    .notification-actions-right {
        margin-left: 0.75rem;
        gap: 0.5rem;
    }
    
    .notification-actions-right .btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
        border-width: 1px;
    }
    
    .notification-icon-wrapper {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }
    
    .notification-stats .row {
        margin: 0;
    }
    
    .notification-stats .stat-item {
        padding: 0.25rem;
    }
    
    .notification-stats .stat-value {
        font-size: 1.2rem;
    }
    
    .notification-stats .stat-label {
        font-size: 0.7rem;
    }
}

/* Прибираємо рожевий фон з прострочених завдань в темній темі */
body[data-theme="dark"] .table-danger,
body[data-theme="dark"] .table-danger > td,
body[data-theme="dark"] .table-danger > th,
body[data-theme="dark"] tr.table-danger,
body[data-theme="dark"] tr.table-danger > td,
body[data-theme="dark"] tr.table-danger > th {
    background-color: transparent !important;
    background: transparent !important;
}

body[data-theme="dark"] .table-warning,
body[data-theme="dark"] .table-warning > td,
body[data-theme="dark"] .table-warning > th,
body[data-theme="dark"] tr.table-warning,
body[data-theme="dark"] tr.table-warning > td,
body[data-theme="dark"] tr.table-warning > th {
    background-color: transparent !important;
    background: transparent !important;
}

/* --- МІНІМАЛІСТИЧНІ СТИЛІ ДЛЯ БЛОКУ СУДОВИХ ЗАСІДАНЬ --- */
.hearings-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
    height: 400px; /* Фіксована висота для відповідності блоку завдань */
    display: flex;
    flex-direction: column;
}

/* Заголовок секції */
.hearings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
    flex-shrink: 0;
    height: 60px;
}

.hearings-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.hearings-title i {
    color: var(--primary-color);
    font-size: 1rem;
}

.btn-add-hearing {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-add-hearing:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.btn-add-hearing i {
    font-size: 0.875rem;
}

/* Основний контент */
.hearings-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Горизонтальний layout для десктопу */
.hearings-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.hearings-sidebar {
    flex: 0 0 320px;
    min-width: 0;
}

.hearings-main {
    flex: 1;
    min-width: 0;
}

/* Порожній стан */
.hearings-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.hearings-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.hearings-empty h6 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.hearings-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* Наступне засідання */
.next-hearing {
    padding: 0.625rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-light);
    height: 100%;
    display: flex;
    align-items: center;
}

.next-hearing.empty {
    background: var(--bg-tertiary);
    opacity: 0.7;
}

.next-hearing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.125rem;
    width: 100%;
    color: var(--text-primary);
}

.next-hearing-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.0625rem;
}

.date-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.date-month {
    font-size: 0.8rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.date-year {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.125rem;
}



.next-hearing-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.next-hearing-time i {
    font-size: 0.75rem;
    color: var(--text-primary);
}

.next-hearing-court {
    font-size: 0.75rem !important;
    color: var(--text-primary) !important;
    line-height: 1.2;
    margin: 0;
    padding: 0;
}

.next-hearing-judge {
    font-size: 0.75rem !important;
    color: var(--text-primary) !important;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    font-style: normal !important;
}

.day-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.time {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: var(--border-radius-pill);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(0,0,0,0.06);
    color: var(--text-primary);
}

.status-badge.urgent {
    background: rgba(255, 193, 7, 0.15);
    color: #8a6d00;
}

.status-badge.overdue {
    background: rgba(220, 53, 69, 0.12);
    color: #842029;
}

.next-hearing-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}





.next-hearing-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.0625rem;
}

.action-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.action-link:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    text-decoration: none;
}

.action-link i {
    font-size: 0.875rem;
}

/* Список засідань */
.hearings-list {
    border-top: none;
    padding-top: 0;
}

.hearings-list-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hearings-list-header {
    margin-bottom: 1rem;
}

.hearings-info-message {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    margin: 1rem 0;
    min-height: 200px;
}

.hearings-info-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
    max-width: 400px;
}

.hearings-info-content i {
    font-size: 1.5rem;
    color: var(--text-muted);
    flex-shrink: 0;
    opacity: 0.6;
}

.hearings-info-text {
    flex: 1;
}

.hearings-info-title {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.hearings-info-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    opacity: 0.8;
}

.hearings-list-header h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    font-size: 0.9rem;
}

.hearing-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    border: 1px solid transparent;
    margin-bottom: 0.5rem;
    flex: 0 0 calc(50% - 0.25rem);
}

.hearing-item:hover {
    background: var(--bg-secondary);
    border-color: var(--border-light);
}

.hearing-item.collapsible-item {
    display: none;
}

.hearings-list-items.is-expanded .hearing-item.collapsible-item {
    display: flex;
}

.hearing-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 40px;
}

.hearing-day {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.hearing-month {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.hearing-year {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.125rem;
}

.hearing-content {
    flex: 1;
    min-width: 0;
}

.hearing-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.hearing-time {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.hearing-day-name {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.hearing-details {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.hearing-court {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.hearing-judge {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.hearing-result {
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: space-between;
}

.result-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255, 193, 7, 0.15);
    color: #8a6d00;
    border-radius: var(--border-radius-pill);
    font-size: 0.7rem;
    font-weight: 600;
}

.result-badge i {
    font-size: 0.75rem;
}

.hearing-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.hearing-actions .action-link {
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.hearing-actions .action-link span {
    display: inline;
}

/* Кнопка "Показати всі" */
.hearings-more {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.view-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    margin-top: 0.5rem;
}

.view-more-link:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.view-more-link i {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.view-more-link:hover i {
    transform: translateY(1px);
}

.hearings-more {
    text-align: center;
    margin-top: 0.5rem;
}

/* Стилі для бічної панелі (наступне засідання) */
/* next-hearing minimal panel */
.next-hearing-panel {
    border: 1px solid var(--border-dark);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    padding: 8px 12px;
}

.nh-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 6px;
}
.nh-title i { color: var(--primary-color); }

.nh-row { display: flex; gap: 10px; align-items: center; }
.nh-date { width: 48px; text-align: center; }
.nh-day { font-size: 1.25rem; font-weight: 700; line-height: 1.1; color: var(--text-primary); }
.nh-month { font-size: 0.68rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: .6px; }
.nh-meta-wrap { flex: 1; min-width: 0; }
.nh-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.nh-chip { background: var(--bg-accent); color: var(--text-secondary); border-radius: var(--border-radius-pill); padding: 2px 8px; font-size: .72rem; font-weight: 600; }
.nh-time { font-weight: 700; color: var(--text-primary); font-size: .9rem; }
.nh-court { color: var(--text-secondary); font-size: .9rem; margin-bottom: 0; }
.nh-judge { color: var(--text-muted); font-size: .85rem; }
.nh-foot { display: flex; gap: 10px; align-items: center; margin-top: 2px; }
.nh-link { color: var(--primary-color); text-decoration: none; font-weight: 600; font-size: .85rem; }
.nh-link:hover { text-decoration: underline; }

/* Стилі для наступного засідання */
.next-hearing-info {
    text-align: left;
    margin-bottom: 1rem;
}

.next-hearing-header {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    align-items: center;
}

.next-hearing-meta {
    display: flex;
    gap: 10px;
    align-items: baseline;
    flex-wrap: wrap;
}

.next-hearing-date {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-family: var(--font-display);
    line-height: 1;
}

.next-hearing-day {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: capitalize;
}

.next-hearing-time {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.next-hearing-month {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.next-hearing-court {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.next-hearing-judge {
    font-size: 0.875rem;
    color: var(--text-light);
    font-style: italic;
}

.next-hearing-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 0.25rem;
    padding: 0.2rem 0.6rem;
    background: rgba(0,0,0,0.06); /* нейтральний by default */
    color: var(--text-secondary);
    border-radius: var(--border-radius-pill);
    font-weight: 600;
    font-size: 0.72rem;
    line-height: 1;
}

.next-hearing-status.urgent {
    background: rgba(255, 193, 7, 0.18);
    color: #8a6d00;
}

.next-hearing-status.overdue {
    background: rgba(220, 53, 69, 0.14);
    color: #842029;
}



/* Адаптивність для мобільних пристроїв */
@media (max-width: 768px) {
    .hearings-header {
        padding: 0.75rem 1rem;
    }
    
    .hearings-title {
        font-size: 0.9rem;
    }
    
    .hearings-content {
        padding: 0.75rem;
    }
    
    .hearings-layout {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hearings-sidebar {
        flex: none;
        width: 100%;
    }
    
    .hearings-main {
        flex: none;
        width: 100%;
    }
    
    .hearing-item {
        flex: 0 0 100%;
    }
    
    .hearings-list-items {
        flex-direction: column;
    }
    
    .hearings-info-message {
        padding: 1.5rem 0.75rem;
    }
    
    .hearings-info-content {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .hearings-info-content i {
        font-size: 1.5rem;
    }
    
    .next-hearing {
        height: auto;
        min-height: 200px;
    }
    
    .next-hearing-content {
        padding: 1rem 0;
    }
    
    .next-hearing {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.875rem;
    }
    
    .next-hearing-main {
        gap: 0.75rem;
    }
    
    .next-hearing-date {
        min-width: 40px;
    }
    
    .date-number {
        font-size: 1.25rem;
    }
    
    .next-hearing-meta {
        gap: 0.5rem;
    }
    
    .day-name,
    .time {
        font-size: 0.85rem;
    }
    
    .status-badge {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }
    
    .hearing-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .hearing-date {
        min-width: 36px;
    }
    
    .hearing-day {
        font-size: 1.125rem;
    }
    
    .hearing-meta {
        gap: 0.5rem;
    }
    
    .hearing-time {
        font-size: 0.8rem;
    }
    
    .hearing-day-name {
        font-size: 0.75rem;
    }
    
    .hearing-actions {
        justify-content: flex-end;
    }
    
    .hearing-actions .action-link {
        padding: 0.5rem 0.75rem;
    }
    
    .hearing-actions .action-link span {
        display: inline;
    }
}





/* Темна тема */
body[data-theme="dark"] .hearings-section {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body[data-theme="dark"] .hearings-header {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body[data-theme="dark"] .next-hearing {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body[data-theme="dark"] .next-hearing.empty {
    background: var(--bg-secondary);
}

body[data-theme="dark"] .hearing-item:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-color);
}

body[data-theme="dark"] .hearings-list {
    border-color: var(--border-color);
}

body[data-theme="dark"] .hearings-more {
    border-color: var(--border-color);
}

body[data-theme="dark"] .status-badge {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body[data-theme="dark"] .result-badge {
    background: rgba(255, 193, 7, 0.2);
    color: #ffd54f;
}



/* ... existing code ... */


/* Анімації для сповіщень */


.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: 2px solid var(--bs-body-bg);
}

.notification-badge.critical {
    background: #dc3545;
    animation: pulse 1s infinite;
}


.bell-icon.has-notifications {
    animation: bellRing 1s ease-in-out infinite;
}

.bell-icon.soft {
    animation: bellSoft 2s ease-in-out infinite;
}

/* Desktop notification styles */
.notification-permission-panel {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
}

.notification-permission-panel .btn {
    margin-top: 10px;
}

/* Анімації для сповіщень */
@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    10% { transform: rotate(15deg); }
    20% { transform: rotate(-15deg); }
    30% { transform: rotate(15deg); }
    40% { transform: rotate(-15deg); }
    50% { transform: rotate(10deg); }
    60% { transform: rotate(-10deg); }
    70% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
    90% { transform: rotate(2deg); }
}

@keyframes bellSoft {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(8deg); }
    75% { transform: rotate(-8deg); }
}

.bell-icon.has-notifications {
    animation: bellRing 1s ease-in-out infinite;
}

.bell-icon.soft {
    animation: bellSoft 2s ease-in-out infinite;
}

.notification-badge.critical {
    background: #dc3545;
    animation: pulse 0.8s infinite;
}


@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Компактне модальне вікно створення завдання */
#taskModal .modal-dialog {
    max-width: 600px;
}

#taskModal .modal-content {
    font-size: 13px; /* Зменшено з 15px на 2 пункти */
}

#taskModal .modal-header {
    padding: 0.75rem 1rem;
}

#taskModal .modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

#taskModal .modal-body {
    padding: 0;
}

#taskModal .tab-content {
    padding: 1rem;
}

#taskModal .form-label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

#taskModal .form-control,
#taskModal .form-select {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
    min-height: 36px;
}

#taskModal .btn {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
}

#taskModal .nav-pills-modal .nav-link {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

#taskModal .badge {
    font-size: 0.7rem;
}

#taskModal .alert {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
}

#taskModal .alert h6 {
    font-size: 0.9rem;
}

#taskModal .alert p {
    font-size: 0.75rem;
}

#taskModal .btn-group .btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

#taskModal .modal-footer {
    padding: 0.75rem 1rem;
}

#taskModal .form-text {
    font-size: 0.75rem;
}

#taskModal textarea.form-control {
    min-height: 60px;
}

#taskModal .row.gx-3 {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

#taskModal .row.gx-3 > [class*="col-"] {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Стилі для полів тільки для читання в модальному вікні завдання */
#taskModal .form-control-plaintext {
    background-color: transparent;
    border: none;
    padding: 0.375rem 0;
    color: var(--text-primary);
    font-weight: 500;
}

#taskModal .form-control-plaintext:focus {
    outline: none;
    box-shadow: none;
}

#taskModal select.form-control-plaintext {
    background-image: none;
    cursor: default;
}

#taskModal textarea.form-control-plaintext {
    resize: none;
    min-height: auto;
}

/* Додаткові стилі для кращого відображення в режимі перегляду */
#taskModal .form-control-plaintext[readonly] {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius-sm);
    padding: 0.375rem 0.75rem;
}

#taskModal .form-control-plaintext:not([readonly]) {
    background-color: transparent;
    border: none;
    padding: 0.375rem 0;
}

#taskModal .form-label {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

/* Стилі для заголовка в режимі перегляду */
#taskModal .modal-title i.bi-eye {
    color: var(--primary-color);
}

#taskModal .modal-title i.bi-pencil {
    color: var(--warning-color);
}

/* Стилі для режиму перегляду завдання */
.task-view-container {
    padding: 0;
    max-width: 100%;
}

/* Заголовок завдання */
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.task-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
    flex: 1;
    padding-right: 1rem;
}

.task-status-indicator {
    flex-shrink: 0;
}

/* Сітка мета-інформації */
.task-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.task-meta-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.task-meta-item:hover {
    border-color: var(--primary-color);
}

.task-meta-content {
    flex: 1;
    min-width: 0;
}

.task-meta-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.125rem;
}

.task-meta-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Секції */
.task-section {
    margin-bottom: 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.task-section-header {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.task-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.task-section-content {
    padding: 1rem;
}

/* Опис завдання */
.task-description-text {
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 0.85rem;
    margin: 0;
}

/* Зв'язки */
.task-connections-grid {
    display: grid;
    gap: 0.5rem;
}

.task-connection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    border-left: 2px solid var(--primary-color);
    transition: all var(--transition-fast);
}

.task-connection-item:hover {
    background-color: var(--primary-light);
}

.task-connection-label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.task-connection-value {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.8rem;
    text-align: right;
    max-width: 60%;
}

/* Адаптивність для мобільних пристроїв */
@media (max-width: 768px) {
    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .task-title {
        font-size: 1.125rem;
        padding-right: 0;
    }
    
    .task-meta-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .task-meta-item {
        padding: 0.625rem;
    }
    
    .task-section-header {
        padding: 0.625rem 0.875rem;
    }
    
    .task-section-content {
        padding: 0.875rem;
    }
    
    .task-connection-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
    
    .task-connection-value {
        text-align: left;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .task-title {
        font-size: 1rem;
    }
    
    .task-meta-item {
        padding: 0.5rem;
    }
    
    .task-meta-label {
        font-size: 0.65rem;
    }
    
    .task-meta-value {
        font-size: 0.8rem;
    }
    
    .task-section-header {
        padding: 0.5rem 0.75rem;
    }
    
    .task-section-content {
        padding: 0.75rem;
    }
}

/* Стилі для бейджа статусу в режимі перегляду */
.task-status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid currentColor;
    opacity: 0.7;
}

/* Стилі для кнопки "Редагувати" в режимі перегляду */
#taskModal .modal-footer .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 500;
    transition: all var(--transition-fast);
}

#taskModal .modal-footer .btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-sm);
}

/* Стилі для активних полів у вкладках Файли та Коментарі */
#taskModal #task-files-pane .form-control,
#taskModal #task-files-pane .form-select,
#taskModal #task-comments-pane .form-control,
#taskModal #task-comments-pane .form-select {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
}

#taskModal #task-files-pane .form-control:focus,
#taskModal #task-files-pane .form-select:focus,
#taskModal #task-comments-pane .form-control:focus,
#taskModal #task-comments-pane .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

#taskModal #task-files-pane .btn,
#taskModal #task-comments-pane .btn {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
}

/* Стилі для кнопки "Попередні засідання" */
.previous-hearings-button {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.previous-hearings-button .btn {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
}

.previous-hearings-button .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Темна тема для кнопки "Попередні засідання" */
body[data-theme="dark"] .previous-hearings-button {
    border-top-color: var(--border-medium);
}

body[data-theme="dark"] .previous-hearings-button .btn:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Стилі для карток попередніх засідань */
.previous-hearings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.hearing-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.hearing-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Рядки картки */
.hearing-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.hearing-card-row:last-child {
    margin-bottom: 0;
}

/* Перший рядок: Дата, час, бейдж */
.hearing-date-time {
    display: flex;
    align-items: center;
}

.hearing-date-time-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.hearing-status {
    display: flex;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-pill);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

.status-badge.completed {
    background: #198754;
    color: white;
    border-color: #198754;
}

.status-badge.pending {
    background: #ffc107;
    color: #212529;
    border-color: #ffc107;
}

.status-badge.scheduled {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

.status-badge i {
    font-size: 0.75rem;
}

/* Другий рядок: Суд */
.hearing-court {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    width: 100%;
}

.hearing-court i {
    color: var(--text-muted);
    font-size: 0.7rem;
    width: 14px;
    text-align: center;
}

.hearing-court span {
    font-weight: 500;
}

/* Третій рядок: Суддя */
.hearing-judge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    width: 100%;
}

.hearing-judge i {
    color: var(--text-muted);
    font-size: 0.7rem;
    width: 14px;
    text-align: center;
}

.hearing-judge span {
    font-weight: 500;
}

/* Четвертий рядок: Кнопки */
.hearing-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
}

.hearing-actions .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    justify-content: center;
}

.hearing-actions .btn:hover {
    /* Анімація підйому прибрана */
}

.empty-hearings-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-hearings-content {
    max-width: 400px;
}

.empty-hearings-content i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-hearings-content h6 {
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-hearings-content p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

/* Темна тема для карток засідань */
body[data-theme="dark"] .hearing-card {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
}

body[data-theme="dark"] .hearing-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .hearing-date-badge {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

body[data-theme="dark"] .hearing-time-info {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

body[data-theme="dark"] .hearing-result {
    background: var(--bg-secondary);
}

body[data-theme="dark"] .hearing-card-actions {
    border-top-color: var(--border-medium);
}

/* Адаптивність для карток */
@media (max-width: 768px) {
    .previous-hearings-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        max-height: 300px;
    }
    
    .hearing-card {
        padding: 0.75rem;
    }
    
    .hearing-card-row {
        margin-bottom: 0.5rem;
    }
    
    .hearing-date-time-text {
        font-size: 0.8rem;
    }
    
    .hearing-court,
    .hearing-judge {
        font-size: 0.7rem;
    }
    
    .hearing-court i,
    .hearing-judge i {
        font-size: 0.65rem;
        width: 12px;
    }
    
    .hearing-actions {
        flex-direction: column;
        gap: 0.375rem;
    }
    
    .hearing-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Стилі для скроллбару в сітці засідань */
.previous-hearings-grid::-webkit-scrollbar {
    width: 6px;
}

.previous-hearings-grid::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.previous-hearings-grid::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.previous-hearings-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Темна тема для скроллбару */
body[data-theme="dark"] .previous-hearings-grid::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

body[data-theme="dark"] .previous-hearings-grid::-webkit-scrollbar-thumb {
    background: var(--border-medium);
}

body[data-theme="dark"] .previous-hearings-grid::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Стилі для блоку завдань */
.tasks-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 400px; /* Збільшена висота для точного відповідності */
}

.tasks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
    flex-shrink: 0; /* Запобігає стисненню */
    height: 60px; /* Фіксована висота заголовка - така ж як у судових засідань */
}

.tasks-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tasks-filters {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-filter {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-light);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 500;
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-filter:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.btn-filter.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-filter i {
    font-size: 0.7rem;
}

.tasks-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.tasks-title i {
    color: var(--primary-color);
    font-size: 1rem;
}

.btn-add-task {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-add-task:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.btn-add-task i {
    font-size: 0.875rem;
}

.btn-add-time {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--info-color);
    color: white;
    border-radius: var(--border-radius);
    transition: var(--transition-fast);
    cursor: pointer;
}

.btn-add-time:hover {
    background: var(--info-hover);
    transform: scale(1.05);
}

.btn-add-time i {
    font-size: 0.875rem;
}

.btn-add-time-task {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid #ffc107;
    background: #ffc107;
    color: #212529;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 1;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.btn-add-time-task:hover {
    background: #e0a800;
    color: #212529;
    border-color: #e0a800;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 193, 7, 0.3);
}

.btn-add-time-task:active {
    background: #d39e00;
    color: #212529;
    border-color: #d39e00;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.2);
}

.btn-add-time-task i {
    font-size: 0.9rem;
}

.tasks-content {
    padding: 0.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Важливо для правильного розподілу простору */
    overflow: hidden; /* Запобігає переповненню */
    max-height: calc(400px - 60px); /* Висота блоку мінус заголовок (60px) */
}

.tasks-progress-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-light);
    flex-shrink: 0; /* Запобігає стисненню */
    height: 40px; /* Фіксована висота прогрес-бару */
}

.tasks-progress {
    flex: 1;
    height: 8px;
}

.tasks-stats {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.tasks-completed {
    color: var(--success-color);
}

.tasks-separator {
    color: var(--text-muted);
}

.tasks-total {
    color: var(--text-secondary);
}

.tasks-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    min-height: 0; /* Важливо для правильного розподілу простору */
    max-height: calc(400px - 100px); /* Висота блоку мінус заголовок (60px) та прогрес-бар (40px) */
}

.task-item {
    padding: 0.15rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid #dee2e6;
    transition: var(--transition-fast);
    user-select: none;
    display: flex !important;
    align-items: center;
    gap: 0;
}

.task-content {
    flex: 1;
    cursor: pointer;
    padding-right: 0.75rem;
}

.task-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex-shrink: 0;
    min-width: 32px;
    padding-left: 0.5rem;
}

.task-item:last-child {
    border-bottom: none;
}

/* Відступи для підзавдань */
.task-item[style*="margin-left"] {
    margin-left: 1.5rem;
}

/* Альтернативний спосіб для відступів підзавдань */
.task-item .task-name .task-indent-icon {
    margin-right: 0.5rem;
}

/* Додатковий відступ для підзавдань через CSS */
.task-item.subtask-level-1 {
    margin-left: 1.5rem;
}

.task-item.subtask-level-2 {
    margin-left: 3rem;
}

.task-item.subtask-level-3 {
    margin-left: 4.5rem;
}

.task-item:hover {
    border-bottom-color: var(--primary-color);
    background: var(--bg-secondary);
    transform: translateX(2px);
}

.task-item.task-overdue {
    border-bottom-color: var(--danger-color);
}

.task-item.task-completed {
    border-bottom-color: var(--success-color);
}

.task-item.task-completed .task-name span {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-item.task-completed .task-meta {
    color: var(--text-muted);
}

.task-item.task-pending-review {
    border-bottom-color: var(--warning-color);
}



/* Класи для фільтрації завдань */
.task-item.task-hidden {
    display: none !important;
}

.task-item.task-visible {
    display: flex !important;
}

.task-content {
    min-width: 0;
}

.task-main-row {
    margin-bottom: 0.1rem;
}

.task-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 0;
    font-size: 0.9rem;
}

.task-name span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-indent-icon {
    font-size: 0.65rem;
    color: var(--text-muted);
    width: 12px;
    text-align: center;
}

/* Стилі для бейджа статусу (тепер в task-meta-left) */
.task-status {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.task-status .status-badge {
    font-size: 0.5rem;
    padding: 0.08rem 0.25rem;
    border-radius: var(--border-radius-pill);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.1px;
    white-space: nowrap;
}

/* Іконки прапорців пріоритету */
.priority-flag {
    font-size: 0.7rem;
    flex-shrink: 0;
    margin-right: 0.25rem;
}

.priority-flag.priority-high {
    color: #dc3545;
}

.priority-flag.priority-medium {
    color: #ffc107;
}

.priority-flag.priority-low {
    color: #0dcaf0;
}

/* Уніфіковані стилі для бейджів статусу */
.task-status .status-badge.bg-success {
    background: #198754 !important;
    color: white !important;
    border: 1px solid #198754;
}

.task-status .status-badge.bg-primary {
    background: #0d6efd !important;
    color: white !important;
    border: 1px solid #0d6efd;
}

.task-status .status-badge.bg-danger {
    background: #dc3545 !important;
    color: white !important;
    border: 1px solid #dc3545;
}

.task-status .status-badge.bg-warning {
    background: #ffc107 !important;
    color: #212529 !important;
    border: 1px solid #ffc107;
}

.task-status .status-badge.bg-info {
    background: #0dcaf0 !important;
    color: white !important;
    border: 1px solid #0dcaf0;
}

.task-status .status-badge.bg-dark {
    background: #212529 !important;
    color: white !important;
    border: 1px solid #212529;
}

.task-status .status-badge.bg-secondary {
    background: #6c757d !important;
    color: white !important;
    border: 1px solid #6c757d;
}

.task-status .status-badge.bg-light {
    background: #f8f9fa !important;
    color: #212529 !important;
    border: 1px solid #dee2e6;
}

/* Видалено - тепер використовуються кольорові прапорці */

.task-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.task-meta-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
}

.task-priority {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.task-assigned,
.task-due-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.task-priority i {
    font-size: 0.7rem;
}

.task-assigned i,
.task-due-date i {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.task-due-date.overdue {
    color: var(--danger-color);
}

.overdue-label {
    color: #dc3545;
    font-weight: 700;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 0.5rem;
}

/* Видалено - тепер використовується task-badges */

.tasks-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.tasks-empty i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.tasks-empty h6 {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.tasks-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* Стилі для скроллбару в списку завдань */
.tasks-list::-webkit-scrollbar {
    width: 6px;
}

.tasks-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.tasks-list::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.tasks-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Темна тема для блоку завдань */
body[data-theme="dark"] .tasks-section {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
}

body[data-theme="dark"] .tasks-progress-section {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

body[data-theme="dark"] .task-item {
    border-bottom-color: var(--border-medium);
}

body[data-theme="dark"] .task-item:hover {
    border-bottom-color: var(--primary-color);
    background: var(--bg-secondary);
    transform: translateX(2px);
}

body[data-theme="dark"] .tasks-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

body[data-theme="dark"] .tasks-list::-webkit-scrollbar-thumb {
    background: var(--border-medium);
}

body[data-theme="dark"] .tasks-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Стилі для прокрутки нотаток */
.notes-scrollable {
    max-height: calc(400px - 120px); /* Висота блоку мінус заголовок (60px) та summary (60px) */
    overflow-y: auto;
}

.notes-scrollable::-webkit-scrollbar {
    width: 6px;
}

.notes-scrollable::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.notes-scrollable::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.notes-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Темна тема для прокрутки нотаток */
body[data-theme="dark"] .notes-scrollable::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

body[data-theme="dark"] .notes-scrollable::-webkit-scrollbar-thumb {
    background: var(--border-medium);
}

body[data-theme="dark"] .notes-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Стилі для прокрутки витрат часу */
.time-scrollable {
    max-height: calc(400px - 120px); /* Висота блоку мінус заголовок (60px) та summary (60px) */
    overflow-y: auto;
}

.time-scrollable::-webkit-scrollbar {
    width: 6px;
}

.time-scrollable::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.time-scrollable::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.time-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Темна тема для прокрутки витрат часу */
body[data-theme="dark"] .time-scrollable::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

body[data-theme="dark"] .time-scrollable::-webkit-scrollbar-thumb {
    background: var(--border-medium);
}

body[data-theme="dark"] .time-scrollable::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Стилі для summary блоків */
.time-summary,
.notes-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 1rem;
}

.time-label,
.notes-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.time-total,
.notes-total {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Стилі для клікабельних рядків нотаток */
.note-item-clickable {
    cursor: pointer;
    transition: var(--transition-fast);
}

.note-item-clickable:hover {
    background: var(--bg-secondary);
    transform: translateX(2px);
    border-bottom-color: var(--primary-color);
}

.note-item-clickable .note-title {
    color: var(--text-primary);
    font-weight: 500;
}

.note-item-clickable:hover .note-title {
    color: var(--primary-color);
}
