/* ============================================================
   DASHBOARD.CSS — Premium Sidebar Dashboard
   Sidebar nav (desktop) + bottom tab bar (mobile)
   4 panels: Messages, Listings, Saved, Profile
   ============================================================ */

/* ── Page Load ── */
body { opacity: 0; }
body.page-loaded { opacity: 1; transition: opacity 0.3s ease; }
body.page-exiting { opacity: 0; transition: opacity 0.2s ease; }
body::before { content: ''; position: fixed; inset: 0; background-image: radial-gradient(var(--sand) 1px, transparent 1px); background-size: 32px 32px; opacity: 0.25; pointer-events: none; z-index: -1; }

/* ── Top Nav ── */
.dash-nav { padding: 0 48px; height: 64px; display: flex; align-items: center; justify-content: space-between; background: rgba(247,242,234,0.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--sand); position: sticky; top: 0; z-index: 200; }
.dash-nav .nav-logo { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--clay); text-decoration: none; letter-spacing: -0.04em; }
.dash-nav .nav-right { display: flex; align-items: center; gap: 16px; }
.dash-nav .nav-greeting { font-size: 13px; color: var(--warm-grey); }
.dash-nav .nav-greeting strong { color: var(--ink); font-weight: 600; }
.dash-nav .nav-badge { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 100px; background: #DCFCE7; color: #166534; }
.dash-nav .sign-out-btn { font-size: 13px; color: var(--warm-grey); background: none; border: 1px solid var(--sand); border-radius: 8px; padding: 6px 14px; cursor: pointer; font-family: var(--sans); transition: all 0.2s; }
.dash-nav .sign-out-btn:hover { border-color: var(--clay); color: var(--clay); }

/* ── Layout Shell ── */
.dash-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); }

/* ── Sidebar ── */
.dash-sidebar { background: rgba(247,242,234,0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-right: 1px solid var(--sand); padding: 24px 14px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-section { display: flex; flex-direction: column; gap: 2px; }
.sidebar-section + .sidebar-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--sand); }

.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; border: none; background: none; width: 100%; text-align: left; font-family: var(--sans); transition: all 0.25s var(--ease-out); position: relative; text-decoration: none; }
.sidebar-item:hover { background: rgba(255,255,255,0.7); transform: translateX(2px); }
.sidebar-item.active { background: white; color: var(--clay); font-weight: 600; box-shadow: 0 2px 8px rgba(26,22,18,0.04); }
.sidebar-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.sidebar-label { flex: 1; }
.sidebar-badge { background: var(--clay); color: white; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 100px; min-width: 18px; text-align: center; }

.sidebar-link { color: var(--warm-grey); font-size: 13px; }
.sidebar-link:hover { color: var(--clay); }
.sidebar-link .sidebar-icon { font-size: 14px; }
.sidebar-link::after { content: '→'; margin-left: auto; font-size: 11px; opacity: 0; transition: opacity 0.2s, transform 0.2s; }
.sidebar-link:hover::after { opacity: 1; transform: translateX(2px); }

/* ── Main Content ── */
.dash-content { padding: 36px 40px 80px; max-width: 960px; min-width: 0; }

/* ── Greeting ── */
.greeting { margin-bottom: 32px; }
.greeting-eyebrow { font-size: 12px; color: var(--warm-grey); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0; animation: dashReveal 0.5s ease 0.05s both; }
.greeting h1 { font-family: var(--serif); font-size: 28px; font-weight: 700; line-height: 1.2; opacity: 0; animation: dashReveal 0.55s var(--ease-spring) 0.1s both; }
.greeting h1 em { font-style: italic; color: var(--clay); }

/* ── Panels ── */
.panel { display: none; animation: dashReveal 0.3s var(--ease-out) both; }
.panel.active { display: block; }

