/**
 * =========================================================================
 * PropXchange - Modern Dual-Mode Glassmorphism Design System
 * =========================================================================
 * - Bright Mode: Ultra-modern, high-end professional Frosted Glassmorphism
 * - Dark Mode: Sleek Obsidian & Deep Slate with Luminous Accents
 */

/* -------------------------------------------------------------
 * 1. THEME TOKENS & COLOR VARIABLES
 * ------------------------------------------------------------- */
:root, [data-theme="light"] {
    --bg-body: #eaedf2;
    --bg-mesh-1: rgba(37, 99, 235, 0.06);
    --bg-mesh-2: rgba(16, 185, 129, 0.05);
    --bg-mesh-3: rgba(99, 102, 241, 0.06);

    /* Glass Surfaces */
    --bg-glass-card: #ffffff;
    --bg-glass-card-hover: #ffffff;
    --bg-glass-panel: #ffffff;
    --bg-glass-navbar: rgba(255, 255, 255, 0.95);
    --bg-glass-sidebar: #ffffff;
    --bg-glass-modal: #ffffff;
    --bg-glass-hover: rgba(241, 245, 249, 0.85);

    /* Inputs & Controls */
    --bg-input: #ffffff;
    --bg-input-focus: #ffffff;
    --border-input: #cbd5e1;
    --bg-table-head: #f1f5f9;

    /* Borders & Dividers */
    --border-glass: #cbd5e1;
    --border-glass-card: #cbd5e1;
    --border-glass-highlight: rgba(255, 255, 255, 0.9);

    /* Typography */
    --text-heading: #0f172a;
    --text-main: #334155;
    --text-muted: #64748b;

    /* Shadows & Glows */
    --shadow-glass-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-glass: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
    --shadow-glass-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-glass-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 6px 12px -2px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"], :root.dark, html.dark {
    --bg-body: #090e17;
    --bg-mesh-1: rgba(37, 99, 235, 0.15);
    --bg-mesh-2: rgba(16, 185, 129, 0.12);
    --bg-mesh-3: rgba(139, 92, 246, 0.14);

    /* Glass Surfaces */
    --bg-glass-card: rgba(17, 24, 39, 0.72);
    --bg-glass-card-hover: rgba(24, 34, 53, 0.85);
    --bg-glass-panel: rgba(15, 23, 42, 0.8);
    --bg-glass-navbar: rgba(11, 17, 32, 0.82);
    --bg-glass-sidebar: rgba(11, 17, 32, 0.88);
    --bg-glass-modal: rgba(17, 24, 39, 0.95);
    --bg-glass-hover: rgba(30, 41, 59, 0.6);

    /* Inputs & Controls */
    --bg-input: rgba(15, 23, 42, 0.65);
    --bg-input-focus: rgba(24, 34, 53, 0.95);
    --border-input: rgba(51, 65, 85, 0.8);
    --bg-table-head: rgba(15, 23, 42, 0.75);

    /* Borders & Dividers */
    --border-glass: rgba(51, 65, 85, 0.55);
    --border-glass-card: rgba(51, 65, 85, 0.65);
    --border-glass-highlight: rgba(255, 255, 255, 0.12);

    /* Typography */
    --text-heading: #f8fafc;
    --text-main: #cbd5e1;
    --text-muted: #94a3b8;

    /* Shadows & Glows */
    --shadow-glass-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
    --shadow-glass: 0 10px 30px -4px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
    --shadow-glass-lg: 0 24px 48px -8px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.08);
    --shadow-glass-hover: 0 20px 40px -6px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.2);
}

/* -------------------------------------------------------------
 * 2. BACKGROUND MESH & AMBIENT GLOWS
 * ------------------------------------------------------------- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background:
        radial-gradient(circle at 15% 15%, var(--bg-mesh-1) 0%, transparent 40%),
        radial-gradient(circle at 85% 20%, var(--bg-mesh-2) 0%, transparent 45%),
        radial-gradient(circle at 50% 80%, var(--bg-mesh-3) 0%, transparent 50%);
}

/* -------------------------------------------------------------
 * 3. GLASS CONTAINERS & CARDS
 * ------------------------------------------------------------- */
.glass-card {
    background: var(--bg-glass-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-glass-highlight), transparent);
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .glass-card-hover:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-glass-hover);
        background: var(--bg-glass-card-hover);
        border-color: rgba(37, 99, 235, 0.35);
    }
}

