/* ============================================================
   uPlace — Up Place. Your Place.
   Design System & Main CSS
   Version: 1.0.0
   ============================================================ */

/* ── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --color-primary:        #1B4FFF;
  --color-primary-dark:   #1340CC;
  --color-primary-light:  #4D74FF;
  --color-primary-bg:     #EEF2FF;

  /* Neutrals */
  --color-dark:           #0F1117;
  --color-dark-2:         #1A1E2E;
  --color-gray-900:       #111827;
  --color-gray-800:       #1F2937;
  --color-gray-700:       #374151;
  --color-gray-600:       #4B5563;
  --color-gray-500:       #6B7280;
  --color-gray-400:       #9CA3AF;
  --color-gray-300:       #D1D5DB;
  --color-gray-200:       #E5E7EB;
  --color-gray-100:       #F3F4F6;
  --color-gray-50:        #F9FAFB;
  --color-white:          #FFFFFF;

  /* Semantic */
  --color-success:        #10B981;
  --color-success-bg:     #ECFDF5;
  --color-warning:        #F59E0B;
  --color-warning-bg:     #FFFBEB;
  --color-danger:         #EF4444;
  --color-danger-bg:      #FEF2F2;
  --color-info:           #3B82F6;
  --color-info-bg:        #EFF6FF;

  /* Badge Colors */
  --color-sale:           #10B981;
  --color-rent:           #3B82F6;
  --color-featured:       #F59E0B;
  --color-new:            #8B5CF6;

  /* Typography */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Poppins', var(--font-sans);

  /* Font Sizes */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Font Weights */
  --fw-normal:   400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extrabold:800;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  20px;
  --radius-3xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,.1), 0 10px 10px rgba(0,0,0,.04);
  --shadow-2xl:0 25px 50px rgba(0,0,0,.25);

  /* Layout */
  --header-height:   68px;
  --sidebar-width:   260px;
  --container-max:   1280px;
  --container-pad:   clamp(1rem, 4vw, 2rem);
}

/* ── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-gray-800);
  background: var(--color-gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-primary); text-decoration: none; transition: color 150ms; }
a:hover { color: var(--color-primary-dark); }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea, button { font-family: inherit; }

/* ── CONTAINER ─────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* ── HEADER ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-4);
}

/* ── LOGO ──────────────────────────────────────────────────── */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-extrabold);
  letter-spacing: -1px;
  box-shadow: 0 4px 12px rgba(27,79,255,.35);
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--color-dark);
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--color-primary);
}

/* ── MAIN NAV ──────────────────────────────────────────────── */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--color-gray-700);
  transition: all 150ms;
  text-decoration: none;
}

.nav-link:hover { background: var(--color-gray-100); color: var(--color-dark); }
.nav-link.active { color: var(--color-primary); background: var(--color-primary-bg); }

.nav-link-sell {
  background: var(--color-primary-bg);
  color: var(--color-primary) !important;
  font-weight: var(--fw-semibold);
  border: 1.5px solid rgba(27,79,255,.2);
}

.nav-link-sell:hover {
  background: var(--color-primary);
  color: white !important;
  border-color: var(--color-primary);
}

/* ── HEADER ACTIONS ────────────────────────────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ── SWITCHERS (Lang / Currency) ───────────────────────────── */
.lang-switcher, .currency-switcher { position: relative; }

.switcher-btn {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: none;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--color-gray-700);
  cursor: pointer;
  transition: all 150ms;
  white-space: nowrap;
}

.switcher-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }

.switcher-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--color-white);
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: 200;
  animation: dropdownIn 150ms ease;
}

.switcher-dropdown.open { display: block; }

.switcher-dropdown a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-gray-700);
  transition: background 100ms;
  text-decoration: none;
}

.switcher-dropdown a:hover { background: var(--color-gray-100); }
.switcher-dropdown a.active { color: var(--color-primary); font-weight: var(--fw-semibold); background: var(--color-primary-bg); }

/* ── USER MENU ─────────────────────────────────────────────── */
.user-menu { position: relative; }

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--color-white);
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  z-index: 200;
  animation: dropdownIn 150ms ease;
}

