/* --- ОСНОВНЫЕ ПЕРЕМЕННЫЕ --- */
:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --secondary: #4cc9f0;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #ff9e00;
    --info: #3498db;
    --light: #f8f9fa;
    --dark: #343a40;
    --primary-rgb: 67, 97, 238;
    --success-rgb: 76, 201, 240;
    --danger-rgb: 247, 37, 133;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --gradient-success: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    --card-shadow: 0 5px 20px rgba(0,0,0,0.08);
    --light-bg: #f8f9fa;
    --header-height: 56px;
}

/* --- ОСНОВНОЙ СТИЛЬ ТЕЛА --- */
body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
    padding-top: 0 !important;
}

/* --- СТРУКТУРА ОБОЛОЧКИ --- */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- БОКОВАЯ ПАНЕЛЬ (САЙДБАР) --- */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg, #212529 0%, #343a40 100%);
    height: 100vh; /* Фиксируем высоту на весь экран */
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    overflow: hidden; /* Скрываем общий скролл, скроллить будем только меню */
    display: flex;
    flex-direction: column;
}

/* Область прокрутки меню */
.sidebar-menu-content {
    flex-grow: 1; /* Занимает все доступное место */
    overflow-y: auto; /* Вертикальная прокрутка */
    overflow-x: hidden;
    padding-bottom: 20px;
}

/* Стилизация скроллбара для меню (Webkit) */
.sidebar-menu-content::-webkit-scrollbar {
    width: 5px;
}
.sidebar-menu-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}
.sidebar-menu-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}
.sidebar-menu-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.sidebar .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, .7);
    padding: 0.8rem 1.5rem;
    border-radius: 0;
    margin-bottom: 0;
    border-left: 4px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, .05);
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(67, 97, 238, 0.1);
    border-left-color: var(--primary);
}

.sidebar .nav-link i {
    margin-right: 12px;
    font-size: 1.2rem;
    vertical-align: text-bottom;
}

.sidebar-brand-wrapper {
    padding: 1.5rem 1rem;
    background: rgba(0,0,0,0.1);
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 0; /* Убрали отступ, он будет внутри скролла если нужно */
    flex-shrink: 0; /* Запрещаем сжимать логотип */
}

.sidebar-brand-wrapper img {
    height: 50px;
    width: auto;
    margin-bottom: 10px;
}

.sidebar-brand-text {
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    display: block;
}

.sidebar-footer {
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.05);
    width: 100%;
    flex-shrink: 0; /* Запрещаем сжимать подвал */
    margin-top: auto;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-profile-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* --- ОСНОВНОЙ КОНТЕНТ --- */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 20px;
    min-height: 100vh;
    background-color: #f8f9fa;
    transition: margin-left 0.3s ease;
}

/* --- МОБИЛЬНОЕ МЕНЮ --- */
.navbar-mobile {
    background: var(--gradient-primary);
    z-index: 101;
    height: var(--header-height);
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

/* АНИМАЦИИ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

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

.pulse {
    animation: pulse 2s infinite;
}

/* КАРТОЧКИ */
.custom-card {
    border: none;
    border-radius: 15px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.custom-card:hover {
    box-shadow: 0 15px 35px rgba(67, 97, 238, 0.15);
    transform: translateY(-5px);
}

.custom-card .card-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 1rem 1.5rem;
    border: none;
}

/* КНОПКИ */
.btn-gradient {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
}

.btn-outline-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                var(--gradient-primary) border-box;
    color: var(--primary);
    transition: all 0.3s ease;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-weight: 600;
}

.btn-outline-gradient:hover {
    background: var(--gradient-primary);
    color: white;
}

/* ПОЛЯ ВВОДА */
.custom-input {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.custom-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

/* ТАБЛИЦЫ */
.custom-table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    width: 100%;
}