/* ── Sub-tabs (Messages: Inbox/Tours, Listings: My Listings/Leases) ── */
.sub-tabs { display: flex; gap: 4px; margin-bottom: 24px; background: white; border: 1px solid var(--sand); border-radius: 10px; padding: 3px; width: fit-content; }
.sub-tab { padding: 7px 18px; border-radius: 8px; border: none; background: none; font-size: 13px; font-weight: 500; font-family: var(--sans); color: var(--warm-grey); cursor: pointer; white-space: nowrap; transition: all 0.25s var(--ease-spring); }
.sub-tab.active { background: var(--clay); color: white; box-shadow: 0 2px 10px rgba(196,98,45,0.2); }
.sub-tab:hover:not(.active) { color: var(--ink); background: var(--cream); }
.sub-panel { display: none; }
.sub-panel.active { display: block; animation: dashReveal 0.25s var(--ease-out) both; }

/* ── Section Headers ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; }
.section-title { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.section-sub { font-size: 13px; color: var(--warm-grey); margin-top: 3px; }
.section-action { font-size: 13px; color: var(--clay); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.section-action:hover { text-decoration: underline; }

/* ── Stat Cards ── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { background: white; border: 1px solid var(--sand); border-radius: var(--radius-lg); padding: 20px; text-align: center; box-shadow: 0 2px 8px rgba(26,22,18,0.03); transition: transform 0.35s var(--ease-spring), box-shadow 0.3s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(26,22,18,0.07); }
.stat-num { font-family: var(--serif); font-size: 28px; font-weight: 700; color: var(--clay); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; color: var(--warm-grey); text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Cards ── */
.cards-grid { display: flex; flex-direction: column; gap: 12px; }

.app-card { background: white; border: 1px solid var(--sand); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; transition: all 0.3s var(--ease-spring); }
.app-card:hover { box-shadow: 0 8px 24px rgba(26,22,18,0.06); transform: translateY(-2px); border-color: transparent; }
.app-card-left { flex: 1; min-width: 0; }
.app-card-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.app-card-sub { font-size: 12px; color: var(--warm-grey); }