.glass-panel {
    background: var(--bg-glass-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass-lg);
    padding: 2rem;
}

/* -------------------------------------------------------------
 * 4. NAVIGATION & SIDEBAR GLASS
 * ------------------------------------------------------------- */
.glass-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--navbar-height);
    background: var(--bg-glass-navbar);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    transition: background-color var(--transition-normal);
}

.glass-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    max-height: 100vh;
    background: var(--bg-glass-sidebar);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1010;
    transition: transform var(--transition-normal);
}

@media (min-width: 992px) {
    .app-wrapper .main-content {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        max-width: calc(100% - var(--sidebar-width));
    }
}

@media (max-width: 991px) {
    .glass-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-glass-lg);
        z-index: 9999;
    }

    .glass-sidebar.active {
        transform: translateX(0);
    }

    .app-wrapper .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-normal);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

.sidebar-header {
    height: var(--navbar-height);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
}

.sidebar-menu {
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-full);
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

.sidebar-version-footer {
    flex-shrink: 0;
}

.sidebar-heading {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.75rem 0.85rem 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.92rem;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
}

.sidebar-link i, .sidebar-link svg {
    font-size: 1.2rem;
    width: 22px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: var(--bg-glass-hover);
    color: var(--color-primary);
}

.sidebar-link:hover i, .sidebar-link:hover svg {
    color: var(--color-primary);
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(59, 130, 246, 0.08));
    color: var(--color-primary);
    font-weight: 700;
    border: 1px solid rgba(37, 99, 235, 0.25);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.sidebar-link.active i, .sidebar-link.active svg {
    color: var(--color-primary);
}

.sidebar-badge {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-full);
}

/* -------------------------------------------------------------
 * 5. MODALS & POPUPS
 * ------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.glass-modal {
    background: var(--bg-glass-modal);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--border-glass-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-glass-lg);
    max-width: 580px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
    transform: scale(0.94) translateY(12px);
    transition: all var(--transition-normal);
    position: relative;
}

.glass-modal form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.modal-overlay.active .glass-modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem 1.85rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-body {
    padding: 1.85rem;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal-footer {
    padding: 1.25rem 1.85rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.85rem;
    flex-shrink: 0;
}

/* Compact Modal & Dialog Styles */
.dialog-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}
.badge-success-glow { background: rgba(16, 185, 129, 0.12); box-shadow: 0 0 14px rgba(16, 185, 129, 0.2); }
.badge-danger-glow { background: rgba(239, 68, 68, 0.12); box-shadow: 0 0 14px rgba(239, 68, 68, 0.2); }
.badge-warning-glow { background: rgba(245, 158, 11, 0.12); box-shadow: 0 0 14px rgba(245, 158, 11, 0.2); }
.badge-primary-glow { background: rgba(37, 99, 235, 0.12); box-shadow: 0 0 14px rgba(37, 99, 235, 0.2); }

.glass-modal.dialog-modal {
    max-width: 380px !important;
    padding: 1.25rem 1.35rem 1.15rem 1.35rem !important;
    border-radius: 12px !important;
    text-align: center !important;
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.45), 0 6px 12px -3px rgba(0, 0, 0, 0.3) !important;
}

.glass-modal.dialog-modal.dialog-prompt {
    max-width: 400px !important;
    text-align: left !important;
}