.custom-table thead th {
    background: var(--light);
    border: none;
    padding: 1rem;
    font-weight: 600;
    color: var(--dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.custom-table tbody td {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

.custom-table tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

/* СТАТУСЫ */
.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-active {
    background-color: rgba(46, 204, 113, 0.1);
    color: var(--success);
}

.status-warning {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning);
}

.status-danger {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}

.status-info {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--info);
}

/* ПАГИНАЦИЯ */
.pagination .page-link {
    border: none;
    color: var(--primary);
    margin: 0 5px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    color: white;
}

/* МОДАЛЬНЫЕ ОКНА */
.custom-modal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.custom-modal .modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 20px 20px 0 0 !important;
    border: none;
}

/* ОБЩИЙ СКРОЛЛБАР */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

/* СОРТИРОВКА ТАБЛИЦ */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px !important;
}

.sortable-header:hover {
    background-color: rgba(0,0,0,0.05);
}

.sort-icon {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.sort-icon.active {
    opacity: 1;
    color: var(--primary);
}

.column-toggle-btn {
    border-radius: 20px;
    padding: 5px 15px;
    margin: 2px;
}

.column-toggle-btn.active {
    background-color: var(--primary) !important;
    color: white !important;
}

.hidden-column {
    display: none !important;
}

.date-status {
    font-size: 0.85em;
    font-weight: 500;
}

.status-expired {
    color: #dc3545;
}

.status-warning-text {
    color: #ffc107;
}

.status-ok {
    color: #198754;
}

.no-data {
    color: #6c757d;
    font-style: italic;
}

.date-simple {
    font-size: 0.85em;
    font-weight: 500;
}

/* УВЕДОМЛЕНИЯ */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

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

.notification-error {
    background-color: var(--danger);
    color: white;
}

.notification-warning {
    background-color: var(--warning);
    color: white;
}

/* СТАТИСТИКА */
.stat-card {
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-card.bg-danger {
    background-color: #dc3545 !important;
}

.stat-card.bg-warning {
    background-color: #ffc107 !important;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-right: 15px;
}

.stat-icon.employees {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.125) 0%, rgb(var(--primary-rgb)) 100%);
    color: rgb(var(--primary-rgb));
}

.stat-icon.training {
    background: linear-gradient(135deg, rgba(var(--success-rgb), 0.125) 0%, rgb(var(--success-rgb)) 100%);
    color: rgb(var(--success-rgb));
}

.stat-icon.medical {
    background: linear-gradient(135deg, rgba(var(--danger-rgb), 0.125) 0%, rgb(var(--danger-rgb)) 100%);
    color: rgb(var(--danger-rgb));
}

.user-badge {
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 5px 15px;
    backdrop-filter: blur(10px);
}

/* ПРОЧЕЕ */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.alert {
    border-radius: 10px;
    border: none;
}

.input-group-text {
    border-radius: 10px 0 0 10px;
}

.form-select {
    border-radius: 0 10px 10px 0;
}

.main-content h1, .main-content h2, .main-content h3, .main-content h4, .main-content h5, .main-content h6 {
    color: var(--primary);
    font-weight: 600;
}

.btn-group .btn {
    border-radius: 8px;
    margin: 0 2px;
}

.border-bottom {
    border-color: rgba(0,0,0,0.1) !important;
    padding-bottom: 1rem;
}

/* АДАПТИВНОСТЬ */
@media (max-width: 991.98px) {
    .wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1040;
        height: 100vh;
        width: 250px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 80px 15px 15px 15px; 
    }
    
    .navbar-mobile {
        display: flex;
    }
    
    .notification {
        top: 70px;
        left: 15px;
        right: 15px;
        width: auto;
    }
}

@media (min-width: 992px) {
    .main-content {
        margin-left: 250px;
    }
}

@media (max-width: 768px) {
    .custom-table {
        font-size: 0.8rem;
    }
    
    .custom-table thead th,
    .custom-table tbody td {
        padding: 0.5rem;
    }
    
    .btn-gradient {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .custom-card {
        padding: 1rem !important;
    }
    
    .main-content {
        padding: 15px;
    }
}

footer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    margin-top: auto;
    width: 100%;
}

