/* Автор: Sergey Shardico */
/* Общие стили для всех страниц MedFarm */

/* Базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Общие классы */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

/* ====================================== */
/* ЗАГОЛОВКИ СТРАНИЦ */
/* ====================================== */

.page-header {
    margin-bottom: 24px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.page-title p {
    color: #666;
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

/* ====================================== */
/* ТОНКИЕ ПОЛОСЫ ПРОКРУТКИ */
/* ====================================== */

/* Тонкие полосы прокрутки только для элементов интерфейса */

/* Специальные стили для таблиц и гридов */
.data-table-container::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.task-main-content::-webkit-scrollbar,
.task-sidebar::-webkit-scrollbar {
    width: 4px;
}

.data-table-container::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.task-main-content::-webkit-scrollbar-track,
.task-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.data-table-container::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.task-main-content::-webkit-scrollbar-thumb,
.task-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.data-table-container::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
.task-main-content::-webkit-scrollbar-thumb:hover,
.task-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Горизонтальная прокрутка для табов */
.modal-tabs::-webkit-scrollbar {
    height: 6px;
}

.modal-tabs::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.modal-tabs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.modal-tabs::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ====================================== */
/* ПРОКРУТКА В ТАБЛИЦАХ */
/* ====================================== */

/* Тонкие полосы прокрутки для содержимого ячеек таблиц */
.data-table td::-webkit-scrollbar,
.data-table th::-webkit-scrollbar,
.tasks-table td::-webkit-scrollbar,
.tasks-table th::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}

.data-table td::-webkit-scrollbar-track,
.data-table th::-webkit-scrollbar-track,
.tasks-table td::-webkit-scrollbar-track,
.tasks-table th::-webkit-scrollbar-track {
    background: transparent;
}

.data-table td::-webkit-scrollbar-thumb,
.data-table th::-webkit-scrollbar-thumb,
.tasks-table td::-webkit-scrollbar-thumb,
.tasks-table th::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 1px;
}

.data-table td::-webkit-scrollbar-thumb:hover,
.data-table th::-webkit-scrollbar-thumb:hover,
.tasks-table td::-webkit-scrollbar-thumb:hover,
.tasks-table th::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* Стили для ячеек с прокруткой */
.data-table td,
.data-table th,
.tasks-table td,
.tasks-table th {
    overflow: auto;
    max-height: 60px;
    word-wrap: break-word;
}

/* ====================================== */
/* ГОРИЗОНТАЛЬНАЯ ПРОКРУТКА БОЛЬШИХ ТАБЛИЦ */
/* ====================================== */

/* Контейнеры таблиц с горизонтальной и вертикальной прокруткой */
.data-table-container,
.tasks-table-container {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    max-height: 70vh;
}

/* Тонкие полосы прокрутки для горизонтальной и вертикальной прокрутки таблиц */
.data-table-container::-webkit-scrollbar,
.tasks-table-container::-webkit-scrollbar {
    width: 4px;
    height: 6px;
}

.data-table-container::-webkit-scrollbar-track,
.tasks-table-container::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.data-table-container::-webkit-scrollbar-thumb,
.tasks-table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.data-table-container::-webkit-scrollbar-thumb:hover,
.tasks-table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Минимальная ширина для таблиц */
.data-table,
.tasks-table {
    min-width: 800px !important;
    white-space: nowrap !important;
}

/* Ячейки таблиц с фиксированной шириной */
.data-table td,
.data-table th,
.tasks-table td,
.tasks-table th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #1976d2;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1565c0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover:not(:disabled) {
    background: #e0e0e0;
    border-color: #1976d2;
    color: #1976d2;
}

.btn-success {
    background: #4caf50;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #45a049;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #da190b;
}

.btn-warning {
    background: #ff9800;
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #f57c00;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-outline {
    background: #f5f5f5;
    border: 1px solid #ddd;
    color: #666;
    border-radius: 6px;
    font-weight: 500;
}

.btn-outline:hover {
    background: #e0e0e0;
    border-color: #1976d2;
    color: #1976d2;
}

/* Кнопки фильтров и действий */
.filter-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.filter-btn:hover {
    background: #f5f5f5;
    border-color: #1976d2;
}