.glass-modal.dialog-modal h3 {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    margin-bottom: 0.35rem !important;
    letter-spacing: -0.01em !important;
    color: var(--text-heading, #f8fafc) !important;
}

.glass-modal.dialog-modal .dialog-message {
    color: var(--text-muted, #94a3b8) !important;
    font-size: 0.82rem !important;
    margin-bottom: 1.15rem !important;
    line-height: 1.45 !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

.dialog-actions-wrap {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.dialog-actions-wrap .btn,
.dialog-action-btn {
    min-width: 85px !important;
    padding: 0.4rem 0.85rem !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    border-radius: 0.45rem !important;
    min-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.25 !important;
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 0.75rem !important;
    }

    .glass-modal {
        max-width: 100% !important;
        border-radius: var(--radius-lg) !important;
    }

    .glass-modal.dialog-modal {
        padding: 1.15rem 1rem !important;
        max-width: calc(100vw - 1.5rem) !important;
        width: 100% !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
        margin: 0 auto !important;
    }

    .glass-modal.dialog-modal h3 {
        font-size: 0.98rem !important;
        line-height: 1.35 !important;
    }

    .glass-modal.dialog-modal .dialog-icon-badge {
        width: 40px !important;
        height: 40px !important;
        margin-bottom: 0.65rem !important;
    }

    .glass-modal.dialog-modal .dialog-icon-badge svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* -------------------------------------------------------------
 * 6. PROPERTY CARD SHOWCASE
 * ------------------------------------------------------------- */
.property-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.property-img-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: #0f172a;
}

.property-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

@media (hover: hover) and (pointer: fine) {
    .property-card:hover .property-img {
        transform: scale(1.06);
    }
}

.property-badge-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
}

.property-price-tag {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.property-photo-pill {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    z-index: 2;
    background: rgba(15, 23, 42, 0.88);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@media (min-width: 992px) {
    .property-photo-pill {
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
    }
}

.property-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.property-features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.85rem 0 1.25rem;
}

.feature-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    background: var(--bg-glass-hover);
    color: var(--text-main);
    border: 1px solid var(--border-glass);
}

/* Toast Notification System */
.toast-container-fixed {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 999999 !important;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 400px;
    width: 100%;
    box-sizing: border-box;
}

.custom-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    color: #ffffff;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.3), 0 8px 16px -6px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    pointer-events: auto !important;
    user-select: text;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    max-width: 100%;
}

.toast-msg-wrap {
    flex: 1;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.toast-close-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: none !important;
    color: #ffffff !important;
    cursor: pointer !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    margin-left: 8px !important;
    transition: background 0.2s ease, transform 0.15s ease !important;
    outline: none !important;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.toast-close-btn:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    transform: scale(1.1);
}

.toast-close-btn:active {
    transform: scale(0.92);
}

/* Mobile Responsiveness for Toasts */
@media (max-width: 640px) {
    .toast-container-fixed,
    #toast-container {
        top: max(0.75rem, env(safe-area-inset-top, 0.75rem)) !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        gap: 0.55rem !important;
    }

    .custom-toast {
        padding: 11px 14px !important;
        font-size: 13px !important;
        border-radius: 12px !important;
        gap: 10px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .toast-msg-wrap {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }

    .toast-close-btn {
        min-width: 36px !important;
        min-height: 36px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 20px !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        margin-left: 6px !important;
    }
}

@media (max-width: 380px) {
    .toast-container-fixed,
    #toast-container {
        left: 0.5rem !important;
        right: 0.5rem !important;
        top: max(0.5rem, env(safe-area-inset-top, 0.5rem)) !important;
    }

    .custom-toast {
        padding: 9px 11px !important;
        font-size: 12.5px !important;
        gap: 8px !important;
    }
}

/* In-Page Alert Banners (Success, Warning, Info, Danger) */
.alert {
    position: relative;
    padding: 0.95rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-sizing: border-box;
    width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid transparent;
    transition: all var(--transition-normal);
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.28);
    color: #059669;
}
[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.alert-danger,
.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: #dc2626;
}
[data-theme="dark"] .alert-danger,
[data-theme="dark"] .alert-error {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.28);
    color: #d97706;
}
[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.alert-info,
.alert-information {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.28);
    color: #2563eb;
}
[data-theme="dark"] .alert-info,
[data-theme="dark"] .alert-information {
    background: rgba(37, 99, 235, 0.16);
    border-color: rgba(37, 99, 235, 0.35);
    color: #60a5fa;
}

@media (max-width: 640px) {
    .alert {
        padding: 0.75rem 0.95rem;
        font-size: 0.84rem;
        margin-bottom: 1rem;
        gap: 0.55rem;
        border-radius: 10px;
    }
}

/* =========================================================================
 * 13. MOBILE POLISH & HARDWARE SCROLL ENGINE
 * =========================================================================
 * Non-destructive mobile performance tuning.
 * Preserves 100% of the glassmorphic aesthetics, ambient background glows,
 * and responsive sidebar drawer navigation, while ensuring silky smooth scrolling.
 * ========================================================================= */
