/* ============================================
   UNION - INVEST CRM Система
   Аграрная тематика: Темная и Светлая темы
   ============================================ */

/* CSS Variables - Темная тема (по умолчанию) */
:root[data-theme="dark"] {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;
    --bg-active: #388bfd1a;
    
    --text-primary: #e6edf3;
    --text-secondary: #7d8590;
    --text-muted: #484f58;
    
    --accent-primary: #7cb342;
    --accent-primary-hover: #8bc34a;
    --accent-secondary: #afb42b;
    --accent-gold: #ffc107;
    --accent-orange: #ff9800;
    
    --border-color: #30363d;
    --border-light: #21262d;
    
    --status-active: #7cb342;
    --status-inactive: #ef5350;
    --status-new: #42a5f5;
    --status-pending: #ffa726;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    
    /* Цвета культур */
    --crop-grechikha: #8d6e63;
    --crop-oves: #ffcc80;
    --crop-gorchitsa: #fff176;
    --crop-len: #81d4fa;
    --crop-raps: #ffeb3b;
    --crop-soya: #aed581;
    --crop-goroh: #90caf9;
    --crop-semechka: #ff7043;
    --crop-proso: #d7ccc8;
    --crop-vika: #ce93d8;
    --crop-redka: #ffab91;
    --crop-koriandr: #4db6ac;
    --crop-exotic: #b39ddb;
    
    --logo-color: #e6edf3;
    --logo-accent-1: #7cb342;
    --logo-accent-2: #afb42b;
    --logo-accent-3: #cddc39;
}

/* CSS Variables - Светлая тема */
:root[data-theme="light"] {
    --bg-primary: #f5f5f0;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fafaf5;
    --bg-hover: #e8e8e0;
    --bg-active: #7cb3421a;
    
    --text-primary: #2e3b28;
    --text-secondary: #5a6b52;
    --text-muted: #9aaa91;
    
    --accent-primary: #558b2f;
    --accent-primary-hover: #689f38;
    --accent-secondary: #9e9d24;
    --accent-gold: #f9a825;
    --accent-orange: #f57c00;
    
    --border-color: #d4d9cf;
    --border-light: #e8ebe5;
    
    --status-active: #558b2f;
    --status-inactive: #d32f2f;
    --status-new: #1976d2;
    --status-pending: #f57c00;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --crop-grechikha: #6d4c41;
    --crop-oves: #ff8f00;
    --crop-gorchitsa: #fbc02d;
    --crop-len: #0288d1;
    --crop-raps: #f9a825;
    --crop-soya: #7cb342;
    --crop-goroh: #039be5;
    --crop-semechka: #e64a19;
    --crop-proso: #8d6e63;
    --crop-vika: #8e24aa;
    --crop-redka: #f4511e;
    --crop-koriandr: #00897b;
    --crop-exotic: #5e35b1;
    
    --logo-color: #2e3b28;
    --logo-accent-1: #558b2f;
    --logo-accent-2: #7cb342;
    --logo-accent-3: #9e9d24;
}

/* ============================================
   Базовые стили
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Верхняя панель
   ============================================ */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 200000;
    box-shadow: var(--shadow-sm);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 36px;
    width: auto;
    color: var(--logo-color);
}

.logo .logo-accent-1 { color: var(--logo-accent-1); }
.logo .logo-accent-2 { color: var(--logo-accent-2); }
.logo .logo-accent-3 { color: var(--logo-accent-3); }
.logo .logo-accent-4 { color: var(--accent-primary); }
.logo .logo-accent-5 { color: var(--accent-gold); }
.logo .logo-accent-6 { color: var(--accent-orange); }
.logo .logo-accent-7 { color: var(--accent-primary); }
.logo .logo-accent-8 { color: var(--accent-secondary); }
.logo .logo-accent-9 { color: var(--accent-primary); }
.logo .logo-accent-10 { color: var(--accent-secondary); }

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.notifications-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    font-size: 18px;
}

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

.notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.theme-toggle i {
    position: absolute;
    transition: all 0.3s ease;
}

.theme-toggle .fa-sun {
    opacity: 0;
    transform: translateY(20px) rotate(180deg);
}

.theme-toggle .fa-moon {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

[data-theme="light"] .theme-toggle .fa-sun {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

[data-theme="light"] .theme-toggle .fa-moon {
    opacity: 0;
    transform: translateY(-20px) rotate(-180deg);
}

/* Меню пользователя */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

.user-menu:hover {
    background: var(--bg-hover);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-menu .fa-chevron-down {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.user-menu.active .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 500000;
}

.user-menu.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 13px;
}

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

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
}

.dropdown-item:hover i {
    color: var(--accent-primary);
}

.dropdown-item.logout {
    color: var(--status-inactive);
}

.dropdown-item.logout i {
    color: var(--status-inactive);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* ============================================
   Основной контейнер
   ============================================ */
.main-container {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

/* ============================================
   Боковое меню
   ============================================ */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    transition: width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 70px;
}

.menu-section {
    padding: 16px 12px;
    flex: 1;
}

.sidebar.collapsed .menu-section {
    padding: 16px 8px;
}

.menu-section + .menu-section {
    border-top: 1px solid var(--border-color);
}

.menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.sidebar.collapsed .menu-header {
    justify-content: center;
    padding: 8px 0;
}

.sidebar.collapsed .menu-header span {
    display: none;
}

.menu-header i {
    font-size: 14px;
}

.admin-section .menu-header {
    color: #ffffff;
}

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .menu-item {
    justify-content: center;
    padding: 10px;
}

.sidebar.collapsed .menu-item span {
    display: none;
}

.menu-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.menu-item.active {
    background: var(--bg-active);
    color: var(--accent-primary);
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* Тумблер сворачивания меню в header */
.sidebar-toggle-icon {
    position: absolute;
    right: 15px;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s ease;
    border-radius: 4px;
}

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

.sidebar-toggle-icon i {
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle-icon i {
    transform: rotate(180deg);
}

/* ============================================
   Переключатель переноса текста
   ============================================ */
.table-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.table-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.table-toggle input {
    display: none;
}

.toggle-slider {
    width: 36px;
    height: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    position: relative;
    transition: background 0.3s ease;
    border: 1px solid var(--border-color);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.table-toggle input:checked + .toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.table-toggle input:checked + .toggle-slider::before {
    transform: translateX(16px);
    background: white;
}

.toggle-label {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

/* ============================================
   Основной контент
   ============================================ */
.content {
    flex: 1;
    margin-left: 260px;
    padding: 20px;
    min-height: calc(100vh - 64px);
    transition: margin-left 0.3s ease;
    width: calc(100% - 260px);
    max-width: calc(100% - 260px);
    min-width: 0;
    overflow-x: hidden;
}

.sidebar.collapsed + .content,
.sidebar.collapsed ~ .content {
    margin-left: 70px;
    width: calc(100% - 70px);
    max-width: calc(100% - 70px);
}

/* Заголовок страницы */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: none;
}

.page-header h1 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 i {
    color: var(--accent-primary);
}

.page-actions {
    display: flex;
    gap: 10px;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

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

.btn-outline:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ============================================
   Фильтры (в модальном окне)
   ============================================ */
.filter-select {
    padding: 6px 10px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    min-width: 120px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--accent-primary);
    outline: none;
}

/* ============================================
   ПЛАНИРОВАНИЕ - Дни + месяц в одну строку
   ============================================ */
.planning-days-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.planning-days-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 10px 8px 6px;
    gap: 6px;
}

.planning-days-track {
    display: flex;
    gap: 2px;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.planning-days-track::-webkit-scrollbar {
    height: 4px;
}

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

/* Прогресс выполнения плана за день (внутри блока дней) */
.planning-day-progress {
    position: relative;
    width: 100%;
    height: 3px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
}

.planning-day-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--day-progress, 0%);
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.planning-month-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    align-self: stretch;
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 10px 16px;
}

.month-nav {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 4px;
}

.month-nav:hover {
    color: #fff;
    transform: scale(1.15);
}

.month-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 140px;
    text-align: center;
}

.plan-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 32px;
    padding: 5px 2px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-secondary);
    flex: 1;
}

.plan-day:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.plan-day.active {
    background: var(--accent-primary);
    color: #fff;
}

.plan-day.weekend {
    color: #ef4444;
}

.plan-day.active.weekend {
    background: #ef4444;
    color: #fff;
}

.plan-day-name {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 500;
    position: relative;
}

/* Зелёная точка — на день назначены задания */
.plan-day.has-tasks .plan-day-name::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--accent-primary);
}

.plan-day.active.has-tasks .plan-day-name::before {
    background: #fff;
}

.plan-day-num {
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   ПЛАНИРОВАНИЕ - Таблица
   ============================================ */
.planning-table th,
.planning-table td {
    text-align: center;
    vertical-align: middle;
}

.planning-table th.col-manager,
.planning-table td.col-manager {
    text-align: center !important;
    vertical-align: middle;
}

/* Flex-контейнер внутри ячейки */
.cell-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
}

.planning-table th.col-manager .manager-cell {
    justify-content: center;
}

/* Обёртка ячейки менеджера: инпут + прогресс */
.plan-cell-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}

