/* ================================================================
   GoaKeys — User Dashboard
   Design source: Google Stitch "Emerald Legacy — Elder Friendly"
   Principles: deep emerald + premium gold, 8px rhythm, oversized
   type (18px+ body), 48px+ touch targets, glassmorphism surfaces,
   high-contrast 2px borders, low-density generous spacing.
   ================================================================ */

:root {
    /* Stitch color tokens (Emerald Legacy, light theme) */
    --primary: #004225;
    --primary-hover: #002b18;
    --gold: #D4AF37;
    --text-main: #1A1C1B;
    --text-light: #414943;
    --white: #FFFFFF;
    --surface: #F9F9F7;
    --surface-soft: #EBF2EE;
    --border: #D1D5DB;
    --card-shadow: 0 10px 30px -12px rgba(1, 50, 32, 0.18), 0 4px 12px rgba(1, 50, 32, 0.08);

    --sidebar-width: 280px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --font-serif: "Source Serif 4", "EB Garamond", Georgia, serif;
    --font-sans: "Atkinson Hyperlegible Next", "Plus Jakarta Sans", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    background-color: var(--surface);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

/* The footer is a flex sibling of .main-content (the sidebar is position:
   fixed). Without wrap it was squeezed into the leftover horizontal space
   beside .main-content's 1280px cap - rendering as a broken sliver on the
   right edge. Give it its own full-width line. */
body > .footer {
    flex-basis: 100%;
    width: 100%;
    box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

a {
    text-decoration: none;
}

/* ------------------------------------------------------------------
   Buttons — large, elder-friendly targets
   ------------------------------------------------------------------ */
.btn {
    min-height: 48px;
    padding: 12px 26px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 12px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn .material-symbols-rounded {
    font-size: 1.4rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn.btn-primary {
    min-height: 56px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 16px rgba(1, 50, 32, 0.28);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--surface-soft);
}

.btn.delete-btn {
    background: transparent;
    color: #B91C1C;
    border: 2px solid #FCA5A5;
}

.btn.delete-btn:hover {
    background: #FEF2F2;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ------------------------------------------------------------------
   Sidebar — fixed 280px glass panel
   ------------------------------------------------------------------ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: rgba(249, 249, 247, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 2px solid var(--border);
    z-index: 100;
    box-shadow: 4px 0 20px rgba(1, 50, 32, 0.06);
}

aside.sidebar {
    width: var(--sidebar-width);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header .material-symbols-rounded {
    color: var(--primary);
    font-size: 2.25rem;
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 1.9rem;
    font-weight: 700;
    font-family: var(--font-serif);
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar .nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    min-height: 52px;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    border-radius: 10px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar .nav-item .material-symbols-rounded {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.sidebar .nav-item:hover {
    background: var(--surface-soft);
    color: var(--primary);
}

.sidebar .nav-item.active {
    background: var(--primary);
    color: var(--white);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.clerk-user-button {
    min-height: 48px;
    display: flex;
    align-items: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 99;
}

/* ------------------------------------------------------------------
   Main content
   ------------------------------------------------------------------ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    width: 100%;
    max-width: 1280px;
    min-height: 100vh;
    padding: 40px;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.top-bar-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--text-main);
}

.welcome-text {
    font-size: 1.125rem;
    color: var(--text-light);
    margin: 8px 0 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-main);
    width: 48px;
    height: 48px;
    border-radius: 10px;
}

.mobile-menu-btn .material-symbols-rounded {
    font-size: 2rem;
}

/* ------------------------------------------------------------------
   Profile completion + Pro upgrade banners
   ------------------------------------------------------------------ */
.completion-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, #006035 100%);
    color: var(--white);
    border-radius: 20px;
    padding: 32px 40px;
    margin-bottom: 32px;
    box-shadow: var(--card-shadow);
}

.banner-copy {
    max-width: 560px;
}

.completion-banner h2 {
    font-size: 1.75rem;
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--white);
    margin-bottom: 8px;
}

.completion-banner p {
    font-size: 1.125rem;
    margin: 0;
    opacity: 0.92;
}

.progress-bar-container {
    width: 100%;
    max-width: 360px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 18px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gold);
    border-radius: 999px;
    transition: width 1s ease-out;
}

.completion-banner small {
    display: block;
    margin-top: 10px;
    font-size: 1rem;
    opacity: 0.9;
}

.completion-banner .btn-white {
    background: var(--white);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 16px 28px;
    border-radius: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.completion-banner .btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.pro-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 12px;
    font-size: 0.9375rem;
    opacity: 0.9;
}

.pro-perks span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pro-perks .material-symbols-rounded {
    font-size: 1rem;
    color: var(--gold);
}

/* ------------------------------------------------------------------
   Metric cards
   ------------------------------------------------------------------ */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px -12px rgba(1, 50, 32, 0.22);
}

.metric-card .metric-info h3 {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    margin: 0 0 10px;
}

.metric-card .metric-info .value {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
    margin: 0;
}

.metric-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--surface-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon .material-symbols-rounded {
    font-size: 1.8rem;
}

.metric-icon.icon-amber {
    background: #FEF3C7;
    color: #D97706;
}

.metric-icon.icon-green {
    background: #ECFDF5;
    color: #059669;
}

/* ------------------------------------------------------------------
   Listings
   ------------------------------------------------------------------ */
#listingsContainer {
    margin-top: 32px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--text-main);
    margin-bottom: 18px;
}

.section-title .material-symbols-rounded {
    font-size: 1.8rem;
}

.section-title .icon-amber {
    color: #F59E0B;
}

.section-title .icon-green {
    color: #10B981;
}

.listings-grid {
    display: grid;
    gap: 16px;
}

.listing-card {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -12px rgba(1, 50, 32, 0.2);
}

.card-image {
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    background-color: #F1F5F9;
    background-size: cover;
    background-position: center;
}

.card-content {
    min-width: 0;
}

.card-header {
    margin-bottom: 8px;
}

.property-type {
    display: inline-block;
    background: var(--surface-soft);
    color: var(--primary);
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
}

.card-title {
    font-size: 1.375rem;
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--text-main);
    margin: 0 0 8px;
}

.card-meta {
    font-size: 1.125rem;
    color: var(--text-light);
    margin: 0;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-soft);
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    border: 2px solid var(--border);
}