@media (max-width: 991px), (pointer: coarse) {
    /* Hardware-accelerated momentum scrolling with instant touch response */
    html {
        scroll-behavior: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* Disable intensive multi-layer real-time blurs on all scrolling elements */
    .property-card,
    .property-price-tag,
    .property-photo-pill,
    .glass-card,
    .glass-panel,
    .filter-toolbar,
    .dashboard-tabs-bar,
    .stat-card,
    .feature-pill,
    .custom-toast {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Disable hover zoom and lift animations during touch scrolling */
    .glass-card-hover:hover,
    .glass-card-hover:active {
        transform: none !important;
        box-shadow: var(--shadow-glass) !important;
    }

    .property-card:hover .property-img,
    .property-card:active .property-img {
        transform: none !important;
    }

    /* Clean, crisp solid white surfaces in light mode without GPU compositor penalty */
    :root, [data-theme="light"] {
        --bg-glass-card: #ffffff;
        --bg-glass-panel: #ffffff;
        --shadow-glass: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
        --shadow-glass-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
    }

    [data-theme="dark"] {
        --bg-glass-card: rgba(17, 24, 39, 0.92);
        --bg-glass-panel: rgba(15, 23, 42, 0.95);
        --shadow-glass: 0 4px 14px rgba(0, 0, 0, 0.4);
        --shadow-glass-lg: 0 8px 20px rgba(0, 0, 0, 0.55);
    }

    /* Isolate layout and paint scopes to prevent sub-pixel layout ripple */
    .property-card {
        contain: layout paint;
        content-visibility: auto;
        contain-intrinsic-size: 380px;
    }

    .property-img-wrapper {
        contain: layout paint;
    }
}

/* -------------------------------------------------------------
 * 12. LIGHT THEME HIGH CONTRAST & PROFESSIONAL CORPORATE COLORS
 * (Strictly scoped to html:not(.dark) so dark mode remains 100% untouched)
 * ------------------------------------------------------------- */

/* Grounded Canvas in Light Mode */
html:not(.dark) body,
html:not(.dark) .min-w-0.bg-slate-100 {
    background-color: #eaedf2 !important;
}

/* Crisp Boundaries & Elevation for Cards on Light Canvas */
html:not(.dark) .bg-white {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

html:not(.dark) .border-slate-200 {
    border-color: #cbd5e1;
}

html:not(.dark) .bg-white.hover\:shadow-md:hover,
html:not(.dark) a.bg-white.group:hover,
html:not(.dark) a.bg-white:hover {
    border-color: #94a3b8;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

/* Glass-cards and Filter-Toolbars in Light Mode */
html:not(.dark) .glass-card,
html:not(.dark) .filter-toolbar {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.05) !important;
}

/* High-Contrast Table Headers in Light Mode */
html:not(.dark) thead tr,
html:not(.dark) .table th,
html:not(.dark) table thead th {
    background-color: #f1f5f9 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    color: #334155 !important;
}

/* -------------------------------------------------------------
 * 2-3 Professional Corporate Accent Colors (Light Mode Only)
 * 1. Executive Oxford Slate-Blue (#2563eb / #1e40af)
 * 2. Corporate Forest Emerald (#059669 / #065f46)
 * 3. Warm Sand / Corporate Amber (#d97706 / #92400e)
 * + Complementary Slate-Indigo (#4f46e5)
 * ------------------------------------------------------------- */
html:not(.dark) .card-accent-blue {
    border-top: 4px solid #2563eb !important;
}

html:not(.dark) .card-accent-emerald {
    border-top: 4px solid #059669 !important;
}

html:not(.dark) .card-accent-amber {
    border-top: 4px solid #d97706 !important;
}

html:not(.dark) .card-accent-indigo {
    border-top: 4px solid #4f46e5 !important;
}

html:not(.dark) .card-accent-slate {
    border-top: 4px solid #64748b !important;
}

/* Professional Subtle Light Tints for Hero Cards & Banners */
html:not(.dark) .card-tint-blue {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.9) 0%, #ffffff 100%) !important;
}

html:not(.dark) .card-tint-amber {
    background: linear-gradient(135deg, rgba(254, 243, 199, 0.45) 0%, #ffffff 100%) !important;
}

html:not(.dark) .card-tint-emerald {
    background: linear-gradient(135deg, rgba(240, 253, 244, 0.7) 0%, #ffffff 100%) !important;
}

/* Sidebar Active Branch Widget in Light Theme */
html:not(.dark) .sidebar-branch-box {
    background-color: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    border-left: 4px solid #1e40af !important;
}


