/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* Навигация */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.3rem;
    color: #667eea;
}

.logo i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 5px 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 70px;
    flex-shrink: 0;
}

.nav-item i {
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 0.8rem;
}

.nav-item:hover,
.nav-item.active {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.user-menu {
    display: flex;
    gap: 10px;
}

.btn-login {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-login:hover {
    background: #764ba2;
    transform: scale(1.05);
}

/* Основной контент */
.main-container {
    max-width: 100%;
    margin: 20px auto;
    padding: 0 15px;
}

.content-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 20px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
}

/* === СТИЛИ ДЛЯ РАЗДЕЛА ПРОГРЕССА === */

/* Общий обзор */
.progress-overview {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .progress-overview {
        grid-template-columns: 1fr;
    }
}

/* Карточка уровня */
.level-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.level-badge {
    text-align: center;
    flex-shrink: 0;
}

.level-number {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.level-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 5px;
}

.level-info {
    flex: 1;
}

.level-info h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.xp-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.xp-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.xp-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
}

.xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.streak {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 87, 34, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    width: fit-content;
    font-size: 0.9rem;
}

.streak i {
    color: #FF5722;
}

/* Быстрая статистика */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.quick-stat {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.quick-stat:hover {
    transform: translateY(-3px);
}

.quick-stat i {
    font-size: 2rem;
    width: 40px;
}

.quick-stat .stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.quick-stat .stat-label {
    font-size: 0.85rem;
    color: #666;
}

/* Прогресс по разделам */
.section-progress {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.progress-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #667eea;
    transition: transform 0.3s ease;
}

.progress-section:hover {
    transform: translateY(-5px);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header h4 {
    font-size: 1rem;
    color: #444;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-percent {
    font-weight: 700;
    font-size: 1.2rem;
    color: #667eea;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
}

.progress-details i {
    margin-right: 5px;
}

/* Достижения */
.achievements-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.achievement-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    opacity: 0.3;
    transition: all 0.3s ease;
    position: relative;
}

.achievement-card.unlocked {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.3);
}

.achievement-card.locked:after {
    content: '🔒';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
}

.achievement-card i {
    font-size: 2rem;
    margin-bottom: 10px;
}