.status-pill { padding: 4px 12px; border-radius: 100px; font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.status-pending { background: #FEF3C7; color: #92400E; }
.status-approved { background: #DCFCE7; color: #166534; }
.status-rejected { background: #FEE2E2; color: #991B1B; }
.status-viewed { background: #DBEAFE; color: #1E40AF; }
.status-active { background: #DCFCE7; color: #166534; }
.status-paused { background: #FEF3C7; color: #92400E; }
.status-pending-review { background: #DBEAFE; color: #1E40AF; }
.status-rented { background: #D1FAE5; color: #065F46; }

/* ── Listing Cards (My Listings) ── */
.listing-card { background: white; border: 1px solid var(--sand); border-radius: var(--radius-lg); overflow: hidden; display: flex; transition: all 0.3s var(--ease-spring); }
.listing-card:hover { box-shadow: 0 8px 24px rgba(26,22,18,0.06); transform: translateY(-2px); border-color: transparent; }
.listing-card-img { width: 120px; min-height: 100px; background: var(--sand); flex-shrink: 0; object-fit: cover; }
.listing-card-body { padding: 16px 18px; flex: 1; min-width: 0; }
.listing-card-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.listing-card-addr { font-size: 12px; color: var(--warm-grey); margin-bottom: 6px; }
.listing-card-price { font-size: 13px; color: var(--clay); font-weight: 600; }
.listing-card-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.my-listing-card { background: white; border: 1px solid var(--sand); border-radius: var(--radius-lg); overflow: hidden; display: flex; transition: all 0.3s var(--ease-spring); }
.my-listing-card:hover { box-shadow: 0 8px 24px rgba(26,22,18,0.06); transform: translateY(-2px); border-color: transparent; }
.my-listing-thumb { width: 110px; flex-shrink: 0; background: var(--sand); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; color: var(--warm-grey); font-size: 28px; }
.my-listing-body { padding: 16px 18px; flex: 1; min-width: 0; }
.my-listing-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.my-listing-title { font-size: 14px; font-weight: 600; }
.my-listing-addr { font-size: 12px; color: var(--warm-grey); margin-bottom: 6px; }
.my-listing-price { font-size: 13px; color: var(--clay); font-weight: 600; }
.my-listing-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ── Analytics Strip ── */
.analytics-strip { display: flex; gap: 0; margin: 10px 0 0; border: 1px solid var(--sand); border-radius: var(--radius-md); overflow: hidden; background: var(--cream); }
.analytics-stat { flex: 1; padding: 9px 12px; text-align: center; position: relative; transition: background 0.2s; }
.analytics-stat + .analytics-stat::before { content: ''; position: absolute; left: 0; top: 20%; height: 60%; width: 1px; background: var(--sand); }
.analytics-stat:hover { background: white; }
.analytics-num { font-size: 16px; font-weight: 700; color: var(--ink); font-family: var(--serif); line-height: 1; }
.analytics-label { font-size: 9px; color: var(--warm-grey); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 3px; }
.analytics-loading { opacity: 0.35; }

.conversion-wrap { margin-top: 8px; }
.conversion-label { font-size: 11px; color: var(--warm-grey); margin-bottom: 4px; display: flex; justify-content: space-between; }
.conversion-track { height: 5px; background: var(--sand); border-radius: 3px; overflow: hidden; }
.conversion-fill { height: 100%; background: linear-gradient(90deg,var(--clay-light),var(--clay)); border-radius: 3px; transition: width 0.8s ease; }
.view-listing-link { font-size: 12px; color: var(--clay); font-weight: 600; text-decoration: none; }
.view-listing-link:hover { text-decoration: underline; }

/* ── Action Buttons ── */
.card-action-btn { font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 8px; border: 1px solid var(--sand); background: none; cursor: pointer; font-family: var(--sans); color: var(--ink); transition: all 0.25s var(--ease-spring); }
.card-action-btn:hover { border-color: var(--clay); color: var(--clay); transform: translateY(-1px); }
.card-action-btn.primary { background: var(--clay); color: white; border-color: var(--clay); }
.card-action-btn.primary:hover { background: var(--clay-light); color: white; transform: translateY(-2px); box-shadow: 0 4px 14px rgba(196,98,45,0.25); }
.card-action-btn.danger { color: #B91C1C; border-color: #FECACA; }
.card-action-btn.danger:hover { background: #FEF2F2; border-color: #B91C1C; color: #B91C1C; }
.card-action-btn.rented { color: #065F46; border-color: #A7F3D0; }
.card-action-btn.rented:hover { background: #ECFDF5; border-color: #065F46; color: #065F46; }

/* ── CTA Card ── */
.cta-card { background: linear-gradient(135deg,#1A1612 0%,#2D1F14 100%); border-radius: var(--radius-xl); padding: 24px 28px; color: white; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; transition: all 0.3s var(--ease-spring); }
.cta-card:hover { box-shadow: 0 12px 36px rgba(26,22,18,0.2); transform: translateY(-2px); }
.cta-card h3 { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.cta-card p { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.5; }
.cta-btn { padding: 10px 20px; background: var(--clay); color: white; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; font-family: var(--sans); border: none; cursor: pointer; transition: all 0.25s var(--ease-spring); }
.cta-btn:hover { background: var(--clay-light); color: white; transform: translateY(-1px); }

/* ── Empty States ── */
.empty-state { background: white; border: 1px solid var(--sand); border-radius: var(--radius-lg); padding: 48px 32px; text-align: center; }
.empty-icon { font-size: 36px; margin-bottom: 14px; }
.empty-title { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.empty-sub { font-size: 13px; color: var(--warm-grey); line-height: 1.6; margin-bottom: 20px; }
.empty-action { display: inline-block; padding: 10px 22px; background: var(--clay); color: white; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none; transition: all 0.25s var(--ease-spring); }
.empty-action:hover { background: var(--clay-light); color: white; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(196,98,45,0.25); }

/* ── Profile Card ── */
.profile-card { background: white; border: 1px solid var(--sand); border-radius: var(--radius-xl); padding: 28px; display: flex; align-items: center; gap: 24px; margin-bottom: 20px; transition: box-shadow 0.3s ease; }
.profile-card:hover { box-shadow: 0 8px 28px rgba(26,22,18,0.06); }
.avatar { width: 68px; height: 68px; border-radius: 50%; background: linear-gradient(135deg,var(--clay-light),var(--clay)); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 26px; color: white; font-weight: 700; flex-shrink: 0; }
.profile-info { flex: 1; }
.profile-name { font-size: 18px; font-weight: 600; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }
.verified-badge { display: inline-flex; align-items: center; gap: 4px; background: #DCFCE7; color: #166534; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 100px; }
.profile-meta { font-size: 13px; color: var(--warm-grey); margin-bottom: 10px; }
.profile-edit-btn { font-size: 13px; color: var(--clay); background: none; border: 1px solid var(--sand); border-radius: 8px; padding: 6px 14px; cursor: pointer; font-family: var(--sans); transition: all 0.25s var(--ease-spring); }
.profile-edit-btn:hover { border-color: var(--clay); transform: translateY(-1px); }

/* ── Info Card (reusable) ── */
.info-card { background: white; border: 1px solid var(--sand); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 14px; }
.info-card-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1/-1; }
.form-label { font-size: 12px; font-weight: 500; color: var(--ink); }
.form-input, .form-select, .form-textarea { padding: 11px 14px; font-size: 14px; font-family: var(--sans); border: 1.5px solid var(--sand); border-radius: var(--radius-md); background: var(--cream); color: var(--ink); outline: none; transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s var(--ease-spring); }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--clay); background: white; box-shadow: 0 0 0 4px rgba(196,98,45,0.08); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-submit { padding: 13px 26px; background: var(--clay); color: white; border: none; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; font-family: var(--sans); cursor: pointer; transition: all 0.25s var(--ease-spring); }
.form-submit:hover { background: var(--clay-light); color: white; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(196,98,45,0.25); }

.amenity-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1.5px solid var(--sand); border-radius: 100px; font-size: 13px; cursor: pointer; user-select: none; background: white; transition: all 0.25s var(--ease-spring); }
.amenity-toggle:hover { border-color: var(--clay-light); transform: translateY(-1px); }
.amenity-toggle:has(input:checked) { border-color: var(--clay); background: rgba(196,98,45,0.06); color: var(--clay); }
.amenity-toggle input { display: none; }

/* ── Photos ── */
.photo-thumb { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; border: 1px solid var(--sand); position: relative; }
.photo-thumb-wrap { position: relative; display: inline-block; }
.photo-remove { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; background: var(--ink); color: white; border-radius: 50%; border: none; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: var(--sans); line-height: 1; z-index: 2; }
.photo-thumb[draggable="true"] { cursor: grab; }
.photo-thumb[draggable="true"]:active { cursor: grabbing; }
.photo-thumb.dragging { opacity: 0.4; transform: scale(0.95); }
.photo-thumb.drag-over { outline: 2px dashed var(--clay); outline-offset: 2px; }
.photo-cover-badge { position: absolute; bottom: 3px; left: 3px; background: rgba(26,22,18,0.7); color: white; font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 5px; border-radius: 4px; pointer-events: none; }

/* ── Lease Cards ── */
.lease-card { background: white; border: 1px solid var(--sand); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 14px; transition: all 0.3s var(--ease-spring); }
.lease-card:hover { box-shadow: 0 8px 24px rgba(26,22,18,0.06); transform: translateY(-2px); }
.lease-icon { width: 42px; height: 42px; border-radius: var(--radius-md); background: var(--cream); border: 1px solid var(--sand); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.lease-body { flex: 1; min-width: 0; }
.lease-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.lease-meta { font-size: 12px; color: var(--warm-grey); }
/* Listing type picker */
.listing-picker-option { display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px 20px; border: 1.5px solid var(--sand); border-radius: 14px; background: white; cursor: pointer; font-family: var(--sans); text-align: left; transition: all 0.2s; margin-bottom: 10px; }
.listing-picker-option:hover { border-color: var(--clay); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(26,22,18,0.08); }
.listing-picker-icon { font-size: 28px; flex-shrink: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--cream); border-radius: 12px; }
.listing-picker-text { flex: 1; min-width: 0; }
.listing-picker-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.listing-picker-desc { font-size: 12px; color: var(--warm-grey); line-height: 1.5; }
.listing-picker-arrow { font-size: 18px; color: var(--clay); font-weight: 700; flex-shrink: 0; }

.ls-svc { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink); cursor: pointer; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--sand); background: white; transition: all 0.15s; }
.ls-svc:hover { border-color: var(--clay); }
.ls-svc:has(input:checked) { background: rgba(196,98,45,0.06); border-color: var(--clay); }
.ls-svc input { accent-color: var(--clay); }

/* Tenancy progress widget */
.tenancy-progress-card { background: white; border: 1px solid var(--sand); border-radius: 14px; padding: 16px 18px; margin-bottom: 10px; transition: all 0.3s var(--ease-spring); }
.tenancy-progress-card:hover { box-shadow: 0 6px 20px rgba(26,22,18,0.06); transform: translateY(-1px); }

/* Lease action buttons */
.ls-action-btn { padding: 6px 14px; border-radius: 8px; border: 1px solid var(--sand); background: white; font-size: 11px; font-weight: 600; color: var(--ink); cursor: pointer; font-family: var(--sans); transition: all 0.15s; }
.ls-action-btn:hover { border-color: var(--clay); color: var(--clay); background: rgba(196,98,45,0.04); }
.ls-action-btn--primary { background: var(--clay); color: white; border-color: var(--clay); }
.ls-action-btn--primary:hover { background: var(--clay-dark); color: white; }
.ls-term-pill { cursor: pointer; }
.ls-term-pill-inner { display: inline-block; padding: 9px 18px; border-radius: 100px; border: 1.5px solid var(--sand); font-size: 13px; font-weight: 600; color: var(--warm-grey); background: white; transition: all 0.2s; font-family: var(--sans); }
.ls-term-pill-inner:hover { border-color: var(--clay); color: var(--ink); }
.ls-term-pill input:checked + .ls-term-pill-inner { background: var(--ink); color: white; border-color: var(--ink); }
.lease-status-pending { background: #FEF3C7; color: #92400E; }
.lease-status-signed { background: #D1FAE5; color: #065F46; }
.lease-status-declined { background: #FEE2E2; color: #991B1B; }

/* ── Modals ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(26,22,18,0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 300; align-items: center; justify-content: center; padding: 24px; }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: var(--radius-2xl); padding: 36px; width: 100%; max-width: 480px; animation: dashModalIn 0.35s var(--ease-spring) both; box-shadow: 0 24px 64px rgba(26,22,18,0.18); }
.modal-title { font-family: var(--serif); font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; }
.modal-cancel { padding: 10px 18px; background: none; border: 1px solid var(--sand); border-radius: 10px; font-size: 13px; cursor: pointer; font-family: var(--sans); transition: all 0.2s; }
.modal-cancel:hover { border-color: var(--warm-grey); }
.modal-save { padding: 10px 20px; background: var(--clay); color: white; border: none; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--sans); transition: all 0.25s var(--ease-spring); }
.modal-save:hover { background: var(--clay-light); color: white; transform: translateY(-1px); }

/* ================================================================
   MESSAGING — Realtime Chat UI
   ================================================================ */

/* Conversation inbox */
.conv-card { background: white; border: 1px solid var(--sand); border-radius: 14px; padding: 14px 18px; margin-bottom: 8px; cursor: pointer; display: flex; align-items: flex-start; gap: 12px; transition: all 0.25s var(--ease-spring); position: relative; }
.conv-card:hover { border-color: var(--clay-light); box-shadow: 0 6px 20px rgba(196,98,45,0.06); transform: translateY(-1px); }
.conv-card.unread { border-left: 3px solid var(--clay); }
.conv-avatar { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--clay-light), var(--clay)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; font-family: var(--serif); }
.conv-body { flex: 1; min-width: 0; }
.conv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 2px; }
.conv-name { font-weight: 600; font-size: 14px; color: var(--ink); }
.conv-time { font-size: 11px; color: var(--warm-grey); flex-shrink: 0; }
.conv-listing { font-size: 12px; color: var(--clay); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-preview { font-size: 13px; color: var(--warm-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-card.unread .conv-preview { color: var(--ink); font-weight: 500; }
.conv-unread-dot { position: absolute; top: 16px; right: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--clay); }

/* Thread view */
#msg-thread-view { display: none; flex-direction: column; height: calc(100vh - 240px); min-height: 400px; }
.msg-back-btn { background: none; border: none; color: var(--clay); font-size: 14px; font-weight: 600; cursor: pointer; padding: 0 0 14px; display: flex; align-items: center; gap: 6px; font-family: var(--sans); }
.msg-back-btn:hover { text-decoration: underline; }

.msg-thread-header { padding-bottom: 14px; border-bottom: 1px solid var(--sand); margin-bottom: 0; }
.msg-thread-user { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.msg-thread-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--clay-light), var(--clay)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; font-family: var(--serif); }
.msg-thread-user-name { font-weight: 700; font-size: 15px; color: var(--ink); }
.msg-thread-user-role { font-size: 12px; color: var(--warm-grey); }
.msg-thread-listing { margin-bottom: 8px; }
.msg-listing-link { font-size: 13px; color: var(--clay); text-decoration: none; font-weight: 500; }
.msg-listing-link:hover { text-decoration: underline; }
.msg-thread-actions { display: flex; gap: 8px; }
.msg-action-btn { font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 8px; border: 1.5px solid var(--sand); background: white; cursor: pointer; font-family: var(--sans); color: var(--clay); text-decoration: none; transition: all 0.2s; }
.msg-action-btn:hover { border-color: var(--clay); background: rgba(196,98,45,0.04); }

/* In-thread tour form */
.msg-tour-form { background: var(--cream); border: 1px solid var(--sand); border-radius: 14px; padding: 16px; margin: 10px 0; }
.msg-tour-form-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 10px; }
.msg-tour-form-row { display: flex; gap: 10px; margin-bottom: 10px; }
.msg-tour-input { padding: 9px 12px; font-size: 13px; border: 1.5px solid var(--sand); border-radius: 10px; font-family: var(--sans); background: white; color: var(--ink); outline: none; flex: 1; }
.msg-tour-input:focus { border-color: var(--clay); }
.msg-tour-note { width: 100%; resize: none; min-height: auto; }
.msg-tour-form-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.msg-tour-cancel { background: none; border: 1px solid var(--sand); border-radius: 8px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-family: var(--sans); color: var(--warm-grey); }
.msg-tour-send { background: var(--clay); color: white; border: none; border-radius: 8px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--sans); }
.msg-tour-send:hover { background: var(--clay-light); }

/* Messages area */
.msg-thread-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 14px 4px 14px 0; scrollbar-width: thin; scrollbar-color: var(--sand) transparent; }
.msg-thread-messages::-webkit-scrollbar { width: 5px; }
.msg-thread-messages::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 3px; }
.msg-empty { text-align: center; color: var(--warm-grey); font-size: 13px; padding: 40px 20px; }
.msg-day-sep { text-align: center; font-size: 11px; font-weight: 600; color: var(--warm-grey); padding: 10px 0 4px; letter-spacing: 0.04em; }
.msg-system { text-align: center; font-size: 12px; color: var(--warm-grey); background: var(--cream); border-radius: 100px; padding: 6px 16px; margin: 6px auto; width: fit-content; max-width: 80%; }

/* Message bubbles */
.msg-bubble { max-width: 72%; padding: 11px 15px; border-radius: 18px; font-size: 14px; line-height: 1.55; word-break: break-word; }
.msg-bubble.mine { background: var(--clay); color: white; border-bottom-right-radius: 4px; }
.msg-bubble.theirs { background: white; border: 1px solid var(--sand); color: var(--ink); border-bottom-left-radius: 4px; }
.msg-bubble.mine a { color: white; text-decoration: underline; }
.msg-bubble.theirs a { color: var(--clay); }
.msg-bubble-wrap { display: flex; flex-direction: column; }
.msg-bubble-wrap.mine { align-items: flex-end; }
.msg-bubble-wrap.theirs { align-items: flex-start; }
.msg-meta { font-size: 10px; color: var(--warm-grey); margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.msg-receipt { font-size: 12px; color: var(--warm-grey); letter-spacing: -3px; }
.msg-receipt.read { color: var(--clay); }

/* File attachments */
.msg-attach-img { margin-bottom: 6px; }
.msg-attach-img img { max-width: 240px; max-height: 180px; border-radius: 10px; cursor: pointer; display: block; }
.msg-attach-file { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: rgba(255,255,255,0.15); border-radius: 8px; font-size: 13px; text-decoration: none; color: inherit; margin-bottom: 6px; border: 1px solid rgba(255,255,255,0.2); }
.msg-bubble.theirs .msg-attach-file { background: var(--cream); border-color: var(--sand); color: var(--clay); }

/* Typing indicator */
.msg-typing { display: none; align-items: center; gap: 8px; padding: 4px 0 8px; }
.typing-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--warm-grey); animation: typingPulse 1.4s infinite ease-in-out; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
.typing-label { font-size: 12px; color: var(--warm-grey); }
@keyframes typingPulse { 0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); } 30% { opacity: 1; transform: scale(1); } }

/* Reply bar */
.msg-reply-bar { display: flex; align-items: flex-end; gap: 10px; background: white; border: 1.5px solid var(--sand); border-radius: var(--radius-lg); padding: 11px 14px; margin-top: auto; transition: border-color 0.2s; }
.msg-reply-bar:focus-within { border-color: var(--clay); }
.msg-reply-bar textarea { flex: 1; border: none; outline: none; font-size: 14px; font-family: var(--sans); resize: none; min-height: 20px; max-height: 120px; color: var(--ink); background: transparent; line-height: 1.5; }
.msg-reply-bar textarea::placeholder { color: var(--warm-grey); }
.msg-attach-btn { cursor: pointer; font-size: 20px; color: var(--warm-grey); padding: 2px; transition: color 0.2s; flex-shrink: 0; }
.msg-attach-btn:hover { color: var(--clay); }
.msg-send-btn { background: var(--clay); color: white; border: none; border-radius: 10px; padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--sans); white-space: nowrap; flex-shrink: 0; transition: background 0.2s; }
.msg-send-btn:hover { background: var(--clay-light); }
.msg-file-preview { display: none; align-items: center; gap: 8px; padding: 6px 12px; background: var(--cream); border-radius: 8px; font-size: 12px; color: var(--ink); margin-bottom: 6px; }
.msg-file-preview button { background: none; border: none; font-size: 14px; cursor: pointer; color: var(--warm-grey); padding: 0; }
.msg-file-preview button:hover { color: var(--ink); }
.msg-loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--warm-grey); font-size: 13px; }

/* ================================================================
   TOUR REQUEST CARDS
   ================================================================ */
.tours-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.tours-tab { padding: 7px 16px; border-radius: 8px; border: 1.5px solid var(--sand); background: white; font-size: 13px; font-weight: 500; cursor: pointer; font-family: var(--sans); color: var(--warm-grey); transition: all 0.2s; }
.tours-tab:hover { border-color: var(--clay); color: var(--clay); }
.tours-tab.active { background: var(--clay); color: white; border-color: var(--clay); }

.tour-card { background: white; border: 1px solid var(--sand); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 10px; transition: all 0.3s var(--ease-spring); }
.tour-card:hover { box-shadow: 0 6px 20px rgba(26,22,18,0.05); transform: translateY(-1px); }
.tour-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tour-card-info { flex: 1; min-width: 0; }
.tour-card-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.tour-card-light { font-weight: 400; color: var(--warm-grey); }
.tour-card-meta { font-size: 12px; color: var(--warm-grey); margin-top: 2px; }
.tour-card-msg { font-size: 12px; color: var(--warm-grey); font-style: italic; margin-top: 4px; }
.tour-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--sand); }

/* ================================================================
   Loading & Utilities
   ================================================================ */
.loading { display: flex; align-items: center; justify-content: center; padding: 48px; }
.spinner { width: 24px; height: 24px; border: 2px solid var(--sand); border-top-color: var(--clay); border-radius: 50%; animation: spin 0.7s linear infinite; }

input, textarea, select { -webkit-appearance: none; }
* { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }

/* ── Bottom Tab Bar (Mobile) ── */
.dash-bottom-bar { display: none; }

/* ── Keyframes ── */
@keyframes dashReveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dashModalIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablet: collapse sidebar, show bottom bar */
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .dash-bottom-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 56px; background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--sand); z-index: 200; align-items: center; justify-content: space-around; padding: 0 8px; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .btab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; border: none; background: none; cursor: pointer; font-family: var(--sans); color: var(--warm-grey); transition: color 0.2s; position: relative; text-decoration: none; }
  .btab.active { color: var(--clay); }
  .btab-icon { font-size: 20px; }
  .btab-label { font-size: 10px; font-weight: 500; }
  .btab .sidebar-badge { position: absolute; top: 0; right: 2px; font-size: 9px; padding: 0 5px; }
  .dash-content { padding: 24px 16px 80px; }
  .dash-nav { padding: 0 16px; height: 56px; }
  .dash-nav .nav-greeting { display: none; }
}

@media (max-width: 768px) {
  .greeting h1 { font-size: 24px; }
  .stats-row { grid-template-columns: repeat(3,1fr); gap: 8px; }
  .stat-card { padding: 14px 10px; }
  .stat-num { font-size: 20px; }
  .stat-label { font-size: 9px; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .cta-card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .profile-card { flex-direction: column; text-align: center; }
  .my-listing-card { flex-direction: column; }
  .my-listing-thumb { width: 100%; height: 150px; }
  .listing-card { flex-direction: column; }
  .listing-card-img { width: 100%; height: 150px; }
  .analytics-strip { flex-wrap: wrap; }
  .analytics-stat { min-width: 50%; }
  .analytics-stat + .analytics-stat::before { display: none; }
  .modal { padding: 24px 18px; margin: 16px; max-height: 90vh; overflow-y: auto; }
  #msg-thread-view { height: calc(100vh - 180px); height: calc(100dvh - 180px); }
  .msg-reply-bar { position: sticky; bottom: 0; background: white; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .msg-thread-actions { flex-wrap: wrap; }
  .msg-tour-form-row { flex-direction: column; }
  .msg-attach-img img { max-width: 180px; }
  .tour-card-top { flex-direction: column; gap: 6px; }
  .lease-card { flex-wrap: wrap; gap: 10px; }
  .sub-tabs { width: 100%; }
  .sub-tab { flex: 1; text-align: center; }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .my-listing-thumb { height: 130px; }
  .greeting h1 { font-size: 22px; }
  .section-title { font-size: 18px; }
  .photo-thumb { width: 64px; height: 64px; }
}