.filter-btn.active {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.filter-btn .material-icons {
    font-size: 20px;
}

/* Кнопки действий в таблицах */
.table-action-btn {
    padding: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
}

.table-action-btn:hover {
    background: #e3f2fd;
}

.table-action-btn .material-icons {
    font-size: 18px;
    color: #1976d2;
}

.table-action-btn.delete:hover {
    background: #ffebee;
}

.table-action-btn.delete .material-icons {
    color: #d32f2f;
}

.table-action-btn.timer:hover {
    background: #e8f5e9;
}

.table-action-btn.timer .material-icons {
    color: #4caf50;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group label.required::after {
    content: ' *';
    color: #d32f2f;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.form-control.error {
    border-color: #d32f2f;
}

.form-control.success {
    border-color: #2e7d32;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* Расширенные стили форм из 10-tasks.css */
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* Сообщения */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.alert-error {
    background: #ffebee;
    color: #d32f2f;
    border: 1px solid #f44336;
}

.alert-warning {
    background: #fff3e0;
    color: #f57c00;
    border: 1px solid #ff9800;
}

.alert-info {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #2196f3;
}

/* Карточки */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: #f8f9fa;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
}

/* Таблицы */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    color: #333;
    border-bottom: 1px solid #e0e0e0;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.table tr:hover {
    background: #f8f9fa;
}

.table tr.selected {
    background: #e3f2fd;
}

/* Контейнер таблицы */
.data-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #f8f9fa;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.data-table th.sortable:hover {
    background: #e9ecef;
}

.data-table th .material-icons {
    font-size: 16px;
    margin-left: 4px;
    vertical-align: middle;
}

.data-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.checkbox-col {
    width: 40px;
    text-align: center;
}

.checkbox-col input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.actions-col {
    width: 140px;
    text-align: center;
}

/* Статусы */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-inactive {
    background: #ffebee;
    color: #d32f2f;
}

.status-pending {
    background: #fff3e0;
    color: #f57c00;
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 95%;
    max-width: 1600px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #666;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Кастомные мультиселекты */
.custom-multiselect {
    position: relative;
}

.multiselect-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.multiselect-header:hover {
    border-color: #1976d2;
}

.custom-multiselect.active .multiselect-header {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.multiselect-placeholder {
    font-size: 14px;
    color: #666;
}

.multiselect-header .material-icons {
    font-size: 20px;
    color: #666;
    transition: transform 0.2s ease;
}

.custom-multiselect.active .multiselect-header .material-icons {
    transform: rotate(180deg);
}

.multiselect-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    display: none;
}

.custom-multiselect.active .multiselect-dropdown {
    display: block;
}

.multiselect-options {
    overflow: visible;
}

.multiselect-option {
    padding: 0;
}

.multiselect-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin: 0;
    font-weight: 400;
}

.multiselect-option label:hover {
    background: #f5f5f5;
}

.multiselect-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.multiselect-option span {
    font-size: 14px;
    color: #333;
}

/* Поиск в мультиселекте */
.multiselect-search {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.multiselect-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
}

.multiselect-search input:focus {
    border-color: #1976d2;
}

/* Кастомный селект с поиском */
.searchable-select {
    position: relative;
}

.searchable-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.searchable-select-header:hover {
    border-color: #1976d2;
}

.searchable-select.active .searchable-select-header {
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.searchable-select.disabled .searchable-select-header {
    background: #f5f5f5;
    cursor: not-allowed;
}

.searchable-select-placeholder {
    font-size: 14px;
    color: #666;
}

.searchable-select.disabled .searchable-select-placeholder {
    color: #999;
}

.searchable-select-header .material-icons {
    font-size: 20px;
    color: #666;
    transition: transform 0.2s ease;
}

.searchable-select.active .searchable-select-header .material-icons {
    transform: rotate(180deg);
}

.searchable-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    z-index: 1000;
    display: none;
}

.searchable-select.active .searchable-select-dropdown {
    display: block;
}

.searchable-select-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.searchable-select-search .material-icons {
    font-size: 20px;
    color: #666;
}

.searchable-select-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    padding: 0;
}