/* Прогресс выполнения задания менеджера — линия под инпутом */
.mgr-progress-track {
    width: 90px;
    height: 3px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.mgr-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--mgr-progress, 0%);
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Кнопка настройки выборки */
.filter-settings-btn {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    margin-left: 4px;
    flex-shrink: 0;
}

.filter-settings-btn:hover {
    color: var(--accent-primary);
    transform: rotate(30deg);
}

.filter-settings-btn.personal-filter {
    color: #e53935;
}

.filter-settings-btn.personal-filter:hover {
    color: #ff5252;
    transform: rotate(30deg);
}

.planning-table td.col-task-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.planning-table .col-task-name {
    min-width: 140px;
    text-align: left !important;
}

.planning-table .col-task-start,
.planning-table .col-task-deadline {
    min-width: 150px;
    max-width: 150px;
    text-align: center !important;
}

.planning-table .col-task-filter {
    min-width: 70px;
    cursor: help;
    text-align: center !important;
}

.planning-table .col-manager {
    min-width: 100px;
}

.planning-table .col-task-block {
    min-width: 50px;
    text-align: center !important;
}

.planning-table .col-task-delete {
    min-width: 40px;
    text-align: center !important;
}

/* Обёртка даты: input + иконка календаря */
.plan-date-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.plan-input.plan-date {
    width: 100%;
    padding: 6px 22px 6px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    cursor: pointer;
}

.plan-date-icon {
    position: absolute;
    right: 6px;
    font-size: 11px;
    color: var(--accent-primary);
    pointer-events: none;
}

/* Прозрачный нативный date picker поверх текстового поля */
.plan-date-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
    margin: 0;
    z-index: 2;
}

.plan-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    transition: border-color 0.15s ease;
    text-align: center;
}

.plan-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.plan-number {
    text-align: center;
    width: 90px;
    display: block;
    position: relative;
    background: transparent;
}

.filter-count {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-primary);
}

.btn-delete-row {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-row:hover {
    background: rgba(239, 68, 68, 0.15);
}

.planning-table .block-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.planning-table .block-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.planning-table .block-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: 0.2s;
}

.planning-table .block-toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: 0.2s;
}

/* Тумблер БЛОКИРОВКИ — красные тоны */
.planning-table .block-toggle input:checked + .block-toggle-slider {
    background: #ef4444;
    border-color: #ef4444;
}

/* Input Название — по левому краю */
.planning-table .col-task-name .plan-input {
    text-align: left;
}

.planning-table .block-toggle input:checked + .block-toggle-slider:before {
    transform: translateX(16px);
    background: #fff;
}

/* ============================================
   Иконки в правом углу заголовка
   ============================================ */
.page-actions-icons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.icon-btn input:checked + i,
.icon-btn:has(input:checked) {
    color: var(--accent-primary);
}

/* ============================================
   Заголовок + вкладки + иконки в одну строку
   ============================================ */
.page-header-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
}

.page-header-inline .page-title {
    flex-shrink: 0;
    white-space: nowrap;
}

.task-tabs-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}
.task-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    white-space: nowrap;
    position: relative;
    user-select: none;
}

.task-tab .progress-fill {
    position: absolute;
    bottom: 3px;
    left: 10%;
    width: 80%;
    height: 3px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.task-tab .progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: var(--progress, 0%);
    height: 100%;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.task-tab.overdue {
    border-color: var(--border-color);
}

.task-tab.overdue .progress-fill::before {
    background: #ef4444;
}

.task-tab.overdue .task-tab-count {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
}

.task-tab:hover {
    border-color: var(--accent-primary);
}

.task-tab.active {
    border-color: rgba(255, 255, 255, 0.25);
}

.task-tab.active::before {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.40) 0%, rgba(16, 185, 129, 0.80) 100%);
}

.task-tab-name {
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.task-tab-count {
    position: relative;
    z-index: 1;
    font-size: 11px;
    color: var(--accent-primary);
    font-weight: 600;
    background: rgba(22, 27, 34, 0.70);
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.3px;
}

/* ============================================
   Таблица поставщиков - Горизонтальный скролл
   ============================================ */
.table-wrapper {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
}

.table-scroll-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 190px);
    position: relative;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-tertiary);
}

/* Скроллбар для Chrome/Safari */
.table-scroll-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--bg-tertiary);
}

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

.table-scroll-container::-webkit-scrollbar-corner {
    background: var(--bg-tertiary);
}

.suppliers-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

/* Фиксированная шапка - единый z-index для всех ячеек */
.suppliers-table thead {
    position: sticky;
    top: 0;
    z-index: 100;
}

.suppliers-table th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    text-align: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    user-select: none;
    position: relative;
    font-size: 12px;
    line-height: 1.4;
}

.suppliers-table th.dragging {
    opacity: 0.5;
    background: var(--accent-primary);
}

.suppliers-table th.drag-over {
    background: var(--bg-active);
    border-left: 2px solid var(--accent-primary);
}

/* Ресайзер колонок - невидим по умолчанию */
.column-resizer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.15s ease;
    z-index: 10;
}

/* Линия ресайзера - видна только при наведении */
.column-resizer::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.column-resizer:hover::after,
.column-resizer:active::after,
.suppliers-table th:hover .column-resizer::after {
    opacity: 1;
}

.suppliers-table th {
    position: relative;
}

.suppliers-table th.resizing {
    background: var(--bg-active);
}

/* Ресайзер для sticky колонок */
.suppliers-table th.col-crops .column-resizer,
.suppliers-table th.col-name .column-resizer {
    z-index: 30;
}

/* При ресайзе - фон как у всех колонок */
.suppliers-table th.resizing {
    background: var(--bg-active);
}

/* Режим переноса текста - по умолчанию обрезка с многоточием */
.suppliers-table .cell-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

/* Режим с переносом текста */
.suppliers-table.wrap-enabled .cell-text {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.5em * 3);
    line-height: 1.5;
}

/* Ширины колонок (минимальная длина = название + иконка фильтра + 30px отступы) */

/* Фиксированная колонка Культуры (первая) - только для горизонтального скролла */
.suppliers-table th.col-crops,
.suppliers-table td.col-crops { 
    min-width: 110px; 
    max-width: 110px; 
    text-align: left; 
    position: sticky;
    left: 0;
    border-right: none;
}

/* Фон как у всех ячеек шапки + z-index для тела */
.suppliers-table th.col-crops {
    background: var(--bg-tertiary);
    z-index: 50;
}
.suppliers-table td.col-crops {
    background: var(--bg-secondary);
    z-index: 50;
}

/* Фиксированная колонка Наименование - динамический left через JS */
.suppliers-table th.col-name,
.suppliers-table td.col-name { 
    min-width: 230px; 
    max-width: 230px; 
    text-align: left; 
    position: sticky;
    left: auto;
    border-right: none;
}

/* Фон как у всех ячеек шапки + z-index для тела */
.suppliers-table th.col-name {
    background: var(--bg-tertiary);
    z-index: 49;
}
.suppliers-table td.col-name {
    background: var(--bg-secondary);
    z-index: 49;
}



/* Фон sticky ячеек при hover */
.suppliers-table tbody tr:hover td.col-crops,
.suppliers-table tbody tr:hover td.col-name {
    background: var(--bg-tertiary);
}

/* У шапки нет тени - единый фон */

.suppliers-table th.col-num,
.suppliers-table td.col-num { min-width: 90px; max-width: 90px; text-align: center; }

.suppliers-table th.col-region,
.suppliers-table td.col-region { min-width: 140px; max-width: 140px; text-align: left; }

.suppliers-table th.col-district,
.suppliers-table td.col-district { min-width: 150px; max-width: 150px; text-align: left; }

.suppliers-table th.col-contacts,
.suppliers-table td.col-contacts { min-width: 180px; max-width: 180px; text-align: left; }

.suppliers-table th.col-vat,
.suppliers-table td.col-vat { min-width: 75px; max-width: 75px; text-align: center; }

.suppliers-table th.col-status,
.suppliers-table td.col-status { min-width: 130px; max-width: 150px; }

.suppliers-table th.col-call,
.suppliers-table td.col-call { min-width: 200px; max-width: 200px; text-align: center; }

.suppliers-table th.col-comment,
.suppliers-table td.col-comment { min-width: 280px; max-width: 280px; text-align: left; padding-right: 30px; }

.suppliers-table th.col-last-call,
.suppliers-table td.col-last-call { min-width: 110px; max-width: 130px; text-align: center; }

.last-call-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.last-call-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.last-call-date {
    color: #fff;
    font-size: 13px;
}

.suppliers-table th.col-manager,
.suppliers-table td.col-manager { min-width: 160px; max-width: 160px; text-align: left; }

/* Колонки культур - тн и га */
.suppliers-table th.col-crop-tn,
.suppliers-table td.col-crop-tn { 
    min-width: 55px; 
    max-width: 55px; 
    text-align: center;
    font-size: 13px;
}

.suppliers-table th.col-crop-ga,
.suppliers-table td.col-crop-ga { 
    min-width: 55px; 
    max-width: 55px; 
    text-align: center;
    font-size: 13px;
}



/* Группа культур в шапке */
.crop-group-header {
    font-size: 13px !important;
}