.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

.main-content > .container-fluid,
.main-content > .container {
    padding: 0;
}

/* Стили для таблицы компаний (дополнительно) */
.company-header-wrapper {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    border-left: 5px solid var(--primary);
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.company-header-wrapper h1 {
    font-weight: 700;
    color: var(--primary-dark);
}

#companiesTable {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

#companiesTable thead th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 1px solid #dee2e6;
    border-bottom: 2px solid var(--primary);
    color: var(--dark);
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

#companiesTable tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

#companiesTable tbody tr:hover {
    background-color: rgba(67, 97, 238, 0.05) !important;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

#companiesTable tbody tr:nth-child(even) {
    background-color: #fafafa;
}

#companiesTable tbody td {
    padding: 1rem 0.75rem;
    vertical-align: middle;
    border-top: none;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

#companiesTable .badge {
    font-weight: 500;
    padding: 0.5em 1em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#companiesTable .badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.badge.bg-primary { background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%) !important; }
.badge.bg-success { background: linear-gradient(135deg, #4cc9f0 0%, #3a0ca3 100%) !important; }
.badge.bg-info { background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%) !important; }
.badge.bg-danger { background: linear-gradient(135deg, #f72585 0%, #b5179e 100%) !important; }
.badge.bg-warning { background: linear-gradient(135deg, #ff9e00 0%, #ff6d00 100%) !important; }

.progress {
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.empty-state {
    padding: 3rem 1rem;
}

.empty-state i {
    opacity: 0.5;
}

#companySearch {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#companySearch:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
}

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

#companiesTable tbody tr {
    animation: fadeInRow 0.5s ease-out forwards;
}

#companiesTable tbody tr.selected {
    background-color: rgba(67, 97, 238, 0.1) !important;
    border-left: 3px solid var(--primary);
}
/* ==================== СТИЛИ CHAT.PHP ==================== */
.chat-container {
    height: calc(100vh - 160px);
    display: flex;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.chat-users-list {
    width: 30%;
    border-right: 1px solid #edf2f4;
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
}

.chat-main {
    width: 70%;
    display: flex;
    flex-direction: column;
}

.user-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.user-item:hover, .user-item.active {
    background: #fff;
    border-left: 4px solid var(--primary);
}

.unread-badge {
    position: absolute;
    right: 15px;
    top: 15px;
    background: #e63946;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

.last-message {
    font-size: 0.85rem;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.messages-area {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fdfdfd;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%234361ee' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.msg-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    margin-bottom: 15px;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    word-wrap: break-word;
}

.msg-out {
    background: var(--primary);
    color: #fff;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.msg-in {
    background: #e9ecef;
    color: #2b2d42;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.msg-time {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 5px;
}

.chat-footer {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #edf2f4;
}

.attachment-preview {
    font-size: 0.8rem;
    background: rgba(0,0,0,0.05);
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 5px;
}

.file-icon {
    font-size: 1.2rem;
    margin-right: 5px;
}

.typing-indicator {
    font-size: 0.85rem;
    color: #6c757d;
    padding: 5px 15px;
    font-style: italic;
}

.search-box {
    border-radius: 20px;
    border: 1px solid #dee2e6;
    padding-left: 15px;
}

.search-box:focus {
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    border-color: var(--primary);
}

.online-indicator {
    width: 10px;
    height: 10px;
    background: #38b000;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid #fff;
}

/* Анимация для индикатора набора текста */
@keyframes typingDots {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

.typing-dots span {
    animation: typingDots 1.4s infinite;
    display: inline-block;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Стили для превью файлов в чате */
.file-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.file-preview-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    max-width: 200px;
}

.file-preview-item img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 5px;
}

/* ==================== СТИЛИ NAVIGATION.PHP ==================== */
.sidebar-brand-wrapper img {
    width: 50px;
    height: auto;
    margin-bottom: 10px;
}

.sidebar-brand-text {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
}

.sidebar-menu-content {
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu-content .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    margin: 2px 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.sidebar-menu-content .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--info);
}

.sidebar-menu-content .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(52, 152, 219, 0.2) 0%, rgba(52, 152, 219, 0.1) 100%);
    border-left-color: var(--info);
    font-weight: 500;
}

.sidebar-menu-content .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 1.1rem;
}

.sidebar-divider {
    margin: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.user-profile-btn {
    color: #fff;
    text-decoration: none;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: background 0.3s;
}

.user-profile-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Стили для раскрывающегося меню склада */
#warehouseSubmenu {
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    margin: 5px 15px;
    padding: 5px 0;
}

#warehouseSubmenu .nav-link {
    padding: 8px 15px;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    color: rgba(255, 255, 255, 0.7);
    margin: 2px 0;
}

#warehouseSubmenu .nav-link:hover,
#warehouseSubmenu .nav-link.active {
    background-color: rgba(52, 152, 219, 0.2);
    color: white;
    border-left-color: var(--info);
}

