/* ============================================
   EK-Task — Style.css (revisado e garantido)
   ============================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --radius: 14px;
    --radius-sm: 10px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --accent: #6366f1;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
    background-attachment: fixed;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* ===== HEADER ===== */
.app-header { margin-bottom: 32px; }

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }

.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: grid;
    place-items: center;
    color: white;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.5);
    flex-shrink: 0;
}

.brand-icon svg { width: 26px; height: 26px; }

.brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #1e293b, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #4f46e5;
}

.subtitle { color: var(--text-muted); font-size: 0.875rem; }

/* ===== HEADER ACTIONS ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ===== USER MENU ===== */
.user-menu { position: relative; }

.user-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    transition: var(--transition);
}

.user-trigger:hover {
    border-color: var(--primary-light);
    background: #f8fafc;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-name { color: var(--text); }

.user-trigger .chev {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform 0.25s;
}

.user-menu.open .chev { transform: rotate(180deg); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.user-menu.open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 12px 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dropdown-header strong { font-size: 0.92rem; color: var(--text); }
.dropdown-header small {
    font-size: 0.8rem;
    color: var(--text-muted);
    word-break: break-all;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.dropdown-item:hover { background: #f1f5f9; }
.dropdown-item.danger { color: #dc2626; }
.dropdown-item.danger:hover { background: #fef2f2; }
.dropdown-item svg { width: 17px; height: 17px; }

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px -2px rgba(99, 102, 241, 0.45);
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px -2px rgba(99, 102, 241, 0.55);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 18px; height: 18px; }

.btn-secondary {
    padding: 12px 22px;
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-secondary:hover { background: #f1f5f9; color: var(--text); }

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: none;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-icon:hover { background: #f1f5f9; color: var(--text); }
.btn-icon svg { width: 20px; height: 20px; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--accent, var(--primary));
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    background: var(--accent, var(--primary));
    background: color-mix(in srgb, var(--accent, var(--primary)) 12%, transparent);
    position: relative;
}

@supports not (background: color-mix(in srgb, red 10%, transparent)) {
    .stat-icon::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(255,255,255,0.88);
        border-radius: inherit;
        z-index: 0;
    }
    .stat-icon { color: inherit; }
}

.stat-info { display: flex; flex-direction: column; min-width: 0; }
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent, var(--primary));
    letter-spacing: -0.03em;
}

/* ===== FILTERS ===== */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 240px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 14px;
    width: 18px; height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    color: var(--text);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }

.filter-chip {
    padding: 10px 18px;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.filter-chip:hover { border-color: var(--primary-light); color: var(--primary); }

.filter-chip.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.4);
}

/* ============================================
   VIEW SWITCHER (Grade / Lista / Compacta)
   ============================================ */
.view-switcher {
    display: inline-flex !important;
    position: relative;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 2px;
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10;
}

.view-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    min-height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    display: grid !important;
    place-items: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 0;
    position: relative;
    z-index: 11;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    font-family: inherit;
}

.view-btn:hover {
    background: #f1f5f9;
    color: var(--text);
}

.view-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    box-shadow: 0 2px 8px -2px rgba(99, 102, 241, 0.5);
}

.view-btn svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.view-btn.active svg {
    color: white;
    stroke: white;
}

/* ============================================
   TASKS GRID (padrão)
   ============================================ */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.task-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: var(--transition);
    position: relative;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.task-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.task-card.completed { opacity: 0.65; }
.task-card.completed .task-title { text-decoration: line-through; color: var(--text-muted); }

.task-priority-bar {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
}