.searchable-select-options {
    max-height: 240px;
    overflow-y: auto;
}

.searchable-select-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    color: #333;
}

.searchable-select-option:hover {
    background: #f5f5f5;
}

.searchable-select-option.selected {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.searchable-select-empty {
    padding: 20px 12px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Поиск и фильтры */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box .material-icons {
    position: absolute;
    left: 12px;
    color: #999;
    font-size: 18px;
}

.search-input {
    padding: 8px 12px 8px 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}

.filter-dropdown {
    position: relative;
    display: inline-block;
}

.filter-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 320px;
    max-height: 500px;
    overflow: hidden;
}

.filter-dropdown-content.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-dropdown-header span {
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

.filter-new-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.filter-new-btn:hover {
    background: #1565c0;
}

.filter-new-btn .material-icons {
    font-size: 16px;
}

.filter-list {
    padding: 8px;
}

.filter-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.filter-item:hover {
    background: #f5f5f5;
}

.filter-item:last-child {
    border-bottom: none;
}

.filter-item-info {
    flex: 1;
}

.filter-item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.filter-item-desc {
    font-size: 12px;
    color: #666;
}

.filter-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.filter-item-actions .material-icons {
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.filter-item-actions .material-icons:hover {
    background: #e0e0e0;
}

.filter-item:hover .filter-item-actions {
    opacity: 1;
}

.filter-dropdown-footer {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
}

.filter-clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: #d32f2f;
    border: 1px solid #d32f2f;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
}

.filter-clear-btn:hover {
    background: #ffebee;
}

.filter-clear-btn .material-icons {
    font-size: 18px;
}

/* Пагинация */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 1px solid #e9ecef;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-size label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.pagination-size select {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 60px;
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #1976d2;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination-page {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-page:hover {
    background: #f5f5f5;
    border-color: #1976d2;
}

.pagination-page.active {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.pagination-page.ellipsis {
    cursor: default;
    border: none;
    background: none;
}

.pagination-page.ellipsis:hover {
    background: none;
    border: none;
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-jump label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.pagination-jump input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.pagination-jump input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* Управление таблицами */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.table-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Статусы */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.status-активный {
    background: #e8f5e8;
    color: #2e7d32;
}

.status-badge.status-неактивный {
    background: #ffebee;
    color: #d32f2f;
}

.status-badge.status-ожидает {
    background: #fff3e0;
    color: #f57c00;
}

/* Загрузка */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1976d2;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====================================== */
/* ПЕРЕКЛЮЧАТЕЛИ ПРЕДСТАВЛЕНИЙ */
/* ====================================== */

.view-switcher {
    display: flex;
    gap: 8px;
    margin-left: 20px;
}

.view-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.view-link:hover {
    background: #f5f5f5;
    color: #1976d2;
}

.view-link.active {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

/* ====================================== */
/* СТАТИСТИКА И КАРТОЧКИ */
/* ====================================== */

.task-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    min-width: 140px;
    flex: 1;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-card.active {
    background: #e3f2fd;
    border-color: #1976d2;
}

.stat-card.completed .stat-number {
    color: #4caf50;
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #1976d2;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    margin-bottom: 4px;
}

.stat-detail {
    font-size: 12px;
    color: #999;
}

/* ====================================== */
/* ВКЛАДКИ */
/* ====================================== */

.clients-tabs {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow-x: auto;
}

.clients-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    color: #666;
    font-weight: 500;
    position: relative;
}

.clients-tab:hover {
    background: #f8f9fa;
    color: #1976d2;
}

.clients-tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    background: #f8f9fa;
}

.clients-tab .material-icons {
    font-size: 20px;
}

.clients-tab .tab-count {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 4px;
}

.clients-tab.active .tab-count {
    background: #1976d2;
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================================== */
/* РАСШИРЕННЫЕ СТАТУСЫ */
/* ====================================== */

.status-badge.new {
    background: #e3f2fd;
    color: #1976d2;
}

.status-badge.qualified {
    background: #fff3e0;
    color: #f57c00;
}

.status-badge.in-progress {
    background: #fff9c4;
    color: #f9a825;
}

.status-badge.converted {
    background: #e8f5e9;
    color: #388e3c;
}

.status-badge.closed {
    background: #ffebee;
    color: #d32f2f;
}

.status-badge.active {
    background: #e8f5e9;
    color: #388e3c;
}

.status-badge.inactive {
    background: #f5f5f5;
    color: #757575;
}

.status-badge.blocked {
    background: #ffebee;
    color: #d32f2f;
}

.status-badge.suspended {
    background: #fff3e0;
    color: #f57c00;
}

.priority-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.priority-high {
    background: #ffebee;
    color: #d32f2f;
}

.priority-medium {
    background: #fff3e0;
    color: #f57c00;
}

.priority-low {
    background: #e8f5e8;
    color: #388e3c;
}

/* ====================================== */
/* РАСШИРЕННЫЕ ФОРМЫ */
/* ====================================== */

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label.required::after {
    content: ' *';
    color: #d32f2f;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* ====================================== */
/* РАСШИРЕННЫЕ МОДАЛЬНЫЕ ОКНА */
/* ====================================== */

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 24px;
    overflow-x: auto;
}

.modal-tab {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.modal-tab:hover {
    color: #1976d2;
    background: #f8f9fa;
}

.modal-tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    background: #fff;
}

.modal-tab .material-icons {
    font-size: 18px;
    margin-right: 8px;
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

/* Тонкие полосы прокрутки для модальных табов */
.modal-tabs::-webkit-scrollbar {
    height: 6px;
}

.modal-tabs::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.modal-tabs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.modal-tabs::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ====================================== */
/* РАСШИРЕННЫЕ ФИЛЬТРЫ */
/* ====================================== */

.filter-modal-content {
    max-width: 800px;
    width: 90%;
}

.filter-rules-container {
    margin: 20px 0;
}

.filter-rules-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.filter-rules-header h4 {
    margin: 0;
    color: #333;
}

.filter-rule {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
    background: #f8f9fa;
}

.filter-rule:first-child {
    background: white;
    border-color: #1976d2;
}

.filter-rule-connector {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.filter-rule-connector input[type="radio"] {
    margin: 0;
}

.filter-rule-connector label {
    font-size: 12px;
    color: #666;
    cursor: pointer;
}

.filter-rule-field {
    flex: 1;
    min-width: 120px;
}

.filter-rule-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-rule-operator {
    min-width: 100px;
}

.filter-rule-operator select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-rule-value {
    flex: 1;
    min-width: 120px;
}

.filter-rule-value input,
.filter-rule-value select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-rule-actions {
    display: flex;
    gap: 4px;
}

.filter-rule-action {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s ease;
}

.filter-rule-action:hover {
    background: #f5f5f5;
    color: #333;
}

.filter-rule-action.delete:hover {
    background: #ffebee;
    color: #d32f2f;
}

.filter-settings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.modal-footer-right {
    display: flex;
    gap: 12px;
}

/* ====================================== */
/* SIDEBAR */
/* ====================================== */

.sidebar {
    width: 280px;
    background: #1976d2;
    color: white;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.header-content {
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .header-content {
    opacity: 0;
    pointer-events: none;
}

.toggle-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.toggle-btn .material-icons {
    transition: transform 0.3s ease;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .toggle-btn {
    position: absolute;
    right: 12px;
    top: 70%;
    transform: translateY(-50%);
    margin: 0;
    background: #1976d2;
}

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 4px;
}

.sidebar-header p {
    font-size: 14px;
    opacity: 0.8;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    max-height: calc(100vh - 140px);
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.sidebar-menu {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-menu {
    max-height: calc(100vh - 100px);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar.collapsed .menu-item {
    padding: 12px;
    justify-content: center;
}

.sidebar.collapsed .menu-item span:not(.material-icons) {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    left: 100%;
    background: #1976d2;
    padding: 8px 12px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
    margin-left: 8px;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .menu-item:hover span:not(.material-icons) {
    opacity: 1;
    pointer-events: auto;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left-color: white;
}

.menu-item .material-icons {
    font-size: 20px;
    margin-right: 12px;
    transition: all 0.3s ease;
}

.sidebar.collapsed .menu-item .material-icons {
    margin-right: 0;
}

.menu-item span {
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar.collapsed .sidebar-footer {
    padding: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar.collapsed .user-info {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0;
    margin-bottom: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.sidebar.collapsed .user-avatar {
    margin: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.user-details {
    flex: 1;
}

.sidebar.collapsed .user-details {
    display: none;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.user-role {
    font-size: 12px;
    opacity: 0.8;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    width: 100%;
    justify-content: center;
}

.sidebar.collapsed .logout-btn {
    width: 100%;
    justify-content: center;
    padding: 8px;
    margin: 0;
    font-size: 0;
    line-height: 0;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
}

.sidebar.collapsed .logout-btn span {
    margin: 0 !important;
    font-size: 18px;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ====================================== */
/* ACTIVITY DROPDOWN */
/* ====================================== */

.activity-dropdown {
    position: relative;
    display: inline-block;
}

.activity-btn {
    position: relative;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-btn:hover {
    background: #f5f5f5;
}

.activity-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #f44336;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.activity-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 400px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 8px;
}

.activity-dropdown-content.show {
    display: block;
}

.activity-header {
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.activity-user {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1976d2;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.activity-user-info {
    flex: 1;
}

.activity-user-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
}

.activity-user-role {
    font-size: 12px;
    color: #666;
}

.activity-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.activity-actions .material-icons {
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.activity-actions .material-icons:hover {
    background: #e0e0e0;
    color: #1976d2;
}

.mark-all-read-container {
    text-align: right;
    margin-top: 8px;
}

.mark-all-read {
    background: none;
    border: none;
    color: #1976d2;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    transition: color 0.2s ease;
}

.mark-all-read:hover {
    color: #1565c0;
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.activity-item:hover {
    background: #f8f9fa;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-content {
    flex: 1;
}

.activity-text {
    margin-bottom: 8px;
    color: #333;
    line-height: 1.4;
}

.activity-details {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #1976d2;
}

.activity-details div {
    margin-bottom: 4px;
}

.activity-details div:last-child {
    margin-bottom: 0;
}

.activity-time {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.activity-status {
    display: flex;
    align-items: center;
}

.activity-status .material-icons {
    font-size: 16px;
    color: #ccc;
    cursor: pointer;
    transition: color 0.2s ease;
}

.activity-status .material-icons:hover {
    color: #1976d2;
}

.activity-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.activity-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.activity-tag {
    display: inline-block;
    background: #1976d2;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* Стили для разных типов уведомлений */
.goal-notification {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.client-notification {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

.training-notification {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
}

/* ====================================== */
/* КАЛЕНДАРНЫЕ ВКЛАДКИ */
/* ====================================== */

.calendar-tabs {
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    overflow-x: auto;
}

.calendar-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    color: #666;
    font-weight: 500;
}

.calendar-tab:hover {
    background: #f8f9fa;
    color: #1976d2;
}

.calendar-tab.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    background: #f8f9fa;
}

.calendar-tab .material-icons {
    font-size: 18px;
}

.calendar-tab.dropdown {
    position: relative;
}

.calendar-tab.dropdown .material-icons {
    font-size: 16px;
}

/* ====================================== */
/* КАЛЕНДАРНЫЕ УПРАВЛЕНИЯ */
/* ====================================== */

.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn, .today-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #666;
}

.nav-btn:hover, .today-btn:hover {
    background: #e0e0e0;
    border-color: #1976d2;
    color: #1976d2;
}

.today-btn {
    background: #1976d2;
    color: white;
    border-color: #1976d2;
}

.today-btn:hover {
    background: #1565c0;
}

/* ====================================== */
/* ОБЩИЕ ВКЛАДКИ */
/* ====================================== */

.tabs-container {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    padding: 0 20px;
    gap: 0;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.tab-btn:hover {
    background: #f5f5f5;
    color: #1976d2;
}

.tab-btn.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    background: #f8f9ff;
}

.tab-btn .material-icons {
    font-size: 20px;
}

/* ====================================== */
/* КОНТЕНТ ВКЛАДОК */
/* ====================================== */

.tab-content {
    display: none;
    padding: 0 20px 20px;
}

.tab-content.active {
    display: block;
}

/* ====================================== */
/* ЗАГОЛОВКИ КОНТЕНТА */
/* ====================================== */

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 20px 0;
}

.content-title h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.content-title p {
    color: #666;
    font-size: 14px;
}

.content-actions {
    display: flex;
    gap: 12px;
}

/* ====================================== */
/* ФИЛЬТРЫ */
/* ====================================== */

.filters-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group input,
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

/* ====================================== */
/* СТАТИСТИКА СТАТУСОВ */
/* ====================================== */

.status-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* ====================================== */
/* ОСНОВНОЙ LAYOUT */
/* ====================================== */

.products-layout {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 280px);
    max-height: calc(100vh - 280px);
}

/* ====================================== */
/* БОКОВАЯ ПАНЕЛЬ С КАТЕГОРИЯМИ */
/* ====================================== */

.categories-sidebar {
    width: 380px;
    min-width: 380px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.categories-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1976d2;
    color: white;
}

.categories-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.categories-header .btn {
    padding: 4px 8px;
    min-width: auto;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.categories-header .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ====================================== */
/* ПЕРЕКЛЮЧАТЕЛЬ РЕЖИМОВ ПРОСМОТРА */
/* ====================================== */

.view-mode-switcher {
    display: flex;
    gap: 0;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 4px;
    margin: 12px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.view-mode-switcher::-webkit-scrollbar {
    height: 4px;
}

.view-mode-switcher::-webkit-scrollbar-track {
    background: transparent;
}

.view-mode-switcher::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.view-mode-switcher::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.view-mode-btn {
    flex-shrink: 0;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-mode-btn:hover {
    background: #e0e0e0;
    color: #1976d2;
}

.view-mode-btn.active {
    background: #1976d2;
    color: white;
}

.view-mode-btn .material-icons {
    font-size: 18px;
}

/* ====================================== */
/* ВИЗИТЫ */
/* ====================================== */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.page-actions {
    display: flex;
    gap: 10px;
}

.tabs-container {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
    top: 2px;
}

.tab-button:hover {
    color: #1976d2;
    background: #f5f5f5;
}

.tab-button.active {
    color: #1976d2;
    border-bottom-color: #1976d2;
    background: white;
}

.tab-button .material-icons {
    font-size: 20px;
}

.tab-button .tab-count {
    background: #e3f2fd;
    color: #1976d2;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 6px;
    font-weight: 600;
}

.tab-button.active .tab-count {
    background: #1976d2;
    color: white;
}

/* ====================================== */
/* ПАНЕЛЬ ФИЛЬТРОВ */
/* ====================================== */

.filters-panel {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 180px;
}

/* ====================================== */
/* ЗАКАЗЫ */
/* ====================================== */

.filters-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    overflow: hidden;
}

.filters-content {
    padding: 24px;
}

.filter-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.filter-group.full-width {
    flex: 1;
    min-width: 400px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.date-input-wrapper,
.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input,
.account-input,
.nomenclature-input {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.date-input:focus,
.account-input:focus,
.nomenclature-input:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.date-icon,
.select-arrow {
    position: absolute;
    right: 12px;
    color: #666;
    pointer-events: none;
}

.status-select {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    appearance: none;
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: #1976d2;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
}

.filter-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ====================================== */
/* SWOT-АНАЛИЗ */
/* ====================================== */

.swot-analysis {
    margin: 20px 0;
}

.swot-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.swot-section {
    padding: 15px;
    border-radius: 8px;
    border: 2px solid;
}

.swot-section h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.swot-section.strengths {
    background-color: #e8f5e8;
    border-color: #4caf50;
}

.swot-section.strengths h4 {
    color: #2e7d32;
}

.swot-section.weaknesses {
    background-color: #ffebee;
    border-color: #f44336;
}

.swot-section.weaknesses h4 {
    color: #c62828;
}

.swot-section.opportunities {
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.swot-section.opportunities h4 {
    color: #1565c0;
}

.swot-section.threats {
    background-color: #fff3e0;
    border-color: #ff9800;
}

.swot-section.threats h4 {
    color: #ef6c00;
}

.swot-section textarea {
    width: 100%;
    border: none;
    background: transparent;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    min-height: 100px;
}

.swot-section textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    padding: 4px;
}

/* ====================================== */
/* ШИРОКИЕ МОДАЛЬНЫЕ ОКНА ДЛЯ КЛИЕНТСКОГО МОДУЛЯ */
/* ====================================== */

/* Специальные стили для модальных окон клиентского модуля */
#clientModal .modal-content,
#leadModal .modal-content,
#competitorModal .modal-content,
#networkModal .modal-content,
#holdingModal .modal-content {
    width: 98%;
    max-width: 1800px;
    max-height: 98vh;
    margin: 1% auto;
}

/* Адаптивность для широких модальных окон */
@media (max-width: 1920px) {
    #clientModal .modal-content,
    #leadModal .modal-content,
    #competitorModal .modal-content,
    #networkModal .modal-content,
    #holdingModal .modal-content {
        width: 96%;
        max-width: 1600px;
    }
}

@media (max-width: 1600px) {
    #clientModal .modal-content,
    #leadModal .modal-content,
    #competitorModal .modal-content,
    #networkModal .modal-content,
    #holdingModal .modal-content {
        width: 95%;
        max-width: 1400px;
    }
}

@media (max-width: 1200px) {
    #clientModal .modal-content,
    #leadModal .modal-content,
    #competitorModal .modal-content,
    #networkModal .modal-content,
    #holdingModal .modal-content {
        width: 98%;
        max-width: 95vw;
    }
}

/* ====================================== */
/* СЕГМЕНТНЫЕ БЕЙДЖИ */
/* ====================================== */

.segment-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    min-width: 40px;
}

.segment-vip {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.segment-a {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196f3;
}

.segment-b {
    background-color: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ff9800;
}

.segment-c {
    background-color: #fce4ec;
    color: #c2185b;
    border: 1px solid #e91e63;
}

.segment-d {
    background-color: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #9c27b0;
}

.segment-n {
    background-color: #e0f2f1;
    color: #00695c;
    border: 1px solid #009688;
}

.segment-u {
    background-color: #f5f5f5;
    color: #616161;
    border: 1px solid #9e9e9e;
}

/* ====================================== */
/* КНОПКИ С ИКОНКАМИ */
/* ====================================== */

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    color: #666;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e9ecef;
    color: #333;
}

/* ====================================== */
/* АДАПТИВНОСТЬ */
/* ====================================== */

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-content {
        width: 98%;
        padding: 16px;
        max-width: 95vw;
    }
    
    .clients-tabs {
        flex-direction: column;
    }
    
    .clients-tab {
        padding: 12px 16px;
    }
    
    .table-controls {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .search-filters {
        flex-direction: column;
        gap: 12px;
    }
    
    .search-input {
        width: 100%;
    }
    
    .pagination-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .swot-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 10px 16px;
        font-size: 16px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
    }
}

/* ====================================== */
/* КНОПКИ ТОЛЬКО С ИКОНКОЙ */
/* ====================================== */

.btn-icon-only {
    padding: 8px !important;
    min-width: 40px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-icon-only .material-icons {
    font-size: 20px;
    margin: 0;
}

.btn-icon-only:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-icon-only:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Стили для модальных действий */
.modal-actions {
    display: flex;
    gap: 8px;
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    justify-content: flex-end;
    align-items: center;
}

/* ====================================== */
/* КАСТОМНЫЕ СЕЛЕКТЫ */
/* ====================================== */

.custom-select {
    position: relative;
    width: 100%;
}

.select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
}

.select-header:hover {
    border-color: #007bff;
}

.select-placeholder {
    color: #666;
    font-size: 14px;
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 200px;
    overflow: hidden;
}

.select-search {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.select-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.select-options {
    max-height: 150px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Скрыть полосу прокрутки в WebKit браузерах */
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.select-options::-webkit-scrollbar {
    width: 6px;
}

.select-options::-webkit-scrollbar-track {
    background: transparent;
}

.select-options::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.select-options::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}

.select-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.select-option:hover {
    background-color: #f8f9fa;
}

.select-option.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

.select-option:last-child {
    border-bottom: none;
}

/* Стили для действий в заголовке модального окна */
.modal-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #fff;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}