.user-dropdown.open { display: block; }

.user-dropdown-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
  background: var(--color-gray-50);
}

.user-name { font-weight: var(--fw-semibold); color: var(--color-dark); font-size: var(--text-sm); }
.user-email { font-size: var(--text-xs); color: var(--color-gray-500); margin-top: 2px; }

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-gray-700);
  transition: background 100ms;
  text-decoration: none;
}

.user-dropdown a:hover { background: var(--color-gray-100); }
.user-dropdown a.danger { color: var(--color-danger); }
.user-dropdown a.danger:hover { background: var(--color-danger-bg); }

.divider { height: 1px; background: var(--color-gray-100); margin: var(--space-1) 0; }

/* ── MOBILE MENU BUTTON ────────────────────────────────────── */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: var(--space-2);
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-gray-700);
  border-radius: 2px;
  transition: all 200ms;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
  .main-nav { display: none; }
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  line-height: 1;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 200ms;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

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

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(27,79,255,.3);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
  box-shadow: 0 4px 12px rgba(27,79,255,.4);
  transform: translateY(-1px);
}

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

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: white; }

.btn-ghost {
  background: transparent;
  color: var(--color-gray-700);
  border-color: var(--color-gray-200);
}
.btn-ghost:hover { background: var(--color-gray-100); color: var(--color-dark); }

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

.btn-sm { padding: 7px 14px; font-size: var(--text-xs); border-radius: var(--radius-md); }
.btn-lg { padding: 14px 28px; font-size: var(--text-base); border-radius: var(--radius-xl); }
.btn-full { width: 100%; }

/* ── HERO SECTION ──────────────────────────────────────────── */
.hero {
  background: linear-gradient(160deg, var(--color-dark) 0%, var(--color-dark-2) 60%, #1a2a6c 100%);
  padding: var(--space-20) 0 var(--space-16);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(27,79,255,.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(77,116,255,.1) 0%, transparent 50%);
}

.hero-content { position: relative; z-index: 1; max-width: 720px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(27,79,255,.2);
  border: 1px solid rgba(27,79,255,.4);
  border-radius: var(--radius-full);
  color: #93BBFF;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: var(--space-6);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: var(--fw-extrabold);
  color: white;
  line-height: 1.15;
  margin-bottom: var(--space-5);
  letter-spacing: -1px;
}

.hero-title .highlight {
  background: linear-gradient(135deg, #4D74FF 0%, #93BBFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: rgba(255,255,255,.7);
  margin-bottom: var(--space-8);
  max-width: 540px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  gap: var(--space-8);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

.hero-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: white;
}

.hero-stat-label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,.5);
  margin-top: 2px;
}

/* ── SEARCH BOX ────────────────────────────────────────────── */
.search-box {
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  max-width: 680px;
}

.search-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-gray-200);
  padding: var(--space-2) var(--space-4) 0;
  gap: var(--space-1);
}

.search-tab {
  padding: var(--space-3) var(--space-5);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-500);
  cursor: pointer;
  transition: all 150ms;
  margin-bottom: -1px;
}

.search-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.search-form {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-dark);
  background: var(--color-gray-50);
  transition: all 150ms;
  outline: none;
}

.search-input:focus {
  border-color: var(--color-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(27,79,255,.1);
}

.search-select {
  padding: 12px 14px;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-dark);
  background: var(--color-gray-50);
  cursor: pointer;
  outline: none;
  min-width: 140px;
  transition: border-color 150ms;
}

.search-select:focus { border-color: var(--color-primary); }

.search-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 24px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: all 200ms;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(27,79,255,.3);
}

.search-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27,79,255,.4);
}

.search-advanced-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 150ms;
}

.search-advanced-link:hover { color: var(--color-primary); }

/* ── PROPERTY CARDS ────────────────────────────────────────── */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.property-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1.5px solid var(--color-gray-200);
  transition: all 250ms;
  position: relative;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-gray-300);
}

.property-card-image {
  display: block;
  position: relative;
  overflow: hidden;
  height: 200px;
  background: var(--color-gray-200);
}

