/* ═══════════════════════════════════════════════════
   Shanker Kana — Real Estate SaaS Platform Styles
   © 2026 Shanker Kana Inc. (Ontario, Canada)
   www.shankerkana.com
   ═══════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --primary: #1a56db;
  --primary-dark: #1342a8;
  --primary-light: #e1ecff;
  --secondary: #0f766e;
  --secondary-light: #ccfbf1;
  --accent: #f59e0b;
  --accent-light: #fef3c7;

  --bg: #f8fafc;
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --bg-dark: #1a1a2e;
  --bg-secondary: #f8f9fa;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #1a56db;

  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --text-sidebar: #cbd5e1;
  --text-sidebar-active: #ffffff;

  --surface-2: #e9ecef;
  --card-bg: #ffffff;
  --text-primary: #2d3748;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #dbeafe;

  --radius: 8px;
  --radius-sm: 4px;
  --radius-lg: 12px;
  --sidebar-width: 260px;
  --header-height: 64px;
  --transition: 0.2s ease;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 0.875rem; }

/* ── Loading Screen ── */
.loading-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100vh; gap: 1rem;
}
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════ AUTH PAGES ══════════ */
.auth-page {
  display: flex; min-height: 100vh;
}
.auth-hero {
  flex: 1; background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--secondary));
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 3rem; color: white; position: relative; overflow: hidden;
}
.auth-hero::before {
  content: ''; position: absolute; top: -50%; right: -50%;
  width: 100%; height: 100%; background: rgba(255,255,255,0.03);
  border-radius: 50%; transform: rotate(-15deg);
}
.auth-hero h1 { font-size: 2.5rem; font-weight: 800; margin-bottom: 0.5rem; z-index: 1; }
.auth-hero p { font-size: 1.1rem; opacity: 0.9; max-width: 400px; text-align: center; z-index: 1; }
.auth-hero .logo { font-size: 3rem; margin-bottom: 1rem; z-index: 1; }

.auth-form-section {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem;
}
.auth-form-container {
  width: 100%; max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
.auth-form-container h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.auth-form-container .subtitle { color: var(--text-secondary); margin-bottom: 2rem; }

@media (max-width: 768px) {
  .auth-hero { display: none; }
  .auth-form-section { padding: 1rem; }
}

/* ══════════ LAYOUT ══════════ */
.app-layout {
  display: flex; min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width); background: var(--bg-sidebar);
  color: var(--text-sidebar); display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 0.75rem;
}
.sidebar-header .logo-icon { font-size: 1.5rem; }
.sidebar-header h1 { font-size: 1rem; font-weight: 700; color: white; }
.sidebar-header .org-name { font-size: 0.75rem; color: var(--text-light); }

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-nav .nav-section { padding: 0.5rem 1.5rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); margin-top: 0.5rem; }

.nav-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1.5rem;
  color: var(--text-sidebar); font-size: 0.875rem; transition: all var(--transition);
  border-left: 3px solid transparent; cursor: pointer; text-decoration: none;
}
.nav-item:hover { background: var(--bg-sidebar-hover); text-decoration: none; color: white; }
.nav-item.active { background: var(--bg-sidebar-active); color: white; border-left-color: white; }
.nav-item .icon { width: 20px; text-align: center; }
.nav-item .badge {
  margin-left: auto; background: var(--danger); color: white;
  font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 10px;
}

.sidebar-footer {
  padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; gap: 0.75rem;
}
.sidebar-footer .user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 600; font-size: 0.8rem;
}
.sidebar-footer .user-info { flex: 1; }
.sidebar-footer .user-name { font-size: 0.8rem; color: white; font-weight: 500; }
.sidebar-footer .user-role { font-size: 0.7rem; color: var(--text-light); }

/* Role Switcher Dropdown */
.role-switcher {
  background: rgba(255,255,255,0.1); color: var(--text-light); border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px; padding: 2px 4px; font-size: 0.7rem; cursor: pointer;
  width: 100%; outline: none;
}
.role-switcher:hover { background: rgba(255,255,255,0.18); }
.role-switcher:focus { border-color: var(--primary); }
.role-switcher option { background: var(--bg-dark); color: white; }

/* Checkbox Group (invite form) */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.checkbox-label {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.875rem; cursor: pointer; color: var(--text-primary);
}
.checkbox-label input[type="checkbox"] { accent-color: var(--primary); cursor: pointer; }

/* ── Main Content Area ── */
.main-content {
  flex: 1; margin-left: var(--sidebar-width); min-height: 100vh;
}