/* Подзаголовки тн/га */
.crop-subheader {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Цветные нижние бордеры для ячеек культур в теле таблицы */
.suppliers-table td.col-crop-tn,
.suppliers-table td.col-crop-ga {
    border-bottom-width: 2px;
    border-bottom-style: solid;
}

/* Убираем цветные бордеры в шапке для тн и га */
.suppliers-table th.col-crop-tn,
.suppliers-table th.col-crop-ga {
    border-bottom: 1px solid var(--border-color) !important;
}

/* Ячейки таблицы - padding 20px 10px, выравнивание по центру */
.suppliers-table td {
    padding: 20px 10px 20px 10px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    line-height: 1.5;
}

.suppliers-table tbody tr {
    background: var(--bg-secondary);
}

.suppliers-table tbody tr:hover {
    background: var(--bg-tertiary);
}

/* Цвета культур */
.crop-grechikha { background: var(--crop-grechikha); }
.crop-oves { background: var(--crop-oves); }
.crop-gorchitsa { background: var(--crop-gorchitsa); }
.crop-len { background: var(--crop-len); }
.crop-raps { background: var(--crop-raps); }
.crop-soya { background: var(--crop-soya); }
.crop-goroh { background: var(--crop-goroh); }
.crop-semechka { background: var(--crop-semechka); }
.crop-proso { background: var(--crop-proso); }
.crop-vika { background: var(--crop-vika); }
.crop-redka { background: var(--crop-redka); }
.crop-koriandr { background: var(--crop-koriandr); }
.crop-exotic { background: var(--crop-exotic); }

/* Нижние бордеры цветов культур */
.border-grechikha { border-bottom-color: var(--crop-grechikha) !important; }
.border-oves { border-bottom-color: var(--crop-oves) !important; }
.border-gorchitsa { border-bottom-color: var(--crop-gorchitsa) !important; }
.border-len { border-bottom-color: var(--crop-len) !important; }
.border-raps { border-bottom-color: var(--crop-raps) !important; }
.border-soya { border-bottom-color: var(--crop-soya) !important; }
.border-goroh { border-bottom-color: var(--crop-goroh) !important; }
.border-semechka { border-bottom-color: var(--crop-semechka) !important; }
.border-proso { border-bottom-color: var(--crop-proso) !important; }
.border-vika { border-bottom-color: var(--crop-vika) !important; }
.border-redka { border-bottom-color: var(--crop-redka) !important; }
.border-koriandr { border-bottom-color: var(--crop-koriandr) !important; }
.border-exotic { border-bottom-color: var(--crop-exotic) !important; }

/* Фон ячеек тн и га с прозрачностью 0.15 (соответствует цвету бордера) */
.suppliers-table tbody td.border-grechikha { background: rgba(141, 110, 99, 0.15); }
.suppliers-table tbody td.border-oves { background: rgba(255, 204, 128, 0.15); }
.suppliers-table tbody td.border-gorchitsa { background: rgba(255, 241, 118, 0.15); }
.suppliers-table tbody td.border-len { background: rgba(129, 212, 250, 0.15); }
.suppliers-table tbody td.border-raps { background: rgba(255, 235, 59, 0.15); }
.suppliers-table tbody td.border-soya { background: rgba(174, 213, 129, 0.15); }
.suppliers-table tbody td.border-goroh { background: rgba(144, 202, 249, 0.15); }
.suppliers-table tbody td.border-semechka { background: rgba(255, 112, 67, 0.15); }
.suppliers-table tbody td.border-proso { background: rgba(215, 204, 200, 0.15); }
.suppliers-table tbody td.border-vika { background: rgba(206, 147, 216, 0.15); }
.suppliers-table tbody td.border-redka { background: rgba(255, 171, 145, 0.15); }
.suppliers-table tbody td.border-koriandr { background: rgba(77, 182, 172, 0.15); }
.suppliers-table tbody td.border-exotic { background: rgba(179, 157, 219, 0.15); }

/* Цветные бордеры для заголовков культур */
.suppliers-table th.crop-group-header,
.suppliers-table th.col-crop-tn,
.suppliers-table th.col-crop-ga {
    border-bottom-width: 2px;
    border-bottom-style: solid;
}

/* Сортировка */
.sort-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 4px;
    border-radius: 3px;
    font-size: 10px;
    transition: all 0.15s ease;
}

.sort-btn:hover {
    color: var(--accent-primary);
    background: var(--bg-hover);
}

.sort-btn.active {
    color: var(--accent-primary);
}

/* Кликабельные заголовки таблицы */
.suppliers-table th[class^="col-"] {
    cursor: pointer;
    user-select: none;
}

/* Иконки фильтров в шапке (FontAwesome) */
.filter-icon {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.filter-icon:hover {
    color: var(--accent-primary);
    opacity: 1;
    background: rgba(124, 179, 66, 0.15);
    border-color: var(--accent-primary);
}

/* Статус */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(124, 179, 66, 0.15);
    color: var(--status-active);
}

.status-badge.inactive {
    background: rgba(239, 83, 80, 0.15);
    color: var(--status-inactive);
}

.status-badge.new {
    background: rgba(66, 165, 245, 0.15);
    color: var(--status-new);
}

.status-badge.pending {
    background: rgba(255, 167, 38, 0.15);
    color: #ffa726;
}

.status-badge.noanswer {
    background: rgba(171, 71, 188, 0.15);
    color: #ab47bc;
}

.status-badge.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-badge.clickable:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

/* Дата созвона */
.call-date {
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
}

/* Анимация при наведении на дату созвона */
.call-date:hover {
    animation: callDatePulse 0.6s ease-in-out;
    transform: scale(1.05);
}

@keyframes callDatePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(124, 179, 66, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 8px rgba(124, 179, 66, 0);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 0 0 0 rgba(124, 179, 66, 0);
    }
}

/* Разные цвета анимации для разных статусов дат */
.call-date-overdue:hover {
    animation: callDatePulseRed 0.6s ease-in-out;
}

@keyframes callDatePulseRed {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 8px rgba(239, 83, 80, 0);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 0 0 0 rgba(239, 83, 80, 0);
    }
}

.call-date-today:hover {
    animation: callDatePulseOrange 0.6s ease-in-out;
}

@keyframes callDatePulseOrange {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 167, 38, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 8px rgba(255, 167, 38, 0);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 0 0 0 rgba(255, 167, 38, 0);
    }
}

.call-date-future:hover {
    animation: callDatePulseGreen 0.6s ease-in-out;
}

@keyframes callDatePulseGreen {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(124, 179, 66, 0.4);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 8px rgba(124, 179, 66, 0);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 0 0 0 rgba(124, 179, 66, 0);
    }
}

/* Просроченная дата (меньше сегодня) - красный */
.call-date-overdue {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
}

/* Сегодняшняя дата - оранжевый */
.call-date-today {
    background: rgba(255, 167, 38, 0.15);
    color: #ffa726;
}

/* Будущая дата (больше сегодня) - зеленый */
.call-date-future {
    background: rgba(124, 179, 66, 0.15);
    color: #7cb342;
}

/* Многострочный текст с ограничением */
.cell-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: 4.5em;
}

.cell-text:hover {
    cursor: help;
}

/* Колонка культур */
.suppliers-table td.col-crops {
    padding: 8px 10px;
    text-align: left;
    overflow: hidden;
}

.suppliers-table td.col-crops .crop-indicators {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow: hidden;
}

.suppliers-table td.col-crops .crop-indicators .crop-dot {
    flex-shrink: 0;
}

/* Контейнер для ячейки наименования (кружки сверху, название снизу) */
.name-cell-vertical {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

/* Индикаторы культур в ячейке наименования */
.crop-indicators {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.crop-dot {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.crop-dot:hover {
    transform: scale(1.2);
    z-index: 10;
}

/* Пустой кружочек (серый) */
.crop-dot.crop-empty {
    background: var(--border-color);
    opacity: 0.4;
}

.crop-dot::after {
    content: attr(data-crop);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.crop-dot:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Менеджер */
.manager-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.manager-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

/* ============================================
   Нижняя плашка с количеством
   ============================================ */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    position: sticky;
    bottom: 0;
    z-index: 15;
}

.table-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.table-count strong {
    color: var(--text-primary);
    font-size: 15px;
}

/* ============================================
   Модальные окна
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 2;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-filter {
    width: 350px;
    max-width: 95vw;
}

.modal-call-history {
    width: 700px;
    max-width: 95vw;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2,
.modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.modal-header h2 i,
.modal-header h3 i {
    color: var(--accent-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

/* ============================================
   Фильтр модальное окно
   ============================================ */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-option-group select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
}

.filter-option-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-search-box {
    position: relative;
}

.filter-search-box input {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
}

.filter-search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.filter-search-box i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    padding: 4px;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 12px;
}

.filter-checkbox-item:hover {
    background: var(--bg-hover);
}

.filter-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

/* ============================================
   История созвонов
   ============================================ */
.call-history-supplier {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 16px;
}

.call-history-supplier-info {
    flex: 1;
}

.call-history-supplier-info h3 {
    font-size: 16px;
    margin-bottom: 6px;
}

.call-history-supplier-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.call-history-supplier-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.call-history-supplier-crops {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.call-history-supplier-crops .crop-dot {
    width: 16px;
    height: 16px;
}

/* Таймлайн */
.call-history-timeline {
    position: relative;
    padding-left: 16px;
}

.call-history-timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.call-record {
    position: relative;
    padding: 14px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid var(--border-color);
}

.call-record::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 20px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-secondary);
}

