/* ===== Мои дела (Personal Tasks) ===== */

.personal-tasks-page {
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.personal-tasks-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.personal-tasks-page .page-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    display: flex;
    align-items: center;
    gap: 12px;
}

.personal-tasks-page .page-header h1 i {
    color: var(--accent-primary, #3b82f6);
}

/* Фильтры */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 12px;
    width: fit-content;
}

.filter-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover {
    color: #1e293b;
    background: #e2e8f0;
}

.filter-tab.active {
    background: #3b82f6;
    color: white;
}

/* Секции задач */
.tasks-sections {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tasks-section {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-light, #e2e8f0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Срочные задачи - красный текст, стандартная рамка */
.tasks-section[data-section="urgent"] .section-header h3 {
    color: #ef4444;
}

.tasks-section[data-section="urgent"] .section-header .count {
    background: #ef4444;
    color: white;
}

/* На сегодня - оранжевый текст */
.tasks-section[data-section="today"] .section-header h3 {
    color: #ea580c;
}

.tasks-section[data-section="today"] .section-header .count {
    background: #f97316;
    color: white;
}

/* На неделю - синий счетчик */
.tasks-section[data-section="week"] .section-header .count {
    background: #3b82f6;
    color: white;
}

/* Выполненные - зеленый текст */
.tasks-section[data-section="completed"] .section-header h3 {
    color: #059669;
}

.tasks-section[data-section="completed"] .section-header .count {
    background: #10b981;
    color: white;
}

.section-header {
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    background: #f8fafc;
}

.section-header:hover {
    background: #f1f5f9;
}

.section-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h3 i {
    font-size: 12px;
    color: #64748b;
    transition: transform 0.2s;
}

.tasks-section.collapsed .section-header h3 i {
    transform: rotate(-90deg);
}

.section-header .count {
    background: #e2e8f0;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.section-content {
    border-top: 1px solid #e2e8f0;
    transition: max-height 0.3s ease-out;
    max-height: 2000px;
    overflow: hidden;
    background: #ffffff;
}

.tasks-section.collapsed .section-content {
    max-height: 0;
    border-top: none;
}

/* Карточки задач */
.task-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 20px;
    border-left: 4px solid #3b82f6;
    transition: all 0.2s;
    cursor: pointer;
    background: #ffffff;
}

.task-card:hover {
    background: #f8fafc;
}

.task-card + .task-card {
    border-top: 1px solid #e2e8f0;
}

.task-card.completed {
    opacity: 0.6;
}

.task-card.completed .task-title {
    text-decoration: line-through;
}

.task-checkbox {
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding-top: 2px;
}

.task-checkbox:hover {
    color: #3b82f6;
    transform: scale(1.1);
}

.task-card.completed .task-checkbox {
    color: #10b981;
}

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

.task-title {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
}

.task-description {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

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

.task-priority {
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.task-priority.priority-urgent {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.task-priority.priority-high {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.task-priority.priority-normal {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.task-priority.priority-low {
    background: rgba(107, 114, 128, 0.2);
    color: #6b7280;
}

.task-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.task-card:hover .task-actions {
    opacity: 1;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #ef4444;
    color: white;
}

/* Пустое состояние */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Модальное окно */
#personal-task-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
}

#personal-task-modal[style*="display: flex"] {
    display: flex !important;
}

#personal-task-modal .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
}

#personal-task-modal .modal-content {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    z-index: 10001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #94a3b8;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Форма */
#personal-task-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #0f172a;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 560px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    margin-top: 24px;
}

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

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* ===== Интеграция в список задач ===== */

.task-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.task-type-badge.personal {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.task-type-badge.client {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