.achievement-card h4 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.achievement-card p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.achievement-xp {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Ежедневные цели */
.daily-goals {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.goals-list {
    margin-top: 20px;
}

.goal-item {
    display: flex;
    align-items: center;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.goal-item:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.goal-item.completed {
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
}

.goal-checkbox {
    margin-right: 15px;
}

.goal-checkbox input[type="checkbox"] {
    display: none;
}

.goal-checkbox label {
    width: 24px;
    height: 24px;
    border: 2px solid #667eea;
    border-radius: 6px;
    display: block;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.goal-checkbox input:checked + label {
    background: #4CAF50;
    border-color: #4CAF50;
}

.goal-checkbox input:checked + label:after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
}

.goal-content {
    flex: 1;
}

.goal-content h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #333;
}

.goal-content p {
    font-size: 0.85rem;
    color: #666;
}

.goal-xp {
    background: linear-gradient(135deg, #FF9800, #FF5722);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* === ОПТИМИЗИРОВАННАЯ СЕКЦИЯ ЗАДАЧ === */

/* Заголовок с навигацией */
.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.week-navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.current-week {
    font-weight: 600;
    color: #667eea;
    min-width: 120px;
    text-align: center;
    font-size: 0.9rem;
}

/* Недельная таблица задач - КОМПАКТНАЯ */
.week-table-container {
    margin: 20px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.week-table {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 10px;
    min-width: 1100px;
}

.day-column {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.day-column:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.day-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.day-header h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
}

.day-date {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

/* Бейдж "Сегодня" */
.today-badge {
    display: inline-block;
    background: white;
    color: #4CAF50;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Кнопка добавления в заголовке дня */
.add-task-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.add-task-btn:hover {
    background: white;
    color: #667eea;
    transform: scale(1.1);
}

/* Подсветка сегодняшнего дня */
.day-column.today .day-header {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.day-column.today .add-task-btn {
    background: rgba(255, 255, 255, 0.3);
}

.day-column.today .add-task-btn:hover {
    background: white;
    color: #4CAF50;
}

.day-column.today .donut-text {
    color: white;
}

/* Круговая диаграмма прогресса */
.progress-donut {
    display: flex;
    justify-content: center;
    margin: 10px 0;
    position: relative;
}

.donut-chart {
    transform: rotate(-90deg);
    width: 80px;
    height: 80px;
}

.donut-ring {
    stroke-dasharray: 100 100;
    stroke-width: 4;
    stroke: #e0e0e0;
}

.donut-segment {
    stroke-dasharray: 0 100;
    transition: stroke-dasharray 0.5s ease;
    stroke-width: 4;
    stroke: #667eea;
}

/* Контейнер для текста процентов */
.donut-text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.donut-text {
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-align: center;
}

/* Список задач внутри дня */
.tasks-list {
    flex: 1;
    padding: 10px;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
}

.empty-day-tasks {
    text-align: center;
    color: #999;
    padding: 20px 10px;
    font-style: italic;
    font-size: 0.9rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Элемент задачи - УПРОЩЕННЫЙ */
.task-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 8px;
    border-left: 4px solid #667eea;
    position: relative;
    animation: slideIn 0.2s ease;
    cursor: grab;
    transition: all 0.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-item:active {
    cursor: grabbing;
}

.task-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.task-item.completed {
    opacity: 0.7;
    border-left-color: #4CAF50;
    background: #f0f9f0;
}

/* Стили для перетаскивания */
.task-item.dragging {
    opacity: 0.5;
    transform: rotate(3deg);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.day-column.drag-over {
    background: rgba(102, 126, 234, 0.05);
    border: 2px dashed #667eea;
}

.task-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4CAF50;
    z-index: 2;
}

.task-content {
    padding-right: 35px;
}

.task-text {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 0;
    padding-right: 10px;
}

/* Статистика недели */
.week-statistics {
    margin-top: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

.stat-card h3 {
    margin-bottom: 20px;
    color: #444;
    font-size: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin: 15px 0;
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.stat-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Стили для активного фильтра в статистике */
.stat-item.active {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border: 2px solid #667eea;
}

.stat-item.active .stat-icon {
    transform: scale(1.1);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 2px;
}

/* Карточка с выводами */
.analytics-insights {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.analytics-insights h4 {
    color: #444;
    margin-bottom: 15px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insight-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 20px;
    border-left: 4px solid #4CAF50;
}

.insight-content p {
    margin: 0;
    line-height: 1.6;
    color: #444;
}

.insight-content ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.insight-content li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.insight-tip {
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 3px solid #2196F3;
    font-size: 0.9rem;
}

/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal.edit-mode .modal-header {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
}

.modal-body {
    padding: 20px;
}

.modal-body textarea,
.modal-body select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 15px;
}

.modal-body textarea:focus,
.modal-body select:focus {
    outline: none;
    border-color: #667eea;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.3);
}

/* Финансы */
.finance-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.income { color: #2ed573; font-size: 1.5rem; font-weight: 600; }
.expense { color: #ff4757; font-size: 1.5rem; font-weight: 600; }
.balance { color: #3742fa; font-size: 1.5rem; font-weight: 600; }

.budget-input {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.budget-input input,
.budget-input select {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    flex: 1;
    min-width: 120px;
}

/* Чат и ИИ */
.chat-container,
.ai-chat {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.chat-messages {
    height: 250px;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 12px;
    background: white;
    border-radius: 10px;
}

.message {
    margin-bottom: 12px;
    padding: 10px 15px;
    border-radius: 10px;
    background: #e9ecef;
    max-width: 80%;
    font-size: 0.95rem;
}

.message.system {
    background: #667eea;
    color: white;
    margin: 0 auto;
    text-align: center;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Бизнес */
.business-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
}

.chart-placeholder {
    background: rgba(255, 255, 255, 0.2);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    margin-top: 15px;
}

/* Футер */
.footer {
    text-align: center;
    padding: 20px;
    color: white;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 30px;
    font-size: 0.9rem;
}

.dev-note {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 8px;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .week-table {
        grid-template-columns: repeat(4, minmax(150px, 1fr));
        min-width: 800px;
    }
}

@media (max-width: 992px) {
    .nav-container {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }
    
    .nav-menu {
        order: 3;
        width: 100%;
        margin-top: 10px;
        justify-content: center;
    }
    
    .week-table {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    .week-table {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        min-width: 400px;
    }
    
    .tasks-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .week-navigation {
        justify-content: center;
    }
    
    .modal {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 576px) {
    .week-table {
        grid-template-columns: 1fr;
        min-width: 300px;
    }
    
    .meal-plan {
        grid-template-columns: 1fr;
    }
    
    .budget-input {
        flex-direction: column;
    }
    
    .chat-input {
        flex-direction: column;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
}

/* === СТИЛИ БИЗНЕС-РАЗДЕЛА === */

.business-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
}

.business-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
    padding: 0 20px;
}

.business-tab {
    padding: 15px 20px;
    background: none;
    border: none;
    font-size: 0.95rem;
    color: #666;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.business-tab:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.business-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.business-tab-content {
    display: none;
    padding: 25px;
}

.business-tab-content.active {
    display: block;
}

/* Дашборд */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.dashboard-header h3 {
    margin: 0;
}

.period-selector select {
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
}

.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
}

.kpi-card.revenue {
    border-left: 4px solid #4CAF50;
}

.kpi-card.expenses {
    border-left: 4px solid #FF5722;
}

.kpi-card.profit {
    border-left: 4px solid #2196F3;
}

.kpi-card.clients {
    border-left: 4px solid #9C27B0;
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.kpi-card.revenue .kpi-icon {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
}

.kpi-card.expenses .kpi-icon {
    background: linear-gradient(135deg, #FF5722, #D84315);
}

.kpi-card.profit .kpi-icon {
    background: linear-gradient(135deg, #2196F3, #0D47A1);
}

.kpi-card.clients .kpi-icon {
    background: linear-gradient(135deg, #9C27B0, #6A1B9A);
}

.kpi-info {
    flex: 1;
}

.kpi-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.kpi-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.kpi-change {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: #e8f5e9;
    color: #2E7D32;
}

.kpi-card.expenses .kpi-change {
    background: #ffebee;
    color: #D84315;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.chart-container h4 {
    margin-bottom: 15px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-business-tasks {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.active-business-tasks h4 {
    margin-bottom: 15px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tasks-list {
    min-height: 100px;
}

.empty-tasks {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* Закупки */
.procurement-header,
.employees-header,
.documents-header,
.clients-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.procurement-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.procurement-filters select {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-width: 150px;
}

.procurement-list {
    min-height: 300px;
    margin-bottom: 25px;
}

.empty-procurement,
.empty-employees,
.empty-documents,
.empty-clients {
    text-align: center;
    padding: 50px 20px;
    color: #666;
}

.empty-icon {
    font-size: 3rem;
    color: #e0e0e0;
    margin-bottom: 15px;
}

.empty-procurement h4,
.empty-employees h4,
.empty-documents h4,
.empty-clients h4 {
    margin-bottom: 10px;
    color: #444;
}

/* Сотрудники */
.org-structure {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.structure-tree {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-structure {
    text-align: center;
    color: #666;
    padding: 30px;
}

.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.employees-stats {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

/* Документы */
.document-actions {
    display: flex;
    gap: 10px;
}

.document-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding: 10px 0;
}

.category {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.category:hover {
    background: #e0e0e0;
}

.category.active {
    background: #667eea;
    color: white;
}

.documents-list {
    min-height: 300px;
    margin-bottom: 25px;
}

.documents-stats .stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

/* Клиенты */
.clients-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.client-stat {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.clients-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.clients-filters input,
.clients-filters select {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    min-width: 200px;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.sales-funnel {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
}

.funnel-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.funnel-stage {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    position: relative;
}

.funnel-stage:after {
    content: '→';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

.funnel-stage:last-child:after {
    display: none;
}

.stage-name {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.stage-count {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
}

/* Стили для элементов бизнеса */
.procurement-item, .employee-card, .document-item, .client-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.procurement-item:hover, .employee-card:hover, .document-item:hover, .client-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.procurement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.procurement-header h4 {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

.procurement-status {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.procurement-status.planning {
    background: #FFF3E0;
    color: #EF6C00;
}

.procurement-status.ordered {
    background: #E3F2FD;
    color: #1565C0;
}

.procurement-status.delivered {
    background: #E8F5E9;
    color: #2E7D32;
}

.procurement-status.paid {
    background: #F3E5F5;
    color: #7B1FA2;
}

.procurement-details {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
}

.procurement-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.procurement-priority {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.procurement-priority.low {
    background: #E8F5E9;
    color: #2E7D32;
}

.procurement-priority.medium {
    background: #FFF3E0;
    color: #EF6C00;
}

.procurement-priority.high {
    background: #FFEBEE;
    color: #C62828;
}

.employee-card, .client-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.employee-avatar, .client-avatar {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.employee-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.employee-info, .client-info {
    flex: 1;
}

.employee-info h4, .client-info h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #333;
}

.employee-info p, .client-info p {
    margin: 0 0 5px 0;
    font-size: 0.85rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.client-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 5px;
}

.client-status.lead {
    background: #E3F2FD;
    color: #1565C0;
}

.client-status.active {
    background: #E8F5E9;
    color: #2E7D32;
}

.client-status.inactive {
    background: #F5F5F5;
    color: #757575;
}

.client-status.vip {
    background: #FFF3E0;
    color: #EF6C00;
}

.document-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.document-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.document-info {
    flex: 1;
}

.document-info h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #333;
}

.document-info p {
    margin: 0 0 3px 0;
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.procurement-actions, .employee-actions, .document-actions, .client-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: white;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #f5f5f5;
    color: #667eea;
    border-color: #667eea;
}

/* Стили для универсального модального окна бизнеса */
.form-section {
    padding: 10px 0;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #444;
    font-size: 0.9rem;
}

.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
}

.modal-body .form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* Адаптивность для бизнес-раздела */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .procurement-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .employee-card, .client-card, .document-item {
        flex-direction: column;
        text-align: center;
    }
    
    .employee-avatar, .client-avatar, .document-icon {
        margin: 0 auto 10px;
    }
    
    .employee-actions, .client-actions, .document-actions, .procurement-actions {
        justify-content: center;
        margin-top: 10px;
    }
}

/* Стили для ИИ-чата */
.ai-chat {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.ai {
    background: white;
    border: 1px solid #e0e0e0;
    margin-right: auto;
}

.message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
}

.message strong {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    opacity: 0.8;
}

.chat-input {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.chat-input input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-input button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.chat-input button:hover {
    transform: translateY(-2px);
}

/* Индикатор "ИИ печатает" */
.ai-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background: white;
    border-radius: 12px;
    margin-bottom: 15px;
    width: fit-content;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Стили для ИИ-чата */
.ai-chat {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 25px;
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.message {
    margin-bottom: 15px;
    padding: 15px 20px;
    border-radius: 15px;
    max-width: 85%;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
    font-size: 0.95rem;
    word-wrap: break-word;
    position: relative;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.ai {
    background: white;
    border: 1px solid rgba(102, 126, 234, 0.2);
    margin-right: auto;
    border-top-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    border-top-right-radius: 5px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.message strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85em;
    opacity: 0.9;
}

.chat-input {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    align-items: center;
}

.chat-input input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chat-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-input button {
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.chat-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

/* Индикатор "ИИ печатает" */
.ai-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: white;
    border-radius: 12px;
    margin-bottom: 15px;
    width: fit-content;
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-typing strong {
    font-size: 0.85em;
    color: #666;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Стили для списка похожих вопросов */
.suggestions {
    margin-top: 20px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.suggestions h4 {
    margin-bottom: 10px;
    color: #444;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.suggestion-item {
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    color: #666;
    border: 1px solid #e0e0e0;
}

.suggestion-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border-color: #667eea;
    transform: translateX(5px);
}

/* Адаптивность */
@media (max-width: 768px) {
    .ai-chat {
        padding: 15px;
        max-height: 400px;
    }
    
    .message {
        max-width: 90%;
        padding: 12px 15px;
        font-size: 0.9rem;
    }
    
    .chat-input {
        flex-direction: column;
    }
    
    .chat-input input,
    .chat-input button {
        width: 100%;
    }
}
/* Добавить в конец style.css */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}