/* ── Header ── */
.top-header {
  height: var(--header-height); background: var(--bg-white);
  border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between;
  padding: 0 2rem; position: sticky; top: 0; z-index: 40;
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-left h2 { font-size: 1.25rem; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 1rem; }

.btn-icon {
  width: 38px; height: 38px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-white);
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg); }
.btn-icon .notif-dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
}

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

/* ── Page Content ── */
.page-content { padding: 2rem; }
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; }

/* ══════════ COMPONENTS ══════════ */

/* ── Cards ── */
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  padding: 1.5rem; transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-light);
}
.card-header h3 { font-size: 1rem; font-weight: 600; }

/* ── Stats Grid ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem; margin-bottom: 2rem;
}
.stat-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  padding: 1.5rem; display: flex; align-items: flex-start; gap: 1rem;
}
.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-info h4 { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; }
.stat-info .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-info .stat-change { font-size: 0.75rem; margin-top: 0.25rem; }
.stat-change.positive { color: var(--success); }
.stat-change.negative { color: var(--danger); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem; border-radius: var(--radius); font-size: 0.875rem;
  font-weight: 500; border: 1px solid transparent;
  transition: all var(--transition); text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border-light); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-block { display: flex; justify-content: center; width: 100%; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 0.35rem;
}
.form-control {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.875rem; background: var(--bg-white);
  transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 0.25rem; }
.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper .form-control { padding-right: 2.5rem; }
.password-toggle {
  position: absolute; right: 0.5rem; background: none; border: none;
  cursor: pointer; color: var(--text-secondary); padding: 0.2rem;
  display: flex; align-items: center; border-radius: var(--radius-sm);
  transition: color var(--transition);
}
.password-toggle:hover { color: var(--text-primary); }
.password-toggle[data-shown="false"] .eye-hide { display: none; }
.password-toggle[data-shown="true"]  .eye-show  { display: none; }

select.form-control { cursor: pointer; }
textarea.form-control { min-height: 80px; resize: vertical; }

/* ── Tables ── */
.table-container {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  overflow: hidden;
}
.table-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 0.75rem;
}
.table-header h3 { font-weight: 600; }
.table-filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.table-filters .form-control { width: auto; min-width: 140px; padding: 0.4rem 0.6rem; }
.table-filters input.form-control { min-width: 200px; }

table { width: 100%; border-collapse: collapse; }
th { background: var(--bg); text-align: left; padding: 0.75rem 1rem; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }
th.sortable:hover { color: var(--text); background: var(--surface-2, #eef0f3); }
th.sortable .sort-arrow { font-size: 0.7rem; opacity: 0.5; margin-left: 2px; }
th.sortable:hover .sort-arrow { opacity: 1; }
td { padding: 0.75rem 1rem; font-size: 0.875rem; border-top: 1px solid var(--border-light); }
tbody tr { transition: background var(--transition); }
tbody tr:hover { background: var(--bg); }

.table-actions { display: flex; gap: 0.25rem; }
.table-pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1.5rem; border-top: 1px solid var(--border);
  font-size: 0.8rem; color: var(--text-secondary);
}

/* ── Badges ── */
.badge {
  display: inline-flex; align-items: center; padding: 0.2rem 0.6rem;
  border-radius: 99px; font-size: 0.75rem; font-weight: 500;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-default { background: var(--border-light); color: var(--text-secondary); }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; transform: translateY(20px);
  transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1.1rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.25rem; color: var(--text-secondary); padding: 0.25rem; }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 0.5rem;
  padding: 1rem 1.5rem; border-top: 1px solid var(--border);
}

/* ── Toast Notifications ── */
.toast-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 200;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
  padding: 0.75rem 1rem; border-radius: var(--radius); color: white;
  font-size: 0.875rem; box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease; min-width: 280px; max-width: 400px;
  display: flex; justify-content: space-between; align-items: center;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