.property-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
}

.property-card:hover .property-card-image img { transform: scale(1.04); }

.property-card-badges {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.property-card-fav {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 34px;
  height: 34px;
  background: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all 200ms;
  color: var(--color-gray-400);
}

.property-card-fav:hover, .property-card-fav.active { color: var(--color-danger); }
.property-card-fav.active svg { fill: var(--color-danger); }

.property-card-body { padding: var(--space-4); }

.property-price {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.property-price .period {
  font-size: var(--text-xs);
  font-weight: var(--fw-normal);
  color: var(--color-gray-500);
  font-family: var(--font-sans);
}

.property-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-dark);
  margin-bottom: var(--space-2);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.property-location {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  margin-bottom: var(--space-3);
}

.property-specs {
  display: flex;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-gray-100);
}

.property-spec {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-gray-600);
  font-weight: var(--fw-medium);
}

/* ── BADGES ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  line-height: 1;
  white-space: nowrap;
}

.badge-sale     { background: rgba(16,185,129,.15); color: #059669; }
.badge-rent     { background: rgba(59,130,246,.15); color: #2563EB; }
.badge-featured { background: rgba(245,158,11,.15); color: #D97706; }
.badge-new      { background: rgba(139,92,246,.15); color: #7C3AED; }
.badge-sold     { background: rgba(107,114,128,.15); color: #4B5563; }
.badge-count    {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--color-danger);
  color: white;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--fw-bold);
}

/* ── SECTIONS ──────────────────────────────────────────────── */
.section { padding: var(--space-16) 0; }
.section-sm { padding: var(--space-10) 0; }
.bg-white { background: var(--color-white); }

.section-header { margin-bottom: var(--space-8); }
.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-2);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--color-dark);
  letter-spacing: -0.5px;
}

/* ── FORMS ─────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-5); }

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-gray-700);
  margin-bottom: var(--space-2);
}

.form-label .required { color: var(--color-danger); }

.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-gray-300);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--color-dark);
  background: var(--color-white);
  transition: all 150ms;
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(27,79,255,.1);
}

.form-control.error { border-color: var(--color-danger); }
.form-control::placeholder { color: var(--color-gray-400); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea.form-control { resize: vertical; min-height: 100px; line-height: 1.6; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

@media (max-width: 640px) {
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

.form-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-gray-500);
  margin-top: var(--space-1);
}

.form-error {
  display: none;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-danger);
  margin-top: var(--space-1);
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.form-check-label { font-size: var(--text-sm); color: var(--color-gray-700); }

/* ── ALERTS ────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  border: 1px solid transparent;
}

.alert-success { background: var(--color-success-bg); color: #065F46; border-color: rgba(16,185,129,.2); }
.alert-danger  { background: var(--color-danger-bg);  color: #991B1B; border-color: rgba(239,68,68,.2); }
.alert-warning { background: var(--color-warning-bg); color: #92400E; border-color: rgba(245,158,11,.2); }
.alert-info    { background: var(--color-info-bg);    color: #1E40AF; border-color: rgba(59,130,246,.2); }

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--color-gray-200);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-gray-100);
}

.card-title {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--color-dark);
}

.card-body { padding: var(--space-6); }

/* ── TABLES ────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-xl);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table thead tr { background: var(--color-gray-50); }
.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--fw-semibold);
  color: var(--color-gray-600);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-gray-200);
}

.table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-gray-100);
  color: var(--color-gray-700);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--color-gray-50); }

/* ── PAGINATION ────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1.5px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--color-gray-700);
  text-decoration: none;
  transition: all 150ms;
  background: white;
}

.page-item:hover { border-color: var(--color-primary); color: var(--color-primary); }
.page-item.active { background: var(--color-primary); border-color: var(--color-primary); color: white; }
.page-item.disabled { opacity: .5; cursor: default; }

/* ── FILTER SIDEBAR ────────────────────────────────────────── */
.filter-sidebar {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--color-gray-200);
  padding: var(--space-5);
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
}