/* Анимация иконки стрелки */
.collapse-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

[aria-expanded="true"] .collapse-icon {
    transform: rotate(180deg);
}

/* Стили для активного состояния пункта склада */
.nav-link[aria-expanded="true"] {
    background-color: rgba(52, 152, 219, 0.15);
    color: white !important;
}

/* Бейдж для чата с анимацией */
#chatUnreadBadge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Анимация ripple эффекта для меню */
.nav-item .nav-link {
    position: relative;
    overflow: hidden;
}

.nav-item .nav-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.nav-item .nav-link:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Адаптивность для чата и навигации */
@media (max-width: 992px) {
    .chat-container {
        flex-direction: column;
        height: calc(100vh - 200px);
    }
    
    .chat-users-list {
        width: 100%;
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #edf2f4;
    }
    
    .chat-main {
        width: 100%;
        height: calc(100% - 200px);
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1050;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .sidebar-footer {
        position: absolute;
        bottom: 0;
        width: 100%;
    }
    
    .messages-area {
        padding: 15px;
    }
    
    .msg-bubble {
        max-width: 85%;
    }
}

@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 180px);
    }
    
    .chat-users-list {
        height: 150px;
    }
    
    .chat-main {
        height: calc(100% - 150px);
    }
    
    .user-item {
        padding: 10px 15px;
    }
    
    .msg-bubble {
        max-width: 90%;
        padding: 10px 12px;
    }
    
    .attachment-preview {
        font-size: 0.7rem;
    }
}

/* Стили для модальных окон чата */
.modal-chat-search .modal-content {
    border-radius: 15px;
}

.modal-chat-search .modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-chat-search .modal-body {
    padding: 20px;
}

/* Стили для бейджей в таблице пользователей */
.user-status-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
}

/* Стили для списка участников в модальном окне группы */
.group-members-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
}

.group-members-list::-webkit-scrollbar {
    width: 5px;
}

