/* ===================================================================
   EstateMap Shared Design System
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --navy:     #0d1117;
  --navy-2:   #161b22;
  --navy-3:   #21262d;
  --navy-4:   #30363d;
  --gold:     #d4a843;
  --gold-light: #f0c060;
  --gold-dark:  #b8902e;
  --white:    #ffffff;
  --white-80: rgba(255,255,255,0.8);
  --white-60: rgba(255,255,255,0.6);
  --white-40: rgba(255,255,255,0.4);
  --white-20: rgba(255,255,255,0.2);
  --white-10: rgba(255,255,255,0.1);
  --white-05: rgba(255,255,255,0.05);
  --green:    #2ea043;
  --green-light: #4ade80;
  --blue:     #1f6feb;
  --blue-light: #60a5fa;
  --red:      #f85149;
  --orange:   #e67e22;
  --orange-light: #fb923c;
  --yellow:   #f1c40f;
  --yellow-light: #facc15;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.6);
  --shadow-gold: 0 8px 24px rgba(212,168,67,0.3);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== RESET ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100vh;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--navy-2); }
::-webkit-scrollbar-thumb { background: var(--navy-4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

/* ===== PAGE HEADER ===== */
.page-header {
  background: var(--navy);
  border-bottom: 1px solid var(--navy-3);
  padding: 0 28px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  gap: 16px;
}

.page-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.page-header-logo img { height: 32px; width: auto; object-fit: contain; }

.logo-text {
  font-family: 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}

.logo-highlight { color: var(--gold); }

.page-header-left  { display: flex; align-items: center; gap: 14px; }
.page-header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.header-page-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--white-60);
  letter-spacing: 0.1px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-gold {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-light);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-outline-gold {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold-dark);
}
.btn-outline-gold:hover {
  background: rgba(212,168,67,0.1);
  border-color: var(--gold);
}

.btn-ghost {
  background: var(--navy-2);
  color: var(--white);
  border-color: var(--navy-4);
}
.btn-ghost:hover {
  background: var(--navy-3);
  border-color: var(--white-20);
}

.btn-danger {
  background: rgba(248,81,73,0.08);
  color: var(--red);
  border-color: rgba(248,81,73,0.2);
}
.btn-danger:hover { background: rgba(248,81,73,0.18); }

.btn-success {
  background: rgba(46,160,67,0.08);
  color: var(--green-light);
  border-color: rgba(46,160,67,0.25);
}
.btn-success:hover { background: rgba(46,160,67,0.18); }

.btn-back {
  background: var(--navy-2);
  color: var(--white-60);
  border-color: var(--navy-4);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
}
.btn-back:hover {
  background: var(--navy-3);
  color: var(--white);
  border-color: var(--white-20);
}