.call-record-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.call-date-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.call-date-badge i {
    color: var(--accent-primary);
}

.call-manager {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Стили для недозвонов в истории */
.call-record-noanswer {
    background: rgba(171, 71, 188, 0.08);
    border-color: rgba(171, 71, 188, 0.3);
}

.call-record-noanswer::before {
    background: #ab47bc;
}

.noanswer-badge {
    color: #ab47bc;
}

.noanswer-badge i {
    color: #ab47bc;
}

.noanswer-label {
    background: rgba(171, 71, 188, 0.15);
    color: #ab47bc;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 6px;
}

.noanswer-comment .call-general-comment-label {
    color: #ab47bc;
}

.noanswer-comment .call-general-comment-text {
    color: var(--text-secondary);
    font-style: italic;
}

.call-manager img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

/* Культуры в записи созвона */
.call-crops-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.call-crop-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
}

.call-crop-item.has-comment {
    cursor: pointer;
}

.call-crop-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    transition: background 0.15s ease;
}

.call-crop-item.has-comment .call-crop-header:hover {
    background: var(--bg-hover);
}

.call-crop-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.call-crop-name {
    font-weight: 500;
    font-size: 13px;
    min-width: 70px;
}

.call-crop-type {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.call-crop-stats {
    display: flex;
    gap: 16px;
    margin-left: auto;
    font-size: 12px;
}

.call-crop-stat {
    display: flex;
    align-items: center;
    gap: 3px;
}

.call-crop-stat strong {
    font-size: 14px;
    color: var(--text-primary);
}

.call-crop-stat span {
    color: var(--text-secondary);
    font-size: 11px;
}

.call-crop-toggle {
    margin-left: 8px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    font-size: 12px;
}

.call-crop-toggle.has-comment {
    color: var(--accent-primary);
}

.call-crop-item.expanded .call-crop-toggle {
    transform: rotate(180deg);
}

/* Комментарий к культуре */
.call-crop-comment {
    display: none;
    padding: 10px 12px 12px 46px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.call-crop-item.expanded .call-crop-comment {
    display: block;
}

/* Общий комментарий */
.call-general-comment {
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border-left: 3px solid var(--accent-primary);
}

.call-general-comment-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.call-general-comment-text {
    font-size: 12px;
    line-height: 1.5;
}

/* Следующий созвон */
.call-next-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--bg-active);
    border-radius: 6px;
    font-size: 11px;
}

.call-next-info i {
    color: var(--accent-primary);
}

/* Новый контакт */
.call-new-contact {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 4px 10px;
    background: rgba(124, 179, 66, 0.15);
    color: var(--accent-primary);
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
}

/* ============================================
   Страница "В разработке"
   ============================================ */
.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 40px;
}

.coming-soon-icon {
    font-size: 64px;
    color: var(--accent-primary);
    margin-bottom: 24px;
    opacity: 0.8;
}

.coming-soon h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.coming-soon p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============================================
   Скроллбары
   ============================================ */
.modal-body::-webkit-scrollbar,
.filter-checkbox-list::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track,
.filter-checkbox-list::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.modal-body::-webkit-scrollbar-thumb,
.filter-checkbox-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* ============================================
   Адаптивность
   ============================================ */
@media (max-width: 1200px) {
    .sidebar {
        width: 220px;
    }
    
    .sidebar.collapsed {
        width: 70px;
    }
    
    .content {
        margin-left: 220px;
    }
    
    .sidebar.collapsed ~ .content {
        margin-left: 70px;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .page-actions {
        width: 100%;
    }
    
    .page-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .modal-call-history {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* ============================================
   Анимации
   ============================================ */
@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.call-record {
    animation: slideUp 0.3s ease;
}

/* Tooltip для обрезанного текста */
.tooltip {
    position: fixed;
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    max-width: 300px;
    z-index: 10000;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.tooltip.visible {
    opacity: 1;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО СОЗВОНА (РАБОЧЕЕ) - УКРУПНЕННОЕ
   ============================================ */

.modal-call-work {
    width: 98vw;
    max-width: 1600px;
    height: 95vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
}

.call-work-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.call-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.call-header-left h2 {
    margin: 0;
    font-size: 24px;
    color: var(--text-primary);
}

.call-header-left h2 i {
    color: var(--accent-primary);
}

/* Таймер */
.call-timer {
    font-size: 18px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: var(--text-primary);
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    min-width: 80px;
    text-align: center;
}

.call-supplier-name {
    font-size: 20px;
    color: var(--text-primary);
    font-weight: 500;
}

.call-work-body {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.call-work-column {
    padding: 20px 24px;
    overflow-y: auto;
}

.call-work-column h3 {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.call-work-column h3 i {
    margin-right: 8px;
    color: var(--accent-primary);
}

/* Колонка таблицы культур */
.call-crops-table-column {
    flex: 1.2;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
}

.crops-table-container {
    overflow: auto;
    max-height: calc(100% - 40px);
}

.crops-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.crops-data-table th {
    background: var(--bg-tertiary);
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    font-size: 13px;
}

.crops-data-table th .input-label {
    display: block;
    font-size: 13px;
}

.crops-data-table td {
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

/* Кастомные тултипы для инпутов */
.input-with-tooltip {
    position: relative;
}

.input-with-tooltip input,
.input-with-tooltip textarea {
    width: 100%;
}

.custom-tooltip {
    position: fixed;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid;
}

/* Недавно обновлено - зеленый */
.custom-tooltip.date-recent {
    background: #4caf50;
}

.custom-tooltip.date-recent::after {
    border-top-color: #4caf50;
}

/* Давно обновлено - желтый/оранжевый */
.custom-tooltip.date-medium {
    background: #ff9800;
}

.custom-tooltip.date-medium::after {
    border-top-color: #ff9800;
}

/* Очень давно обновлено - красный */
.custom-tooltip.date-old {
    background: #f44336;
}

.custom-tooltip.date-old::after {
    border-top-color: #f44336;
}

/* Структура строк культур */
.crop-row {
    transition: background 0.2s ease;
}

/* Убираем border из ячеек */
.crop-row td {
    border-bottom: none !important;
}

/* Разделительная строка между культурами */
.crop-divider {
    height: 2px;
    background: var(--border-color);
}

.crop-divider td {
    padding: 0 !important;
    height: 2px;
    background: var(--border-color);
}

/* Тумблер */
.crop-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    margin: 0 auto;
}

.crop-toggle.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.crop-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.crop-toggle.active::after {
    left: 22px;
    background: #fff;
}

/* Колонки таблицы */
.crops-data-table .crop-name-col {
    width: 140px;
    text-align: left;
}

.crops-data-table .crop-check-col {
    width: 50px;
    text-align: center;
}

.crops-data-table .crop-type-col {
    width: 80px;
    text-align: center;
}

.crops-data-table .crop-input-col {
    width: 100px;
    text-align: center;
}

.crops-data-table .crop-comment-col {
    width: 180px;
    text-align: left;
}

/* Ячейка с названием культуры */
.crop-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 15px;
}

.crop-name-cell .crop-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Инпуты в таблице */
.crops-data-table input[type="text"] {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
    transition: all 0.2s ease;
}

.crops-data-table input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.crops-data-table input[type="text"]::placeholder {
    text-align: center;
    color: var(--text-muted);
}

/* Тип культуры */
.crop-type-cell {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
}

.crop-type-cell.spring {
    background: rgba(124, 179, 66, 0.2);
    color: var(--accent-primary);
}

.crop-type-cell.winter {
    background: rgba(66, 165, 245, 0.2);
    color: #42a5f5;
}

/* Инпуты в таблице культур */
.crops-data-table input[type="number"] {
    width: 100%;
    padding: 4px 6px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 11px;
    text-align: right;
}

.crops-data-table input[type="number"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.crops-data-table input[type="number"]:hover {
    border-color: var(--accent-primary);
}

/* Комментарий в таблице — как общий комментарий */
.crop-comment-col {
    padding: 8px !important;
    vertical-align: top;
}

.crop-comment-input {
    width: 100%;
    height: 100%;
    min-height: 100px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
}

.crop-comment-input::placeholder {
    color: var(--text-muted);
    font-family: inherit;
}

.crop-comment-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Тип культуры */
.crop-type-cell {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    font-weight: 500;
}

.crop-type-cell.spring {
    background: rgba(124, 179, 66, 0.2);
    color: var(--accent-primary);
}

.crop-type-cell.winter {
    background: rgba(66, 165, 245, 0.2);
    color: #42a5f5;
}

.crops-data-table input {
    width: 100%;
    padding: 5px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    text-align: right;
}

.crops-data-table input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.crops-data-table input::placeholder {
    color: var(--text-muted);
}

/* Колонка информации */
.call-info-column {
    flex: 0 0 500px;
    background: var(--bg-primary);
}

.info-section {
    margin-bottom: 20px;
}

/* Заголовок предыдущего комментария с аватаркой */
.prev-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.prev-comment-header h3 {
    margin: 0;
}

.prev-comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prev-comment-date {
    font-size: 13px;
    color: var(--text-muted);
}

.prev-comment-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}

/* Заголовок контактов с кнопкой добавления */
.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.contacts-header h3 {
    margin: 0;
}

/* Карусель контактов */
.contacts-carousel {
    position: relative;
    padding: 0 4px;
}

.carousel-container {
    overflow: hidden;
    min-height: 80px;
}

.contacts-list {
    display: flex;
    gap: 0;
    transition: transform 0.3s ease;
}

/* Контролы карусели (стрелки и точки) — аккуратные без обводок и background */
.carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.carousel-arrow {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.carousel-arrow:hover {
    color: var(--accent-primary);
}

.carousel-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.carousel-arrow.hidden {
    display: none;
}

/* Точки карусели */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-dot.active {
    background: var(--accent-primary);
}

/* Карточка контакта */
.contact-card {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: relative;
    min-height: 180px;
    box-sizing: border-box;
}

.contact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.contact-card input {
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-primary);
}

.contact-card input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.contact-card input.contact-name {
    flex: 1;
}

.contact-card input.contact-position {
    width: 120px;
}

.contact-card-row {
    display: flex;
    gap: 10px;
}

.contact-card input.contact-phone,
.contact-card input.contact-email {
    flex: 1;
}

.contact-card textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    min-height: 50px;
}

.contact-card textarea::placeholder {
    color: var(--text-muted);
    font-family: inherit;
}

.contact-card textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.contact-card input::placeholder {
    color: var(--text-muted);
    font-family: inherit;
}

/* Красный крестик удаления контакта — просто иконка */
.contact-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: auto;
    height: auto;
    border: none;
    background: transparent;
    color: var(--status-inactive);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    padding: 2px;
    transition: all 0.2s ease;
}

.contact-remove-btn:hover {
    color: #d32f2f;
}

/* Предыдущий комментарий */
.previous-comment {
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    min-height: 140px;
    max-height: 280px;
    overflow-y: auto;
    position: relative;
    padding-bottom: 40px;
}

.previous-comment p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.prev-comment-date {
    font-size: 10px;
    color: var(--text-muted);
    font-style: italic;
}

/* Общий комментарий — как в предыдущем */
#generalComment {
    width: 100%;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    min-height: 140px;
    max-height: 280px;
}

#generalComment::placeholder {
    color: var(--text-muted);
    font-family: inherit;
}

#generalComment:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Футер с кнопками справа */
.call-work-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    gap: 12px;
    z-index: 500000;
}

.call-actions-right-group {
    display: flex;
    gap: 12px;
}

/* Крупные кнопки в футере */
.call-work-footer .btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
}