.toast-warning { background: var(--warning); }
.toast-close { background: none; border: none; color: white; font-size: 1.1rem; opacity: 0.8; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Empty State ── */
.empty-state {
  text-align: center; padding: 3rem; color: var(--text-secondary);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; color: var(--text); margin-bottom: 0.5rem; }

/* ── Dashboard Charts Area ── */
.dashboard-grid {
  display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem;
}
.dashboard-grid-full {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}

/* ── Priority Badges ── */
.priority-urgent { color: var(--danger); font-weight: 600; }
.priority-high { color: #ea580c; font-weight: 600; }
.priority-medium { color: var(--warning); }
.priority-low { color: var(--text-secondary); }

/* ── Pricing Cards ── */
.pricing-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; padding: 2rem 0;
}
.pricing-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); border: 2px solid var(--border);
  padding: 2rem; text-align: center; transition: all var(--transition);
}
.pricing-card.featured { border-color: var(--primary); transform: scale(1.03); }
.pricing-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.pricing-card .plan-unit-badge {
  display: inline-block; background: var(--primary-light, rgba(99,102,241,0.1));
  color: var(--primary); font-size: 0.8rem; font-weight: 600;
  padding: 0.25rem 0.75rem; border-radius: 999px; margin-bottom: 1rem;
}
.pricing-card .price { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.pricing-card .price span { font-size: 1rem; color: var(--text-secondary); font-weight: 400; }
.pricing-card .price-sub { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.25rem; margin-bottom: 1rem; }
.pricing-card .plan-support {
  font-size: 0.85rem; color: var(--text);
  margin: 1rem 0 1.5rem; padding: 0.5rem 0.75rem;
  background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border);
}

/* ═══ Pricing Includes Section ═══ */
.pricing-includes {
  margin: 2.5rem auto 0; padding: 2.5rem; max-width: 900px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); text-align: center;
}
.pricing-includes h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.4rem; }
.pricing-includes > p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }
.pricing-includes-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem 1rem; text-align: left;
}
.pricing-include-item {
  font-size: 0.875rem; color: var(--text); padding: 0.4rem 0;
}
.pricing-include-item::before { content: '\2713\0020'; color: var(--success); font-weight: 700; }
.pricing-includes-grid .pricing-include-item { display: block; }

/* ═══ Landing Page ═══ */
.landing-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 3rem; background: var(--bg-white); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.landing-nav .logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.landing-nav .nav-links { display: flex; gap: 2rem; align-items: center; }
.landing-nav .nav-links a { color: var(--text-secondary); font-size: 0.9rem; }
.landing-nav .nav-links a:hover { color: var(--primary); text-decoration: none; }

.hero-section {
  text-align: center; padding: 5rem 2rem 4rem;
  background: linear-gradient(135deg, var(--primary-light), var(--bg));
}
.hero-section h1 {
  font-size: 3rem; font-weight: 800; line-height: 1.2; max-width: 700px; margin: 0 auto 1rem;
}
.hero-section p {
  font-size: 1.15rem; color: var(--text-secondary); max-width: 550px; margin: 0 auto 2rem;
}
.hero-buttons { display: flex; gap: 1rem; justify-content: center; }

.features-section { padding: 5rem 3rem; max-width: 1200px; margin: 0 auto; }
.features-section h2 { text-align: center; font-size: 2rem; font-weight: 700; margin-bottom: 3rem; }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}
.feature-card {
  padding: 2rem; border-radius: var(--radius-lg); border: 1px solid var(--border);
  transition: all var(--transition);
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-card .icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; }

.cta-section {
  background: var(--bg-sidebar); color: white; text-align: center; padding: 5rem 2rem;
}
.cta-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
.cta-section p { opacity: 0.8; margin-bottom: 2rem; max-width: 500px; margin-left: auto; margin-right: auto; }

.landing-footer {
  background: var(--bg); padding: 3rem; text-align: center;
  border-top: 1px solid var(--border);
}
.landing-footer p { color: var(--text-secondary); font-size: 0.85rem; }
.landing-footer a { color: var(--text-secondary); text-decoration: underline; }
.landing-footer a:hover { color: var(--primary); }

/* ═══ Legal Pages ═══ */
.legal-page {
  max-width: 800px; margin: 0 auto; padding: 3rem 2rem 4rem;
  color: var(--text); line-height: 1.7;
}
.legal-page h1 {
  font-size: 2rem; font-weight: 700; margin-bottom: 0.25rem;
  color: var(--text);
}
.legal-page .legal-updated {
  color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 2rem;
}
.legal-page h2 {
  font-size: 1.25rem; font-weight: 600; margin: 2rem 0 0.75rem;
  color: var(--text); border-bottom: 1px solid var(--border); padding-bottom: 0.5rem;
}
.legal-page h3 {
  font-size: 1.05rem; font-weight: 600; margin: 1.25rem 0 0.5rem;
  color: var(--text);
}
.legal-page p { margin: 0.75rem 0; }
.legal-page ul {
  margin: 0.75rem 0; padding-left: 1.5rem;
}
.legal-page ul li { margin: 0.4rem 0; }
.legal-page a { color: var(--primary); text-decoration: underline; }
.legal-page strong { color: var(--text); }

/* ═══ Responsive / Fluid Design ═══ */