.group-members-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.group-members-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Стили для аватаров в чате */
.chat-avatar {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.chat-avatar-small {
    width: 35px;
    height: 35px;
}

/* Стили для времени сообщений */
.message-timestamp {
    font-size: 0.7rem;
    opacity: 0.6;
}

/* Стили для статуса доставки сообщений */
.message-status {
    font-size: 0.8rem;
    margin-left: 5px;
}

.message-status.read {
    color: var(--primary);
}

.message-status.sent {
    color: #6c757d;
}

/* Стили для пустого состояния чата */
.empty-chat-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-chat-state i {
    font-size: 4rem;
    opacity: 0.2;
    margin-bottom: 20px;
}

/* Анимация для появления новых сообщений */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.new-message {
    animation: slideInUp 0.3s ease-out;
}

/* Стили для поиска в чате */
.chat-search-container {
    position: relative;
    margin-bottom: 15px;
}

.chat-search-container .search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.chat-search-container input {
    padding-left: 40px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

/* Дополнительное правило из нового кода (фокус для поля поиска в чате) */
.chat-search-container input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* Стили для задач */
.task-priority-low { border-left: 4px solid #6c757d; }
.task-priority-medium { border-left: 4px solid #0dcaf0; }
.task-priority-high { border-left: 4px solid #ffc107; }
.task-priority-urgent { border-left: 4px solid #dc3545; }

.task-card {
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.task-status-open { background-color: #fff3cd; }
.task-status-in_progress { background-color: #cff4fc; }
.task-status-completed { background-color: #d1e7dd; }
.task-status-cancelled { background-color: #f8d7da; }

.task-deadline-overdue {
    color: #dc3545;
    font-weight: bold;
}

.task-deadline-soon {
    color: #ffc107;
    font-weight: bold;
}

.task-comments {
    max-height: 300px;
    overflow-y: auto;
}

.task-attachment {
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 5px;
}

.task-attachment:hover {
    background-color: #f8f9fa;
}

/* Стили для модального окна задачи */
.task-modal .modal-header {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .task-card .btn-group {
        flex-direction: column;
    }
    
    .task-card .btn {
        margin-bottom: 5px;
    }
}

/* ==========================================================================
   НОВЫЕ СТИЛИ: ЛЕНДИНГ (LANDING PAGE) И СТРАНИЦА ВХОДА
   ========================================================================== */

/* ---------- СТАРТОВАЯ СТРАНИЦА (LANDING PAGE) ---------- */
body.landing-page {
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
}

.landing-navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    padding: 15px 0;
}

.landing-navbar .navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-dark) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-login {
    background-color: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
    font-weight: 600;
    padding: 8px 25px;
    border-radius: 8px;
    transition: all 0.3s;
}

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

.btn-register {
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    font-weight: 600;
    padding: 8px 25px;
    border-radius: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.2);
    display: flex;
    align-items: center;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
    color: #fff;
}

.hero-section {
    background: linear-gradient(rgba(10, 20, 40, 0.75), rgba(10, 20, 40, 0.85)), url('../img/backgraund_for_enter.jpg') center center / cover no-repeat;
    padding: 140px 0 120px;
    flex: 1;
    display: flex;
    align-items: center;
    min-height: 80vh;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    line-height: 1.6;
}

.btn-primary-custom {
    background: var(--gradient-primary);
    border: none;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 15px 40px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(67, 97, 238, 0.3);
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(67, 97, 238, 0.4);
    color: #fff;
}

.features-section {
    padding: 80px 0;
    background-color: #fff;
}

.feature-card {
    padding: 30px;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    height: 100%;
    transition: transform 0.3s, border-color 0.3s;
    border: 1px solid rgba(0,0,0,0.02);
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
    display: inline-block;
    background: rgba(67, 97, 238, 0.1);
    width: 70px;
    height: 70px;
    line-height: 70px;
    text-align: center;
    border-radius: 20px;
    transition: all 0.3s;
}

.feature-card:hover .feature-icon {
    background: var(--primary);
    color: #fff;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.feature-text {
    color: #6c757d;
    line-height: 1.6;
}

.landing-footer {
    background-color: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 60px 0 20px;
    margin-top: auto;
}

.landing-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.landing-footer a:hover {
    color: #fff;
}

/* Адаптив для лендинга */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-section {
        padding: 80px 0 60px;
        text-align: center;
        min-height: auto;
    }
}

/* ---------- СТРАНИЦА ВХОДА (LOGIN PAGE) ---------- */
body.login-page {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    position: relative;
    overflow: hidden;
}

body.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/backgraund_for_enter.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(3px);
    z-index: -2;
}

body.login-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.login-page .login-container {
    max-width: 420px;
    width: 100%;
    padding: 20px;
    z-index: 1;
    animation: fadeIn 0.8s ease-out;
}

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

.login-page .login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px 35px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-page .logo-section {
    text-align: center;
    margin-bottom: 35px;
}

.login-page .logo-image {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    background: white;
    border-radius: 50%;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 3px solid #4361ee;
    animation: float 6s ease-in-out infinite;
}

.login-page .logo-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.login-page .system-name {
    color: #2c3e50;
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 5px;
    background: linear-gradient(45deg, #4361ee, #3a0ca3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.5px;
}

.login-page .system-subtitle {
    color: #7b8a8b;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.login-page .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 15px;
}

.login-page .form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.login-page .form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
    background: white;
}

.login-page .form-control::placeholder {
    color: #a0aec0;
}

.login-page .btn-login-submit {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    border: none;
    color: white;
    padding: 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-top: 10px;
    width: 100%;
    letter-spacing: 0.5px;
}

.login-page .btn-login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.4);
    background: linear-gradient(135deg, #3a0ca3 0%, #4361ee 100%);
    color: white;
}

.login-page .btn-login-submit:active {
    transform: translateY(0);
}

.login-page .alert-danger {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    color: #e74c3c;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
    font-weight: 500;
}

.login-page .input-icon {
    position: relative;
}

.login-page .input-icon i.bi-person-fill,
.login-page .input-icon i.bi-lock-fill {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #7b8a8b;
    font-size: 18px;
}

.login-page .input-icon input {
    padding-left: 50px;
}

.login-page .password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #7b8a8b;
    cursor: pointer;
}

.login-page .footer-links {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 13px;
    color: #7b8a8b;
}

.login-page .footer-links a {
    color: #4361ee;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.login-page .footer-links a:hover {
    color: #3a0ca3;
    text-decoration: underline;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@media (max-width: 576px) {
    .login-page .login-container {
        padding: 15px;
        max-width: 95%;
    }
    .login-page .login-card {
        padding: 30px 25px;
    }
    .login-page .logo-image {
        width: 100px;
        height: 100px;
        padding: 15px;
    }
    .login-page .system-name {
        font-size: 24px;
    }
}

@media (max-height: 700px) {
    body.login-page {
        align-items: flex-start;
        padding-top: 30px;
    }
    .login-page .login-container {
        margin-top: 20px;
    }
}
/* ---------- СТРАНИЦА РЕГИСТРАЦИИ ---------- */
body.register-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    position: relative;
    overflow-x: hidden;
}

body.register-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/backgraund_for_enter.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(3px);
    z-index: -2;
}

body.register-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}

.register-page .register-container {
    max-width: 550px;
    width: 100%;
    padding: 20px;
    z-index: 1;
    animation: fadeIn 0.8s ease-out;
}

.register-page .card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.register-page .card-header {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    border-radius: 20px 20px 0 0 !important;
    padding: 25px 20px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 600;
    border: none;
}

.register-page .form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.register-page .form-control:focus {
    border-color: #4361ee;
    box-shadow: 0 0 0 0.25rem rgba(67, 97, 238, 0.25);
    background: white;
}

.register-page .btn-primary {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    border: none;
    color: white;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
    letter-spacing: 0.5px;
}

.register-page .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.4);
    background: linear-gradient(135deg, #3a0ca3 0%, #4361ee 100%);
}

.register-page .alert {
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.register-page .input-group-text {
    background: #e9ecef;
    border: 2px solid #e9ecef;
    border-left: none;
    border-radius: 0 12px 12px 0;
}

.register-page .input-group .form-control {
    border-right: none;
    border-radius: 12px 0 0 12px;
}

/* Адаптивность */
@media (max-width: 576px) {
    .register-page .register-container {
        padding: 15px;
        max-width: 95%;
    }
    .register-page .card-header {
        font-size: 1.4rem;
        padding: 20px 15px;
    }
}