.filter-section { margin-bottom: var(--space-5); padding-bottom: var(--space-5); border-bottom: 1px solid var(--color-gray-100); }
.filter-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.filter-title { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--color-dark); margin-bottom: var(--space-3); }

/* ── UPLOAD ZONE ───────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--color-gray-300);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  text-align: center;
  cursor: pointer;
  transition: all 200ms;
  background: var(--color-gray-50);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.upload-preview-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 1;
}

.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }

.upload-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,.6);
  border: none;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ── ADMIN LAYOUT ──────────────────────────────────────────── */
.admin-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--header-height));
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

.admin-sidebar {
  background: var(--color-white);
  border-right: 1px solid var(--color-gray-200);
  padding: var(--space-6) var(--space-4);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  overflow-y: auto;
}

.admin-content {
  padding: var(--space-8);
  background: var(--color-gray-50);
  min-height: calc(100vh - var(--header-height));
}

.admin-nav-section { margin-bottom: var(--space-6); }

.admin-nav-label {
  font-size: 10px;
  font-weight: var(--fw-bold);
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--color-gray-600);
  text-decoration: none;
  transition: all 150ms;
  margin-bottom: 2px;
  justify-content: space-between;
}

.admin-nav-link > *:first-child { display: flex; align-items: center; gap: var(--space-3); }
.admin-nav-link:hover { background: var(--color-gray-100); color: var(--color-dark); }
.admin-nav-link.active { background: var(--color-primary-bg); color: var(--color-primary); font-weight: var(--fw-semibold); }

/* ── STAT CARDS ────────────────────────────────────────────── */
.stat-card {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--color-gray-200);
  padding: var(--space-5);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  transition: box-shadow 200ms;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(59,130,246,.1);  color: #2563EB; }
.stat-icon.green  { background: rgba(16,185,129,.1);  color: #059669; }
.stat-icon.orange { background: rgba(245,158,11,.1);  color: #D97706; }
.stat-icon.red    { background: rgba(239,68,68,.1);   color: #DC2626; }
.stat-icon.purple { background: rgba(139,92,246,.1);  color: #7C3AED; }

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: var(--color-dark);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label { font-size: var(--text-xs); color: var(--color-gray-500); font-weight: var(--fw-medium); }

.stat-change {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  margin-top: var(--space-2);
}

.stat-change.up { color: var(--color-success); }
.stat-change.down { color: var(--color-danger); }

/* ── FOOTER ────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-dark);
  color: rgba(255,255,255,.7);
  padding: var(--space-16) 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-12);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand .site-logo .logo-text { color: white; }
.footer-brand .site-logo .logo-text span { color: #4D74FF; }

.footer-tagline {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.4);
  margin: var(--space-3) 0;
  font-style: italic;
}

.footer-desc {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.5);
  line-height: 1.7;
  margin-bottom: var(--space-5);
}

.footer-social {
  display: flex;
  gap: var(--space-3);
}

.footer-social a {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  transition: all 200ms;
}

.footer-social a:hover { background: var(--color-primary); color: white; }

.footer-col-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: white;
  margin-bottom: var(--space-4);
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: var(--space-3); }
.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.5);
  text-decoration: none;
  transition: color 150ms;
}
.footer-links a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: var(--space-5) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: rgba(255,255,255,.3);
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ── TOAST NOTIFICATIONS ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-dark);
  color: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  max-width: 360px;
  pointer-events: all;
  animation: toastIn 300ms cubic-bezier(.34,1.56,.64,1) forwards;
}

.toast.success { background: var(--color-success); }
.toast.error   { background: var(--color-danger); }
.toast.warning { background: var(--color-warning); color: var(--color-dark); }

/* ── ANIMATIONS ────────────────────────────────────────────── */
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── UTILITIES ─────────────────────────────────────────────── */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: var(--space-12) 0 var(--space-10); }
  .hero-title { font-size: var(--text-3xl); }
  .search-form { flex-direction: column; }
  .search-select { width: 100%; }
  .properties-grid { grid-template-columns: 1fr; }
  .admin-content { padding: var(--space-4); }
}