/* Sidebar overlay on mobile */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 49; opacity: 0; transition: opacity 0.3s;
}
.sidebar-overlay.active { display: block; opacity: 1; }

/* ── Large Desktop (1400px+): no changes needed ── */

/* ── Desktop / small laptop ── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .page-content { padding: 1.5rem; }
}

/* ── Tablet landscape / small desktop ── */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid-full { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .pricing-includes-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Tablet portrait / large phone landscape ── */
@media (max-width: 768px) {
  /* Sidebar collapses to off-canvas */
  .sidebar { transform: translateX(-100%); width: 280px; }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex; }

  /* Header */
  .top-header { padding: 0 1rem; }
  .top-header h2 { font-size: 1rem; }

  /* Page content */
  .page-content { padding: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .page-header h1 { font-size: 1.25rem; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }

  /* Tables — horizontal scroll */
  .table-container { overflow: visible; }
  .table-container > div[style*="overflow-x"] { -webkit-overflow-scrolling: touch; }
  table { min-width: 600px; }
  th, td { padding: 0.5rem 0.75rem; font-size: 0.8rem; white-space: nowrap; }
  .table-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0.75rem 1rem; }
  .table-filters { width: 100%; }
  .table-filters .form-control { width: 100%; min-width: unset; }
  .table-filters input.form-control { min-width: unset; }
  .table-pagination { flex-direction: column; gap: 0.5rem; padding: 0.75rem 1rem; }

  /* Modal */
  .modal { max-width: 95vw; max-height: 85vh; margin: 0.5rem; }
  .modal-body { padding: 1rem; }
  .modal-footer { padding: 0.75rem 1rem; flex-wrap: wrap; }

  /* Cards */
  .card { padding: 1rem; }
  .card-header { margin-bottom: 0.75rem; padding-bottom: 0.5rem; }

  /* Landing page */
  .auth-hero { display: none; }
  .auth-form-section { padding: 1.5rem 1rem; }
  .hero-section h1 { font-size: 2rem; }
  .hero-section p { font-size: 1rem; }
  .hero-section { padding: 3rem 1.5rem 2.5rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .landing-nav { padding: 0.75rem 1rem; }
  .landing-nav .nav-links { display: none; }
  .features-section { padding: 2.5rem 1rem; }
  .features-section h2 { font-size: 1.5rem; margin-bottom: 2rem; }
  .cta-section { padding: 3rem 1.5rem; }
  .cta-section h2 { font-size: 1.5rem; }
  .landing-footer { padding: 2rem 1rem; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-includes-grid { grid-template-columns: 1fr 1fr; }
  .pricing-card { padding: 1.5rem; }
  .pricing-card.featured { transform: none; }

  /* Stat card compact */
  .stat-card { padding: 1rem; gap: 0.75rem; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-info .stat-value { font-size: 1.4rem; }

  /* Action buttons stack */
  .table-actions { flex-wrap: wrap; }
  .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
}

/* ── Phone portrait ── */
@media (max-width: 480px) {
  html { font-size: 15px; }
  .stats-grid { grid-template-columns: 1fr; gap: 0.75rem; }
  .stat-card { flex-direction: row; align-items: center; }
  .page-header h1 { font-size: 1.15rem; }

  /* Single column form rows even with 3 cols */
  .form-row { grid-template-columns: 1fr !important; }

  /* Auth */
  .auth-form-container h2 { font-size: 1.25rem; }
  .auth-form-section { padding: 1rem 0.75rem; }
  .auth-form-container { padding: 1.5rem; }

  /* Modal fills screen */
  .modal { max-width: 100vw; border-radius: var(--radius) var(--radius) 0 0; margin: 0; max-height: 90vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-header { padding: 1rem; }
  .modal-body { padding: 0.75rem 1rem; }
  .modal-footer { padding: 0.75rem 1rem; }

  /* Table */
  table { min-width: 500px; }
  th, td { padding: 0.4rem 0.5rem; font-size: 0.75rem; }

  /* Buttons */
  .btn { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
  .btn-lg { padding: 0.6rem 1.2rem; font-size: 0.9rem; }

  /* Toast */
  .toast-container { left: 0.5rem; right: 0.5rem; top: 0.5rem; }
  .toast { min-width: unset; width: 100%; }

  /* Landing */
  .hero-section h1 { font-size: 1.65rem; line-height: 1.3; }
  .features-grid { grid-template-columns: 1fr; }
}

/* ── Very small phones ── */
@media (max-width: 360px) {
  html { font-size: 14px; }
  .sidebar { width: 100%; }
  .page-content { padding: 0.75rem; }
  .card { padding: 0.75rem; }
}

/* ── Print styles ── */
@media print {
  .sidebar, .top-header, .mobile-menu-btn, .btn, .table-actions, .toast-container { display: none !important; }
  .main-content { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none; border: 1px solid #ddd; page-break-inside: avoid; }
  table { min-width: unset; }
}

/* ── Touch-friendly enhancements ── */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 44px; min-width: 44px; }
  .btn-sm { min-height: 36px; }
  .nav-item { padding: 0.75rem 1.5rem; }
  .form-control { padding: 0.7rem 0.75rem; font-size: 1rem; }
  select.form-control { padding: 0.7rem 0.75rem; }
  th.sortable { padding: 0.85rem 1rem; }
  .places-item { padding: 0.65rem 0.75rem !important; }
}

/* ══════════════════════════════════════
   Accessibility Enhancements
   ══════════════════════════════════════ */

/* Skip-to-main link (visible on keyboard focus) */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 10001;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-nav:focus {
  top: 0;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Focus-visible: clear outlines for keyboard users only */
*:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
*:focus:not(:focus-visible) {
  outline: none;
}

/* Modal focus trap visual indicator */
.modal-overlay[aria-modal="true"] {
  isolation: isolate;
}

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

/* ══════════════════════════════════════
   Dark Mode
   ══════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-white: #1e293b;
    --bg-card: #1e293b;
    --bg-dark: #0b1220;
    --bg-secondary: #1e293b;
    --bg-sidebar: #0b1220;
    --bg-sidebar-hover: #1e293b;

    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-light: #64748b;
    --text-primary: #f1f5f9;

    --surface-2: #334155;
    --card-bg: #1e293b;
    --border: #334155;
    --border-light: #1e293b;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2);

    --primary-light: #1e3a5f;
    --secondary-light: #134e4a;
    --success-bg: #14532d;
    --warning-bg: #78350f;
    --danger-bg: #7f1d1d;
    --info-bg: #1e3a5f;

    color-scheme: dark;
  }

  body {
    background-color: var(--bg);
    color: var(--text);
  }

  .form-control, select.form-control, textarea.form-control {
    background-color: var(--bg-dark);
    border-color: var(--border);
    color: var(--text);
  }

  .form-control:focus, select.form-control:focus, textarea.form-control:focus {
    border-color: var(--primary);
    background-color: var(--bg-dark);
  }

  input::placeholder, textarea::placeholder {
    color: var(--text-light);
  }

  .table-container { background: var(--bg-card); }
  table th { background: var(--bg-secondary); color: var(--text); }
  table td { border-bottom-color: var(--border); }
  table tr:hover td { background: var(--bg-secondary); }

  .modal-content { background: var(--bg-card); }
  .modal-overlay { background: rgba(0,0,0,0.7); }

  .badge { opacity: 0.9; }
  .auth-form-container { background: var(--bg-card); box-shadow: 0 4px 24px rgba(0,0,0,0.25); }
  .auth-hero { background: var(--bg-dark); }

  img, svg { opacity: 0.9; }
}

/* ═══════════════════════════════════════════════════
   Partner / Professionals Directory
   ═══════════════════════════════════════════════════ */

.professionals-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.professionals-hero {
  text-align: center;
  margin-bottom: 3rem;
}

.professionals-hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1rem;
}

.professionals-hero p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.7;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.partner-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.partner-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
  border-color: var(--primary);
}

.partner-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
}

.partner-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.partner-avatar--law {
  background: var(--success);
}

.partner-head-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.partner-head-text h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.partner-brokerage {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

.partner-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  width: fit-content;
}

.partner-badge--realtor {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
}

.partner-badge--lawyer {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
}

.partner-body {
  padding: 0 1.5rem 1.25rem;
  flex: 1;
}

.partner-body > p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.partner-services {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.partner-services li {
  font-size: 0.875rem;
  color: var(--text);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.4;
}

.partner-services li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
  font-size: 0.8rem;
}

.partner-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.partner-areas span {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--bg);
}

.partner-card-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.partner-card-footer .btn {
  width: 100%;
}

.partner-disclaimer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.partner-disclaimer strong {
  color: var(--text);
}

/* Consultation Modal */
.consult-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.consult-modal {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.consult-modal h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
  padding-right: 1.5rem;
}

.consult-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.consult-modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

/* Responsive: stack partner cards on mobile */
@media (max-width: 720px) {
  .partner-grid {
    grid-template-columns: 1fr;
  }

  .professionals-hero h1 {
    font-size: 1.75rem;
  }
}