/**
 * PRIME PRACTICE — app.css
 * ═══════════════════════════════════════════════════════
 * Sections:
 *   - CSS Variables & Base
 *   - Auth / Login Screen
 *   - Navbar, Sidebar
 *   - Tables, Cards, Badges
 *   - Chat UI (Instant Messenger)
 *   - Notification Panel
 *   - PWA Install Button & Banner
 *   - Sidebar Toggle (flexbox)
 *   - Custom Searchable Dropdown (CSD)
 *   - Mobile (@media max-width: 768px)
 *     - Bottom Nav, Task Cards, Client Cards
 *     - Bottom Sheets, Filter FAB
 *     - Collapsible Sections (clientFormBody, complianceSectionBody)
 *
 * TO EDIT: Upload only this file for styling/layout issues
 * ═══════════════════════════════════════════════════════
 */

        :root { --ca-navy: #0B2447; --ca-gold: #C5A880; --ca-bg: #F8F9FA; --ca-surface: #FFFFFF; --text-main: #2B2D42; }
        body { font-family: 'Inter', sans-serif; background-color: var(--ca-bg); color: var(--text-main); min-height: 100vh; margin: 0; }
        h1,h2,h3,h4,h5,.navbar-brand,.merriweather { font-family: 'Merriweather', serif; }

        /* ── ENHANCED: Split-Screen Login ───────────────── */
        .auth-wrapper { min-height: 100vh; display: flex; align-items: stretch; }

        /* ── Personal Welcome Scene (left panel) ────────────────────────
           Mirrors marketing page (#0a0e27 + mesh blobs + Playfair Display
           + gold gradient hero text). No rotating content — calm sense
           of arrival. Replaces the earlier compliance-tip carousel. */
        .auth-left-panel {
            flex: 1;
            background: #0a0e27;
            color: #e2e8f0;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            padding: 56px 48px; position: relative; overflow: hidden;
        }
        /* Subtle grid overlay (matches marketing page mesh-bg::before) */
        .auth-left-panel::before {
            content: '';
            position: absolute; inset: 0;
            background-image:
                linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
            background-size: 60px 60px;
            -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
            mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
            pointer-events: none;
            z-index: 0;
        }
        /* Mesh-blob ambience (gold + blue + purple, blurred, floating) */
        .auth-mesh {
            position: absolute; inset: 0;
            overflow: hidden;
            z-index: 0;
            pointer-events: none;
        }
        .auth-blob {
            position: absolute;
            border-radius: 50%;
            filter: blur(80px);
            opacity: 0.35;
            animation: ppBlobFloat 22s ease-in-out infinite;
        }
        .auth-blob-1 {
            width: 460px; height: 460px;
            background: #d4af37;
            top: -120px; left: -100px;
            animation-delay: 0s;
        }
        .auth-blob-2 {
            width: 520px; height: 520px;
            background: #3b82f6;
            bottom: -160px; right: -120px;
            animation-delay: -8s;
        }
        .auth-blob-3 {
            width: 360px; height: 360px;
            background: #8b5cf6;
            top: 40%; left: 50%;
            opacity: 0.22;
            animation-delay: -15s;
        }
        @keyframes ppBlobFloat {
            0%, 100% { transform: translate(0, 0) scale(1); }
            33%      { transform: translate(50px, -70px) scale(1.08); }
            66%      { transform: translate(-40px, 40px) scale(0.94); }
        }

        .auth-left-content {
            position: relative; z-index: 1;
            text-align: center;
            max-width: 460px;
            width: 100%;
        }

        /* Eyebrow pill — sets the tone "you are recognized" */
        .workspace-eyebrow {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 8px 16px;
            border-radius: 999px;
            background: rgba(212, 175, 55, 0.10);
            border: 1px solid rgba(212, 175, 55, 0.32);
            color: #d4af37;
            font-size: 0.8125rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            margin-bottom: 26px;
            animation: ppFadeUp 0.6s ease-out;
        }
        .workspace-eyebrow .pulse-dot {
            width: 8px; height: 8px;
            background: #d4af37;
            border-radius: 50%;
            animation: ppPulse 2s infinite;
        }
        @keyframes ppPulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50%      { opacity: 0.4; transform: scale(1.4); }
        }
        @keyframes ppFadeUp {
            from { opacity: 0; transform: translateY(14px); }
            to   { opacity: 1; transform: translateY(0); }
        }

        /* Greeting line — small label above the firm name hero */
        .workspace-greeting {
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            color: #94a3b8;
            font-weight: 500;
            margin-bottom: 4px;
            letter-spacing: 0.01em;
            animation: ppFadeUp 0.7s ease-out 0.1s both;
        }

        /* Firm name hero — Playfair Display gradient shimmer */
        .workspace-hero {
            font-family: 'Playfair Display', 'Merriweather', serif;
            font-size: clamp(2rem, 5vw, 3.2rem);
            font-weight: 800;
            line-height: 1.1;
            letter-spacing: -0.02em;
            color: #f8fafc;
            margin: 0 0 22px 0;
            animation: ppFadeUp 0.8s ease-out 0.2s both;
        }
        .workspace-hero .firm-name-text {
            background: linear-gradient(135deg, #d4af37 0%, #f4d76e 50%, #d4af37 100%);
            background-size: 200% auto;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: ppShimmerHero 5s linear infinite;
            display: inline-block;
        }
        @keyframes ppShimmerHero {
            0%   { background-position: 0% center; }
            100% { background-position: 200% center; }
        }

        .workspace-sub {
            font-family: 'Inter', sans-serif;
            color: #cbd5e1;
            font-size: 0.95rem;
            line-height: 1.6;
            max-width: 360px;
            margin: 0 auto 30px;
            animation: ppFadeUp 0.8s ease-out 0.3s both;
        }
        .workspace-sub strong {
            color: #f4d76e;
            font-weight: 700;
        }

        /* Today / clock strip — alive without being noisy */
        .workspace-time {
            display: inline-flex;
            flex-direction: column;
            gap: 8px;
            padding: 14px 20px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            margin-bottom: 28px;
            animation: ppFadeUp 0.8s ease-out 0.4s both;
        }
        .workspace-time .time-row {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            color: #e2e8f0;
            font-size: 0.875rem;
            font-weight: 500;
        }
        .workspace-time .time-row-muted { color: #94a3b8; font-weight: 400; }
        .workspace-time .time-icon { font-size: 1rem; opacity: 0.85; }

        /* Trust badges — workspace-focused vocabulary (not marketing) */
        .workspace-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            margin-bottom: 28px;
            animation: ppFadeUp 0.8s ease-out 0.5s both;
        }
        .ws-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 7px 13px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 999px;
            font-size: 0.78rem;
            font-weight: 500;
            color: #cbd5e1;
            transition: border-color 0.25s ease, color 0.25s ease;
        }
        .ws-badge:hover {
            border-color: rgba(212, 175, 55, 0.4);
            color: #f4d76e;
        }

        /* Footer line — privacy promise as the closing note */
        .workspace-footer {
            position: relative;
            margin-top: 4px;
            animation: ppFadeUp 0.8s ease-out 0.6s both;
        }
        .workspace-footer::before {
            content: '';
            display: block;
            width: 50px;
            height: 1px;
            margin: 0 auto 16px;
            background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.55), transparent);
        }
        .workspace-footer span {
            color: rgba(255, 255, 255, 0.5);
            font-size: 0.78rem;
            letter-spacing: 0.04em;
            font-style: italic;
        }

        /* Right panel sizing — unchanged from earlier */
        .auth-right-panel { width: 480px; min-width: 380px; background: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px 44px; overflow-y: auto; }
        .auth-right-panel .brand-mobile { display: none; }
        .auth-card { background: transparent; border: none; width: 100%; }
        .auth-card.wide { max-width: none; }

        /* Respect users who prefer reduced motion */
        @media (prefers-reduced-motion: reduce) {
            .auth-blob { animation: none; }
            .workspace-eyebrow .pulse-dot { animation: none; }
            .workspace-hero .firm-name-text { animation: none; }
            .workspace-eyebrow,
            .workspace-greeting,
            .workspace-hero,
            .workspace-sub,
            .workspace-time,
            .workspace-badges,
            .workspace-footer { animation: none; }
        }

        /* ════════════════════════════════════════════════════════════
           FULL-PAGE TENANT LANDING (Phase 1.2)
           ────────────────────────────────────────────────────────────
           Replaces the split left/right panel. The whole page is now a
           personalized landing — header + hero + features + footer —
           with the auth form moved into a modal opened by the header
           Login button (and the hero CTA). Mirrors the marketing-page
           aesthetic so the user feels they've arrived at THEIR private
           branded space without losing visual continuity.
           ════════════════════════════════════════════════════════════ */
        .auth-fullpage {
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background: #0a0e27;
            color: #e2e8f0;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
        }

        /* HEADER (sticky on scroll) */
        .auth-fp-header {
            position: sticky;
            top: 0;
            z-index: 50;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 28px;
            background: rgba(10, 14, 39, 0.7);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }
        .auth-fp-brand {
            display: inline-flex;
            align-items: center;
            gap: 12px;
            font-weight: 700;
            font-size: 1.05rem;
            letter-spacing: -0.01em;
            color: #f8fafc;
            text-decoration: none;
            transition: opacity 0.2s ease, transform 0.2s ease;
        }
        .auth-fp-brand:hover {
            opacity: 0.88;
            transform: translateX(-1px);
        }
        .auth-fp-brand:hover .auth-fp-logo-mark {
            box-shadow: 0 4px 14px rgba(212, 175, 55, 0.4);
        }
        .auth-fp-logo-mark {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: linear-gradient(135deg, #d4af37 0%, #f4d76e 100%);
            color: #0a0e27;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Playfair Display', serif;
            font-weight: 800;
            font-size: 20px;
            transition: box-shadow 0.2s ease;
        }
        .auth-fp-brand-text { font-family: 'Inter', sans-serif; }
        .auth-fp-nav-actions { display: flex; gap: 10px; align-items: center; }
        .auth-fp-btn {
            padding: 10px 18px;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            border: none;
            transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
            font-family: inherit;
            display: inline-flex;
            align-items: center;
            gap: 8px;
            text-decoration: none;
        }
        .auth-fp-btn-primary {
            background: linear-gradient(135deg, #d4af37 0%, #f4d76e 100%);
            color: #0a0e27;
            box-shadow: 0 4px 18px rgba(212, 175, 55, 0.30);
        }
        .auth-fp-btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 26px rgba(212, 175, 55, 0.50);
        }
        .auth-fp-btn-primary i { font-size: 0.95em; }

        /* Ghost button — secondary nav (Home / Back to main site) */
        .auth-fp-btn-ghost {
            background: transparent;
            color: #cbd5e1;
            border: 1px solid rgba(255, 255, 255, 0.14);
        }
        .auth-fp-btn-ghost:hover {
            color: #d4af37;
            border-color: rgba(212, 175, 55, 0.5);
            background: rgba(212, 175, 55, 0.06);
            transform: translateY(-1px);
        }
        .auth-fp-btn-ghost i { font-size: 0.92em; }

        /* HERO */
        .auth-fp-hero {
            position: relative;
            min-height: calc(100vh - 68px); /* full viewport minus header */
            padding: 60px 28px 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
        }
        .auth-fp-hero::before {
            content: '';
            position: absolute; inset: 0;
            background-image:
                linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
            background-size: 60px 60px;
            -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
            mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
            pointer-events: none;
            z-index: 0;
        }
        .auth-fp-hero-content {
            position: relative;
            z-index: 1;
            max-width: 720px;
            width: 100%;
            text-align: center;
        }
        /* Override workspace-hero font size inside the wider full-page hero */
        .auth-fp-hero-content .workspace-hero {
            font-size: clamp(2.4rem, 6.5vw, 4.2rem);
            margin-bottom: 28px;
        }
        .auth-fp-hero-content .workspace-sub {
            font-size: 1.05rem;
            max-width: 520px;
        }
        .auth-fp-hero-content .workspace-time {
            margin-bottom: 30px;
        }

        /* Hero CTA — primary call-to-action */
        .auth-fp-cta {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 14px 28px;
            border-radius: 12px;
            background: linear-gradient(135deg, #d4af37 0%, #f4d76e 100%);
            color: #0a0e27;
            font-weight: 700;
            font-size: 1rem;
            border: none;
            cursor: pointer;
            box-shadow: 0 6px 24px rgba(212, 175, 55, 0.32);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            font-family: inherit;
            margin-top: 4px;
            animation: ppFadeUp 0.8s ease-out 0.7s both;
        }
        .auth-fp-cta:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 32px rgba(212, 175, 55, 0.55);
        }
        .auth-fp-cta i { font-size: 1.1em; }
        .auth-fp-cta-arrow {
            transition: transform 0.2s ease;
        }
        .auth-fp-cta:hover .auth-fp-cta-arrow {
            transform: translateX(3px);
        }

        /* FEATURES section */
        .auth-fp-features {
            padding: 80px 28px 70px;
            position: relative;
            border-top: 1px solid rgba(255, 255, 255, 0.04);
            background: linear-gradient(180deg, #0a0e27 0%, #0d1230 100%);
        }
        .auth-fp-section-head {
            max-width: 720px;
            margin: 0 auto 50px;
            text-align: center;
        }
        .auth-fp-section-eyebrow {
            display: inline-block;
            font-size: 0.75rem;
            font-weight: 600;
            letter-spacing: 0.18em;
            text-transform: uppercase;
            color: #d4af37;
            margin-bottom: 12px;
        }
        .auth-fp-section-title {
            font-family: 'Playfair Display', serif;
            font-size: clamp(1.8rem, 4vw, 2.6rem);
            font-weight: 700;
            letter-spacing: -0.02em;
            color: #f8fafc;
            margin: 0;
        }
        .auth-fp-feature-grid {
            max-width: 1100px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 18px;
        }
        .auth-fp-feat {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0%, rgba(255, 255, 255, 0.015) 100%);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 14px;
            padding: 24px 22px;
            transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
        }
        .auth-fp-feat:hover {
            transform: translateY(-3px);
            border-color: rgba(212, 175, 55, 0.32);
            background: linear-gradient(135deg, rgba(212, 175, 55, 0.04) 0%, rgba(255, 255, 255, 0.015) 100%);
        }
        .auth-fp-feat-icon {
            width: 44px; height: 44px;
            border-radius: 10px;
            background: rgba(212, 175, 55, 0.10);
            border: 1px solid rgba(212, 175, 55, 0.25);
            color: #d4af37;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            margin-bottom: 16px;
        }
        .auth-fp-feat-title {
            font-size: 1.02rem;
            font-weight: 700;
            color: #f8fafc;
            margin-bottom: 6px;
        }
        .auth-fp-feat-desc {
            font-size: 0.88rem;
            color: #94a3b8;
            line-height: 1.55;
        }

        /* FOOTER */
        .auth-fp-footer {
            padding: 40px 28px 50px;
            text-align: center;
            border-top: 1px solid rgba(255, 255, 255, 0.04);
        }

        /* ════════════════════════════════════════════════════════════
           LOGIN MODAL — overlays the page when Login / CTA clicked
           ════════════════════════════════════════════════════════════ */
        .auth-fp-modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(5, 8, 22, 0.72);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            z-index: 1000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
            animation: ppFadeIn 0.2s ease-out;
        }
        .auth-fp-modal-overlay.show { display: flex; }
        @keyframes ppFadeIn { from { opacity: 0; } to { opacity: 1; } }

        .auth-fp-modal {
            position: relative;
            background: linear-gradient(180deg, #0f1535 0%, #0a0e27 100%);
            border: 1px solid rgba(212, 175, 55, 0.22);
            border-radius: 18px;
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
            max-width: 460px;
            width: 100%;
            max-height: 92vh;
            overflow-y: auto;
            padding: 36px 32px 30px;
            animation: ppFadeUp 0.3s ease-out;
        }
        .auth-fp-modal .auth-card.wide {
            /* register card uses wide; allow it to grow up to ~720px */
            max-width: none;
        }
        .auth-fp-modal-close {
            position: absolute;
            top: 14px;
            right: 14px;
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.08);
            color: #94a3b8;
            font-size: 1.3rem;
            line-height: 1;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            padding: 0;
        }
        .auth-fp-modal-close:hover {
            background: rgba(255, 255, 255, 0.10);
            color: #f8fafc;
        }
        /* When register card is shown inside the modal, widen the modal box */
        .auth-fp-modal:has(#registerCard:not(.hidden)) { max-width: 720px; }

        /* Forgot password link */
        .auth-fp-forgot-link {
            color: #94a3b8;
            font-size: 0.82rem;
            text-decoration: underline;
            text-decoration-color: rgba(148, 163, 184, 0.3);
            text-underline-offset: 3px;
            transition: color 0.2s ease, text-decoration-color 0.2s ease;
        }
        .auth-fp-forgot-link:hover {
            color: #d4af37;
            text-decoration-color: #d4af37;
        }

        /* Pull the existing dark-theme right-panel styles into the modal scope —
           the auth-fp-modal inherits the same input/button styling because we
           apply the same selector path to the inner .card auth-card markup. */
        .auth-fp-modal .form-label { color: #cbd5e1; letter-spacing: 0.05em; }
        .auth-fp-modal .text-muted { color: #94a3b8; }
        .auth-fp-modal h3, .auth-fp-modal h4 { color: #f8fafc; }
        .auth-fp-modal hr { border-color: rgba(255, 255, 255, 0.08); }
        .auth-fp-modal .input-group-text.bg-light {
            background: rgba(255, 255, 255, 0.04) !important;
            border: 1px solid rgba(255, 255, 255, 0.10) !important;
            border-right: none !important;
            color: #d4af37 !important;
        }
        .auth-fp-modal .input-group-text.bg-light i { color: #d4af37 !important; }
        .auth-fp-modal .form-control.bg-light,
        .auth-fp-modal .form-select.bg-light {
            background: rgba(255, 255, 255, 0.04) !important;
            border: 1px solid rgba(255, 255, 255, 0.10) !important;
            color: #f8fafc !important;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
        }
        .auth-fp-modal .input-group .form-control.bg-light { border-left: none !important; }
        .auth-fp-modal .form-control.bg-light::placeholder { color: #64748b; }
        .auth-fp-modal .form-control.bg-light:focus,
        .auth-fp-modal .form-select.bg-light:focus {
            background: rgba(255, 255, 255, 0.06) !important;
            border-color: #d4af37 !important;
            box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15) !important;
            outline: none !important;
        }
        .auth-fp-modal .input-group:focus-within .input-group-text.bg-light {
            border-color: #d4af37 !important;
        }
        .auth-fp-modal small,
        .auth-fp-modal .form-text { color: #94a3b8 !important; }
        .auth-fp-modal .btn-primary {
            background: linear-gradient(135deg, #d4af37 0%, #f4d76e 100%) !important;
            border: none !important;
            color: #0a0e27 !important;
            font-weight: 700 !important;
            box-shadow: 0 4px 18px rgba(212, 175, 55, 0.30) !important;
            transition: transform 0.2s ease, box-shadow 0.2s ease !important;
        }
        .auth-fp-modal .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 26px rgba(212, 175, 55, 0.50) !important;
            color: #0a0e27 !important;
        }
        .auth-fp-modal .btn-success {
            background: linear-gradient(135deg, #34d399 0%, #6ee7b7 100%) !important;
            border: none !important;
            color: #0a0e27 !important;
            font-weight: 700 !important;
        }
        .auth-fp-modal .btn-outline-danger {
            background: rgba(239, 68, 68, 0.06) !important;
            border: 1px solid rgba(239, 68, 68, 0.35) !important;
            color: #fca5a5 !important;
            font-weight: 600 !important;
        }
        .auth-fp-modal .btn-outline-danger:hover {
            background: rgba(239, 68, 68, 0.14) !important;
            border-color: #ef4444 !important;
            color: #fecaca !important;
        }
        .auth-fp-modal .btn-outline-success {
            background: rgba(34, 197, 94, 0.06) !important;
            border: 1px solid rgba(34, 197, 94, 0.35) !important;
            color: #86efac !important;
            font-weight: 600 !important;
        }
        .auth-fp-modal .btn-outline-success:hover {
            background: rgba(34, 197, 94, 0.14) !important;
            border-color: #22c55e !important;
            color: #bbf7d0 !important;
        }
        .auth-fp-modal .btn-link { color: #94a3b8 !important; }
        .auth-fp-modal .btn-link:hover { color: #d4af37 !important; }
        .auth-fp-modal #authErrorMsg {
            background: rgba(239, 68, 68, 0.08);
            border-radius: 8px;
            padding: 8px 12px;
            margin-top: 12px;
            min-height: 0;
        }
        .auth-fp-modal #authErrorMsg:empty { display: none; }
        .auth-fp-modal .text-success { color: #86efac !important; }
        .auth-fp-modal .text-danger { color: #fca5a5 !important; }

        @media (max-width: 768px) {
            .auth-fp-header { padding: 12px 18px; gap: 10px; }
            .auth-fp-brand-text { display: none; }
            .auth-fp-btn-text { display: none; }     /* "Home" word hides; icon stays */
            .auth-fp-btn { padding: 9px 13px; }
            .auth-fp-hero { padding: 40px 18px 60px; min-height: calc(100vh - 60px); }
            .auth-fp-hero-content .workspace-hero { font-size: clamp(2rem, 9vw, 2.6rem); }
            .auth-fp-features { padding: 60px 18px 50px; }
            .auth-fp-feature-grid { grid-template-columns: 1fr; }
            .auth-fp-modal { padding: 28px 22px 22px; max-height: 88vh; }
            .auth-fp-cta { width: 100%; justify-content: center; }
        }

        /* ── DARK PREMIUM RIGHT PANEL (Phase 1 polish) ──────────────────
           Right side previously rendered on white #fff with Bootstrap's
           bg-light inputs. That broke visual continuity with the marketing
           page + the dark gold-accented left panel. Below: scoped overrides
           that turn the right side into a premium dark panel matching the
           landing page (#0a0e27 + gold #d4af37 accents). All selectors are
           prefixed with .auth-right-panel so the rest of the app is untouched. */
        .auth-right-panel {
            background: linear-gradient(180deg, #0a0e27 0%, #0f1535 100%);
            border-left: 1px solid rgba(255, 255, 255, 0.06);
            color: #e2e8f0;
            position: relative;
            overflow: hidden;
        }
        /* Soft gold glow at the top-right — mirrors the marketing page's blob feel. */
        .auth-right-panel::before {
            content: '';
            position: absolute;
            top: -120px; right: -120px;
            width: 320px; height: 320px;
            background: #d4af37;
            border-radius: 50%;
            filter: blur(130px);
            opacity: 0.12;
            pointer-events: none;
        }
        .auth-right-panel > * { position: relative; z-index: 1; }

        /* "Welcome Back" headline — Playfair-grade weight + size. */
        .auth-right-panel h3.merriweather,
        .auth-right-panel h4.merriweather {
            color: #f8fafc !important;
            font-weight: 800 !important;
            letter-spacing: -0.01em;
        }
        .auth-right-panel h3.merriweather { font-size: 1.7rem; }
        .auth-right-panel .pp-firm-tag {
            display: inline-block;
            background: linear-gradient(135deg, #d4af37 0%, #f4d76e 100%);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            font-weight: 800;
        }

        /* Subtitle + helper text. */
        .auth-right-panel .text-muted { color: #94a3b8 !important; }
        .auth-right-panel .form-label { color: #cbd5e1 !important; letter-spacing: 0.05em; }
        .auth-right-panel hr { border-color: rgba(255, 255, 255, 0.08) !important; }
        .auth-right-panel .text-success { color: #86efac !important; }
        .auth-right-panel .text-danger { color: #fca5a5 !important; }

        /* Input groups — dark surfaces with gold focus ring. */
        .auth-right-panel .input-group-text.bg-light {
            background: rgba(255, 255, 255, 0.04) !important;
            border: 1px solid rgba(255, 255, 255, 0.10) !important;
            border-right: none !important;
            color: #94a3b8 !important;
        }
        .auth-right-panel .input-group-text.bg-light i { color: #d4af37 !important; }
        .auth-right-panel .form-control.bg-light,
        .auth-right-panel .form-select.bg-light {
            background: rgba(255, 255, 255, 0.04) !important;
            border: 1px solid rgba(255, 255, 255, 0.10) !important;
            color: #f8fafc !important;
            transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
        }
        .auth-right-panel .input-group .form-control.bg-light { border-left: none !important; }
        .auth-right-panel .form-control.bg-light::placeholder { color: #64748b; }
        .auth-right-panel .form-control.bg-light:focus,
        .auth-right-panel .form-select.bg-light:focus {
            background: rgba(255, 255, 255, 0.06) !important;
            border-color: #d4af37 !important;
            box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15) !important;
            outline: none !important;
        }
        .auth-right-panel .input-group:focus-within .input-group-text.bg-light {
            border-color: #d4af37 !important;
        }
        /* Bootstrap small text inside register form */
        .auth-right-panel small,
        .auth-right-panel .form-text { color: #94a3b8 !important; }

        /* Primary CTA button — gold gradient (replaces Bootstrap blue). */
        .auth-right-panel .btn-primary {
            background: linear-gradient(135deg, #d4af37 0%, #f4d76e 100%) !important;
            border: none !important;
            color: #0a0e27 !important;
            font-weight: 700 !important;
            box-shadow: 0 4px 18px rgba(212, 175, 55, 0.30) !important;
            transition: transform 0.2s ease, box-shadow 0.2s ease !important;
        }
        .auth-right-panel .btn-primary:hover,
        .auth-right-panel .btn-primary:focus {
            transform: translateY(-1px);
            box-shadow: 0 8px 26px rgba(212, 175, 55, 0.50) !important;
            color: #0a0e27 !important;
        }
        .auth-right-panel .btn-primary:disabled {
            opacity: 0.6; transform: none;
        }

        /* Success CTA (Create Database) — green-tinted gold variant */
        .auth-right-panel .btn-success {
            background: linear-gradient(135deg, #34d399 0%, #6ee7b7 100%) !important;
            border: none !important;
            color: #0a0e27 !important;
            font-weight: 700 !important;
            box-shadow: 0 4px 18px rgba(52, 211, 153, 0.30) !important;
        }
        .auth-right-panel .btn-success:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 26px rgba(52, 211, 153, 0.50) !important;
        }

        /* Outline buttons — Google red + Register green refined for dark bg. */
        .auth-right-panel .btn-outline-danger {
            background: rgba(239, 68, 68, 0.06) !important;
            border: 1px solid rgba(239, 68, 68, 0.35) !important;
            color: #fca5a5 !important;
            font-weight: 600 !important;
        }
        .auth-right-panel .btn-outline-danger:hover {
            background: rgba(239, 68, 68, 0.14) !important;
            border-color: #ef4444 !important;
            color: #fecaca !important;
        }
        .auth-right-panel .btn-outline-success {
            background: rgba(34, 197, 94, 0.06) !important;
            border: 1px solid rgba(34, 197, 94, 0.35) !important;
            color: #86efac !important;
            font-weight: 600 !important;
        }
        .auth-right-panel .btn-outline-success:hover {
            background: rgba(34, 197, 94, 0.14) !important;
            border-color: #22c55e !important;
            color: #bbf7d0 !important;
        }
        .auth-right-panel .btn-link { color: #94a3b8 !important; }
        .auth-right-panel .btn-link:hover { color: #d4af37 !important; }

        /* OR divider line color */
        .auth-right-panel .d-flex.align-items-center .text-muted { color: #64748b !important; }

        /* Error message styling */
        .auth-right-panel #authErrorMsg {
            color: #fca5a5 !important;
            background: rgba(239, 68, 68, 0.08);
            border-radius: 8px;
            padding: 8px 12px;
            margin-top: 12px;
            display: block;
            min-height: 0;
        }
        .auth-right-panel #authErrorMsg:empty { display: none; }

        /* Mobile brand block — dark theme variant. */
        .auth-right-panel .brand-mobile h4 {
            color: #f8fafc !important;
        }

        @media (max-width: 768px) {
            .auth-left-panel { display: none; }
            .auth-right-panel { width: 100%; padding: 32px 24px; background: #0a0e27; }
            .auth-right-panel .brand-mobile { display: block; text-align: center; margin-bottom: 20px; }
        }

        /* ── App Chrome ─────────────────────────────────── */
        .navbar { background-color: var(--ca-navy); border-bottom: 3px solid var(--ca-gold); }
        /* sidebar base styles are in the toggle block below */
        .nav-pills .nav-link { color: var(--text-main); font-weight: 500; cursor: pointer; border-radius: 8px; margin-bottom: 5px; font-size: 0.88rem; }
        .nav-pills .nav-link.active { background-color: var(--ca-gold); color: var(--ca-surface); }
        .nav-pills .nav-link:hover:not(.active) { background-color: var(--ca-bg); }
        .hidden { display: none !important; }
        .btn-primary { background-color: var(--ca-navy); border-color: var(--ca-navy); }
        .btn-primary:hover { background-color: #0d2d5a; border-color: #0d2d5a; }
        .accordion-button:not(.collapsed) { background-color: #f0f4f8; color: var(--ca-navy); font-weight: bold; }
        /* Enhancement 2: Smaller table font */
        .table th { background-color: var(--ca-navy); color: white; font-weight: 500; font-size: 0.82rem; }
        .table td { font-size: 0.82rem; }
        .dash-card { cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; }
        .dash-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important; }
        .bulk-card { border-radius: 14px; transition: box-shadow 0.2s; }
        .bulk-card:hover { box-shadow: 0 8px 24px rgba(11,36,71,0.13) !important; }
        .bulk-card .card-header { border-radius: 14px 14px 0 0 !important; font-size: 1rem; }
        .step-list { padding-left: 1.2rem; }
        .step-list li { margin-bottom: 6px; font-size: 0.84rem; color: #555; }
        .step-list li strong { color: var(--ca-navy); }
        .badge-freq { font-size: 0.7rem; }
        .table-sm td, .table-sm th { font-size: 0.80rem; }
        .manual-task-card { border-left: 5px solid #198754; }
        .tx-link-panel { background: #f0fff4; border: 1.5px solid #198754; border-radius: 10px; padding: 14px 16px; margin-top: 10px; }
        .tx-link-panel.adhoc { background: #fff8e1; border-color: #fd7e14; }
        .form-check-input:checked { background-color: var(--ca-navy); border-color: var(--ca-navy); }
        .billed-badge { font-size: 0.72rem; background: #d4edda; color: #155724; border: 1px solid #c3e6cb; padding: 2px 7px; border-radius: 20px; }
        .unbilled-badge { font-size: 0.72rem; background: #fff3cd; color: #856404; border: 1px solid #ffc107; padding: 2px 7px; border-radius: 20px; }

        /* Enhancement 11: Priority Badges */
        .priority-high   { background:#dc3545!important;color:#fff!important;font-size:0.68rem; }
        .priority-medium { background:#fd7e14!important;color:#fff!important;font-size:0.68rem; }
        .priority-low    { background:#6c757d!important;color:#fff!important;font-size:0.68rem; }

        /* Enhancement 15: Reminder Row Highlight */
        .task-reminder-row { background: rgba(220,53,69,0.07) !important; }
        .task-reminder-row td:first-child::before { content:'⚠️ '; }

        /* Enhancement 13: Chat Interface */
        /* ── Chat Panel: flex column keeps input always at bottom ── */
        #taskChatPanel { display: flex; flex-direction: column; }
        .chat-window { height: 280px; overflow-y: auto; background: #f4f6fb; border: 1px solid #dee2e6; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
        /* FIX 4: Prevent Instant Messenger from collapsing when admin section is hidden on mobile */
        @media (max-width: 768px) {
            #taskUpdateModal .modal-body { min-height: 480px !important; }
            #taskChatPanel { min-height: 420px; display: flex; flex-direction: column; }
            #taskChatPanel .chat-window { flex: 1; height: auto; min-height: 260px; }
            /* FIX 5: When chat tab is active (full-screen mode) expand chat to use full modal height */
            #taskUpdateModal.chat-fullscreen .modal-body {
                display: flex; flex-direction: column; padding: 0 !important;
                height: calc(100svh - 56px) !important; min-height: unset !important;
            }
            #taskUpdateModal.chat-fullscreen #taskChatPanel {
                flex: 1; min-height: unset; padding: 8px 12px 4px;
                display: flex; flex-direction: column;
            }
            #taskUpdateModal.chat-fullscreen #taskChatPanel .chat-window {
                flex: 1; height: auto; min-height: unset;
            }
            #taskUpdateModal.chat-fullscreen #taskUpdatePanel { display: none !important; }
        }
        .chat-bubble-wrap { display: flex; align-items: flex-end; gap: 8px; }
        .chat-bubble-wrap.self { flex-direction: row-reverse; }
        .chat-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
        .chat-bubble { max-width: 72%; padding: 9px 13px; border-radius: 16px; font-size: 0.82rem; line-height: 1.45; position: relative; word-break: break-word; }
        .chat-bubble.incoming { background: #fff; border: 1px solid #e0e0e0; border-bottom-left-radius: 4px; }
        .chat-bubble.outgoing { background: var(--ca-navy); color: #fff; border-bottom-right-radius: 4px; }
        .chat-bubble .chat-meta { font-size: 0.68rem; opacity: 0.65; margin-bottom: 3px; font-weight: 600; }
        .chat-input-area { display: flex; gap: 8px; margin-top: 8px; flex-shrink: 0; }
        /* Desktop: chat input is sticky below chat window — never moves */
        @media (min-width: 769px) {
            #taskChatPanel { height: 100%; }
            #taskChatPanel .chat-window { flex: 1 1 0; min-height: 200px; height: auto !important; }
            .chat-input-area {
                position: sticky !important;
                bottom: 0 !important;
                background: #fff !important;
                padding: 10px 0 6px !important;
                border-top: 1px solid #e9ecef !important;
                box-shadow: 0 -2px 8px rgba(11,36,71,0.06) !important;
                z-index: 10;
            }
            #taskChatWindow { padding-bottom: 0 !important; }
        }
        .chat-input-area textarea { flex: 1; resize: none; border-radius: 20px; padding: 8px 14px; font-size: 0.83rem; border: 1px solid #ced4da; outline: none; }
        .chat-send-btn { border-radius: 50%; width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--ca-navy); color: #fff; border: none; cursor: pointer; }
        .chat-send-btn:hover { background: var(--theme-primary-hover, #1a3f70); }
        /* Enhancement 14: Unread badge */
        .unread-chat-dot { display: inline-block; width: 9px; height: 9px; background: #dc3545; border-radius: 50%; margin-left: 5px; vertical-align: middle; animation: pulse 1.2s infinite; }
        @keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

        /* FIX 9: Bell Notification Icon */
        .notif-bell-btn {
            position: relative; background: transparent; border: 1px solid rgba(255,255,255,0.35);
            color: #fff; border-radius: 8px; padding: 4px 10px;
            cursor: pointer; transition: background 0.15s;
            display: flex; align-items: center; justify-content: center;
        }
        .notif-bell-btn:hover { background: rgba(255,255,255,0.12); }
        .notif-bell-badge {
            position: absolute; top: -5px; right: -5px;
            background: #dc3545; color: #fff; border-radius: 50%;
            width: 18px; height: 18px; font-size: 0.6rem; font-weight: 700;
            display: flex; align-items: center; justify-content: center;
            border: 2px solid var(--ca-navy);
            animation: pulse 1.4s infinite;
        }
        /* Notification Panel */
        #notifPanel {
            display: none; position: fixed; top: 60px; right: 16px;
            width: 340px; max-height: 480px; overflow-y: auto;
            background: #fff; border-radius: 16px;
            box-shadow: 0 12px 40px rgba(11,36,71,0.22);
            border: 1px solid #e2e8f0; z-index: 9000;
        }
        #notifPanel.show { display: block; animation: slideDown 0.2s ease; }
        @keyframes slideDown { from{transform:translateY(-10px);opacity:0} to{transform:translateY(0);opacity:1} }
        .notif-item { padding: 10px 14px; border-bottom: 1px solid #f0f2f7; cursor: pointer; transition: background 0.15s; }
        .notif-item:hover { background: #f8f9ff; }
        .notif-item.unread { border-left: 3px solid var(--ca-gold); }
        .notif-item-title { font-size: 0.82rem; font-weight: 600; color: var(--ca-navy); }
        .notif-item-body  { font-size: 0.74rem; color: #6c757d; margin-top: 2px; }
        .notif-item-time  { font-size: 0.66rem; color: #adb5bd; margin-top: 3px; }
        /* Mobile bell in top header */
        .mob-notif-bell {
            position: relative; background: transparent; border: none;
            color: #fff; font-size: 1.1rem; cursor: pointer; padding: 4px 6px;
        }
        .mob-notif-badge {
            position: absolute; top: 0; right: 0;
            background: #dc3545; color: #fff; border-radius: 50%;
            width: 15px; height: 15px; font-size: 0.55rem; font-weight: 700;
            display: flex; align-items: center; justify-content: center;
            border: 1.5px solid var(--ca-navy);
        }

        /* Flatpickr overrides */
        .flatpickr-input { background: #fff !important; cursor: pointer; }

        /* ── PWA Install Button — Blinking / Attractive ──────── */
        @keyframes pwa-blink {
            0%,100% { box-shadow: 0 0 0 0 rgba(255,193,7,0.8); opacity:1; }
            50%      { box-shadow: 0 0 0 8px rgba(255,193,7,0); opacity:0.82; }
        }
        @keyframes pwa-shine {
            0%   { background-position: -200% center; }
            100% { background-position: 200% center; }
        }
        .mob-menu-install {
            display: flex; align-items: center; gap: 12px;
            padding: 13px 20px; cursor: pointer;
            background: linear-gradient(90deg, var(--ca-navy) 0%, var(--theme-primary-hover, #1a3f70) 40%, var(--ca-gold) 100%);
            background-size: 200% auto;
            animation: pwa-blink 1.6s ease-in-out infinite, pwa-shine 2.8s linear infinite;
            margin: 8px 12px 4px; border-radius: 12px;
            color: #fff !important; font-weight: 700; font-size: 0.9rem;
            border: 2px solid var(--ca-gold);
            position: relative; overflow: hidden;
        }
        .mob-menu-install::after {
            content: ''; position: absolute; inset: 0;
            background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.18) 50%, transparent 60%);
            background-size: 200% auto;
            animation: pwa-shine 2s linear infinite;
        }
        .mob-menu-install i { font-size: 1.25rem; color: var(--ca-gold); }
        .mob-menu-install .install-sub { font-size: 0.68rem; font-weight: 400; opacity: 0.85; display: block; margin-top: 1px; }
        /* pwaInstallBtn always visible — inline style handles it */

        /* ── PWA Install Banner (on-load prompt) ─────────────── */
        #pwaInstallBanner {
            display: none; position: fixed;
            bottom: 70px; left: 10px; right: 10px;
            background: linear-gradient(135deg, var(--ca-navy) 0%, var(--theme-primary-hover, #1a3f70) 100%);
            border: 2px solid var(--ca-gold); border-radius: 16px;
            box-shadow: 0 8px 32px rgba(11,36,71,0.45);
            z-index: 2000; padding: 14px 16px;
            animation: pwa-blink 2s ease-in-out infinite;
            color: #fff;
        }
        #pwaInstallBanner.show { display: flex; align-items: center; gap: 12px; }
        .pwa-banner-icon { font-size: 2rem; color: var(--ca-gold); flex-shrink: 0; }
        .pwa-banner-text { flex: 1; }
        .pwa-banner-text strong { display: block; font-size: 0.9rem; }
        .pwa-banner-text small { opacity: 0.8; font-size: 0.75rem; }
        .pwa-banner-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
        .btn-pwa-install {
            background: var(--ca-gold); color: var(--ca-navy); border: none;
            border-radius: 8px; padding: 6px 14px; font-weight: 700;
            font-size: 0.8rem; cursor: pointer; white-space: nowrap;
        }
        .btn-pwa-later {
            background: transparent; color: rgba(255,255,255,0.7);
            border: 1px solid rgba(255,255,255,0.3);
            border-radius: 8px; padding: 5px 14px;
            font-size: 0.75rem; cursor: pointer; white-space: nowrap;
        }

        /* ── Sidebar Toggle — pure flexbox, zero scroll jump ── */
        .sidebar {
            flex: 0 0 210px;
            width: 210px;
            overflow: hidden;
            background: #fff;
            border-right: 1px solid #E2E8F0;
            padding-top: 20px;
            transition: flex-basis 0.3s ease, width 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
        }
        .sidebar.sidebar-collapsed {
            flex-basis: 0 !important;
            width: 0 !important;
            padding: 0 !important;
            opacity: 0;
            pointer-events: none;
        }
        .main-content-area {
            flex: 1 1 0%;
            min-width: 0;
            padding: 1.5rem;
            background: var(--ca-bg);
        }
        .btn-sidebar-toggle {
            background: transparent;
            border: 1px solid rgba(255,255,255,0.35);
            color: #fff;
            border-radius: 6px;
            padding: 4px 10px;
            font-size: 1.1rem;
            line-height: 1;
            cursor: pointer;
            transition: background 0.15s;
            margin-right: 8px;
        }
        .btn-sidebar-toggle:hover { background: rgba(255,255,255,0.12); }

        /* ── Custom Searchable Dropdown (CSD) ─────────────── */
        .csd-wrap { position: relative; }
        .csd-list {
            display: none;
            position: absolute;
            top: 100%;
            left: 0; right: 0;
            z-index: 1055;
            background: #fff;
            border: 1px solid #ced4da;
            border-top: 2px solid var(--ca-navy);
            border-radius: 0 0 6px 6px;
            max-height: 200px;
            overflow-y: auto;
            box-shadow: 0 6px 16px rgba(0,0,0,0.12);
            list-style: none;
            padding: 0; margin: 0;
        }
        .csd-list.open { display: block; }
        .csd-list li {
            padding: 6px 11px;
            font-size: 0.82rem;
            cursor: pointer;
            border-bottom: 1px solid #f3f3f3;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .csd-list li:hover, .csd-list li.csd-active { background: #e8f0fe; color: var(--ca-navy); font-weight: 500; }
        .csd-list li.csd-no-match { color: #aaa; cursor: default; font-style: italic; }
        .csd-input.csd-valid { border-color: #198754 !important; box-shadow: 0 0 0 0.2rem rgba(25,135,84,.15) !important; }

        /* ═══════════════════════════════════════════════════════
           MOBILE-FIRST PWA STYLES — max-width: 768px
           ═══════════════════════════════════════════════════════ */
        @media (min-width: 769px) {
            #mobileBottomNav, .filter-fab, .mob-card-list,
            .mob-page-header, #mobileMenuSheet, #mobileMenuOverlay,
            .mob-top-header, .mob-filter-chips { display: none !important; }
        }

        @media (max-width: 768px) {
            :root {
                --mob-radius: 16px;
                --mob-card-shadow: 0 2px 16px rgba(11,36,71,0.10);
                --mob-active-glow: 0 0 14px rgba(197,168,128,0.6);
            }
            body { padding-bottom: 76px; background: #f0f2f7; }
            .navbar { display: none !important; }
            .sidebar, #appSidebar { display: none !important; }
            .main-content-area { padding: 0 0 1rem; }

            /* ── Mobile Page Header ───────────────────────────── */
            .mob-page-header {
                display: flex; align-items: center;
                background: linear-gradient(135deg, var(--ca-navy) 0%, var(--theme-primary-hover, #1a3f70) 100%);
                padding: 14px 16px 12px;
                border-bottom: 2px solid var(--ca-gold);
                position: sticky; top: 0; z-index: 200;
                box-shadow: 0 2px 12px rgba(11,36,71,0.3);
            }
            .mob-page-header h5 {
                color: #fff; font-family: 'Merriweather', serif;
                margin: 0; font-size: 1rem; flex: 1;
                letter-spacing: 0.2px;
            }
            .mob-header-actions { display: flex; align-items: center; gap: 8px; }
            .mob-header-actions .btn {
                padding: 5px 12px; font-size: 0.75rem;
                border-radius: 20px; font-weight: 600;
            }
            /* Header right icons */
            .mob-header-icon-btn {
                width: 34px; height: 34px; border-radius: 50%;
                border: 1.5px solid rgba(255,255,255,0.25);
                background: rgba(255,255,255,0.08);
                color: #fff; display: flex; align-items: center; justify-content: center;
                font-size: 1rem; cursor: pointer; flex-shrink: 0;
                -webkit-tap-highlight-color: transparent;
            }
            .mob-header-icon-btn:active { background: rgba(255,255,255,0.2); }

            /* ── BOTTOM NAVIGATION — Advanced ───────────────── */
            #mobileBottomNav {
                display: flex; position: fixed;
                bottom: 0; left: 0; right: 0;
                height: 68px;
                background: rgba(11,36,71,0.97);
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                border-top: 1px solid rgba(197,168,128,0.35);
                z-index: 1060; align-items: stretch;
                padding: 0 4px;
                box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
            }
            .mob-nav-item {
                flex: 1; display: flex; flex-direction: column;
                align-items: center; justify-content: center;
                color: rgba(255,255,255,0.42); font-size: 0.56rem;
                font-weight: 600; cursor: pointer; letter-spacing: 0.5px;
                border: none; background: transparent; gap: 4px;
                text-transform: uppercase; padding: 0 2px;
                transition: color 0.2s, transform 0.15s;
                -webkit-tap-highlight-color: transparent; outline: none;
                position: relative; border-radius: 12px; margin: 6px 2px;
            }
            .mob-nav-item i { font-size: 1.35rem; line-height: 1; transition: transform 0.2s; }
            .mob-nav-item.active {
                color: var(--ca-gold);
                background: rgba(197,168,128,0.12);
            }
            .mob-nav-item.active i { transform: translateY(-2px); }
            .mob-nav-item.active::after {
                content: '';
                position: absolute; bottom: -6px; left: 50%;
                transform: translateX(-50%);
                width: 24px; height: 3px;
                background: var(--ca-gold);
                border-radius: 2px 2px 0 0;
            }
            .mob-nav-item:active { transform: scale(0.9); }
            /* Nav badge for unread */
            .mob-nav-badge {
                position: absolute; top: 4px; right: calc(50% - 18px);
                background: #dc3545; color: #fff;
                font-size: 0.55rem; font-weight: 700;
                border-radius: 8px; padding: 1px 5px;
                min-width: 16px; text-align: center;
                line-height: 1.4; border: 1.5px solid rgba(11,36,71,0.97);
            }

            /* ── Hide tables on mobile, show card lists ──────── */
            #viewTasks .table-responsive { display: none !important; }
            #viewClients > .card .table-responsive { display: none !important; }
            .mob-card-list { display: flex !important; flex-direction: column; gap: 0; padding: 10px 12px 4px; }

            /* ── TASK CARD — Advanced glassmorphism style ────── */
            .swipe-wrapper {
                position: relative; overflow: hidden;
                border-radius: var(--mob-radius); margin-bottom: 10px;
                box-shadow: var(--mob-card-shadow);
            }
            .swipe-bg {
                position: absolute; top: 0; bottom: 0; width: 88px;
                display: flex; align-items: center; justify-content: center;
                flex-direction: column; gap: 5px; font-size: 0.65rem;
                font-weight: 700; color: #fff; user-select: none;
                letter-spacing: 0.3px;
            }
            .swipe-bg-left  { left: 0; background: linear-gradient(135deg,#0d6efd,#4d9eff); border-radius: var(--mob-radius) 0 0 var(--mob-radius); }
            .swipe-bg-right { right: 0; background: linear-gradient(135deg,#198754,#2dbb6e); border-radius: 0 var(--mob-radius) var(--mob-radius) 0; }
            .swipe-card {
                position: relative; z-index: 2;
                transition: transform 0.28s cubic-bezier(.4,0,.2,1);
                will-change: transform; touch-action: pan-y;
                border-radius: var(--mob-radius); background: #fff;
            }

            /* Task card main */
            .mob-task-card {
                padding: 14px 14px 10px;
                border-left: 4px solid #adb5bd;
                border-radius: var(--mob-radius);
            }
            .mob-task-card.priority-border-high   { border-left-color: #dc3545; }
            .mob-task-card.priority-border-medium { border-left-color: #fd7e14; }
            .mob-task-card.priority-border-low    { border-left-color: #198754; }

            .mob-task-card-title {
                font-weight: 700; font-size: 0.9rem; color: var(--ca-navy);
                line-height: 1.3;
            }
            .mob-task-card-sub {
                font-size: 0.75rem; color: #6c757d; margin-bottom: 2px;
                display: flex; align-items: center; gap: 5px;
            }
            .mob-task-card-sub i { font-size: 0.78rem; flex-shrink: 0; }
            .mob-task-card-meta {
                display: flex; gap: 8px; flex-wrap: wrap;
                margin-top: 8px; margin-bottom: 8px;
            }
            .mob-task-chip {
                display: inline-flex; align-items: center; gap: 3px;
                background: #f0f2f7; border-radius: 20px;
                padding: 3px 9px; font-size: 0.68rem; color: #495057;
                font-weight: 500;
            }
            .mob-task-chip.danger { background: #fff5f5; color: #dc3545; font-weight: 700; }
            .mob-task-chip.warning { background: #fff8f0; color: #fd7e14; }
            .mob-task-chip.success { background: #f0fff4; color: #198754; }
            .mob-task-card-actions {
                display: flex; gap: 6px; margin-top: 8px;
                align-items: center; flex-wrap: wrap;
                border-top: 1px solid #f0f0f0; padding-top: 10px;
            }
            .mob-action-btn {
                display: inline-flex; align-items: center; gap: 5px;
                border-radius: 20px; padding: 5px 12px;
                font-size: 0.73rem; font-weight: 600;
                border: none; cursor: pointer;
                -webkit-tap-highlight-color: transparent;
                transition: transform 0.1s, box-shadow 0.15s;
            }
            .mob-action-btn:active { transform: scale(0.95); }
            .mob-action-btn.call { background: #e8f4ff; color: #0d6efd; }
            .mob-action-btn.whatsapp { background: #e8fff0; color: #128C7E; }
            .mob-action-btn.whatsapp-tpl { background: #25D366; color: #fff; }
            .mob-wa-btn { background: #25D366 !important; border-color: #25D366 !important; color: #fff !important; }

            /* ── CLIENT CARDS — Advanced ─────────────────────── */
            .mob-client-card {
                background: #fff; border-radius: var(--mob-radius);
                padding: 14px 14px 12px; border-left: 4px solid var(--ca-navy);
                margin-bottom: 10px;
                box-shadow: var(--mob-card-shadow);
            }
            .mob-client-card-name {
                font-weight: 700; font-size: 0.92rem; color: var(--ca-navy);
            }
            .mob-client-card-id {
                font-size: 0.68rem; color: #adb5bd; font-weight: 500;
                letter-spacing: 0.3px;
            }
            .mob-client-card-pills {
                display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0;
            }
            .mob-client-pill {
                display: inline-flex; align-items: center; gap: 3px;
                background: #f0f2f7; border-radius: 20px;
                padding: 2px 8px; font-size: 0.67rem; color: #495057;
            }
            .mob-client-pill.group { background: #e8f4ff; color: #0d6efd; font-weight: 600; }
            .mob-client-pill.compliance { background: #f0e8ff; color: #6f42c1; }

            /* ── BOTTOM SHEETS ───────────────────────────────── */
            .modal.bottom-sheet { padding: 0 !important; }
            .modal.bottom-sheet .modal-dialog {
                position: fixed; bottom: 0; left: 0; right: 0; margin: 0;
                max-width: 100% !important; width: 100%;
                transform: translateY(100%);
                transition: transform 0.38s cubic-bezier(.4,0,.2,1);
            }
            .modal.bottom-sheet.show .modal-dialog { transform: translateY(0); }
            .modal.bottom-sheet .modal-content {
                border-radius: 24px 24px 0 0 !important; border: none;
                max-height: 92vh; overflow-y: auto; padding-top: 6px;
                box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
            }
            .modal.bottom-sheet .modal-content::before {
                content: ''; display: block; width: 40px; height: 4px;
                background: #ced4da; border-radius: 2px; margin: 8px auto 10px;
            }

            /* ── Chat UI — Input FIXED above bottom nav, never moves ── */
            #taskUpdateModal.bottom-sheet .modal-content {
                max-height: 100svh; border-radius: 0 !important;
            }
            #taskUpdateModal.bottom-sheet .modal-content::before { display: none; }
            /* Chat window height = viewport minus: header(56) + tabs(40) + attachment-warning(36) + label(28) + fixed-input(70) + nav(68) + padding(20) */
            #taskUpdateModal .chat-window {
                height: calc(100svh - 390px);
                min-height: 150px;
                padding-bottom: 8px !important;
            }
            /* Fixed input bar — ALWAYS above bottom nav bar (68px), keyboard-proof */
            .chat-input-area {
                position: fixed !important;
                bottom: 68px !important;
                left: 0 !important;
                right: 0 !important;
                background: #fff !important;
                padding: 8px 12px 10px !important;
                z-index: 1080 !important;
                border-top: 2px solid #e2e8f0 !important;
                box-shadow: 0 -4px 16px rgba(11,36,71,0.12) !important;
            }
            /* Space at bottom of chat window so last message not hidden behind fixed input */
            #taskChatWindow {
                padding-bottom: 90px !important;
            }
            /* chat-fullscreen mode — same treatment */
            #taskUpdateModal.chat-fullscreen .chat-input-area {
                position: fixed !important;
                bottom: 68px !important;
                left: 0 !important; right: 0 !important;
                z-index: 1090 !important;
                padding: 8px 12px 10px !important;
                background: #fff !important;
                border-top: 2px solid #e2e8f0 !important;
                box-shadow: 0 -4px 16px rgba(11,36,71,0.12) !important;
            }
            /* Fullscreen chat window uses all available space */
            #taskUpdateModal.chat-fullscreen #taskChatPanel .chat-window {
                height: calc(100svh - 230px) !important;
                min-height: 180px;
            }
            /* Fix 3: Save button clears 68px bottom nav */
            #taskUpdatePanel .d-md-none.mt-3 {
                padding-bottom: 80px;
            }
            /* Also ensure modal body scrolls fully */
            #taskUpdateModal .modal-body {
                padding-bottom: 20px;
            }

            /* ── FILTER FAB ─────────────────────────────────── */
            .filter-fab {
                display: flex; position: fixed;
                bottom: 80px; right: 16px;
                width: 52px; height: 52px; border-radius: 26px;
                background: var(--ca-navy); color: var(--ca-gold);
                border: 2px solid var(--ca-gold);
                align-items: center; justify-content: center;
                font-size: 1.2rem;
                box-shadow: 0 6px 20px rgba(11,36,71,0.4);
                z-index: 1050; cursor: pointer;
                transition: transform 0.15s, box-shadow 0.15s;
                -webkit-tap-highlight-color: transparent;
            }
            .filter-fab:active { transform: scale(0.9); }
            .filter-fab.active { background: var(--ca-gold); color: var(--ca-navy); box-shadow: var(--mob-active-glow); }
            .mob-filter-panel { display: none; }
            .mob-filter-panel.open { display: block; }
            .mob-filter-panel .card { margin: 0 12px 10px; border-radius: 14px !important; }

            /* Sticky form buttons */
            #manualTaskCard .row .col-md-2:last-child .btn.btn-success,
            button[onclick="saveTransaction()"] {
                position: sticky; bottom: 70px; z-index: 50;
                width: 100% !important; border-radius: 24px !important;
                padding: 13px; font-size: 1rem; margin-top: 12px;
                box-shadow: 0 4px 16px rgba(25,135,84,0.35);
            }

            /* ── Mobile Top Header — Prime Practice + Right Menu ─── */
        .mob-top-header {
            display: none;
        }
        @media (max-width: 768px) {
            .mob-top-header {
                display: flex; align-items: center; justify-content: space-between;
                background: linear-gradient(135deg, var(--ca-navy) 0%, var(--theme-primary-hover, #1a3f70) 100%);
                padding: 10px 14px;
                border-bottom: 2px solid var(--ca-gold);
                position: sticky; top: 0; z-index: 210;
                box-shadow: 0 2px 12px rgba(11,36,71,0.35);
            }
            .mob-top-brand {
                display: flex; align-items: center; gap: 8px;
                color: #fff; font-family: 'Merriweather', serif; font-size: 0.95rem; font-weight: 700;
            }
            .mob-top-brand img { height: 28px; border-radius: 6px; background: #fff; padding: 2px; }
            .mob-top-brand span span { color: var(--ca-gold); }
            .mob-top-right { display: flex; align-items: center; gap: 6px; }
            .mob-top-menu-btn {
                width: 34px; height: 34px; border-radius: 50%;
                border: 1.5px solid rgba(255,255,255,0.3);
                background: rgba(255,255,255,0.1); color: #fff;
                display: flex; align-items: center; justify-content: center;
                font-size: 1.1rem; cursor: pointer;
            }
            /* Compact Mobile Filters */
            .mob-filter-chips {
                display: flex; flex-wrap: wrap; gap: 6px;
                padding: 8px 12px; background: #fff;
                border-bottom: 1px solid #e9ecef;
            }
            .mob-filter-chip {
                display: flex; align-items: center; gap: 4px;
                background: #f0f2f7; border: 1px solid #dee2e6;
                border-radius: 20px; padding: 4px 10px;
                font-size: 0.7rem; color: #495057; font-weight: 500;
                cursor: pointer; position: relative;
            }
            .mob-filter-chip.active { background: var(--ca-navy); color: #fff; border-color: var(--ca-navy); }
            .mob-filter-chip select {
                background: transparent; border: none; outline: none;
                font-size: 0.7rem; color: inherit; cursor: pointer;
                max-width: 100px;
            }
            .mob-filter-chip select option { color: #000; }
            /* Email template compact button */
            .mob-email-btn { background: #e8f4ff; color: #0d6efd; }
            .mob-email-btn:active { transform: scale(0.95); }
        }
            #mobileMenuSheet {
                display: block; position: fixed;
                bottom: -100%; left: 0; right: 0;
                background: #fff; border-radius: 24px 24px 0 0;
                box-shadow: 0 -8px 40px rgba(0,0,0,0.22);
                z-index: 1070; transition: bottom 0.35s cubic-bezier(.4,0,.2,1);
                padding: 6px 0 82px;
            }
            #mobileMenuSheet::before {
                content: ''; display: block; width: 40px; height: 4px;
                background: #ced4da; border-radius: 2px; margin: 10px auto 14px;
            }
            #mobileMenuSheet.show-sheet { bottom: 0; }
            #mobileMenuSheet .mob-menu-section-title {
                font-size: 0.65rem; font-weight: 700; letter-spacing: 1px;
                text-transform: uppercase; color: #adb5bd;
                padding: 6px 22px 4px; margin-top: 4px;
            }
            #mobileMenuSheet .mob-menu-item {
                display: flex; align-items: center; gap: 14px;
                padding: 13px 22px; font-size: 0.88rem; font-weight: 500;
                color: var(--text-main); cursor: pointer;
                -webkit-tap-highlight-color: transparent;
            }
            #mobileMenuSheet .mob-menu-item .mob-menu-icon {
                width: 38px; height: 38px; border-radius: 10px;
                display: flex; align-items: center; justify-content: center;
                font-size: 1.1rem; flex-shrink: 0;
            }
            #mobileMenuSheet .mob-menu-item:active { background: #f8f9fa; }
            #mobileMenuOverlay {
                display: none; position: fixed; inset: 0;
                background: rgba(0,0,0,0.45); z-index: 1065;
                backdrop-filter: blur(2px);
            }
            #mobileMenuOverlay.show { display: block; }

            /* ── DASHBOARD on mobile ────────────────────────── */
            #viewDashboard .row.g-3 > [class*="col-md-3"] { flex: 0 0 50%; max-width: 50%; }
            .dash-card {
                border-radius: 14px !important;
                overflow: hidden;
            }
            .dash-card .card-body { padding: 14px 12px !important; }
            .dash-card h3 { font-size: 1.5rem !important; }

            /* Manual task card - vertical stack */
            .manual-task-card .row.g-3 > div[class*="col-md"] { flex: 0 0 100%; max-width: 100%; }

            /* General */
            .card { border-radius: 14px !important; }
            .card-body { padding: 14px 12px; }
            .modal.bottom-sheet .modal-footer { position: sticky; bottom: 0; background: #f8f9fa; z-index: 10; }
            .auth-left-panel { display: none; }
            .auth-right-panel { width: 100%; padding: 28px 18px; }

            /* ── FLOATING WA Button ─────────────────────────── */
            .mob-wa-float {
                display: flex; align-items: center; gap: 5px;
                background: #25D366; color: #fff;
                border-radius: 20px; padding: 5px 12px;
                font-size: 0.73rem; font-weight: 700;
                border: none; cursor: pointer;
                box-shadow: 0 2px 8px rgba(37,211,102,0.4);
                -webkit-tap-highlight-color: transparent;
            }
            .mob-wa-float:active { transform: scale(0.95); }

            /* section spacing */
            .view-panel > * { margin-bottom: 0; }

            @media (max-width: 768px) {
            /* Hide individual page headers since global top header is used */
            .mob-page-header {
                display: none !important;
            }
            /* Add top padding to main content to account for global header */
            .main-content-area {
                padding-top: 0 !important;
            }
        }

        /* Mobile icon-only action buttons for client cards */
        .mob-icon-btn {
            width: 32px; height: 32px; min-width: 32px;
            border-radius: 8px; border: none; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            -webkit-tap-highlight-color: transparent;
            transition: opacity 0.15s, transform 0.12s;
        }
        .mob-icon-btn:active { transform: scale(0.88); opacity: 0.75; }

        /* Mobile icon-only action buttons for client cards */
        .mob-icon-btn {
            width: 32px; height: 32px; min-width: 32px;
            border-radius: 8px; border: none; cursor: pointer;
            display: flex; align-items: center; justify-content: center;
            -webkit-tap-highlight-color: transparent;
            transition: opacity 0.15s, transform 0.12s;
        }
        .mob-icon-btn:active { transform: scale(0.88); opacity: 0.75; }

        /* Task modal tabs (mobile) */
        .task-modal-tab { transition: background 0.2s, color 0.2s; border: none !important; }
        .task-modal-tab.active { background: var(--ca-navy) !important; color: #fff !important; }
        .task-status-btn { font-size: 0.75rem !important; padding: 6px 4px !important; font-weight: 600 !important; border-radius: 8px !important; }
        .task-status-btn.selected { box-shadow: 0 0 0 3px var(--ca-navy); transform: scale(1.04); }

        @media (max-width: 768px) {
            #taskUpdatePanel, #taskChatPanel { display: block; }
            #taskUpdatePanel.hidden-tab, #taskChatPanel.hidden-tab { display: none; }
            #taskModalTabs { display: flex !important; }
        }
        @media (min-width: 769px) {
            #taskModalTabs { display: none !important; }
            #taskUpdatePanel.hidden-tab, #taskChatPanel.hidden-tab { display: block !important; }
        }

        /* Pill status badges */
        .mob-status-pending   { background:#fff3cd;color:#856404;border-radius:20px;padding:2px 8px;font-size:0.67rem;font-weight:600; }
        .mob-status-wip       { background:#cff4fc;color:#0d6efd;border-radius:20px;padding:2px 8px;font-size:0.67rem;font-weight:600; }
        .mob-status-complete  { background:#d1e7dd;color:#0a3622;border-radius:20px;padding:2px 8px;font-size:0.67rem;font-weight:600; }

        /* ── COMPREHENSIVE MOBILE UI IMPROVEMENTS ──── */
        @media (max-width: 768px) {
            /* Body with top header space */
            body { padding-bottom: 80px; }

            /* Main content below mob-top-header */
            #appContainer .main-content-area { padding: 0 0 1rem; }

            /* Dashboard cards — 2 per row, better sizing */
            #viewDashboard .row.g-3 > [class*="col-md-3"] { flex: 0 0 50%; max-width: 50%; }
            .dash-card h3 { font-size: 1.4rem !important; }
            .dash-card .card-body { padding: 12px !important; }
            .dash-card { border-radius: 14px !important; min-height: 80px; }

            /* Filter bar compact */
            .mob-filter-chips { overflow-x: auto; flex-wrap: nowrap; padding: 8px 10px;
                scrollbar-width: none; -ms-overflow-style: none; }
            .mob-filter-chips::-webkit-scrollbar { display: none; }
            .mob-filter-chip { flex-shrink: 0; white-space: nowrap; }

            /* Task cards better typography */
            .mob-task-card { padding: 12px 13px 10px; }
            .mob-task-card-title { font-size: 0.88rem; font-weight: 700; color: var(--ca-navy); }
            .mob-task-card-sub   { font-size: 0.75rem; color: #6c757d; display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
            .mob-task-card-meta  { display: flex; flex-wrap: wrap; gap: 5px; margin: 5px 0; }
            .mob-task-chip       { display: inline-flex; align-items: center; gap: 3px; background: #f0f2f7; border-radius: 20px; padding: 2px 8px; font-size: 0.66rem; color: #495057; }
            .mob-task-chip.danger { background: #fff0f0; color: #dc3545; }
            .mob-task-card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f0f2f7; }

            /* Client cards */
            .mob-client-card { border-radius: 14px; padding: 13px; }

            /* Section headers inside views */
            #viewDashboard h3, #viewClients h3, #viewReports h3,
            #viewTasks h3, #viewFinance h3, #viewStaff h3 { font-size: 1.1rem !important; padding: 10px 12px 0; }

            /* Forms inside views */
            #viewClients .card-body, #viewFinance .card-body,
            #viewStaff .card-body { padding: 12px !important; }
            #viewClients .col-md-4, #viewClients .col-md-8 { flex: 0 0 100%; max-width: 100%; }

            /* Manual task card full width fields */
            #manualTaskCard .col-md-4,
            #manualTaskCard .col-md-2 { flex: 0 0 100%; max-width: 100%; }

            /* Bottom nav active indicator fix */
            .mob-nav-item.active::after { bottom: -8px; }

            /* Modal better on mobile */
            .modal.bottom-sheet .modal-body { padding: 14px; }
            .modal.bottom-sheet .modal-header { padding: 12px 14px; }

            /* Swipe hint text */
            .swipe-hint { font-size: 0.6rem; color: #adb5bd; text-align: center; margin-top: 4px; }

            /* Report cards smaller on mobile */
            #rptSummaryCards .merriweather { font-size: 0.95rem !important; }
            #rptSummaryCards .card-body { padding: 10px 12px !important; }

            /* Compliance filter input full width */
            #mobFilterComp { width: 90px; }

            /* ── Collapsible sections on mobile ────────────────── */
            /* Ensure hidden state is always respected — override card-body rules */
            #clientFormBody[style*="display:none"],
            #complianceSectionBody[style*="display:none"] {
                display: none !important;
            }
            /* When open, ensure card-body inside is visible */
            #clientFormBody[style*="display:block"],
            #clientFormBody[style*="display: block"] {
                display: block !important;
            }
            #complianceSectionBody[style*="display:block"],
            #complianceSectionBody[style*="display: block"] {
                display: block !important;
            }
            /* Card header tap target — full width, easy tap */
            #clientFormCardHeader {
                padding: 14px 16px !important;
                border-radius: 12px 12px 0 0;
            }
            #clientFormCardHeader:active {
                background: #f0f4ff !important;
            }
            #complianceSectionHeader {
                border-radius: 8px !important;
                padding: 10px 12px !important;
            }
            /* Chevron always visible */
            #clientFormChevron,
            #complianceSectionChevron {
                display: flex !important;
                align-items: center;
                justify-content: center;
                min-width: 32px;
                min-height: 32px;
            }

            /* Task update modal full height */
            #taskUpdateModal .modal-content { min-height: 60vh; }

            /* About modal compact */
            #aboutModal .modal-body { padding: 16px; }

            /* Hide desktop-only elements */
            .d-none.d-md-flex, .d-none.d-md-block { display: none !important; }

            /* Finance table scroll */
            #viewFinance .table-responsive { max-height: 60vh; overflow-y: auto; }
        }



/* ═══════════════════════════════════════════════════════════════
   PP Phase HT (2026-05-23 evening) — Update Task modal width fix
   ═══════════════════════════════════════════════════════════════
   See build-deploy.js Phase HT comment for full rationale.
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
    #taskUpdateModal .modal-dialog {
        max-width: min(1380px, 95vw) !important;
        width: min(1380px, 95vw) !important;
    }
}
#taskUpdateModal #taskUpdatePanel,
#taskUpdateModal #taskChatPanel {
    min-width: 0;
}
#taskUpdateModal .task-status-btn {
    min-width: 0 !important;
    padding-left: 4px !important;
    padding-right: 4px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (min-width: 768px) and (max-width: 991px) {
    #taskUpdateModal .task-status-btn {
        font-size: 0.7rem !important;
        padding: 5px 2px !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   PP Phase HM (2026-05-23 night) — Lock page horizontal overflow +
   sticky Actions column — pro UX touch.
   ═══════════════════════════════════════════════════════════════ */
html, body { overflow-x: hidden !important; max-width: 100vw !important; }
.main-content-area { max-width: 100% !important; overflow-x: hidden !important; min-width: 0 !important; }
#viewClients { max-width: 100% !important; overflow-x: hidden !important; }
#viewClients > .card { max-width: 100% !important; overflow: hidden !important; }
#viewClients .card-body { max-width: 100% !important; padding: 0 !important; overflow: hidden !important; }
#viewClients .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    position: relative;
}
#viewClients .table-responsive table { min-width: 1100px; }
#viewClients .table thead th:last-child,
#viewClients .table tbody td:last-child {
    position: sticky !important;
    right: 0 !important;
    z-index: 5;
    box-shadow: -4px 0 6px -2px rgba(11, 36, 71, 0.10);
}
#viewClients .table thead th:last-child { background: #f8f9fa !important; }
#viewClients .table tbody td:last-child { background: #ffffff !important; }
#viewClients .table tbody tr:hover td:last-child { background: #f8faff !important; }
html[data-theme="dark"] #viewClients .table thead th:last-child { background: #2d3e54 !important; }
html[data-theme="dark"] #viewClients .table tbody td:last-child { background: #1e293b !important; }
html[data-theme="dark"] #viewClients .table tbody tr:hover td:last-child { background: #334155 !important; }


/* ═══════════════════════════════════════════════════════════════
   PP Phase HN (2026-05-23 night) — Brighten dark/night mode text
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="dark"] { color: #f8fafc !important; }
html[data-theme="dark"] body { background: #1e293b !important; color: #f8fafc !important; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .card-body,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer { background: #2d3e54 !important; color: #f8fafc !important; }
html[data-theme="dark"] .table,
html[data-theme="dark"] .table > :not(caption) > * > * { color: #f1f5f9 !important; background: #2d3e54 !important; }
html[data-theme="dark"] .table-light > :not(caption) > * > * { background: #1e293b !important; color: #f1f5f9 !important; }
html[data-theme="dark"] .table thead th { color: #ffffff !important; font-weight: 700; }
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] small.text-muted,
html[data-theme="dark"] .small.text-muted { color: #cbd5e1 !important; }
html[data-theme="dark"] .form-label,
html[data-theme="dark"] label { color: #f1f5f9 !important; }
html[data-theme="dark"] .badge.bg-light.text-dark { background: #475569 !important; color: #f8fafc !important; border-color: #64748b !important; }
html[data-theme="dark"] .badge.bg-secondary { background: #64748b !important; color: #f8fafc !important; }
html[data-theme="dark"] td, html[data-theme="dark"] th { color: #f1f5f9 !important; }
html[data-theme="dark"] .form-control, html[data-theme="dark"] .form-select {
    background: #1e293b !important; color: #f8fafc !important; border-color: #64748b !important;
}
html[data-theme="dark"] .form-control::placeholder { color: #94a3b8 !important; }
html[data-theme="dark"] .modal-header { color: #f8fafc !important; }
html[data-theme="dark"] .alert { color: #f8fafc !important; }
html[data-theme="dark"] a:not(.btn):not(.nav-link) { color: #93c5fd !important; }
/* Final overflow override — keep LAST so it wins specificity ties. */
#viewClients .table-responsive { overflow-x: scroll !important; overflow-y: hidden !important; }


/* ═══════════════════════════════════════════════════════════════
   PP Phase HP (2026-05-23 night) — Client Master column widths +
   Edit Client modal header/body resize.
   ═══════════════════════════════════════════════════════════════ */
#viewClients .table-responsive table { table-layout: auto; }
#viewClients .table-responsive table th:nth-child(1),
#viewClients .table-responsive table td:nth-child(1) { min-width: 70px; }
#viewClients .table-responsive table th:nth-child(2),
#viewClients .table-responsive table td:nth-child(2) { min-width: 160px; }
#viewClients .table-responsive table th:nth-child(3),
#viewClients .table-responsive table td:nth-child(3) { min-width: 140px; }
#viewClients .table-responsive table th:nth-child(4),
#viewClients .table-responsive table td:nth-child(4) { min-width: 105px; }
#viewClients .table-responsive table th:nth-child(5),
#viewClients .table-responsive table td:nth-child(5) { min-width: 130px; }
#viewClients .table-responsive table th:nth-child(6),
#viewClients .table-responsive table td:nth-child(6) { min-width: 230px; max-width: 280px; }
#viewClients .table-responsive table th:nth-child(7),
#viewClients .table-responsive table td:nth-child(7) { min-width: 175px; }
#viewClients .table-responsive table th:nth-child(8),
#viewClients .table-responsive table td:nth-child(8) { min-width: 90px; }
#viewClients .table-responsive table th:nth-child(9),
#viewClients .table-responsive table td:nth-child(9) { min-width: 95px; }
#viewClients .table-responsive table th:nth-child(10),
#viewClients .table-responsive table td:nth-child(10) { min-width: 140px; white-space: nowrap; }
#viewClients .table-responsive { overflow-x: scroll !important; }
#v26ClientModal .modal-header {
    padding: 0.45rem 1rem !important;
    min-height: 0 !important;
}
#v26ClientModal .modal-header .modal-title {
    font-size: 1rem !important;
    line-height: 1.2 !important;
}
#v26ClientModal .modal-body {
    min-height: 72vh !important;
    max-height: 82vh !important;
    overflow-y: auto !important;
}
@media (max-height: 780px) {
    #v26ClientModal .modal-body {
        min-height: 65vh !important;
        max-height: 78vh !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   PP Phase HR (2026-05-23 evening) — Client Master horizontal scroll
   ═══════════════════════════════════════════════════════════════ */
#viewClients .table-responsive {
    overflow-x: scroll !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
    scrollbar-color: #C5A880 #f0f0f0;
}
#viewClients .table-responsive::-webkit-scrollbar {
    height: 12px;
    background: #f0f0f0;
}
#viewClients .table-responsive::-webkit-scrollbar-thumb {
    background: #C5A880;
    border-radius: 6px;
    border: 2px solid #f0f0f0;
}
#viewClients .table-responsive::-webkit-scrollbar-thumb:hover { background: #b38e6a; }
#viewClients .table-responsive table { min-width: 1200px; }
#clientTableBody td .qa-email,
#clientTableBody td .qa-mobile { white-space: nowrap; }