.call-work-footer .btn i {
    font-size: 16px;
}

/* Кнопки с выпадающим меню */
.action-btn-wrapper {
    position: relative;
    z-index: 500001;
}

.date-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 220px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.date-dropdown.active {
    display: block;
}

.date-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    gap: 8px;
}

.date-dropdown .dropdown-item:hover {
    background: var(--bg-hover);
}

.date-dropdown .dropdown-item .item-title {
    flex: 1;
    font-size: 13px;
    color: var(--text-primary);
}

.date-dropdown .dropdown-item .item-date {
    font-size: 11px;
    color: var(--text-secondary);
}

.date-dropdown .dropdown-item .item-count {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 10px;
}

.date-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.date-dropdown .dropdown-item.custom-date {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.date-dropdown .dropdown-item.custom-date input[type="date"] {
    width: 100%;
    padding: 6px 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
}

/* ============================================
   НОВЫЕ МОДАЛЬНЫЕ ДРОПДАУНЫ ВЫБОРА ДАТЫ
   ============================================ */

.date-dropdown-modal {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    z-index: 500000;
    display: none;
}

.date-dropdown-modal.active {
    display: block;
}

.date-dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: -1;
}

.date-dropdown-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 320px;
    max-width: 90vw;
    overflow: hidden;
    z-index: 1;
    animation: dropdownSlideIn 0.2s ease;
}

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

/* Заголовок дропдауна */
.date-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.date-dropdown-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.date-dropdown-title i {
    color: var(--accent-primary);
    font-size: 18px;
}

/* Счетчик созвонов (дробь) */
.date-dropdown-counter {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    padding: 4px 10px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.counter-current {
    color: var(--accent-primary);
}

.counter-divider {
    color: var(--text-muted);
}

.counter-total {
    color: var(--text-secondary);
}

/* Кнопка закрытия */
.date-dropdown-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.date-dropdown-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Тело дропдауна */
.date-dropdown-body {
    padding: 8px;
}

.date-dropdown-body .dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 10px;
    border-radius: 8px;
    margin-bottom: 4px;
}

.date-dropdown-body .dropdown-item:last-of-type {
    margin-bottom: 0;
}

.date-dropdown-body .dropdown-item:hover {
    background: var(--bg-hover);
}

.date-dropdown-body .dropdown-item.selected {
    background: var(--bg-active);
    border: 1px solid var(--accent-primary);
}

.date-dropdown-body .dropdown-item .item-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.date-dropdown-body .dropdown-item .item-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.date-dropdown-body .dropdown-item .item-count {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 3px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

.date-dropdown-body .dropdown-item.noanswer-reason {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 14px;
    border: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.date-dropdown-body .dropdown-item.noanswer-reason .item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.date-dropdown-body .dropdown-item.noanswer-reason .item-desc {
    font-size: 11px;
    color: rgba(140, 150, 170, 0.7);
    line-height: 1.4;
}

.date-dropdown-body .dropdown-item.noanswer-reason.selected {
    border-color: var(--accent-primary);
    background: transparent !important;
}

/* Счётчик перезвонов — неактивный (0/0) и активный */
.date-dropdown-counter {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.date-dropdown-counter.inactive {
    color: var(--text-muted);
    background: var(--bg-primary);
}

.date-dropdown-counter.active {
    color: var(--accent-primary);
    background: rgba(124, 179, 66, 0.12);
}

.date-dropdown-counter .counter-divider {
    opacity: 0.5;
}

/* Адрес textarea */
.address-textarea {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
}

.address-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Кнопка История в блоке Предыдущий комментарий */
.prev-comment-footer {
    position: absolute;
    bottom: 5px;
    right: 5px;
}

.history-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.history-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(124, 179, 66, 0.1);
}

.history-btn i {
    font-size: 10px;
}

.history-count {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Статус звонка в истории созвонов */
.call-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 8px;
}

.call-status-completed {
    background: rgba(124, 179, 66, 0.15);
    color: var(--accent-primary);
}

.call-status-noanswer {
    background: rgba(255, 167, 38, 0.15);
    color: #ffa726;
}

.call-status-callback {
    background: rgba(66, 165, 245, 0.15);
    color: #42a5f5;
}

/* Модальное окно История созвонов — такие же стили как История общения */
#historyCallsModal.history-modal {
    z-index: 500010 !important;
}

.history-modal .modal-overlay {
    z-index: 500011 !important;
}

.history-modal-content {
    width: 480px;
    max-height: 640px;
    display: flex;
    flex-direction: column;
    z-index: 500012 !important;
}

.history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.history-modal-header h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-modal-header h2 i {
    color: var(--accent-primary);
    font-size: 14px;
}

.history-modal-header .modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s ease;
}

.history-modal-header .modal-close-btn:hover {
    color: var(--text-primary);
}

.history-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.history-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(48, 54, 61, 0.4);
}

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

.history-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

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

.history-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.history-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-date {
    font-size: 12px;
    color: #a0aab5;
}

.history-text {
    font-size: 13px;
    color: #b0b8c4;
    line-height: 1.5;
}

.history-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Налогообложение — мультиселекты */
.tax-selects-wrap {
    display: flex;
    gap: 12px;
}

.tax-select-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tax-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tax-multiselect {
    width: 100%;
    min-height: 70px;
    padding: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
}

.tax-multiselect:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.tax-multiselect option {
    padding: 4px 8px;
    border-radius: 3px;
    margin-bottom: 1px;
}

.tax-multiselect option:checked {
    background: var(--accent-primary);
    color: #fff;
}

.tax-multiselect option:hover {
    background: var(--bg-hover);
}

