        * { margin: 0; padding: 0; box-sizing: border-box; }

        :root, [data-theme="light"] {
            --bg: #f8f9fb; --surface: #ffffff; --surface-2: #f1f4f8; --border: #e3e7ee;
            --text: #1a2030; --text-muted: #6b7a90; --accent: #4f46e5; --accent-light: #6366f1;
            --header-bg: linear-gradient(135deg, #eef2ff, #e0e7ff); --header-text: #1e293b; --header-sub: #64748b;
            --stat-bg: rgba(79,70,229,0.06); --stat-border: rgba(79,70,229,0.12);
            --theme-btn-bg: rgba(0,0,0,0.06); --theme-btn-border: rgba(0,0,0,0.12); --theme-btn-text: #1e293b;
            --p1: #dc2626; --p2: #ea580c; --p3: #2563eb; --p4: #6b7280;
            --done: #16a34a; --progress: #ca8a04; --pending: #64748b; --blocked: #dc2626; --deferred: #9333ea; --danger: #dc2626;
            --shadow-sm: 0 1px 3px rgba(0,0,0,0.06); --shadow-md: 0 4px 12px rgba(0,0,0,0.08); --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
        }

        body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 15px; -webkit-font-smoothing: antialiased; }

        /* ---- AUTH SCREEN ---- */
        #authScreen {
            min-height: 100vh; display: flex; align-items: center; justify-content: center;
            background: linear-gradient(135deg, #eef2ff 0%, #f8f9fb 50%, #fef3c7 100%);
        }
        .auth-box {
            background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
            padding: 44px; width: 420px; max-width: 90vw; box-shadow: var(--shadow-lg);
        }
        .auth-box h1 { font-size: 26px; font-weight: 700; margin-bottom: 6px; color: var(--accent); }
        .auth-box p { color: var(--text-muted); font-size: 15px; margin-bottom: 28px; }
        .auth-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
        .auth-tab {
            flex: 1; padding: 10px; text-align: center; border-radius: 10px; cursor: pointer;
            font-size: 14px; font-weight: 500; color: var(--text-muted); transition: all 0.2s;
        }
        .auth-tab.active { background: var(--accent); color: #fff; }
        .auth-form { display: flex; flex-direction: column; gap: 14px; }
        .auth-form input {
            padding: 13px 16px; background: var(--surface-2); border: 1px solid var(--border);
            border-radius: 12px; color: var(--text); font-size: 15px; outline: none; transition: border-color 0.2s;
        }
        .auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
        .auth-form input::placeholder { color: var(--text-muted); }
        .auth-btn {
            padding: 14px; background: var(--accent); color: #fff; border: none; border-radius: 12px;
            font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-top: 4px;
        }
        .auth-btn:hover { background: var(--accent-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }
        .auth-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
        .auth-error { color: #dc2626; font-size: 14px; text-align: center; min-height: 20px; }
        .auth-success { color: #16a34a; font-size: 14px; text-align: center; }

        /* ---- APP ---- */
        #appScreen { display: none; }

        .header { background: var(--header-bg); padding: 24px 40px; border-bottom: 1px solid var(--border); }
        .header-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
        .header h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: var(--header-text); }
        .header h1 span { color: var(--accent); }
        .header-date { color: var(--header-sub); font-size: 14px; margin-top: 2px; }
        .header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .user-pill {
            background: rgba(79,70,229,0.08); border: 1px solid rgba(79,70,229,0.15);
            border-radius: 20px; padding: 6px 14px; font-size: 13px; color: var(--accent);
        }
        .logout-btn {
            padding: 6px 14px; background: transparent; border: 1px solid var(--border);
            border-radius: 8px; color: var(--text-muted); font-size: 13px; cursor: pointer; transition: all 0.2s;
        }
        .logout-btn:hover { background: rgba(220,38,38,0.06); border-color: rgba(220,38,38,0.3); color: var(--danger); }

        .stats-bar { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
        .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 18px; min-width: 110px; text-align: center; box-shadow: var(--shadow-sm); }
        .stat-card .num { font-size: 28px; font-weight: 800; }
        .stat-card .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-top: 2px; }
        .stat-total .num { color: var(--accent); }
        .stat-progress .num { color: var(--progress); }
        .stat-pending .num { color: var(--pending); }
        .stat-done .num { color: var(--done); }
        .stat-blocked .num { color: var(--blocked); }
        .stat-overdue .num { color: var(--p1); }

        .controls { display: flex; gap: 10px; padding: 14px 40px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; align-items: center; }
        .search-box { flex: 1; min-width: 200px; padding: 10px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px; outline: none; transition: border-color 0.2s; }
        .search-box:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.08); }
        .search-box::placeholder { color: var(--text-muted); }
        .filter-btn { padding: 8px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); font-size: 14px; cursor: pointer; transition: all 0.2s; white-space: nowrap; font-weight: 500; }
        .filter-btn:hover { border-color: var(--accent); color: var(--text); }
        .filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
        select.filter-select { padding: 8px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px; cursor: pointer; outline: none; }

        .main { padding: 24px 40px; max-width: 1400px; margin: 0 auto; }

        .priority-section { margin-bottom: 28px; }
        .priority-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; user-select: none; }
        .priority-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
        .priority-header h2 { font-size: 17px; font-weight: 600; }
        .priority-count { background: var(--surface-2); padding: 2px 10px; border-radius: 10px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
        .priority-chevron { margin-left: auto; color: var(--text-muted); font-size: 16px; transition: transform 0.2s; }
        .priority-section.collapsed .priority-chevron { transform: rotate(-90deg); }
        .priority-section.collapsed .task-list { display: none; }

        .task-list { display: flex; flex-direction: column; gap: 6px; }

        /* ---- TASK CARD ---- */
        .task-card {
            background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
            padding: 14px 18px; display: grid;
            grid-template-columns: 24px 36px 1fr 110px 110px 100px 100px 34px;
            align-items: center; gap: 14px; transition: all 0.15s; cursor: pointer;
            box-shadow: var(--shadow-sm);
        }
        .task-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
        .task-card.overdue { border-left: 3px solid var(--p1); }
        .task-card.status-done { opacity: 0.45; }
        .task-card.status-done:hover { opacity: 0.7; }
        .task-card.dragging { opacity: 0.4; border: 2px dashed var(--accent); }

        .drag-handle { cursor: grab; color: var(--text-muted); font-size: 16px; text-align: center; user-select: none; display: flex; align-items: center; justify-content: center; opacity: 0.3; transition: opacity 0.15s; }
        .drag-handle:active { cursor: grabbing; }
        .task-card:hover .drag-handle { opacity: 0.7; }
        .task-list.drag-over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 10px; }
        .task-card.drop-above { box-shadow: 0 -3px 0 0 var(--accent); }
        .task-card.drop-below { box-shadow: 0 3px 0 0 var(--accent); }

        .task-num { font-size: 13px; font-weight: 600; color: var(--text-muted); text-align: center; }
        .task-info { min-width: 0; }
        .task-title { font-size: 15px; font-weight: 500; line-height: 1.4; }
        .task-notes-preview { font-size: 13px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .task-has-attachments { display: inline-block; font-size: 11px; color: var(--accent); margin-left: 6px; vertical-align: middle; }
        .task-recurrence-badge { display: inline-block; font-size: 10px; font-weight: 500; color: #7c3aed; background: rgba(147,51,234,0.1); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; text-transform: capitalize; }
        .task-category { font-size: 13px; padding: 4px 10px; background: var(--surface-2); border-radius: 6px; color: var(--text-muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .task-assigned { font-size: 14px; color: var(--text-muted); }
        .task-deadline { font-size: 14px; color: var(--text-muted); }
        .task-deadline.overdue-text { color: var(--p1); font-weight: 600; }

        .status-badge { font-size: 13px; padding: 5px 10px; border-radius: 6px; text-align: center; font-weight: 500; white-space: nowrap; cursor: pointer; position: relative; }
        .status-badge[data-status="pending"] { background: rgba(100,116,139,0.12); color: #475569; }
        .status-badge[data-status="progress"] { background: rgba(202,138,4,0.1); color: #a16207; }
        .status-badge[data-status="done"] { background: rgba(22,163,74,0.1); color: #15803d; }
        .status-badge[data-status="blocked"] { background: rgba(220,38,38,0.1); color: #dc2626; }
        .status-badge[data-status="deferred"] { background: rgba(147,51,234,0.1); color: #7c3aed; }
        .status-badge[data-status="not-required"] { background: rgba(37,99,235,0.1); color: #2563eb; }

        .status-dropdown { display: none; position: absolute; top: 100%; left: 0; z-index: 100; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 4px; min-width: 160px; box-shadow: var(--shadow-lg); }
        .status-dropdown.open { display: block; }
        .status-option { padding: 9px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: background 0.15s; }
        .status-option:hover { background: var(--surface-2); }

        .edit-icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--surface-2); color: var(--text-muted); cursor: pointer; transition: all 0.15s; font-size: 15px; flex-shrink: 0; opacity: 0.45; }
        .task-card:hover .edit-icon { opacity: 1; }
        .edit-icon:hover { background: var(--accent); color: #fff; opacity: 1; }

        /* ---- BULK SELECT ---- */
        .select-toggle-btn, .export-csv-btn {
            padding: 7px 14px; background: var(--surface-2); border: 1px solid var(--border);
            border-radius: 8px; color: var(--text); font-size: 13px; font-weight: 500;
            cursor: pointer; transition: all 0.15s;
        }
        .select-toggle-btn:hover, .export-csv-btn:hover { border-color: var(--accent); color: var(--accent); }
        .select-toggle-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

        body.selection-mode .task-card { cursor: pointer; grid-template-columns: 28px 24px 36px 1fr 110px 110px 100px 100px 34px; }
        body.selection-mode .task-card.selected { border-color: var(--accent); background: rgba(79,70,229,0.05); }
        body.selection-mode .task-card .drag-handle { opacity: 0.15; }
        .task-select {
            width: 22px; height: 22px; border: 2px solid var(--border); border-radius: 6px;
            display: flex; align-items: center; justify-content: center; background: var(--surface);
            cursor: pointer; flex-shrink: 0; transition: all 0.15s; font-size: 14px; color: #fff;
        }
        body:not(.selection-mode) .task-select { display: none; }
        .task-card.selected .task-select { background: var(--accent); border-color: var(--accent); }
        .task-card.selected .task-select::before { content: '\2713'; }

        .bulk-bar {
            display: none; position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
            background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
            padding: 10px 14px; gap: 10px; align-items: center; box-shadow: var(--shadow-lg);
            z-index: 200;
        }
        body.selection-mode .bulk-bar.visible { display: flex; }
        .bulk-count { font-size: 14px; font-weight: 600; color: var(--text); padding: 0 6px; }
        .bulk-btn {
            padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
            background: var(--accent); color: #fff; font-size: 13px; font-weight: 500;
            cursor: pointer; transition: all 0.15s;
        }
        .bulk-btn:hover { opacity: 0.9; }
        .bulk-btn-danger { background: var(--danger); border-color: var(--danger); }
        .bulk-btn-ghost { background: var(--surface-2); color: var(--text); }

        /* ---- EXPANDABLE NOTES ---- */
        .task-expand {
            display: none; grid-column: 1 / -1; border-top: 1px solid var(--border);
            margin-top: 10px; padding-top: 12px;
        }
        .task-card.expanded .task-expand { display: block; }
        .task-expand-notes {
            font-size: 14px; color: var(--text); line-height: 1.7; white-space: pre-wrap;
            max-height: 300px; overflow-y: auto; padding: 4px 0;
        }
        .task-expand-notes:empty::before {
            content: 'No notes yet. Click edit to add notes.';
            color: var(--text-muted); font-style: italic;
        }
        .task-expand-images {
            display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px;
        }
        .task-expand-images img {
            max-width: 220px; max-height: 180px; border-radius: 8px; border: 1px solid var(--border);
            cursor: pointer; transition: transform 0.2s; object-fit: cover;
        }
        .task-expand-images img:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }

        /* Image lightbox */
        .lightbox-overlay {
            display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85);
            z-index: 3000; justify-content: center; align-items: center; cursor: pointer;
        }
        .lightbox-overlay.open { display: flex; }
        .lightbox-overlay img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }

        /* ---- GOALS ---- */
        .goals-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }
        .goals-header { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
        .goals-header h2 { font-size: 20px; color: var(--accent); }
        .add-goal-btn { padding: 6px 14px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; font-weight: 500; transition: all 0.2s; }
        .add-goal-btn:hover { background: var(--accent-light); }
        .goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
        .goal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px; cursor: pointer; transition: all 0.2s; position: relative; box-shadow: var(--shadow-sm); }
        .goal-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
        .goal-card .goal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
        .goal-card .goal-name { font-size: 15px; font-weight: 600; flex: 1; }
        .goal-card .goal-edit { color: var(--text-muted); font-size: 15px; cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: all 0.15s; }
        .goal-card .goal-edit:hover { background: var(--accent); color: #fff; }
        .goal-card .goal-meta { font-size: 13px; color: var(--text-muted); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
        .goal-card .goal-notes { font-size: 13px; color: var(--text-muted); margin-top: 6px; font-style: italic; }
        .goal-progress-bar { height: 4px; background: var(--surface-2); border-radius: 2px; margin-top: 10px; overflow: hidden; }
        .goal-progress-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.3s; }
        .goal-status-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 4px; font-weight: 500; }
        .goal-status-badge.in-progress { background: rgba(202,138,4,0.1); color: #a16207; }
        .goal-status-badge.achieved { background: rgba(22,163,74,0.1); color: #15803d; }
        .goal-status-badge.not-started { background: rgba(100,116,139,0.12); color: #475569; }
        .goal-status-badge.on-hold { background: rgba(147,51,234,0.1); color: #7c3aed; }

        /* ---- MODALS ---- */
        .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 1000; justify-content: center; align-items: center; }
        .modal-overlay.open { display: flex; }
        .modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: 580px; max-width: 92vw; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
        .modal h2 { font-size: 20px; margin-bottom: 20px; font-weight: 600; }
        .form-row { display: flex; gap: 14px; }
        .form-row .form-group { flex: 1; }
        .form-group { margin-bottom: 14px; }
        .form-group label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
        .form-group input, .form-group select, .form-group textarea { width: 100%; padding: 11px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 15px; outline: none; font-family: inherit; transition: border-color 0.2s; }
        .form-group textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
        .form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.08); }

        /* ---- IMAGE UPLOAD ZONE ---- */
        .image-upload-zone {
            border: 2px dashed var(--border); border-radius: 12px; padding: 20px;
            text-align: center; cursor: pointer; transition: all 0.2s; margin-top: 4px;
            background: var(--surface-2);
        }
        .image-upload-zone:hover, .image-upload-zone.dragover {
            border-color: var(--accent); background: rgba(79,70,229,0.04);
        }
        .image-upload-zone p { color: var(--text-muted); font-size: 13px; margin: 0; }
        .image-upload-zone p strong { color: var(--accent); }
        .image-upload-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
        .image-preview-grid {
            display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;
        }
        .image-preview-item {
            position: relative; width: 100px; height: 100px; border-radius: 8px; overflow: hidden;
            border: 1px solid var(--border);
        }
        .image-preview-item img { width: 100%; height: 100%; object-fit: cover; }
        .image-preview-remove {
            position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
            background: rgba(220,38,38,0.9); color: #fff; border: none; border-radius: 50%;
            font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center;
            line-height: 1; transition: transform 0.15s;
        }
        .image-preview-remove:hover { transform: scale(1.15); }

        .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
        .btn { padding: 11px 22px; border-radius: 10px; font-size: 15px; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; }
        .btn-primary { background: var(--accent); color: #fff; }
        .btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }
        .btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
        .btn-ghost:hover { border-color: var(--text-muted); }
        .btn-danger { background: var(--danger); color: #fff; }
        .btn-danger:hover { background: #b91c1c; }

        .add-task-btn { position: fixed; bottom: 28px; right: 28px; width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; border: none; font-size: 28px; cursor: pointer; box-shadow: 0 4px 20px rgba(79,70,229,0.35); transition: all 0.2s; z-index: 100; }
        .add-task-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(79,70,229,0.45); }

        .toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--done); color: #fff; padding: 12px 24px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; transition: all 0.3s; z-index: 2000; box-shadow: var(--shadow-md); }
        .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

        .confirm-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 2000; justify-content: center; align-items: center; }
        .confirm-overlay.open { display: flex; }
        .confirm-box { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; width: 380px; max-width: 90vw; text-align: center; box-shadow: var(--shadow-lg); }
        .confirm-box p { margin-bottom: 20px; font-size: 16px; line-height: 1.5; }
        .confirm-actions { display: flex; gap: 10px; justify-content: center; }

        .assignee-combo { display: flex; gap: 6px; align-items: center; }
        .assignee-combo select { flex: 1; }
        .assignee-manage-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.15s; flex-shrink: 0; }
        .assignee-manage-btn:hover { border-color: var(--accent); color: var(--accent); }

        .team-list { max-height: 320px; overflow-y: auto; margin-bottom: 14px; }
        .team-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-radius: 10px; margin-bottom: 4px; background: var(--surface-2); border: 1px solid var(--border); }
        .team-item-name { font-size: 15px; }
        .team-item-remove { background: none; border: none; color: var(--danger); font-size: 18px; cursor: pointer; padding: 2px 8px; border-radius: 4px; transition: background 0.15s; }
        .team-item-remove:hover { background: rgba(220,38,38,0.08); }
        .team-add-row { display: flex; gap: 8px; }
        .team-add-row input { flex: 1; }

        /* Loading overlay */
        .loading-overlay { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 9999; flex-direction: column; gap: 16px; }
        .loading-overlay.hidden { display: none; }
        .spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        .loading-text { color: var(--text-muted); font-size: 14px; }

        /* ---- EMPTY STATE ---- */
        .empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
        .empty-state p { font-size: 16px; margin-bottom: 8px; }
        .empty-state small { font-size: 13px; }

        /* ---- MOBILE ---- */
        @media (max-width: 900px) {
            .header { padding: 16px 16px 20px; }
            .header h1 { font-size: 22px; }
            .header-right { gap: 8px; }
            .user-pill { font-size: 11px; padding: 4px 10px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
            .logout-btn { font-size: 11px; padding: 4px 10px; }
            .stats-bar { gap: 6px; margin-top: 12px; }
            .stat-card { min-width: 70px; padding: 8px 10px; }
            .stat-card .num { font-size: 22px; }
            .stat-card .label { font-size: 10px; }
            .controls { padding: 10px 12px; gap: 8px; }
            .main { padding: 16px 12px; }

            .task-card {
                display: flex; flex-direction: column; gap: 0; padding: 12px 14px;
            }
            .drag-handle { display: none; }
            .task-num { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; text-align: left; }
            .task-info { margin-bottom: 8px; }
            .task-title { font-size: 15px; font-weight: 600; line-height: 1.4; white-space: normal; }
            .task-notes-preview { font-size: 13px; margin-top: 3px; white-space: normal; overflow: visible; text-overflow: unset; }

            .task-card .task-category,
            .task-card .task-assigned,
            .task-card .task-deadline { display: none; }

            .task-meta-mobile {
                display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
                margin-bottom: 8px; font-size: 12px; color: var(--text-muted);
            }
            .task-meta-mobile .meta-cat {
                background: var(--surface-2); border-radius: 4px; padding: 2px 8px; font-size: 12px; color: var(--text-muted);
            }
            .task-meta-mobile .meta-sep { opacity: 0.4; }

            .task-bottom-row {
                display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px;
            }
            .status-badge { font-size: 13px; padding: 5px 10px; }
            .edit-icon { width: 32px; height: 32px; font-size: 15px; }

            .form-row { flex-direction: column; gap: 0; }
            .goals-grid { grid-template-columns: 1fr; }
            .modal { padding: 20px; }

            .task-expand-images img { max-width: 150px; max-height: 120px; }
        }

        /* Hide mobile-only elements on desktop */
        .task-meta-mobile { display: none; }
        .task-bottom-row { display: none; }

        @media (max-width: 900px) {
            .task-meta-mobile { display: flex; }
            .task-bottom-row { display: flex; }
            .task-card > .task-category,
            .task-card > .task-assigned,
            .task-card > .task-deadline { display: none !important; }
            .task-card > div[style*="position:relative"] { display: none !important; }
            .task-card > .edit-icon { display: none !important; }
        }
