/**
 * OFFERHUB UNIFIED DESIGN SYSTEM v4.0
 * =====================================
 * Single source of truth for ALL pages.
 * 
 * Architecture:
 *   1. Reset & Scrollbar Stability
 *   2. CSS Variables
 *   3. Base Typography & Body
 *   4. App Header (sticky, fixed height)
 *   5. Master Layout (.app-shell / .app-layout)
 *   6. Sidebar
 *   7. Content Area
 *   8. Shared Components (cards, forms, buttons, alerts, tables, stats)
 *   9. Chat-specific (messages, input, welcome)
 *  10. Page-specific content styles
 *  11. Account page styles
 *  12. Listings page styles
 *  13. Auth Modal
 *  14. Toast Notifications
 *  15. Confirm Dialog
 *  16. Mobile Menu
 *  17. Chat Message Enhancements
 *  18. Mobile Modal System
 *  19. Utility Classes
 *  20. Responsive Breakpoints
 */


/* ==========================================================================
   1. RESET & SCROLLBAR STABILITY
   
   KEY DECISIONS:
   - html gets overflow-y: scroll to ALWAYS show scrollbar gutter.
     This prevents width jump when content goes from short to tall.
   - We use width: 100% everywhere, NEVER 100vw (which includes scrollbar).
   - No overflow on body — let html handle it.
   - Scrollbar is styled to be subtle and consistent.
   ========================================================================== */

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

html {
    overflow: hidden;
    height: 100%;
}

body {
    height: 100%;
    overflow: hidden;
}

/* Override for full-page scrollable content (blog, static pages) */
html.page-scroll, html.page-scroll body {
    overflow: visible !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    min-height: 100%;
}

/* Subtle, consistent scrollbar — applies to inner scroll containers */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(128, 128, 128, 0.5);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.3) transparent;
}


/* ==========================================================================
   2. CSS VARIABLES
   ========================================================================== */

:root {
    /* ─────────────────────────────────────────────────
       OfferHub Real Estate Theme  ·  V1.0
       Refined Teal — trust, stability, professional
       Inspired by Property Finder / Rightmove
    ───────────────────────────────────────────────── */

    /* Brand — refined property teal */
    --primary:          #007b7b;
    --primary-hover:    #006666;
    --primary-active:   #005252;
    --primary-light:    rgba(0,123,123,.07);
    --primary-border:   rgba(0,123,123,.18);
    --primary-rgb:      0,123,123;

    /* Gold accent — Premium accent */
    --accent:           #c49a2a;
    --accent-hover:     #a8821f;
    --accent-light:     rgba(196,154,42,.07);
    --accent-border:    rgba(196,154,42,.20);

    /* Backgrounds — clean white, barely-there teal tint */
    --bg-page:          #f4fafa;
    --bg-card:          #fafefe;
    --bg-card-raised:   #ffffff;
    --bg-input:         #eef6f6;
    --bg-hover:         rgba(0,123,123,.04);
    --bg-active:        rgba(0,123,123,.08);

    /* Typography — warm dark, not cold black */
    --text-primary:     #0d2626;
    --text-secondary:   #2a4a4a;
    --text-muted:       #5a7a7a;
    --text-placeholder: #9ababa;

    /* Borders — teal-tinted neutral */
    --border:           #c0d8d8;
    --border-light:     #d8ecec;
    --border-strong:    #98bebe;

    /* Semantic */
    --success:          #059669;
    --success-bg:       #ecfdf5;
    --error:            #dc2626;
    --error-bg:         #fef2f2;
    --warning:          #d97706;
    --warning-bg:       #fffbeb;
    --info:             #2563eb;
    --info-bg:          #eff6ff;

    /* Layout */
    --header-height:          60px;
    --sidebar-width:          256px;
    --content-max-width:      900px;
    --content-max-width-wide: 1200px;

    /* Radius system */
    --radius-xs:   4px;
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   14px;
    --radius-xl:   20px;
    --radius-full: 9999px;

    /* Shadows — cool teal-tinted depth */
    --shadow-xs:    0 1px 2px rgba(0,80,80,.06);
    --shadow-sm:    0 1px 4px rgba(0,80,80,.08), 0 0 0 1px rgba(0,80,80,.025);
    --shadow-md:    0 4px 16px rgba(0,80,80,.10), 0 1px 4px rgba(0,80,80,.05);
    --shadow-lg:    0 12px 40px rgba(0,80,80,.13), 0 2px 8px rgba(0,80,80,.05);
    --shadow-xl:    0 24px 64px rgba(0,80,80,.18);
    --shadow-focus: 0 0 0 3px rgba(0,123,123,.20);

    /* Transitions */
    --transition-fast: 0.12s ease;
    --transition-base: 0.18s ease;
    --transition-slow: 0.28s ease;

    --overlay-bg: rgba(0,20,20,.55);
}


/* ==========================================================================
   2b. DARK THEME
   ========================================================================== */