/* Кнопка Изменить статус */
.btn-status {
    background: linear-gradient(135deg, #7cb342 0%, #558b2f 100%);
    color: #fff;
    border: none;
    transition: all 0.15s ease;
}

.btn-status:hover {
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
    transform: translateY(-1px);
}

/* Пункты Изменить статус — цветные левые бордюры */
.date-dropdown-body .dropdown-item.status-reason {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 10px 14px;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    cursor: pointer;
}

.date-dropdown-body .dropdown-item.status-reason.status-green {
    border-left-color: rgba(124, 179, 66, 0.3);
}

.date-dropdown-body .dropdown-item.status-reason.status-yellow {
    border-left-color: rgba(255, 167, 38, 0.3);
}

.date-dropdown-body .dropdown-item.status-reason.status-red {
    border-left-color: rgba(239, 83, 80, 0.3);
}

.date-dropdown-body .dropdown-item.status-reason .item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.date-dropdown-body .dropdown-item.status-reason .item-desc {
    font-size: 11px;
    color: rgba(140, 150, 170, 0.7);
    line-height: 1.4;
}

/* Выделение при выборе — зеленый border, без фона */
.date-dropdown-body .dropdown-item.status-reason.selected {
    border: 1px solid var(--accent-primary);
    background: transparent !important;
}

/* Пункты Перезвона — border выбор без сдвига */
.date-dropdown-body .dropdown-item[data-date] {
    border: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.date-dropdown-body .dropdown-item[data-date].selected {
    border-color: var(--accent-primary);
    background: transparent !important;
}

/* Блок "Выбрать дату" — border выбор без фона */
.date-dropdown-body .dropdown-item.custom-date {
    border: 1px solid transparent;
    transition: border-color 0.15s ease;
}

.date-dropdown-body .dropdown-item.custom-date.selected {
    border-color: var(--accent-primary);
    background: transparent !important;
}

.date-dropdown-body .dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.date-dropdown-body .dropdown-item.custom-date {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.date-dropdown-body .dropdown-item.custom-date .item-title {
    margin-bottom: 4px;
}

.date-dropdown-body .dropdown-item.custom-date input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
}

.date-dropdown-body .dropdown-item.custom-date input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Футер дропдауна */
.date-dropdown-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.date-dropdown-footer .btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Скрытый элемент */
.hidden {
    display: none !important;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn i {
    font-size: 12px;
}

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

.btn-primary:hover {
    background: var(--accent-primary-hover);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-active);
}

.btn-danger {
    background: var(--status-inactive);
    color: #fff;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-success {
    background: var(--status-active);
    color: #fff;
}

.btn-success:hover {
    background: #689f38;
}

.btn-warning {
    background: var(--status-pending);
    color: #fff;
}

.btn-warning:hover {
    background: #f57c00;
}

/* Адаптивность */
@media (max-width: 1000px) {
    .call-work-body {
        flex-direction: column;
        overflow-y: auto;
    }
    
    .call-crops-table-column {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .call-info-column {
        flex: none;
    }
}

/* ============================================
   УВЕДОМЛЕНИЯ
   ============================================ */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--status-active);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification i {
    font-size: 18px;
}

/* ============================================
   СТРАНИЦА НАСТРОЙКИ С/Х КУЛЬТУР
   ============================================ */

/* Заголовок страницы */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: none;
}

.page-title i {
    font-size: 24px;
    color: var(--accent-primary);
}

.page-title h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Панель инструментов */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Контейнер таблицы культур */
.crops-table-container {
    overflow-x: auto;
    position: relative;
    max-width: 100%;
}

.crops-table-container::-webkit-scrollbar {
    height: 8px;
}

.crops-table-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.crops-table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

/* Таблица культур */
.crops-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.crops-table th,
.crops-table td {
    white-space: nowrap;
}

/* Фиксированная шапка */
.crops-table thead.sticky-header th {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-tertiary);
}

.crops-table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    text-align: left !important;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    position: relative;
    user-select: none;
}

.crops-table td {
    text-align: left !important;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.crops-table th.sortable {
    cursor: pointer;
}

.crops-table th.sortable:hover {
    background: var(--bg-hover);
}

.crops-table th .th-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crops-table th .fa-sort {
    color: var(--text-muted);
    font-size: 12px;
}

.crops-table th.sort-asc .fa-sort {
    transform: rotate(180deg);
    color: var(--accent-primary);
}

.crops-table th.sort-desc .fa-sort {
    color: var(--accent-primary);
}

/* Ширина колонок */
.crops-table .col-color {
    width: 70px;
    text-align: center;
}

.crops-table .col-name {
    min-width: 160px;
}

.crops-table .col-short {
    min-width: 130px;
    text-align: center;
}

.crops-table .col-type {
    min-width: 110px;
    text-align: center;
}

.crops-table .col-season-spring,
.crops-table .col-season-winter {
    min-width: 220px;
    text-align: left;
}

.crops-table .col-block {
    width: 70px;
    text-align: center;
}

.crops-table .col-actions {
    width: 110px;
    text-align: center;
}

/* Выравнивание ячеек */
.crops-table td.col-season-spring,
.crops-table td.col-season-winter {
    text-align: left !important;
}

.crops-table td.col-block {
    text-align: center;
}

.crops-table td.col-actions {
    text-align: center;
    vertical-align: middle;
}

/* Строки таблицы */
.crops-table tbody {
    display: table-row-group;
}

.crops-table tbody tr {
    background: var(--bg-secondary);
    transition: all 0.2s ease;
    height: 60px;
}

.crops-table tbody tr:hover {
    background: var(--bg-hover);
}

.crops-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

/* Цвет культуры */
.crop-color {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.crop-color.drag-handle {
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crop-color.drag-handle:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.crop-color.drag-handle:active {
    cursor: grabbing;
}

/* Drag & Drop стили */
.crops-table tbody tr.dragging {
    opacity: 0.5;
    background: var(--bg-active);
}

.crops-table tbody tr.drag-over {
    border-top: 3px solid var(--accent-primary);
}

/* Скрываем кнопки перемещения если есть */
.btn-move {
    display: none !important;
}

.crop-color.drag-handle {
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crop-color.drag-handle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.crop-color.drag-handle:active {
    cursor: grabbing;
}

/* Строка при перетаскивании */
.crops-table tbody tr.dragging {
    opacity: 0.5;
    background: var(--bg-active);
}

.crops-table tbody tr.drag-over {
    border-top: 3px solid var(--accent-primary);
}

/* Тип культуры */
.crop-type-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.crop-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.crop-type-badge.spring {
    background: rgba(124, 179, 66, 0.2);
    color: #7cb342;
}

.crop-type-badge.winter {
    background: rgba(66, 165, 245, 0.2);
    color: #42a5f5;
}

/* Сезон - в одну строку с иконками */
.season-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    flex-wrap: wrap;
}

.season-info .season-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.season-info .season-item i {
    color: var(--accent-primary);
    font-size: 11px;
}

.season-info .season-item.plant i {
    color: #7cb342;
}

.season-info .season-item.harvest i {
    color: #ff9800;
}

.season-info .season-value {
    color: var(--text-primary);
}

.season-info.inactive {
    opacity: 0.4;
}

.season-info.inactive .season-value {
    color: var(--text-muted);
}

/* Тумблер Блок */
.block-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.block-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.block-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: .3s;
    border-radius: 24px;
}

.block-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

.block-toggle input:checked + .block-toggle-slider {
    background-color: rgba(244, 67, 54, 0.3);
    border-color: #f44336;
}

.block-toggle input:checked + .block-toggle-slider:before {
    transform: translateX(20px);
    background-color: #f44336;
}

/* Кнопка редактировать */
.btn-edit {
    width: 28px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 10px;
    margin: auto;
}

.btn-edit:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* ============================================
   МОДАЛЬНОЕ ОКНО КУЛЬТУРЫ (НОВОЕ)
   ============================================ */

.modal-crop {
    width: 600px;
    max-width: 95vw;
}

.modal-crop .modal-body {
    padding: 24px;
}

/* Верхняя часть: цвет + названия */
.crop-modal-top {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.crop-color-section {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.crop-color-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #8B4513;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 3px solid var(--border-color);
}

.crop-color-circle:hover {
    transform: scale(1.05);
    border-color: var(--accent-primary);
}

.crop-color-circle i {
    font-size: 28px;
    color: rgba(255,255,255,0.7);
}

/* HTML5 color input (скрыт, открывается по клику на круг) */
#cropColorInput {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Заметные прочерки в пустых ячейках */
.season-info.inactive {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 4px 12px;
}

.season-info.inactive .season-value {
    color: #9ca3af;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 4px;
}

.crop-names-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.crop-names-section .form-group {
    margin-bottom: 0;
}

.crop-names-section .form-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
}

.crop-names-section .form-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.crop-names-section .form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Нижняя часть: две колонки с сезонами */
.crop-modal-bottom {
    display: flex;
    gap: 0;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 20px;
}

.season-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.season-divider {
    width: 1px;
    background: var(--border-color);
    margin: 0 20px;
}

/* Чекбокс сезона */
.season-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.season-checkbox-label input {
    display: none;
}

.check-icon {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

.check-icon::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    color: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.season-checkbox-label input:checked + .check-icon {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.season-checkbox-label input:checked + .check-icon::after {
    opacity: 1;
}

.season-label-text {
    font-size: 14px;
    font-weight: 600;
}

.season-label-text.spring {
    color: #7cb342;
}

.season-label-text.winter {
    color: #42a5f5;
}

/* Поля сезона */
.season-fields-block {
    display: flex;
    flex-direction: column;
    gap: 16px;
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.season-fields-block.active {
    opacity: 1;
    pointer-events: auto;
}

.season-field-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.season-selects {
    display: flex;
    gap: 8px;
}

.season-selects select {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.season-selects select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Кнопки модального окна */
.modal-crop .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.modal-crop .btn-delete {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #f44336;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-crop .btn-delete:hover {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
}

/* Форма */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group input[type="text"]::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Drag and Drop для таблицы
   ============================================ */

.crops-table tbody tr {
    cursor: default;
}

.crops-table .col-color {
    cursor: grab;
}

.crops-table .col-color:active {
    cursor: grabbing;
}




/* ============================================
   Глобальный tooltip (в body, position: fixed)
   ============================================ */
.global-tooltip {
    position: fixed;
    z-index: 999999;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    max-width: 280px;
    word-wrap: break-word;
}
.has-tooltip,
[data-tooltip] {
    position: relative;
}

.has-tooltip::after,
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
    z-index: 400000;
}

/* Многострочная подсказка для вкладок заданий */
[data-tooltip].task-tab::after {
    white-space: normal;
    width: max-content;
    max-width: 280px;
    text-align: left;
}

.has-tooltip::before,
[data-tooltip]::before {
    content: '';
    position: absolute;
    top: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent var(--border-color) transparent;
    opacity: 0;
}

/* ============================================
   ПАНЕЛЬ УВЕДОМЛЕНИЙ
   ============================================ */

.notifications-wrapper {
    position: relative;
}

.notifications-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: -10px;
    width: 420px;
    max-height: 720px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 500000;
}

.notifications-panel.active {
    display: flex;
}

.notifications-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.notifications-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notifications-header h3 i {
    color: var(--accent-primary);
    font-size: 13px;
}

.notifications-count {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
}

.notifications-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.notifications-list::-webkit-scrollbar {
    width: 4px;
}

.notifications-list::-webkit-scrollbar-track {
    background: transparent;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.notification-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 0;
    position: relative;
    border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

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

.notification-item:hover {
    background: transparent;
}

.notification-item.unread {
    background: transparent;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}

.notification-icon.auto {
    background: rgba(124, 179, 66, 0.15);
    color: var(--accent-primary);
}

.notification-icon.manual {
    background: rgba(66, 165, 245, 0.15);
    color: var(--status-new);
}

.notification-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

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

.notification-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    line-height: 1.3;
}

.notification-message {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
}

.notification-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.notification-time {
    font-size: 10px;
    color: var(--text-muted);
}

.notification-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-accept {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid var(--accent-primary);
    background: transparent;
    color: var(--accent-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

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

.btn-accepted {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: default;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-accepted i {
    font-size: 9px;
    color: var(--accent-primary);
}

.notification-counter {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 2px 6px;
    background: var(--bg-primary);
    border-radius: 4px;
}

.notification-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    color: #e53935;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.notification-item:hover .notification-delete-btn {
    opacity: 1;
}

.notification-delete-btn:hover {
    color: #ff5252;
}

/* Тултип статуса уведомления — fixed, чтобы не обрезался overflow */
.notification-status-tooltip-fixed {
    position: fixed;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 240px;
    max-width: 300px;
    box-shadow: var(--shadow-md);
    z-index: 999999;
    display: none;
    pointer-events: none;
    font-family: inherit;
}

.notification-status-tooltip-fixed.active {
    display: block;
}

.notification-status-tooltip-fixed h4 {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notification-status-tooltip-fixed .status-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notification-status-tooltip-fixed .status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}

.notification-status-tooltip-fixed .status-row .user-name {
    color: var(--text-secondary);
}

.notification-status-tooltip-fixed .status-row .user-time {
    color: var(--text-muted);
    font-size: 10px;
}

.notification-status-tooltip-fixed .status-row .no-data {
    color: var(--text-muted);
    font-style: italic;
}

.notifications-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.notifications-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notifications-input-wrap input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s ease;
}

.notifications-input-wrap input:focus {
    border-color: var(--accent-primary);
}

.notifications-input-wrap input::placeholder {
    color: var(--text-muted);
}

.notifications-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: var(--accent-primary);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.notifications-send-btn:hover {
    background: var(--accent-primary-hover);
}

.notifications-empty {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-muted);
    font-size: 12px;
}

.notifications-empty i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
    color: var(--border-color);
}

/* ============================================
   СТРАНИЦА: Пользователи системы
   ============================================ */

/* --- Заголовок страницы --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    font-size: 24px;
    color: var(--accent-primary);
}

.page-title h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-actions {
    display: flex;
    gap: 8px;
}

/* --- Заголовок + поиск + кнопка в одну строку --- */
.users-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.users-search-input {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 240px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.users-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.12);
}

.users-search-input::placeholder {
    color: var(--text-muted);
}

/* --- Таблица пользователей --- */
.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.users-table thead {
    position: sticky;
    top: 0;
    z-index: 100;
}

.users-table thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    user-select: none;
    position: relative;
    line-height: 1.4;
}

.users-table thead th .th-text {
    position: relative;
    z-index: 2;
}

.users-table thead th .filter-icon {
    margin-left: 6px;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.users-table thead th .filter-icon:hover {
    color: var(--accent-primary);
}

.users-table tbody td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
    font-weight: 400;
}

.users-table tbody tr {
    transition: background 0.15s ease;
}

.users-table tbody tr:hover {
    background: var(--bg-hover);
}

.users-table tbody tr.row-blocked {
    opacity: 0.5;
}

.users-table tbody tr.row-fired {
    background: rgba(239, 83, 80, 0.08);
}

.users-table tbody tr.row-fired:hover {
    background: rgba(239, 83, 80, 0.15);
}

.users-table .cell-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

/* Колонки */
.col-avatar { width: 50px; text-align: center; }
.col-id { width: 50px; }
.col-fio { min-width: 180px; }
.col-position { min-width: 130px; }
.col-region { min-width: 90px; }
.col-login { min-width: 110px; }
.col-dates { min-width: 130px; }
.col-tasks { width: 85px; text-align: center; }
.col-block { width: 85px; text-align: center; }
.col-privs { width: 65px; text-align: center; }
.col-copy { width: 65px; text-align: center; }
.col-actions { width: 140px; text-align: center; }

/* --- Аватар в таблице --- */
.user-table-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto;
    border: 2px solid var(--border-color);
}