.status-badge.status-active {
    background: #DCFCE7;
    color: #166534;
    border-color: #86EFAC;
}

.status-badge.status-pending {
    background: #FEF3C7;
    color: #92400E;
    border-color: #FCD34D;
}

#emptyState {
    display: none;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 56px 24px;
    box-shadow: var(--card-shadow);
}

#emptyState .empty-icon {
    font-size: 4rem;
    color: var(--border);
}

#emptyState h3 {
    font-size: 1.5rem;
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--text-main);
    margin: 20px 0 8px;
}

#emptyState p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin: 0 auto 24px;
    max-width: 420px;
}

@media (min-width: 1024px) {
    .listing-card {
        grid-template-columns: 220px 1fr auto;
        align-items: center;
        padding: 20px;
    }

    .card-actions {
        justify-content: flex-end;
    }
}

/* ------------------------------------------------------------------
   PropBot widget
   ------------------------------------------------------------------ */
.propbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.propbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(1, 50, 32, 0.35);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.propbot-toggle:hover {
    transform: scale(1.06);
    background: var(--primary-hover);
}

.propbot-toggle .material-symbols-rounded {
    font-size: 2rem;
}

#propbot-window {
    display: none;
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 480px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    border: 2px solid var(--border);
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    transition: transform 0.2s ease;
}

.propbot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--primary);
    color: var(--white);
    padding: 14px 16px;
    flex-shrink: 0;
}

.propbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.propbot-title .material-symbols-rounded {
    font-size: 1.5rem;
}

.propbot-title h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--white);
    font-family: var(--font-sans);
}

.propbot-close {
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    color: var(--white);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.propbot-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.propbot-close .material-symbols-rounded {
    font-size: 1.5rem;
}

#propbot-messages {
    flex: 1;
    overflow-y: auto;
    background: #F8FAFC;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.5;
}

.user-message {
    align-self: flex-end;
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: 0;
}

.bot-message {
    align-self: flex-start;
    background: var(--white);
    border: 2px solid var(--border);
    border-bottom-left-radius: 0;
}

/* DPDP AI-processing consent card — surfaced inline when the user opens
 * PropBot for the first time without having granted consent, or after a
 * 403 round-trip from /api/v1/ai/chat. */
.propbot-consent-card {
    max-width: 95%;
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
}
.propbot-consent-inner {
    font-size: 0.9rem;
}
.propbot-consent-card a {
    color: #92400E;
    text-decoration: underline;
}
.propbot-consent-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.15s ease;
}
.propbot-consent-btn:hover:not(:disabled) {
    opacity: 0.9;
}
.propbot-consent-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.propbot-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--white);
    border-top: 2px solid var(--border);
    flex-shrink: 0;
}