[data-theme="dark"] {
    /* ─────────────────────────────────────────────────
       OfferHub Real Estate — Dark  ·  V1.0
    ───────────────────────────────────────────────── */

    --primary:          #00a8a8;
    --primary-hover:    #008c8c;
    --primary-active:   #007070;
    --primary-light:    rgba(0,168,168,.10);
    --primary-border:   rgba(0,168,168,.22);
    --primary-rgb:      0,168,168;

    --accent:           #d4a843;
    --accent-hover:     #c09438;
    --accent-light:     rgba(212,168,67,.10);
    --accent-border:    rgba(212,168,67,.25);

    --bg-page:          #081818;
    --bg-card:          #0d2020;
    --bg-card-raised:   #122828;
    --bg-input:         #142e2e;
    --bg-hover:         rgba(0,168,168,.06);
    --bg-active:        rgba(0,168,168,.12);

    --text-primary:     #e0f4f4;
    --text-secondary:   #70b8b8;
    --text-muted:       #407878;
    --text-placeholder: #305858;

    --border:           #143838;
    --border-light:     #0f2c2c;
    --border-strong:    #205050;

    --success:          #10b981;
    --success-bg:       rgba(16,185,129,.1);
    --error:            #f87171;
    --error-bg:         rgba(248,113,113,.1);
    --warning:          #fbbf24;
    --warning-bg:       rgba(251,191,36,.1);
    --info:             #60a5fa;
    --info-bg:          rgba(96,165,250,.1);

    --shadow-xs:    0 1px 2px rgba(0,0,0,.3);
    --shadow-sm:    0 1px 4px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03);
    --shadow-md:    0 4px 16px rgba(0,0,0,.5), 0 1px 4px rgba(0,0,0,.2);
    --shadow-lg:    0 12px 40px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.2);
    --shadow-xl:    0 24px 64px rgba(0,0,0,.7);
    --shadow-focus: 0 0 0 3px rgba(0,168,168,.24);

    --overlay-bg: rgba(0,0,0,.75);
    color-scheme: dark;
}



/* Dark scrollbar — same neutral tone works for both themes */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
[data-theme="dark"] * {
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}


/* ==========================================================================
   3. BASE
   ========================================================================== */

body {
    font-family: 'Tajawal', 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1, 'liga' 1;
}


/* ==========================================================================
   4. APP HEADER
   ========================================================================== */

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    background: rgba(250,254,254,.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 0 var(--border-light), var(--shadow-xs);
    flex-shrink: 0;
}
[data-theme="dark"] .app-header {
    background: rgba(8,24,24,.96);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    min-width: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    line-height: 1;
}

.logo svg { flex-shrink: 0; display: block; }

.logo-text {
    font-family: 'Tajawal', 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #4e4d4d;
    line-height: 1;
}

[data-theme="dark"] .logo-text { color: #d8d7d7; }
[data-theme="dark"] .logo svg rect { fill: #6a6969; }

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}


/* ==========================================================================
   5. MASTER LAYOUT
   ========================================================================== */

.app-shell,
.app-layout {
    display: flex;
    height: calc(100vh - var(--header-height));
    background: var(--bg-page);
}


/* ==========================================================================
   6. SIDEBAR
   ========================================================================== */

.app-sidebar,
.app-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--bg-card);
    border-left: 1px solid var(--border-light);
    padding: 1.25rem 1rem;
    overflow-y: auto;
    flex-shrink: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.new-post-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9375rem;
    font-family: inherit;
    margin-bottom: 1.5rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.new-post-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-left: 1px solid var(--border-light);
    padding: 1.5rem 0;
    flex-shrink: 0;
}

.sidebar-section { padding: 0 1rem; margin-bottom: 1.5rem; }

.sidebar-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.sidebar-link:hover { background: var(--bg-page); }
.sidebar-link.active { background: var(--bg-page); font-weight: 500; }


/* ==========================================================================
   7. CONTENT AREA
   ========================================================================== */

.app-main,
.app-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Scrollable content area for static pages (about, faq, contact, etc.) */
.s-page-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    height: 100%;
    scrollbar-width: thin;
}

.app-main-inner,
.app-messages {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-page);
}

.app-main-content,
.messages-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.app-main-content--wide,
.messages-wrapper--wide {
    max-width: var(--content-max-width-wide);
}

.page-layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.page-content {
    flex: 1;
    padding: 2rem;
    max-width: var(--content-max-width-wide);
    margin: 0 auto;
    width: 100%;
}

.page-content-full { flex: 1; padding: 2rem; }


/* ==========================================================================
   8. SHARED COMPONENTS
   ========================================================================== */

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}

.required { color: var(--primary); }

input[type="text"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.15s;
    background: var(--bg-input);
    color: var(--text-primary);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
}

textarea { resize: vertical; min-height: 100px; }
input[type="checkbox"] { width: auto; cursor: pointer; }

.field-error { display: none; color: var(--error); font-size: 0.75rem; margin-top: 0.25rem; }
.field-help { display: block; color: var(--text-secondary); font-size: 0.75rem; margin-top: 0.25rem; }
.password-strength { margin-top: 0.5rem; }