.user-table-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- ФИО + статус --- */
.user-fio {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fio-name {
    font-weight: 500;
}

.fired-badge {
    display: inline-block;
    padding: 1px 6px;
    background: var(--status-inactive);
    color: white;
    font-size: 10px;
    border-radius: 4px;
    font-weight: 600;
    width: fit-content;
}

/* --- Даты --- */
.dates-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
}

.dates-wrap i {
    font-size: 10px;
    margin-right: 4px;
    color: var(--text-secondary);
}

.fired-date {
    color: var(--status-inactive);
}

.fired-date i {
    color: var(--status-inactive);
}

/* --- Логин --- */
.col-login code {
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent-primary);
}

/* --- Регионы --- */
.all-regions-badge {
    padding: 2px 8px;
    background: var(--bg-active);
    color: var(--accent-primary);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.more-regions {
    color: var(--text-secondary);
    font-size: 11px;
}

/* --- Simple Toggle (Задания / Блок) --- */
.simple-toggle {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
}

.simple-toggle input {
    display: none;
}

.simple-toggle-slider {
    width: 36px;
    height: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    position: relative;
    transition: all 0.3s ease;
    display: block;
}

.simple-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.simple-toggle input:checked + .simple-toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.simple-toggle input:checked + .simple-toggle-slider::before {
    transform: translateX(16px);
    background: white;
}

/* --- Иконка привилегий (custom) --- */
.col-privs .icon-btn-sm.custom-privs {
    color: var(--accent-gold);
}

.col-privs .icon-btn-sm.custom-privs:hover {
    background: var(--accent-gold);
    color: white;
}

/* --- Подсветка строки блокировки --- */
.row-blocked .col-fio .fio-name::after {
    content: ' (заблокирован)';
    color: var(--status-inactive);
    font-size: 11px;
    font-weight: 400;
}

/* ============================================
   Красная обводка ошибки валидации
   ============================================ */
.form-input.input-error {
    border-color: var(--status-inactive) !important;
    box-shadow: 0 0 0 3px rgba(239, 83, 80, 0.2);
}

/* Чекбокс "Уволен" — красный при checked */
.fired-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    height: 36px;
}

/* Тумблер Блокировки — красный при включении */
.users-table .col-block .simple-toggle input:checked + .simple-toggle-slider {
    background: var(--status-inactive) !important;
    border-color: var(--status-inactive) !important;
}

.fired-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--status-inactive);
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО: Пользователь
   ============================================ */
.user-modal-content {
    max-width: 560px;
    width: 90%;
}

.user-modal-content .modal-body {
    padding: 10px 20px;
}

.user-modal-content .modal-footer {
    padding: 10px 20px 12px;
}

.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    align-items: flex-end;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.form-group-wide {
    flex: 1 1 100%;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group label .required {
    color: var(--status-inactive);
}

.form-input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.15);
}

.form-select {
    cursor: pointer;
    appearance: auto;
}

.form-error {
    font-size: 11px;
    color: var(--status-inactive);
    min-height: 14px;
}

/* --- Поле пароля с генерацией --- */
.password-field {
    display: flex;
    gap: 6px;
}

.password-field .form-input {
    flex: 1;
}

.btn-gen-password {
    padding: 0 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-gen-password:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* --- Загрузка аватара --- */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-preview {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.avatar-upload-actions small {
    color: var(--text-secondary);
    font-size: 11px;
}

.hidden {
    display: none !important;
}

/* --- Переключатель "Уволен" --- */
.fired-row {
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    align-items: center;
}

.toggle-label-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.fired-toggle-wrap {
    display: flex;
    align-items: flex-end;
}

.fired-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.fired-toggle-text {
    line-height: 36px;
}

/* Тумблер уволен — новая структура */
#userFired:checked ~ .fired-toggle-btn .toggle-slider-v2 {
    background: var(--status-inactive);
    border-color: var(--status-inactive);
}

#userFired:checked ~ .fired-toggle-btn .toggle-slider-v2::before {
    transform: translateX(14px);
    background: white;
}

