:root {
  --cream: #FAF6F0;
  --cream-dark: #F0EAE0;
  --gold: #B8860B;
  --gold-light: #D4A843;
  --gold-dark: #8B6508;
  --plum: #6B4C9A;
  --plum-light: #8B6FBB;
  --plum-dark: #4E3574;
  --white: #FFFFFF;
  --text-primary: #2D2A26;
  --text-secondary: #5C574F;
  --text-muted: #8C8680;
  --border: #E5DDD3;
  --border-light: #EDE7DD;
  --success: #4CAF50;
  --warning: #FF9800;
  --danger: #E53935;
  --info: #2196F3;
  --shadow-sm: 0 1px 3px rgba(45,42,38,0.06);
  --shadow-md: 0 4px 12px rgba(45,42,38,0.08);
  --shadow-lg: 0 8px 24px rgba(45,42,38,0.12);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; font-weight: 700; line-height: 1.2; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-dark); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

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

.btn-secondary {
  background: var(--plum);
  color: white;
}
.btn-secondary:hover { background: var(--plum-dark); }

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1.5px solid var(--gold);
}
.btn-outline:hover { background: var(--gold); color: white; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--cream-dark); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #C62828; }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.input-group { margin-bottom: 16px; }
.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: var(--white);
  color: var(--text-primary);
  transition: border-color 0.2s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
input::placeholder { color: var(--text-muted); }

.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card-hover { transition: box-shadow 0.2s, transform 0.2s; }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

/* NAV */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 16px;
}
.nav-brand-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.nav-brand-text span { color: var(--gold); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  border: none;
  background: none;
  font-family: 'Inter', sans-serif;
}
.nav-link:hover { color: var(--text-primary); background: var(--cream); }
.nav-link.active { color: var(--gold); background: rgba(184,134,11,0.08); }
.nav-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* LAYOUT */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.page-title { font-size: 28px; color: var(--text-primary); }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }

/* LANDING */
.landing-hero {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
  padding: 48px 24px;
}
.hero-content {
  max-width: 640px;
  text-align: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: rgba(107,76,154,0.1);
  color: var(--plum);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
}
.hero-title {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.hero-title span { color: var(--gold); }
.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.hero-feature {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--border-light);
  text-align: left;
}
.hero-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}
.hero-feature h4 { font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.hero-feature p { font-size: 13px; color: var(--text-muted); }

/* AUTH */
.auth-container {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
}
.auth-card h2 { text-align: center; margin-bottom: 8px; font-size: 24px; }
.auth-card .subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.auth-toggle { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.auth-toggle a { cursor: pointer; font-weight: 500; }

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Playfair Display', serif;
}
.stat-value.gold { color: var(--gold); }
.stat-value.plum { color: var(--plum); }

/* PROPERTY CARD */
.property-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.property-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.property-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.property-icon {
  width: 42px;
  height: 42px;
  background: rgba(184,134,11,0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.property-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 2px;
}
.property-address {
  font-size: 13px;
  color: var(--text-muted);
}
.property-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.property-meta-item {
  font-size: 12px;
  color: var(--text-muted);
}
.property-meta-item strong {
  color: var(--text-secondary);
}

/* COMPLAINT LIST */
.complaint-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.complaint-row:hover { background: var(--cream); }
.complaint-row:last-child { border-bottom: none; }
.complaint-source {
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.complaint-source.dob { background: rgba(184,134,11,0.12); color: var(--gold-dark); }
.complaint-source.hpd { background: rgba(107,76,154,0.12); color: var(--plum); }
.complaint-info { flex: 1; min-width: 0; }
.complaint-number { font-weight: 600; font-size: 14px; }
.complaint-link { color: var(--primary); text-decoration: none; transition: color 0.2s; }
.complaint-link:hover { color: var(--accent); text-decoration: underline; }
.complaint-desc { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.complaint-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
  background: var(--cream-dark);
  color: var(--text-secondary);
}
.complaint-date { font-size: 12px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }

/* NOTIFICATIONS */
.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
  cursor: pointer;
}
.notification-item:hover { background: var(--cream); }
.notification-item.unread { background: rgba(184,134,11,0.04); }
.notification-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  margin-top: 6px;
}
.notification-dot.read { background: transparent; }
.notification-content { flex: 1; }
.notification-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.notification-message { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.notification-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45,42,38,0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { font-size: 18px; }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: background 0.15s;
}
.modal-close:hover { background: var(--cream); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ADDRESS RESULTS */
.address-results {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  margin-top: 8px;
}
.address-result {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.address-result:hover { background: var(--cream); }
.address-result:last-child { border-bottom: none; }
.address-result-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* BANNER AD */
.ad-banner {
  background: linear-gradient(135deg, var(--plum) 0%, #4a2d73 50%, var(--plum-dark) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  transition: opacity 0.4s ease, transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(107,76,154,0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.ad-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.ad-badge {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.5;
}
.ad-brand {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.7;
  margin-bottom: 6px;
  font-weight: 600;
}
.ad-headline {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}
.ad-desc { font-size: 15px; opacity: 0.9; line-height: 1.5; margin-bottom: 8px; }
.ad-contact { font-size: 14px; opacity: 0.8; margin-top: 4px; }
.ad-contact strong { opacity: 1; }
.ad-cta { flex-shrink: 0; }
.ad-cta .btn, .ad-cta-btn {
  background: var(--gold) !important;
  color: white !important;
  font-size: 16px;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: background 0.2s, transform 0.2s;
  box-shadow: 0 2px 10px rgba(184,134,11,0.3);
}
.ad-cta .btn:hover, .ad-cta-btn:hover {
  background: var(--gold-dark) !important;
  transform: translateY(-1px);
}
.ad-fade-out { opacity: 0.3; }

@keyframes adHeartbeat {
  0%, 100% { transform: scale(1); }
  4% { transform: scale(1.015); }
  8% { transform: scale(1); }
  12% { transform: scale(1.02); }
  16% { transform: scale(1); }
}
.ad-heartbeat {
  animation: adHeartbeat 4s ease-in-out infinite;
}

/* FOOTER AD */
.footer-banner {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  margin-top: 48px;
}
.footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--plum);
  margin-bottom: 4px;
}
.footer-details { font-size: 13px; color: var(--text-muted); }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 14px;
  max-width: 360px;
  margin: 0 auto 20px;
}

/* LOADING */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px;
  color: var(--text-muted);
  font-size: 14px;
}

/* TOAST */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast-msg { flex: 1; font-size: 14px; }

/* TABS */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Inter', sans-serif;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* MOBILE NAV */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 8px 0 env(safe-area-inset-bottom, 8px);
}
.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  font-family: 'Inter', sans-serif;
  position: relative;
}
.mobile-nav-item.active { color: var(--gold); }
.mobile-nav-item svg { width: 22px; height: 22px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-nav { display: block; }
  .container { padding: 16px; padding-bottom: 80px; }
  .hero-title { font-size: 32px; }
  .hero-desc { font-size: 16px; }
  .page-title { font-size: 22px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .ad-banner { flex-direction: column; text-align: center; padding: 24px 20px; }
  .ad-headline { font-size: 20px; }
  .ad-desc { font-size: 14px; }
  .complaint-row { flex-wrap: wrap; }
  .complaint-date { width: 100%; }
}

@media (max-width: 480px) {
  .hero-features { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
}
