        /* Wider modal for regular tasks - almost fullscreen */
        #regularTaskModal .modal-content {
            max-width: 1000px;
            width: 95%;
            max-height: calc(100vh - 2rem);
        }
        
        /* Wider modal for tasks */
        #taskModal .modal-content {
            max-width: 750px;
            width: 95%;
        }
        
        .modal-header { 
            background: var(--dark); 
            color: white; 
            padding: 0.85rem 1rem;
            border-radius: var(--radius) var(--radius) 0 0;
            position: sticky;
            top: 0;
            z-index: 10;
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }
        
        .modal-header h2 { 
            font-size: 1.05rem;
            font-weight: 600;
            margin: 0;
            flex: 1;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .modal-body { padding: 1rem; }
        
        /* Close button — flex-based, без position:absolute */
        .close { 
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 30px;
            height: 30px;
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.15);
            border-radius: 7px;
            color: rgba(255,255,255,0.8);
            cursor: pointer;
            font-size: 1.2rem;
            line-height: 1;
            transition: background 0.15s, color 0.15s;
            padding: 0;
            margin-left: auto;
        }
        
        .close:hover { 
            background: rgba(255,255,255,0.18);
            color: white;
        }
        
        .form-grid { display: grid; grid-template-columns: 1fr; gap: 0.9rem; }
        .form-group { display: flex; flex-direction: column; }
        .form-group.full-width { grid-column: span 1; }
        .form-label { margin-bottom: 0.4rem; font-weight: 600; color: var(--dark); font-size: 0.85rem; }
        
        .form-input, .form-select, .form-textarea { 
            padding: 0.7rem; 
            border: 2px solid #ecf0f1; 
            border-radius: var(--radius-sm); 
            font-size: 1rem;
            min-height: 44px;
        }
        
        .form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--info); }
        .form-textarea { resize: vertical; min-height: 70px; cursor: text; }
        .form-textarea::-webkit-resizer { background: linear-gradient(135deg, transparent 40%, #d1d5db 40%, #d1d5db 45%, transparent 45%, transparent 60%, #d1d5db 60%, #d1d5db 65%, transparent 65%); }
        .form-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
        .form-actions .btn:not(.btn-success):not(.btn-danger) {
            background: transparent;
            color: #6b7280;
            border-color: #e5e7eb;
            font-size: 0.85rem;
            padding: 0.45rem 0.9rem;
        }
        .form-actions .btn-success, .form-actions .btn-danger {
            padding: 0.55rem 1.4rem;
            font-size: 0.95rem;
            font-weight: 600;
            min-width: 110px;
        }
        
        /* Sticky form-actions в taskModal — кнопка Зберегти не ховається під клавіатурою */
        #taskModal .form-actions {
            position: sticky;
            bottom: 0;
            background: white;
            padding: 0.75rem 0 0.25rem;
            margin-top: 0.75rem;
            border-top: 1px solid #f3f4f6;
            z-index: 1;
        }
        
        .dashboard-cards {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 0.6rem;
            margin-bottom: 1rem;
        }
        
        .dashboard-card {
            border-radius: var(--radius);
            padding: 0.8rem;
            text-align: center;
            color: white;
        }
        
        .dashboard-card.urgent { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%); }
        .dashboard-card.warning { background: linear-gradient(135deg, #feca57 0%, #f39c12 100%); }
        .dashboard-card.active { background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%); }
        .dashboard-card.completed { background: linear-gradient(135deg, #55efc4 0%, #00b894 100%); }
        
        .dashboard-card h3 { font-size: 0.75rem; margin-bottom: 0.2rem; opacity: 0.9; }
        .dashboard-number { font-size: 1.75rem; font-weight: 700; }
        
        /* ── AUTH — TALKO OS Premium ── */
        #authPage.auth-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 99999;
            background: #080c10;
            overflow-y: auto;
            font-family: 'DM Sans', -apple-system, sans-serif;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
            padding: 1rem;
        }

        /* Ambient background glow */
        #authPage.auth-container::before {
            content: '';
            position: absolute;
            top: -20%;
            left: 50%;
            transform: translateX(-50%);
            width: 600px;
            height: 600px;
            background: radial-gradient(ellipse, rgba(34,197,94,0.12) 0%, rgba(16,185,129,0.06) 40%, transparent 70%);
            pointer-events: none;
            animation: authPulse 6s ease-in-out infinite;
        }
        #authPage.auth-container::after {
            content: '';
            position: absolute;
            bottom: -10%;
            right: 10%;
            width: 400px;
            height: 400px;
            background: radial-gradient(ellipse, rgba(99,102,241,0.08) 0%, transparent 70%);
            pointer-events: none;
            animation: authPulse 8s ease-in-out infinite reverse;
        }

        @keyframes authPulse {
            0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
            50% { transform: translateX(-50%) scale(1.1); opacity: 0.7; }
        }

        /* Grid pattern overlay */
        #authPage .auth-bg-grid {
            position: absolute;
            inset: 0;
            background-image:
                linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
            background-size: 60px 60px;
            pointer-events: none;
        }

        .auth-card {
            background: rgba(255,255,255,0.04);
            backdrop-filter: blur(40px);
            -webkit-backdrop-filter: blur(40px);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 24px;
            width: 100%;
            max-width: 420px;
            overflow: visible;
            position: relative;
            z-index: 1;
            flex-shrink: 0;
            box-sizing: border-box;
            box-shadow:
                0 0 0 1px rgba(255,255,255,0.05),
                0 40px 80px rgba(0,0,0,0.6),
                0 0 60px rgba(34,197,94,0.06);
            animation: authCardIn 0.6s cubic-bezier(0.16,1,0.3,1) both;
        }

        @keyframes authCardIn {
            from { opacity: 0; transform: translateY(24px) scale(0.97); }
            to   { opacity: 1; transform: translateY(0) scale(1); }
        }

        @media (max-width: 480px) {
            #authPage.auth-container {
                padding: 0;
                justify-content: flex-start;
                align-items: stretch;
            }
            .auth-card {
                border-radius: 0;
                min-height: 100vh;
                min-height: 100dvh;
                width: 100%;
                max-width: 100%;
                border: none;
                animation: none;
                margin: 0;
                flex-shrink: 0;
            }
        }

        /* Language switcher — top of card */
        .auth-lang-bar {
            display: flex;
            justify-content: flex-end;
            gap: 4px;
            padding: 14px 16px 0;
        }
        .auth-lang-btn {
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.08);
            color: rgba(255,255,255,0.45);
            font-size: 11px;
            font-weight: 600;
            letter-spacing: 0.05em;
            padding: 4px 9px;
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.2s;
            font-family: 'DM Mono', monospace;
        }
        .auth-lang-btn:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.1); }
        .auth-lang-btn.active {
            background: rgba(34,197,94,0.15);
            border-color: rgba(34,197,94,0.3);
            color: #4ade80;
        }

        .auth-header {
            background: transparent;
            color: white;
            padding: 2rem 2rem 1.5rem;
            text-align: center;
        }

        /* Logo mark */
        .auth-logo-mark {
            width: 56px;
            height: 56px;
            background: linear-gradient(135deg, #22c55e, #16a34a);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 1.25rem;
            box-shadow: 0 8px 24px rgba(34,197,94,0.3), 0 0 0 1px rgba(34,197,94,0.2);
            animation: logoBounce 0.8s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
        }
        @keyframes logoBounce {
            from { opacity: 0; transform: scale(0.5); }
            to   { opacity: 1; transform: scale(1); }
        }

        .auth-header h2 {
            font-family: 'DM Sans', sans-serif;
            font-size: 1.65rem;
            font-weight: 700;
            color: #ffffff;
            margin: 0 0 0.35rem;
            letter-spacing: -0.03em;
            display: block;
        }
        .auth-header p {
            font-size: 0.85rem;
            color: rgba(255,255,255,0.4);
            font-weight: 400;
            letter-spacing: 0.01em;
        }

        .auth-body { padding: 0 2rem 2rem; }

        .auth-input-group { margin-bottom: 0.85rem; }
        .auth-input-group label {
            display: block;
            font-size: 0.72rem;
            font-weight: 600;
            color: rgba(255,255,255,0.4);
            margin-bottom: 0.4rem;
            letter-spacing: 0.07em;
            text-transform: uppercase;
        }
        .auth-input-group .form-input {
            width: 100%;
            padding: 0.85rem 1rem;
            font-size: 15px;
            font-family: 'DM Sans', sans-serif;
            border: 1px solid rgba(255,255,255,0.09);
            border-radius: 12px;
            transition: all 0.2s;
            background: rgba(255,255,255,0.05);
            color: #ffffff;
            box-sizing: border-box;
        }
        .auth-input-group .form-input::placeholder { color: rgba(255,255,255,0.2); }
        .auth-input-group .form-input:focus {
            border-color: rgba(34,197,94,0.4);
            box-shadow: 0 0 0 3px rgba(34,197,94,0.08);
            background: rgba(255,255,255,0.07);
            outline: none;
        }

        /* Fix browser autofill background - keeps dark theme */
        .auth-input-group .form-input:-webkit-autofill,
        .auth-input-group .form-input:-webkit-autofill:hover,
        .auth-input-group .form-input:-webkit-autofill:focus,
        .auth-input-group .form-input:-webkit-autofill:active {
            -webkit-box-shadow: 0 0 0 100px #111827 inset !important;
            box-shadow: 0 0 0 100px #111827 inset !important;
            -webkit-text-fill-color: #ffffff !important;
            color: #ffffff !important;
            caret-color: #ffffff !important;
            background: #111827 !important;
            background-color: #111827 !important;
            transition: background-color 99999s ease-in-out 0s !important;
        }
        /* Also fix non-autofill state */
        .auth-input-group .form-input {
            color: #ffffff !important;
            -webkit-text-fill-color: #ffffff !important;
        }
        .auth-input-group .input-wrapper { position: relative; }
        .auth-input-group .input-wrapper .form-input { padding-right: 50px; }
        .auth-input-group .password-toggle {
            position: absolute;
            right: 4px; top: 50%;
            transform: translateY(-50%);
            background: none; border: none;
            cursor: pointer; padding: 10px;
            color: rgba(255,255,255,0.3);
            display: flex; align-items: center;
        }
        .auth-input-group .password-toggle:hover { color: rgba(255,255,255,0.6); }

        .auth-btn-primary {
            width: 100%;
            padding: 0.9rem 1rem;
            font-size: 0.95rem;
            font-weight: 600;
            font-family: 'DM Sans', sans-serif;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s cubic-bezier(0.16,1,0.3,1);
            min-height: 52px;
            margin-top: 1.1rem;
            letter-spacing: -0.01em;
        }
        .auth-btn-primary:active { transform: scale(0.98); }
        .auth-btn-login {
            background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
            color: white;
            box-shadow: 0 4px 20px rgba(34,197,94,0.25), inset 0 1px 0 rgba(255,255,255,0.15);
        }
        .auth-btn-login:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 28px rgba(34,197,94,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
        }
        .auth-btn-register {
            background: rgba(255,255,255,0.06);
            color: rgba(255,255,255,0.75);
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: none;
        }
        .auth-btn-register:hover {
            background: rgba(255,255,255,0.1);
            color: white;
            border-color: rgba(255,255,255,0.15);
        }

        .auth-forgot-link {
            display: block;
            text-align: center;
            margin-top: 1rem;
            font-size: 0.82rem;
            color: rgba(255,255,255,0.3);
            text-decoration: none;
            transition: color 0.2s;
        }
        .auth-forgot-link:hover { color: rgba(255,255,255,0.6); }

        .auth-message {
            padding: 0.75rem 1rem;
            border-radius: 10px;
            margin-bottom: 1rem;
            font-size: 0.82rem;
            font-weight: 500;
        }
        .auth-message.success { background: rgba(34,197,94,0.1); color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
        .auth-message.error   { background: rgba(239,68,68,0.1);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
        .auth-message.info    { background: rgba(99,102,241,0.1); color: #a5b4fc; border: 1px solid rgba(99,102,241,0.2); }

        .auth-divider {
            display: flex;
            align-items: center;
            margin: 1.25rem 0;
            color: rgba(255,255,255,0.15);
            font-size: 0.78rem;
        }
        .auth-divider::before, .auth-divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: rgba(255,255,255,0.08);
        }
        .auth-divider span { padding: 0 1rem; color: rgba(255,255,255,0.25); }

        /* No access card in dark theme */
        .no-access-card {
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 14px;
            padding: 1.25rem;
            color: rgba(255,255,255,0.8);
        }
        .no-access-card h3 { color: white; margin-bottom: 0.5rem; font-size: 1rem; }
        .no-access-card p { color: rgba(255,255,255,0.45); }
        .no-access-card .form-input {
            background: rgba(255,255,255,0.05);
            border-color: rgba(255,255,255,0.1);
            color: white;
        }

        /* Auth help accordion dark */
        #authHelpToggle {
            background: rgba(255,255,255,0.04) !important;
            border-color: rgba(255,255,255,0.08) !important;
            color: rgba(255,255,255,0.4) !important;
        }
        #authHelpToggle:hover { color: rgba(255,255,255,0.7) !important; }
        #authHelpContent {
            background: rgba(255,255,255,0.03) !important;
            border-color: rgba(255,255,255,0.07) !important;
            color: rgba(255,255,255,0.5) !important;
        }

        /* Register form dark */
        #registerForm h3 { color: white !important; }
        #registerForm .form-input {
            background: rgba(255,255,255,0.05);
            border-color: rgba(255,255,255,0.1);
            color: white;
        }
        #registerForm .auth-input-group label { color: rgba(255,255,255,0.4); }

        /* selfReg form dark */
        #selfRegForm .form-input {
            background: rgba(255,255,255,0.05);
            border-color: rgba(255,255,255,0.1);
            color: white;
        }
        #selfRegForm label { color: rgba(255,255,255,0.4) !important; }

        /* Footer on auth */
        .auth-footer {
            text-align: center;
            padding: 1.5rem 2rem 0;
            font-size: 0.72rem;
            color: rgba(255,255,255,0.15);
            border-top: 1px solid rgba(255,255,255,0.05);
            margin-top: 0.5rem;
        }
        
        
        .loading {
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 3rem;
        }
        
        .spinner {
            width: 40px;
            height: 40px;
            border: 4px solid #e5e7eb;
            border-top-color: var(--primary);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin { to { transform: rotate(360deg); } }
        
        .footer {
            text-align: center;
            padding: 1.25rem;
            background: #f9fafb;
            border-top: 1px solid #e5e7eb;
            margin-top: 1.5rem;
        }
        
        .footer p { color: var(--gray); font-size: 0.8rem; margin-bottom: 0.5rem; }
        .footer-links { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
        .footer-links a { color: var(--primary); text-decoration: none; font-size: 0.8rem; }
        
        .support-btn {
            position: fixed;
            bottom: 16px;
            right: 16px;
            z-index: 999;
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 12px 20px;
            background: var(--primary);
            color: #ffffff !important;
            border-radius: 50px;
            font-weight: 600;
            font-size: 14px;
            box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
            cursor: pointer;
            text-decoration: none;
            border: none;
            transition: all 0.3s;
        }
        
        .support-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5); }
        
        /* Mobile buttons */
        
        @media (min-width: 768px) {
            .header { padding: 1rem 2rem; }
            .logo { font-size: 1.4rem; }
            .user-info { display: flex; }
            .container { padding: 1.5rem; }
            .controls { flex-direction: row; align-items: center; justify-content: space-between; }
            .filters { width: auto; flex-wrap: nowrap; }
            .filter-select { flex: none; min-width: auto; }
            .status-multiselect { flex: none; min-width: auto; }
            .form-grid { grid-template-columns: 1fr 1fr; }
            .form-group.full-width { grid-column: span 2; }
            .cards-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
            .dashboard-cards { grid-template-columns: repeat(4, 1fr); }
        }
        

/* iOS PWA fix — input text visibility */
#loginEmail, #loginPassword, #registerEmail {
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    opacity: 1 !important;
}
#loginEmail:focus, #loginPassword:focus, #registerEmail:focus {
    -webkit-text-fill-color: #ffffff !important;
}