.toggle-label-wrap input {
    display: none;
}

.toggle-slider-v2 {
    width: 32px;
    height: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider-v2::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-label-wrap input:checked + .toggle-slider-v2 {
    background: var(--status-inactive);
    border-color: var(--status-inactive);
}

.toggle-label-wrap input:checked + .toggle-slider-v2::before {
    transform: translateX(14px);
    background: white;
}

/* --- Выбранные регионы теги --- */
.selected-regions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.region-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-active);
    color: var(--accent-primary);
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid var(--accent-primary);
}

/* ============================================
   МОДАЛЬНОЕ ПОДОКНО: Регионы
   ============================================ */
.region-modal-content {
    max-width: 420px;
    width: 90%;
}

.region-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.region-add-inline {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.region-add-inline input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.region-add-inline input:focus {
    border-color: var(--accent-primary);
}

.region-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 8px;
}

.region-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.region-checkbox-item:hover {
    background: var(--bg-hover);
}

.region-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

/* ============================================
   МОДАЛЬНОЕ ОКНО: Привилегии
   ============================================ */
.privileges-modal-content {
    max-width: 700px;
    width: 95%;
}

.priv-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 12px;
}

.priv-user-info img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.priv-user-info div {
    display: flex;
    flex-direction: column;
}

.priv-user-info strong {
    font-size: 15px;
    color: var(--text-primary);
}

.priv-user-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.privileges-status {
    margin-bottom: 12px;
}

.privileges-default {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg-active);
    color: var(--accent-primary);
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
}

.privileges-custom {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(255, 193, 7, 0.15);
    color: var(--accent-gold);
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
}

.privileges-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.privileges-table thead th {
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    background: var(--bg-secondary);
}

.privileges-table thead th:first-child {
    text-align: left;
}

.privileges-table tbody td {
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.privileges-table tbody td:first-child {
    text-align: left;
}

.privileges-table tbody tr:hover {
    background: var(--bg-hover);
}

/* ============================================
   МОДАЛЬНОЕ ОКНО: Подтверждение удаления
   ============================================ */
.confirm-modal-content {
    max-width: 400px;
    width: 90%;
}

.confirm-modal-content .modal-body p {
    margin-bottom: 8px;
    line-height: 1.5;
}

.confirm-modal-content .modal-body .text-muted {
    color: var(--text-secondary);
    font-size: 12px;
}

/* ============================================
   TOAST УВЕДОМЛЕНИЯ
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    box-shadow: var(--shadow-md);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    min-width: 240px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-color: var(--accent-primary);
}

.toast-success i {
    color: var(--accent-primary);
}

.toast-error {
    border-color: var(--status-inactive);
}

.toast-error i {
    color: var(--status-inactive);
}

.toast-warning {
    border-color: var(--accent-orange);
}

.toast-warning i {
    color: var(--accent-orange);
}

/* ============================================
   Кнопки (дополнения)
   ============================================ */
.btn-danger {
    background: var(--status-inactive);
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #d32f2f;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.icon-btn-sm {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn-sm:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

/* ============================================
   Модальное окно фильтра (дополнения)
   ============================================ */
.filter-modal-content {
    max-width: 320px;
    width: 90%;
}

/* ============================================
   Модальное окно базовые стили (дополнения)
   ============================================ */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 200001;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: var(--accent-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.modal-footer .btn {
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

/* ============================================
   СТРАНИЦА: Должности
   ============================================ */

/* Колонки таблицы должностей */
.col-name { min-width: 160px; }
.col-users {
    width: 100px;
    text-align: center;
}

.position-users-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: default;
    width: 56px;
}

.position-users-count i {
    color: var(--accent-primary);
    font-size: 12px;
}

/* Tooltip со списком пользователей */
.users-tooltip {
    position: fixed;
    z-index: 999999;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 14px;
    box-shadow: var(--shadow-md);
    font-size: 12px;
    color: var(--text-primary);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
}

.users-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.users-tooltip div {
    padding: 2px 0;
    border-bottom: 1px solid var(--border-light);
}

.users-tooltip div:last-child {
    border-bottom: none;
}

/* Модальное окно должности */
.position-modal-content {
    max-width: 680px;
    width: 95%;
}

.position-modal-content .modal-body {
    padding: 10px 20px;
}

.position-modal-content .modal-footer {
    padding: 10px 20px 12px;
}

/* Таблица привилегий в модальном окне должности */
.position-privileges-table {
    margin-top: 4px;
}

.position-privileges-table thead th {
    font-size: 11px;
    padding: 8px 6px;
    text-align: center;
}

.position-privileges-table thead th:first-child {
    text-align: left;
}

.position-privileges-table tbody td {
    padding: 7px 6px;
    text-align: center;
    vertical-align: middle;
}

.position-privileges-table tbody td:first-child {
    text-align: left;
}

.position-privileges-table .simple-toggle {
    margin: 0 auto;
}

/* ============================================
   СТРАНИЦА: Настройка регионов
   ============================================ */

/* Колонки таблицы регионов — левое выравнивание */
#regionsTable .col-region-name,
#regionsTable .col-region-short,
#regionsTable .col-region-capital,
#regionsTable .col-region-vector { text-align: left !important; }

#regionsTable thead th.col-region-name,
#regionsTable thead th.col-region-short,
#regionsTable thead th.col-region-capital,
#regionsTable thead th.col-region-vector { text-align: left !important; }

.col-region-name    { min-width: 170px; }
.col-region-short   { min-width: 130px; }
.col-region-capital { min-width: 100px; }
.col-region-vector  { min-width: 90px; }
.col-region-auto    { width: 70px; text-align: center; }
.col-region-districts { width: 80px; text-align: center; }

/* Кнопка количества районов */
.district-count-btn {
    min-width: 36px;
    padding: 4px 10px;
    font-weight: 600;
}

/* Колонки таблицы районов — левое выравнивание */
#districtsTable .col-district-name,
#districtsTable .col-district-short,
#districtsTable .col-district-center,
#districtsTable .col-district-coords { text-align: left !important; }

#districtsTable thead th.col-district-name,
#districtsTable thead th.col-district-short,
#districtsTable thead th.col-district-center,
#districtsTable thead th.col-district-coords { text-align: left !important; }

.col-district-name   { min-width: 180px; }
.col-district-short  { min-width: 130px; }
.col-district-center { min-width: 120px; }
.col-district-coords { min-width: 140px; }

/* Модальное окно региона */
.region-modal-content {
    max-width: 500px;
    width: 90%;
}

.region-modal-content .modal-body {
    padding: 10px 20px;
}

.region-modal-content .modal-footer {
    padding: 10px 20px 12px;
}

/* ============================================
   СТРАНИЦА: Лента событий
   ============================================ */

/* Фильтры */
.timeline-filters {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.timeline-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.timeline-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    min-width: 180px;
    max-width: 220px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237cb342' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.timeline-filter-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.12);
}

/* Выпадающие опции select */
.timeline-filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 13px;
}

.timeline-filter-select option:hover,
.timeline-filter-select option:focus {
    background: var(--bg-hover) !important;
    color: var(--accent-primary) !important;
}

.timeline-filter-select option:checked {
    background: var(--bg-tertiary) !important;
    color: var(--accent-primary) !important;
    font-weight: 600;
}

.timeline-filter-select option:nth-child(even) {
    background: var(--bg-tertiary);
}

.timeline-date-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-date-input {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    width: 150px;
    cursor: pointer;
}

.timeline-date-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.12);
}

/* Иконка календаря — зеленая */
.timeline-date-input::-webkit-calendar-picker-indicator {
    filter: invert(59%) sepia(12%) saturate(2648%) hue-rotate(38deg) brightness(92%) contrast(89%);
    cursor: pointer;
    opacity: 0.8;
}

.timeline-date-input::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.timeline-date-sep {
    color: var(--text-secondary);
    font-size: 14px;
}

.timeline-filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

/* Лента событий */
.timeline-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.timeline-card:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

/* Левая часть — аватар + имя */
.timeline-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    flex-shrink: 0;
}

.timeline-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
    flex-shrink: 0;
}

.timeline-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.timeline-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* Разделитель */
.timeline-card-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* Центр — дата/время */
.timeline-card-center {
    min-width: 160px;
    flex-shrink: 0;
}

.timeline-datetime {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Правая часть — описание */
.timeline-card-right {
    flex: 1;
    min-width: 0;
}

.timeline-action {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.timeline-action-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-module-tag {
    display: inline-block;
    padding: 1px 8px;
    background: var(--bg-active);
    color: var(--accent-primary);
    font-size: 11px;
    border-radius: 4px;
    font-weight: 500;
}

.timeline-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Формат "было → стало" */
.timeline-old {
    color: var(--status-inactive);
    text-decoration: line-through;
}

.timeline-arrow {
    color: var(--accent-primary);
    font-weight: 600;
    margin: 0 4px;
}

.timeline-new {
    color: var(--accent-primary);
    font-weight: 500;
}

/* Пустое состояние */
.timeline-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.timeline-empty i {
    font-size: 48px;
    opacity: 0.3;
}

.timeline-empty p {
    font-size: 14px;
}