/* Buttons */
.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,123,123,.25), inset 0 1px 0 rgba(255,255,255,.08);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 8px rgba(0,123,123,.3), inset 0 1px 0 rgba(255,255,255,.08);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-page); }
.btn-success { background: var(--success); color: white; }
.btn-error { background: var(--error); color: white; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Alerts */
.alert { padding: 0.875rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-success { background: #d1f4e0; color: #0d5028; border: 1px solid #9de5b8; }
.alert-error { background: #fee; color: #c41e3a; border: 1px solid #fcc; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card { background: var(--bg-card); padding: 1.5rem; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.stat-label { color: var(--text-secondary); font-size: 0.875rem; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: right; padding: 0.75rem; background: var(--bg-page); font-weight: 600; font-size: 0.875rem; color: var(--text-secondary); border-bottom: 1px solid var(--border-light); }
td { padding: 0.75rem; border-bottom: 1px solid var(--border-light); font-size: 0.875rem; }


/* ==========================================================================
   9. CHAT-SPECIFIC
   ========================================================================== */

#welcome-section { padding: 2rem 1rem; text-align: center; }
#welcome-section.hidden { display: none; }

.welcome-header h1 { font-size: 1.875rem; font-weight: 600; margin-bottom: 0.5rem; }
.welcome-header p { color: var(--text-secondary); }

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    max-width: 700px;
    margin: 2rem auto 0;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.action-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-icon {
    width: 48px; height: 48px;
    background: var(--primary); color: white;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}

.action-title { font-weight: 500; color: var(--text-primary); }

.app-input-area {
    padding: 1rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.app-input-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0.25rem 1.125rem 0.25rem 0.25rem;
    transition: border-color 0.2s;
}

.app-input-wrapper:focus-within {
    border-color: var(--primary);
}

input.app-input,
.app-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    padding: 0.625rem 0;
    border-radius: 0;
    width: auto;
    box-shadow: none;
}

.app-input::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-btn:hover { background: var(--primary-hover); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }


/* ==========================================================================
   10. PAGE-SPECIFIC CONTENT (About, Contact, FAQ, Terms, Privacy)
   ========================================================================== */

.page-content-card {
    background: var(--bg-card); border-radius: 12px; padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.page-content-card h1 { font-size: 28px; font-weight: 600; color: var(--text-primary); margin-bottom: 1rem; }
.page-content-card h2 { font-size: 20px; font-weight: 600; color: var(--text-primary); margin-top: 2rem; margin-bottom: 1rem; }
.page-content-card p { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 1rem; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem; margin: 2rem 0;
}

.feature-card { background: var(--bg-page); border-radius: 12px; padding: 1.5rem; text-align: center; }

.feature-icon {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, #c96b4c 0%, #d88b6f 100%);
    color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem; font-size: 28px;
}

.feature-card h3 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }
.feature-card p { font-size: 14px; margin: 0; }

.stats-box {
    background: linear-gradient(135deg, #c96b4c 0%, #d88b6f 100%);
    color: white; border-radius: 12px; padding: 2rem; margin: 2rem 0; text-align: center;
}

.stat-item h3 { font-size: 36px; font-weight: 600; margin-bottom: 0.25rem; }
.stat-item p { font-size: 14px; opacity: 0.9; margin: 0; }


/* ==========================================================================
   11. ACCOUNT
   ========================================================================== */

.account-container { max-width: 100%; }

.account-header {
    display: flex; align-items: center; gap: 1.5rem;
    margin-bottom: 2rem; padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-light);
}

.account-avatar {
    width: 80px; height: 80px; background: var(--primary);
    color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 600; flex-shrink: 0;
}

.account-info h1 { font-size: 1.875rem; font-weight: 600; margin-bottom: 0.25rem; }
.account-info .member-since { color: var(--text-secondary); font-size: 0.875rem; }

.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem; margin-bottom: 2rem;
}

.account-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: 12px; padding: 1.5rem;
}

.account-card h3 {
    font-size: 1.125rem; font-weight: 600; margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 0.5rem;
}

/* Profile fields */
.pf-row { display: flex; gap: 0.875rem; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.pf-row-last { border-bottom: none; }
.pf-icon { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg-page); color: var(--text-muted); margin-top: 2px; }
.pf-icon-wa { color: #25d366; }
.pf-body { flex: 1; min-width: 0; }
.pf-label { font-size: 0.6875rem; color: var(--text-muted); letter-spacing: 0.06em; font-weight: 600; margin-bottom: 0.25rem; }
.pf-view { display: flex; align-items: center; gap: 0.5rem; }
.pf-val { font-size: 0.9375rem; font-weight: 500; color: var(--text-primary); word-break: break-all; }
.pf-val-empty { color: var(--text-muted); font-style: italic; font-weight: 400; }
.pf-pen { width: 28px; height: 28px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 6px; cursor: pointer; background: transparent; color: var(--text-muted); transition: all 0.15s; }
.pf-pen:hover { background: var(--primary-light, rgba(0,123,123,0.1)); color: var(--primary); }

.pf-editor { margin-top: 0.5rem; }
.pf-input { display: block; width: 100%; padding: 0.5rem 0.75rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 0.9375rem; font-family: inherit; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.pf-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,123,123,0.08); }
.pf-actions { display: flex; gap: 0.375rem; margin-top: 0.5rem; }
.pf-btn-save { padding: 0.4rem 1rem; background: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: 0.8125rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.pf-btn-save:hover { filter: brightness(1.1); }
.pf-btn-save:disabled { opacity: 0.5; }
.pf-btn-cancel { padding: 0.4rem 0.75rem; background: transparent; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 6px; font-size: 0.8125rem; cursor: pointer; font-family: inherit; }
.pf-btn-cancel:hover { background: var(--bg-input); }

/* WhatsApp input group */
.pf-wa-wrap { display: flex; }
.pf-wa-tag { display: flex; align-items: center; gap: 0.375rem; padding: 0 0.75rem; background: var(--bg-page); border: 1px solid var(--border); border-left: none; border-radius: 8px 0 0 8px; white-space: nowrap; user-select: none; }
.pf-wa-tag span { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }
.pf-input-wa { border-radius: 0 8px 8px 0 !important; }
.pf-wa-wrap:focus-within .pf-wa-tag { border-color: var(--primary); }

/* Legacy info-row (notifications card) */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 0.875rem 0; border-bottom: 1px solid var(--border-light); }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-secondary); font-size: 0.9375rem; }
.info-value { color: var(--text-primary); font-weight: 500; }