#propbot-input {
    flex: 1;
    min-height: 48px;
    padding: 10px 18px;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#propbot-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--gold);
}

.propbot-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

.propbot-send:hover {
    background: var(--primary-hover);
}

/* ------------------------------------------------------------------
   Modals
   ------------------------------------------------------------------ */
#modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#kycModal,
#leadsModal {
    display: none;
    position: relative;
    background: var(--white);
    border: 2px solid var(--border);
    width: 90%;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.25);
    max-height: 85vh;
    overflow-y: auto;
}

#kycModal {
    max-width: 520px;
}

#leadsModal {
    max-width: 640px;
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--text-main);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 48px;
}

.modal-title .modal-icon {
    color: var(--primary);
    font-size: 1.8rem;
}

.modal-subtext {
    font-size: 1.125rem;
    color: var(--text-light);
    margin: 0 0 24px;
}

.btn-close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.btn-close-modal:hover {
    background: var(--surface-soft);
}

.btn-close-modal .material-symbols-rounded {
    font-size: 1.75rem;
}

/* KYC form */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    font-size: 1.125rem;
    color: var(--text-main);
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--gold);
}

/* Leads */
#leadsListContainer {
    display: grid;
    gap: 16px;
}

.lead-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.lead-info {
    flex: 1;
    min-width: 200px;
}

.lead-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    font-family: var(--font-serif);
    color: var(--text-main);
    margin: 0 0 8px;
}

.lead-contacts span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.0625rem;
    color: var(--text-light);
}

.lead-contacts .material-symbols-rounded {
    color: var(--primary);
}

.lead-contacts p {
    margin: 6px 0 0;
    color: var(--text-light);
    font-size: 0.9375rem;
}

.lead-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.lead-time {
    font-size: 0.875rem;
    color: var(--text-light);
}

.lead-reveal-btn {
    min-height: 48px;
    white-space: nowrap;
}

/* ------------------------------------------------------------------
   Accessibility
   ------------------------------------------------------------------ */
:focus-visible {
    outline: 3px solid var(--gold) !important;
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (forced-colors: active) {
    .sidebar,
    .metric-card,
    .listing-card,
    .lead-card,
    #kycModal,
    #leadsModal,
    #propbot-window {
        border: 2px solid CanvasText;
    }

    .btn-primary,
    .propbot-toggle,
    .propbot-send,
    .propbot-header,
    .avatar,
    .status-badge {
        border: 2px solid CanvasText;
    }
}

/* ------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------ */
@media (max-width: 767px) {
    .mobile-menu-btn {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 20px 16px;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }

    .top-bar-header {
        width: 100%;
        justify-content: space-between;
    }

    .user-profile {
        width: 100%;
        justify-content: space-between;
    }

    .completion-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 24px;
    }

    .progress-bar-container {
        max-width: none;
    }

    .completion-banner .btn-white {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px 12px !important;
    }

    .propbot-container {
        right: 15px;
    }

    #propbot-window {
        width: min(380px, calc(100vw - 30px));
        right: 15px;
        bottom: 70px;
    }

    aside.sidebar {
        width: min(280px, 85vw);
    }

    .metric-card {
        padding: 20px;
    }

    .metric-card .metric-info .value {
        font-size: 1.9rem;
    }

    #kycModal,
    #leadsModal {
        padding: 24px 20px;
    }

    .mobile-menu-btn,
    .btn-close-modal,
    .propbot-close,
    .propbot-send {
        width: 56px;
        height: 56px;
    }
}

/* Tablet (768-1023px): visible sidebar, 2-col metrics, stacked listing cards */
@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --sidebar-width: 264px;
    }

    .mobile-menu-btn {
        display: none;
    }

    .main-content {
        margin-left: 264px;
        padding: 28px 32px;
    }

    .top-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 32px;
    }

    .completion-banner {
        flex-direction: row;
        align-items: center;
        gap: 24px;
        padding: 28px 32px;
    }

    .progress-bar-container {
        max-width: 320px;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .listing-card {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .card-actions {
        justify-content: flex-start;
    }
}

/* Desktop (≥1024px): full sidebar, 4-col metrics */
@media (min-width: 1024px) {
    .metrics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