.btn-sm  { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); gap: 5px; }
.btn-lg  { padding: 13px 28px; font-size: 15px; font-weight: 700; border-radius: var(--radius-lg); gap: 9px; }
.btn-full { width: 100%; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-rent     { background: rgba(46,160,67,0.12);  color: #4ade80; border-color: rgba(46,160,67,0.3); }
.badge-sale     { background: rgba(31,111,235,0.12); color: #60a5fa; border-color: rgba(31,111,235,0.3); }
.badge-pending  { background: rgba(241,196,15,0.12); color: #facc15; border-color: rgba(241,196,15,0.3); }
.badge-approved { background: rgba(46,160,67,0.12);  color: #4ade80; border-color: rgba(46,160,67,0.3); }
.badge-rejected { background: rgba(248,81,73,0.12);  color: var(--red); border-color: rgba(248,81,73,0.3); }
.badge-reported { background: rgba(230,126,34,0.12); color: #fb923c; border-color: rgba(230,126,34,0.3); }
.badge-gold     { background: rgba(212,168,67,0.12); color: var(--gold); border-color: rgba(212,168,67,0.3); }
.badge-blue     { background: rgba(31,111,235,0.12); color: #60a5fa; border-color: rgba(31,111,235,0.3); }

/* ===== CARDS ===== */
.card {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.card-hover:hover {
  border-color: var(--gold-dark);
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--navy-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header-icon {
  width: 36px;
  height: 36px;
  background: rgba(212,168,67,0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

.card-action {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-action:hover { color: var(--gold-light); }

.card-body { padding: 20px 22px; }

/* ===== STATS ===== */
.stats-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.stats-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }

.stat-card {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(212,168,67,0.2);
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 5px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.stat-label {
  font-size: 11px;
  color: var(--white-40);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ===== TABS ===== */
.tabs-bar {
  display: flex;
  gap: 6px;
}

.tab-btn {
  padding: 9px 18px;
  background: var(--navy-2);
  color: var(--white-60);
  border: 1px solid var(--navy-3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
}
.tab-btn:hover { background: var(--navy-3); color: var(--white); }
.tab-btn.active {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

/* ===== FORM ELEMENTS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--white-60);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-control {
  background: var(--navy-3);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--white);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
  width: 100%;
}
.form-control:focus {
  border-color: var(--gold);
  background: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.1);
}
.form-control::placeholder { color: var(--white-40); }
.form-control:disabled { opacity: 0.5; cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { appearance: none; cursor: pointer; }
select.form-control option { background: var(--navy-2); color: var(--white); }

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--navy-4);
  border-radius: 26px;
  transition: var(--transition);
}
.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: var(--white-60);
  border-radius: 50%;
  transition: var(--transition);
}
input:checked + .toggle-slider { background: var(--gold); }
input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--navy); }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(6px);
}
.modal-overlay.active { display: flex; animation: em-fade-in 0.18s ease; }

@keyframes em-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes em-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal {
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  border-radius: var(--radius-xl);
  width: 480px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: em-modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal::-webkit-scrollbar { width: 4px; }
.modal::-webkit-scrollbar-thumb { background: var(--navy-4); border-radius: 4px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--navy-3);
}
.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
}
.modal-close {
  background: var(--navy-3);
  color: var(--white-60);
  border: none;
  border-radius: 50%;
  width: 30px; height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--red); color: white; }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  padding: 16px 24px 20px;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--navy-3);
}

/* ===== TOAST ===== */
#toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--navy-2);
  border: 1px solid var(--navy-4);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
}
#toast.active { transform: translateY(0); opacity: 1; }
#toast.success { border-color: var(--green); }
#toast.error   { border-color: var(--red); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--white-40);
}
.empty-icon {
  width: 56px; height: 56px;
  background: var(--navy-3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--white-40);
}
.empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--white-60);
  margin-bottom: 8px;
}
.empty-desc { font-size: 13px; margin-bottom: 20px; line-height: 1.6; }

/* ===== LOADING ===== */
.loading-wrap {
  text-align: center;
  padding: 80px 20px;
  color: var(--white-40);
  font-size: 14px;
}
.spinner {
  width: 30px; height: 30px;
  border: 2px solid var(--navy-4);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: em-spin 0.7s linear infinite;
  margin: 0 auto 14px;
}
@keyframes em-spin { to { transform: rotate(360deg); } }

/* ===== PAGE WRAPPER ===== */
.page-wrap { max-width: 960px; margin: 36px auto; padding: 0 24px 60px; }
.page-wrap-wide { max-width: 1120px; margin: 0 auto; padding: 0 28px; }

/* ===== WELCOME BAND ===== */
.welcome-band {
  padding: 26px 28px;
  border-bottom: 1px solid var(--navy-3);
  background: var(--navy-2);
}
.welcome-band h1 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}
.welcome-band p { font-size: 13px; color: var(--white-40); }

/* ===== DIVIDER ===== */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--white-40);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--navy-4);
}

/* ===== SECTION HEADING ===== */
.section-heading {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}
.section-sub {
  font-size: 13px;
  color: var(--white-40);
  margin-bottom: 20px;
}

/* ===== LISTING CARD (Dashboard / Admin) ===== */
.listing-card {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: var(--transition);
}
.listing-card:hover {
  border-color: rgba(212,168,67,0.2);
  background: var(--navy-3);
}

.listing-card-info { flex: 1; min-width: 0; }
.listing-card-title { font-size: 14px; font-weight: 600; color: var(--white); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listing-card-price { font-size: 16px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.listing-card-meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.listing-card-meta-item { font-size: 12px; color: var(--white-40); display: flex; align-items: center; gap: 4px; }
.listing-card-meta-item strong { color: var(--white-60); font-weight: 500; }

.listing-card-actions { display: flex; gap: 7px; flex-shrink: 0; }

/* ===== MESSAGE CARD ===== */
.message-card {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: var(--transition);
}
.message-card.unread {
  border-color: rgba(212,168,67,0.25);
  background: rgba(212,168,67,0.03);
}
.message-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.message-sender { font-size: 14px; font-weight: 600; color: var(--white); display: flex; align-items: center; gap: 8px; }
.message-date   { font-size: 11px; color: var(--white-40); }
.message-prop   { font-size: 12px; color: var(--gold); margin-bottom: 8px; font-weight: 500; }
.message-text   { font-size: 13px; color: var(--white-60); line-height: 1.7; }
.message-email  { font-size: 12px; color: var(--white-40); margin-top: 8px; }
.unread-dot { width: 7px; height: 7px; background: var(--gold); border-radius: 50%; flex-shrink: 0; }

/* ===== SETTINGS CARD ===== */
.settings-card {
  background: var(--navy-2);
  border: 1px solid var(--navy-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.settings-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--navy-3);
  display: flex;
  align-items: center;
  gap: 14px;
}
.settings-card-header-icon {
  width: 38px; height: 38px;
  background: rgba(212,168,67,0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.settings-card-header-text h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 2px;
}
.settings-card-header-text p { font-size: 12px; color: var(--white-40); }

.settings-item {
  padding: 17px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--navy-3);
  transition: background 0.2s ease;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--white-05); }

.settings-item-left { flex: 1; }
.settings-item-label { font-size: 14px; font-weight: 500; color: var(--white); margin-bottom: 3px; }
.settings-item-desc  { font-size: 12px; color: var(--white-40); line-height: 1.5; }

/* ===== GOOGLE BUTTON ===== */
.btn-google {
  background: white;
  color: #1a1a2e;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--radius-md);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.btn-google:hover { background: #f5f5f5; transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ===== AUTH ===== */
.auth-error, .auth-success {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: none;
  line-height: 1.5;
}
.auth-error.active, .auth-success.active { display: block; }
.auth-error   { background: rgba(248,81,73,0.1); border: 1px solid rgba(248,81,73,0.3); color: #fca5a5; }
.auth-success { background: rgba(46,160,67,0.1); border: 1px solid rgba(46,160,67,0.3); color: #86efac; }

/* ===== COLOR SWATCH PICKER ===== */
.color-options { display: flex; gap: 10px; flex-wrap: wrap; }
.color-option {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition);
}
.color-option:hover { transform: scale(1.15); }
.color-option.active { border-color: var(--white); transform: scale(1.15); }

/* ===== LIGHT MODE ===== */
body.light-mode {
  --navy:     #f6f8fa;
  --navy-2:   #ffffff;
  --navy-3:   #f0f2f5;
  --navy-4:   #d0d7de;
  --white:    #1a1a2e;
  --white-80: rgba(26,26,46,0.8);
  --white-60: rgba(26,26,46,0.6);
  --white-40: rgba(26,26,46,0.4);
  --white-20: rgba(26,26,46,0.2);
  --white-10: rgba(26,26,46,0.1);
  --white-05: rgba(26,26,46,0.05);
}