.alert-count {
    background: var(--primary); color: white;
    padding: 0.25rem 0.75rem; border-radius: 20px;
    font-size: 0.875rem; font-weight: 600;
}

.action-buttons { display: flex; gap: 1rem; margin-top: 2rem; }

.danger-zone {
    margin-top: 3rem; padding: 1.5rem;
    background: #fef2f2; border: 1px solid #fecaca; border-radius: 12px;
}

.danger-zone h3 { color: #991b1b; margin-bottom: 0.5rem; }
.danger-zone p { color: #7f1d1d; font-size: 0.875rem; margin-bottom: 1rem; }


/* ==========================================================================
   12. LISTINGS
   ========================================================================== */

.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 32px; flex-wrap: wrap; gap: 16px;
}

.page-header h1 { font-size: 28px; font-weight: 600; color: var(--text-primary); }
.page-header p { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.listings-container { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }

.listing-card {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem; background: var(--bg-page);
    border: 1px solid var(--border-light); border-radius: 8px; gap: 1rem;
}

.listing-info { flex: 1; }
.listing-area { font-weight: 600; color: var(--text-primary); margin-bottom: 0.25rem; }
.listing-type { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.listing-price { font-size: 1.125rem; font-weight: 700; color: var(--primary); }

.properties-container { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }

.property-card {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem; background: var(--bg-card);
    border: 1px solid var(--border-light); border-radius: 8px;
    gap: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.property-info { flex: 1; }
.property-title { font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; font-size: 1rem; }
.property-details { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.property-price { font-size: 1.25rem; font-weight: 700; color: var(--primary); }


/* ==========================================================================
   13. AUTH MODAL
   ========================================================================== */

.auth-overlay {
    position: fixed; top: 0; right:0; left: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}

.auth-overlay.active { opacity: 1; pointer-events: auto; }

.auth-modal {
    background: var(--bg-card); border-radius: 16px; padding: 2.5rem;
    max-width: 420px; width: 90%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9); transition: transform 0.3s ease;
    position: relative;
}

.auth-overlay.active .auth-modal { transform: scale(1); }

.auth-close {
    position: absolute; top: 1rem; left: 1rem;
    background: none; border: none; font-size: 2rem;
    color: var(--text-secondary); cursor: pointer;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: background 0.15s;
}

.auth-close:hover { background: var(--bg-page); }

.auth-title { font-size: 1.75rem; font-weight: 600; text-align: center; margin-bottom: 0.5rem; color: var(--text-primary); }
.auth-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 2rem; font-size: 0.9375rem; }

.auth-header { text-align: center; margin-bottom: 1.5rem; }

.auth-header .logo-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.75rem;
}

.auth-header .logo-text { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }

.auth-tabs {
    display: flex; gap: 0.5rem; margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-light);
}

.auth-tab {
    flex: 1; padding: 0.75rem; border: none; background: none;
    color: var(--text-secondary); font-weight: 500; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s; font-family: inherit;
}

.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.auth-tab:hover { color: var(--text-primary); }

.auth-divider { position: relative; text-align: center; margin: 1.5rem 0; }
.auth-divider::before { content: ''; position: absolute; top: 50%; right:0; left: 0; height: 1px; background: var(--border-light); }
.auth-divider span { position: relative; background: var(--bg-card); padding: 0 1rem; color: var(--text-secondary); font-size: 0.875rem; }

.btn-social {
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-primary); display: flex; align-items: center;
    justify-content: center; gap: 0.75rem;
}

.btn-social:hover { background: var(--bg-page); }

.login-method-selector {
    display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
    background: var(--bg-page); padding: 0.25rem; border-radius: 8px;
}

.method-btn {
    flex: 1; padding: 0.625rem 1rem; border: none; background: transparent;
    color: var(--text-secondary); border-radius: 6px; cursor: pointer;
    font-size: 0.875rem; font-weight: 500; font-family: inherit;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: background 0.15s, color 0.15s;
}

.method-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.5); }
.method-btn.active { background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow-sm); }
.method-btn svg { width: 16px; height: 16px; }


/* ==========================================================================
   14. TOAST NOTIFICATIONS
   ========================================================================== */