.task-card[data-priority="high"] .task-priority-bar { background: linear-gradient(90deg, var(--danger), #f87171); }
.task-card[data-priority="medium"] .task-priority-bar { background: linear-gradient(90deg, var(--warning), #fbbf24); }
.task-card[data-priority="low"] .task-priority-bar { background: linear-gradient(90deg, var(--success), #34d399); }

.task-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 4px;
}

.task-checkbox {
    width: 24px; height: 24px;
    min-width: 24px;
    margin-top: 2px;
    border-radius: 8px;
    border: 2px solid var(--border);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: var(--transition);
    flex-shrink: 0;
    background: transparent;
    padding: 0;
}

.task-checkbox:hover { border-color: var(--primary); }

.task-card.completed .task-checkbox {
    background: var(--success);
    border-color: var(--success);
}

.task-checkbox svg {
    width: 14px; height: 14px;
    color: white;
    opacity: 0;
    transition: var(--transition);
}

.task-card.completed .task-checkbox svg { opacity: 1; }

.task-content { flex: 1; min-width: 0; }

.task-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    word-break: break-word;
    line-height: 1.4;
}

.task-description {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 6px;
    margin-bottom: 12px;
    line-height: 1.5;
    word-break: break-word;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    margin-top: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.badge-category { background: rgba(99, 102, 241, 0.12); color: var(--primary-dark); }
.badge-status { text-transform: uppercase; }
.badge-status.pending { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.badge-status.in_progress { background: rgba(59, 130, 246, 0.14); color: #1d4ed8; }
.badge-status.completed { background: rgba(16, 185, 129, 0.14); color: #047857; }

.badge-due {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
}

.badge-due.overdue { background: rgba(239, 68, 68, 0.14); color: #b91c1c; }
.badge-due.today { background: rgba(245, 158, 11, 0.14); color: #b45309; }

.task-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.action-btn {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: transparent;
    border: none;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.action-btn:hover { background: #f1f5f9; }
.action-btn.edit:hover { color: var(--primary); background: rgba(99, 102, 241, 0.1); }
.action-btn.delete:hover { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.action-btn svg { width: 17px; height: 17px; }

/* ============================================
   MODO LISTA — Cards horizontais
   ============================================ */
.tasks-grid.view-list {
    grid-template-columns: 1fr;
    gap: 10px;
}

.view-list .task-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
}

.view-list .task-card:hover {
    transform: translateX(4px) translateY(0);
}

.view-list .task-header {
    margin-bottom: 0;
    align-items: center;
    gap: 0;
    width: 100%;
}

.view-list .task-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.view-list .task-title {
    font-size: 0.98rem;
    margin-bottom: 0;
}

.view-list .task-description {
    font-size: 0.82rem;
    margin-top: 2px;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.view-list .task-meta {
    margin-bottom: 0;
    margin-top: 4px;
    gap: 6px;
}

.view-list .task-actions {
    border-top: none;
    padding-top: 0;
    margin-left: auto;
}

.view-list .badge {
    font-size: 0.68rem;
    padding: 3px 8px;
}

@media (max-width: 640px) {
    .view-list .task-card {
        grid-template-columns: auto 1fr;
        gap: 12px;
    }
    .view-list .task-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid var(--border);
    }
}

/* ============================================
   MODO COMPACTA — Cards menores
   ============================================ */
.tasks-grid.view-compact {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.view-compact .task-card {
    padding: 12px 14px;
    border-radius: 10px;
}

.view-compact .task-card:hover {
    transform: translateY(-2px);
}

.view-compact .task-header {
    margin-bottom: 6px;
    gap: 8px;
}

.view-compact .task-checkbox {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border-radius: 6px;
    margin-top: 1px;
}

.view-compact .task-checkbox svg {
    width: 12px;
    height: 12px;
}

.view-compact .task-title {
    font-size: 0.9rem;
    line-height: 1.3;
}

.view-compact .task-description {
    display: none;
}

.view-compact .task-meta {
    gap: 4px;
    margin-bottom: 8px;
    margin-top: 2px;
}

.view-compact .badge {
    font-size: 0.65rem;
    padding: 2px 7px;
}

.view-compact .task-actions {
    padding-top: 8px;
    gap: 4px;
}

.view-compact .action-btn {
    width: 28px;
    height: 28px;
}

.view-compact .action-btn svg {
    width: 14px;
    height: 14px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-icon { font-size: 4rem; margin-bottom: 16px; opacity: 0.6; }
.empty-state h3 { font-size: 1.25rem; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 0.95rem; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.25s ease;
    overflow-y: auto;
}

.modal-overlay.active { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--card);
    border-radius: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    margin: auto;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }

.modal-body { padding: 26px; }

.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    background: var(--card);
    color: var(--text);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 22px;
    background: var(--text);
    color: white;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(200%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toast.success { background: linear-gradient(135deg, var(--success), #059669); }
.toast.error { background: linear-gradient(135deg, var(--danger), #dc2626); }

/* ===== SHAKE ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .app-container { padding: 20px 16px 48px; }
    .brand h1 { font-size: 1.4rem; }
    .brand-icon { width: 44px; height: 44px; }
    .header-content { flex-direction: column; align-items: stretch; }
    .header-actions { justify-content: space-between; }
    .btn-primary { justify-content: center; flex: 1; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card { padding: 16px; gap: 12px; }
    .stat-icon { width: 40px; height: 40px; font-size: 1.2rem; }
    .stat-value { font-size: 1.3rem; }
    .tasks-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filter-group {
        overflow-x: auto;
        padding-bottom: 4px;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .filter-group::-webkit-scrollbar { display: none; }
    .filter-chip { flex-shrink: 0; }
    .view-switcher { align-self: flex-end; }
    .toast { left: 16px; right: 16px; bottom: 16px; justify-content: center; }
    .user-name { display: none; }
    .user-trigger { padding: 6px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .modal { border-radius: 16px; }
    .modal-header, .modal-body { padding: 20px; }
    .brand h1 { font-size: 1.25rem; }
    .subtitle { font-size: 0.78rem; }
    .view-switcher {
        align-self: stretch;
        justify-content: center;
    }
    .view-btn { flex: 1; }
    .view-list .task-card { padding: 12px 14px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }






/* ============================================================
   EK-TASK — Estilos adicionados para o modo Pessoal/Trabalho
   (não sobrescreve nada existente, apenas complementa)
   ============================================================ */

/* ---------- TELA DE SELEÇÃO DE CATEGORIA ---------- */
.category-select {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 8px;
}

.category-subtitle {
    color: var(--text-secondary, #64748b);
    margin-bottom: 40px;
    font-size: 1.05rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.category-card {
    background: var(--card-bg, #fff);
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 36px 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    font-family: inherit;
    color: inherit;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.12);
    border-color: #6366f1;
}

.category-icon {
    font-size: 3.5rem;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    margin-bottom: 8px;
}

.category-icon.personal { background: linear-gradient(135deg, #ddd6fe, #c4b5fd); }
.category-icon.work     { background: linear-gradient(135deg, #bfdbfe, #93c5fd); }

.category-card h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin: 0;
}

.category-card p {
    color: var(--text-secondary, #64748b);
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

.category-count {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    padding: 6px 14px;
    border-radius: 999px;
}

/* ---------- MODAL ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(0,0,0,.25);
}

.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: 1.25rem; }

.modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

/* ---------- FORMULÁRIOS ---------- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: .85rem;
    font-weight: 600;
    color: #334155;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ---------- BOTÕES ---------- */
.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: transform .15s, opacity .15s, box-shadow .15s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    box-shadow: 0 4px 14px -2px rgba(99,102,241,.45);
}

.btn-primary:hover {
    opacity: .95;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px -2px rgba(99,102,241,.55);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
}

.btn-secondary:hover { background: #e2e8f0; }

/* ---------- TOAST ---------- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: all .3s;
    pointer-events: none;
    z-index: 1000;
    font-size: .9rem;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error { background: #dc2626; }

/* ---------- RESPONSIVO ---------- */
@media (max-width: 600px) {
    .category-title { font-size: 1.5rem; }
    .category-card  { padding: 28px 18px; }
    .form-row       { grid-template-columns: 1fr; }
}