.toast-container {
    position: fixed; top: 1rem; left: 1rem; z-index: 99999;
    display: flex; flex-direction: column; gap: 0.75rem;
    max-width: 400px; width: calc(100% - 2rem);
}

.toast {
    background: var(--bg-card); border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 1rem; display: flex; align-items: start; gap: 0.75rem;
    transform: translateX(calc(100% + 2rem));
    transition: transform 0.3s ease;
    border-right: 4px solid;
}

.toast.show { transform: translateX(0); }

.toast-success  { border-right-color: #10b981; }
.toast-error    { border-right-color: #ef4444; }
.toast-warning  { border-right-color: #f59e0b; }
.toast-info     { border-right-color: #3b82f6; }
.toast-loading  { border-right-color: var(--primary); }

.toast-icon { flex-shrink: 0; }
.toast-success .toast-icon  { color: #10b981; }
.toast-error .toast-icon    { color: #ef4444; }
.toast-warning .toast-icon  { color: #f59e0b; }
.toast-info .toast-icon     { color: #3b82f6; }
.toast-loading .toast-icon  { color: var(--primary); }

.toast-content { flex: 1; }
.toast-message { color: var(--text-primary); font-size: 0.9375rem; line-height: 1.5; }

.toast-close {
    flex-shrink: 0; background: none; border: none;
    color: var(--text-secondary); font-size: 1.5rem; cursor: pointer;
    padding: 0; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px; transition: background 0.15s;
}

.toast-close:hover { background: var(--bg-page); }

.spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* ==========================================================================
   15. CONFIRM DIALOG
   ========================================================================== */

.confirm-overlay {
    position: fixed; top: 0; right:0; left: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6); z-index: 99998;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s ease;
    pointer-events: none;
}

.confirm-overlay.show { opacity: 1; pointer-events: auto; }

.confirm-dialog {
    background: var(--bg-card); border-radius: 16px; padding: 2rem;
    max-width: 400px; width: 90%; text-align: center;
    transform: scale(0.9); transition: transform 0.3s ease;
}

.confirm-dialog.show { transform: scale(1); }

.confirm-icon { margin: 0 auto 1rem; color: var(--text-secondary); }
.confirm-warning .confirm-icon { color: #f59e0b; }
.confirm-danger .confirm-icon  { color: #ef4444; }
.confirm-info .confirm-icon    { color: #3b82f6; }

.confirm-title { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); margin-bottom: 0.5rem; }
.confirm-message { color: var(--text-secondary); margin-bottom: 1.5rem; line-height: 1.5; }
.confirm-actions { display: flex; gap: 0.75rem; justify-content: center; }
.confirm-actions .btn { min-width: 100px; }


/* ==========================================================================
   16. MOBILE MENU
   ========================================================================== */

.desktop-only { display: inline-flex; }

.mobile-menu-btn {
    display: none; background: none; border: none;
    padding: 0.5rem; cursor: pointer;
    color: var(--text-primary); margin-right: 0.5rem;
}

.mobile-menu-overlay {
    display: none; position: fixed; top: 0; right:0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); z-index: 998;
    opacity: 0; transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active { display: block; opacity: 1; }

.mobile-menu {
    position: fixed; top: 0; right: -100%;
    width: 280px; height: 100vh;
    background: var(--bg-card);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    z-index: 999; transition: right 0.3s ease;
    overflow-y: auto;
}

.mobile-menu.active { right: 0; }

.mobile-menu-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1rem; border-bottom: 1px solid var(--border-light);
}

/* Logo in mobile menu header */
.mobile-menu-logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}
.mobile-menu-brand {
    font-size: 1.125rem; font-weight: 700;
    background: linear-gradient(135deg, #007b7b, #00c8c8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section labels */
.mobile-menu-section-label {
    font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: var(--text-muted);
    padding: 12px 16px 4px;
}

.mobile-menu-title { font-size: 1.125rem; font-weight: 600; color: var(--text-primary); }

.mobile-menu-close {
    background: none; border: none; padding: 0.5rem; cursor: pointer;
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; transition: background .12s;
}
.mobile-menu-close:hover { background: var(--bg-page); }

.mobile-menu-nav { padding: 0.5rem 0 1rem; overflow-y: auto; }

.mobile-menu-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; color: var(--text-primary);
    text-decoration: none; font-size: 0.9375rem;
    transition: background 0.15s;
    border: none; background: none; width: 100%;
    text-align: right; cursor: pointer; font-family: inherit;
    border-radius: 8px; margin: 0 8px; width: calc(100% - 16px);
}

.mobile-menu-item:hover, .mobile-menu-item:active { background: var(--bg-page); }
.mobile-menu-item svg { flex-shrink: 0; color: var(--text-secondary); }
.mobile-menu-divider { height: 1px; background: var(--border-light); margin: 0.5rem 0; }
.mobile-menu-logout { color: var(--error); }
.mobile-menu-logout svg { color: var(--error); }
.mobile-menu-primary { color: var(--primary); font-weight: 500; }
.mobile-menu-primary svg { color: var(--primary); }

/* Trending tags in mobile menu */
.mm-trend-item { gap: 8px !important; padding: 8px 16px !important; }
.mm-trend-hash { color: var(--primary); font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.mm-trend-name { flex: 1; font-size: .875rem; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-trend-count { font-size: .7rem; font-weight: 700; background: var(--bg-input); color: var(--text-muted); padding: 1px 7px; border-radius: 999px; flex-shrink: 0; }
.mm-see-more { color: var(--text-muted) !important; font-size: .8125rem !important; padding: 6px 16px !important; gap: 6px !important; }
.mm-see-more svg { color: var(--text-muted) !important; }
.mobile-menu-footer-links {
    display: flex; flex-wrap: wrap; gap: 8px 16px;
    padding: 8px 16px 4px;
}
.mobile-menu-footer-links a {
    font-size: 0.75rem; color: var(--text-muted);
    text-decoration: none; transition: color .12s;
}
.mobile-menu-footer-links a:hover { color: var(--text-secondary); }

body.menu-open { overflow: hidden; }


/* ==========================================================================
   17. CHAT MESSAGE ENHANCEMENTS
   ========================================================================== */

.message-suggestions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

.suggestion-btn {
    padding: 0.5rem 1rem; background: var(--bg-page);
    border: 1px solid var(--border); border-radius: 6px;
    font-size: 0.875rem; cursor: pointer; font-family: inherit;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.suggestion-btn:hover { background: var(--bg-card); border-color: var(--primary); color: var(--primary); }

.alert-offer { margin-top: 1rem; padding: 1rem; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px; }
.alert-offer-message { margin-bottom: 0.75rem; color: var(--text-primary); font-size: 0.9375rem; }
.alert-offer-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }


/* ==========================================================================
   18. MOBILE MODAL SYSTEM
   ========================================================================== */

.mobile-modal-overlay {
    position: fixed; top: 0; right:0; left: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5); z-index: 9999;
    opacity: 0; transition: opacity 0.3s ease; display: none;
}

.mobile-modal-overlay.active { opacity: 1; display: block; }

.mobile-modal {
    position: fixed; bottom: 0; right:0; left: 0;
    background: var(--bg-card); border-radius: 20px 20px 0 0;
    transform: translateY(100%); transition: transform 0.3s ease;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15); z-index: 10000;
}

.mobile-modal.active { transform: translateY(0); }

.mobile-modal-header {
    padding: 1rem; border-bottom: 1px solid var(--border-light);
    position: sticky; top: 0; background: var(--bg-card); z-index: 1;
    border-radius: 20px 20px 0 0;
}

.mobile-modal-line { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 1rem; }
.mobile-modal-title { font-size: 1.125rem; font-weight: 600; text-align: center; color: var(--text-primary); }
.mobile-modal-content { padding: 1.5rem; }

.mobile-modal-buttons {
    padding: 1rem 1.5rem; display: flex; flex-direction: column;
    gap: 0.75rem; border-top: 1px solid var(--border-light);
}

.mobile-modal-btn {
    width: 100%; padding: 1rem; border-radius: 12px;
    font-size: 1rem; font-weight: 600; border: none;
    cursor: pointer; transition: background 0.15s; font-family: inherit;
}

.mobile-modal-btn.primary { background: var(--primary); color: white; }
.mobile-modal-btn.primary:active { background: var(--primary-hover); }
.mobile-modal-btn.secondary { background: var(--bg-page); color: var(--text-primary); }
.mobile-modal-btn.secondary:active { background: var(--border); }


/* ==========================================================================
   19. UTILITY CLASSES
   ========================================================================== */

.text-center { text-align: center; }
.text-right  { text-align: left; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }


/* ==========================================================================
   19b. DARK THEME — COMPONENT OVERRIDES
   Handles hardcoded colors that can't use CSS variables
   ========================================================================== */

/* Page content card (was hardcoded white) */
[data-theme="dark"] .page-content-card { background: var(--bg-card); box-shadow: var(--shadow-sm); }

/* Stat card */
[data-theme="dark"] .stat-card { box-shadow: var(--shadow-sm); }

/* Auth modal */
[data-theme="dark"] .auth-modal { background: var(--bg-card); box-shadow: var(--shadow-lg); }
[data-theme="dark"] .auth-divider span { background: var(--bg-card); }
[data-theme="dark"] .btn-social { background: var(--bg-input); border-color: var(--border); color: var(--text-primary); }
[data-theme="dark"] .btn-social:hover { background: var(--bg-page); }
[data-theme="dark"] .method-btn.active { background: var(--bg-input); box-shadow: var(--shadow-sm); }

/* Toast notifications */
[data-theme="dark"] .toast { background: var(--bg-card); box-shadow: var(--shadow-md); }

/* Confirm dialog */
[data-theme="dark"] .confirm-dialog { background: var(--bg-card); }

/* Mobile modal */
[data-theme="dark"] .mobile-modal { background: var(--bg-card); }
[data-theme="dark"] .mobile-modal-header { background: var(--bg-card); }

/* Alerts — softer in dark mode */
[data-theme="dark"] .alert-success { background: #0d28194d; color: #6ee7a8; border-color: #065f38; }
[data-theme="dark"] .alert-error { background: #3b0a0a4d; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .alert-info { background: #0c274d4d; color: #93c5fd; border-color: #1e40af; }
[data-theme="dark"] .alert-offer { background: #2a200e; border-color: #92702e; }

/* Danger zone */
[data-theme="dark"] .danger-zone { background: #2a0e0e; border-color: #5c1a1a; }
[data-theme="dark"] .danger-zone h3 { color: #fca5a5; }
[data-theme="dark"] .danger-zone p { color: #f87171; }

/* Feature cards on about page */
[data-theme="dark"] .feature-card { background: var(--bg-page); }

/* Overlays */
[data-theme="dark"] .auth-overlay { background: var(--overlay-bg); }
[data-theme="dark"] .confirm-overlay { background: var(--overlay-bg); }
[data-theme="dark"] .mobile-modal-overlay { background: var(--overlay-bg); }

/* Action card hover */
[data-theme="dark"] .action-card:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }

/* Theme toggle button */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text-secondary);
    transition: background 0.15s, color 0.15s;
    margin-top: auto;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--border-light);
}

.theme-toggle-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.theme-toggle-track {
    width: 36px;
    height: 20px;
    background: var(--border);
    border-radius: 10px;
    position: relative;
    margin-right: auto;
    transition: background 0.2s;
    flex-shrink: 0;
}

[data-theme="dark"] .theme-toggle-track {
    background: var(--primary);
}

.theme-toggle-knob {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right:2px;
    transition: transform 0.2s;
}

[data-theme="dark"] .theme-toggle-knob {
    transform: translateX(16px);
}

/* Sidebar layout for toggle placement */
.app-sidebar,
.app-sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}


/* ==========================================================================
   20. RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .app-header { padding: 0 1rem; }
    .logo-icon-mark { font-size: 1.38rem; }
    .logo-text { font-size: 1.3rem; }
    .logo-icon-svg { width: 22px; height: 22px; }
    .desktop-only { display: none !important; }
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }

    .app-sidebar, .app-sidebar { display: none; }
    .app-shell, .app-layout { flex-direction: column; }
    .app-main-content, .messages-wrapper { padding: 1rem; }
    .page-content { padding: 1rem; }

    .form-row { grid-template-columns: 1fr; }
    input, textarea, select { font-size: 16px; padding: 0.875rem; }
    .card { padding: 1.25rem; border-radius: 16px; }
    .btn { padding: 0.5rem 0.875rem; font-size: 0.8125rem; }
    .stats-grid { grid-template-columns: 1fr; }

    .listing-card, .property-card { flex-direction: column; align-items: flex-start; }
    .listing-card .btn, .property-card .btn { width: 100%; }

    .account-header { flex-direction: column; text-align: center; }
    .action-buttons { flex-direction: column; }
    .actions-grid { grid-template-columns: 1fr 1fr; }

    .toast-container { top: auto; bottom: 1rem; right:1rem; left: 1rem; max-width: none; width: calc(100% - 2rem); }
    .toast { transform: translateY(calc(100% + 2rem)); }
    .toast.show { transform: translateY(0); }
    .confirm-dialog { width: 95%; }

    .auth-modal {
        max-width: 100%; width: 100%; padding: 2rem 1.5rem;
        border-radius: 20px 20px 0 0;
        position: fixed; bottom: 0; top: auto;
        transform: translateY(100%); max-height: 90vh; overflow-y: auto;
    }

    .auth-overlay.active .auth-modal { transform: translateY(0); }
    .page-sidebar { width: 100%; border-left: none; border-bottom: 1px solid var(--border-light); }
    .page-layout { flex-direction: column; }
}

/* ═══════ GLOBAL SIDEBAR NAV ═══════ */
.sidebar-global-nav{display:flex;flex-direction:column;gap:2px;padding:12px 8px;border-bottom:1px solid var(--border-light)}
.sidebar-nav-item{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;color:var(--text-secondary);text-decoration:none;font-size:.8125rem;font-weight:500;transition:all .15s;cursor:pointer;border:none;background:none;width:100%;text-align: right;font-family:inherit}
.sidebar-nav-item:hover{background:var(--bg-page);color:var(--text-primary)}
.sidebar-nav-item.active{background:var(--primary);color:#fff}
.sidebar-nav-item.active svg{stroke:#fff}
.sidebar-nav-item svg{flex-shrink:0;opacity:.7}
.sidebar-nav-item.active svg{opacity:1}
.sidebar-nav-divider{height:1px;background:var(--border-light);margin:6px 12px}
@media(max-width:768px){.sidebar-global-nav{display:none}}

/* ═══════ GLOBAL SEARCH BAR — LinkedIn-style compact ═══════ */
.global-search {
    flex: 1 1 0%;
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    z-index: 200;
}
.gs-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    height: 38px;
    width: 100%;
    transition: border-color .2s;
}
.gs-input-wrap:focus-within { border-color: var(--primary); }
.gs-icon { flex-shrink: 0; width: 16px; height: 16px; color: var(--text-secondary); opacity: .5; }
input.gs-input, .gs-input-wrap .gs-input {
    flex: 1; width: auto; background: none; border: none; border-radius: 0;
    color: var(--text-primary); font-size: .8125rem; padding: 0;
    outline: none; font-family: inherit; min-width: 0; box-shadow: none;
}
.gs-input::placeholder { color: var(--text-secondary); }
.gs-close-btn { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; border-radius: 6px; flex-shrink: 0; }
.gs-close-btn:hover { color: var(--text-primary); }
.mobile-search-btn { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; border-radius: 8px; }
.mobile-search-btn:hover { color: var(--text-primary); }

/* Dropdown */
.gs-dropdown { display: none; position: absolute; top: calc(100% + 6px); right:0; left: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.4); z-index: 300; overflow: hidden; max-height: 600px; overflow-y: auto; }
.gs-dropdown.show { display: block; animation: gsSlide .15s ease; }
@keyframes gsSlide { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* Section headers */
.gs-section-header { padding: 8px 14px 4px; font-size: .68rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; background: var(--bg-page); border-bottom: 1px solid var(--border-light); }
.gs-section-header.gs-sh-promoted { color: #f59e0b; background: rgba(245,158,11,.05); }
.gs-deal-promoted { border-right: 2px solid rgba(245,158,11,.5) !important; background: rgba(245,158,11,.03) !important; }
.gs-promoted-tag { margin-right: 6px; background: linear-gradient(135deg,#f59e0b,#ef6c00); color:#fff; font-size:.55rem; font-weight:800; padding:1px 5px; border-radius:4px; letter-spacing:.03em; white-space:nowrap; }

/* Generic row item (keywords, users) */
.gs-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; transition: background .1s; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border-light); }
.gs-item:last-child { border-bottom: none; }
.gs-item:hover, .gs-item.active { background: var(--bg-hover); }
.gs-item-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gs-item-icon svg { width: 16px; height: 16px; }
.gs-item-icon.tag { background: rgba(168,85,247,.12); color: #a855f7; }
.gs-item-icon.user { background: rgba(59,130,246,.12); color: #3b82f6; }
.gs-item-icon.keyword { background: rgba(0,123,123,.12); font-size: 1rem; }
.gs-item-keyword { border-right: 2px solid #007b7b; }
.gs-item-keyword .gs-item-title { font-weight: 700; }
.gs-item-body { flex: 1; min-width: 0; }
.gs-item-title { font-size: .8125rem; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-item-sub { font-size: .6875rem; color: var(--text-secondary); margin-top: 1px; }

/* Deal card row */
.gs-deal-card { display: flex; gap: 12px; padding: 10px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--border-light); transition: background .1s; cursor: pointer; }
.gs-deal-card:last-child { border-bottom: none; }
.gs-deal-card:hover { background: var(--bg-hover); }
.gs-deal-card.related-card { opacity: .9; }
.gs-deal-thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: rgba(255,255,255,.06); position: relative; }
.gs-deal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-deal-thumb-placeholder { width: 72px; height: 72px; border-radius: 8px; flex-shrink: 0; background: rgba(0,123,123,.08); display: flex; align-items: center; justify-content: center; color: rgba(0,123,123,.4); font-size: 1.5rem; }
.gs-deal-disc-badge { position: absolute; top: 4px; left: 4px; background: #007b7b; color: #fff; font-size: .58rem; font-weight: 800; padding: 2px 5px; border-radius: 4px; line-height: 1.3; }
.gs-deal-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.gs-deal-title { font-size: .8125rem; font-weight: 600; color: var(--text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.gs-deal-seller { font-size: .68rem; color: var(--text-secondary); display: flex; align-items: center; gap: 3px; }
.gs-deal-seller-verified { color: #3b82f6; }
.gs-deal-prices { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.gs-deal-price { font-size: .875rem; font-weight: 700; color: #10b981; }
.gs-deal-mkt { font-size: .7rem; color: var(--text-secondary); text-decoration: line-through; }
.gs-deal-location { font-size: .65rem; color: var(--text-secondary); display: flex; align-items: center; gap: 3px; margin-top: 1px; }
.gs-deal-cond { display: inline-block; font-size: .6rem; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: rgba(255,255,255,.07); color: var(--text-secondary); margin-top: 2px; text-transform: capitalize; }

.gs-hl { background: #32f65e; color: #000; border-radius: 2px; font-weight: 700; font-style: normal; padding: 0 1px; }
.gs-view-all { display: block; padding: 10px 14px; text-align: center; color: var(--primary); font-size: .8125rem; font-weight: 600; text-decoration: none; border-top: 1px solid var(--border-light); }
.gs-view-all:hover { background: var(--bg-hover); }
.gs-empty { padding: 20px; text-align: center; color: var(--text-secondary); font-size: .8125rem; }

/* Mobile */
@media (max-width: 768px) {
    .global-search {
        display: none;
        position: absolute;
        top: 0; right:0; left: 0; bottom: 0;
        width: auto;
        padding: 0 12px;
        background: var(--bg-card);
        align-items: center;
        z-index: 210;
    }
    .global-search.mobile-open { display: flex; }
    .global-search.mobile-open .gs-input-wrap { flex: 1; height: 38px; }
    .global-search.mobile-open .gs-close-btn { display: flex; }
    .global-search.mobile-open .gs-dropdown { width: auto; right:12px; left: 12px; top: calc(var(--header-height) - 4px); max-height: calc(100svh - 80px); }
    .mobile-search-btn { display: flex; align-items: center; justify-content: center; }
    .header-right { margin-right: auto; }
}

/* Mobile search */
