/* ─────────────────────────────────────────────────────────────
   LA MARÉ — Bay Harbor Islands
   Investor Portal — Main Stylesheet
   Palette: navy-carbon bg + champagne gold accent + white copy
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Jost:wght@300;400;500;600&display=swap');

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

:root {
  --navy:      #0E1B2A;
  --navy-mid:  #142233;
  --navy-card: #1A2D42;
  --navy-line: #243C56;
  --gold:      #C9A96A;
  --gold-lt:   #DFC08F;
  --gold-dk:   #A8854E;
  --white:     #FFFFFF;
  --off-white: #F0EBE3;
  --muted:     #8BA4BC;
  --available: #4CAF7A;
  --reserved:  #E8A94D;
  --sold:      #6B7A8D;

  --serif: 'Cormorant Garamond', 'Georgia', serif;
  --sans:  'Jost', 'Helvetica Neue', sans-serif;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 16px rgba(0,0,0,0.3);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  background-color: var(--navy);
  color: var(--off-white);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  color: var(--white);
}
h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.6rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }

p { font-size: 0.95rem; color: var(--muted); }

.label {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── Layout ────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.page-wrapper {
  padding-top: 80px;
  min-height: 100vh;
}

/* ── Nav / Header ──────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(14, 27, 42, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--navy-line);
  height: 72px;
  display: flex;
  align-items: center;
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}
.nav__brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav__brand-main {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--white);
  line-height: 1;
}
.nav__brand-sub {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}
.nav__links a {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav__links a:hover { color: var(--gold); }
.nav__user {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav__user-name {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
}
.btn-primary:hover {
  background: var(--gold-lt);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,169,106,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold);
}
.btn-outline:hover {
  background: rgba(201,169,106,0.08);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--navy-line);
}
.btn-ghost:hover {
  color: var(--white);
  border-color: var(--muted);
}

.btn-danger {
  background: rgba(220, 80, 80, 0.12);
  color: #E07070;
  border: 1px solid rgba(220,80,80,0.3);
}
.btn-danger:hover {
  background: rgba(220, 80, 80, 0.2);
}

.btn-success {
  background: rgba(76,175,122,0.12);
  color: var(--available);
  border: 1px solid rgba(76,175,122,0.3);
}
.btn-success:hover {
  background: rgba(76,175,122,0.2);
}

.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.72rem; }
.btn-lg { padding: 1rem 2.8rem; font-size: 0.88rem; }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* ── Status Badges ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.8rem;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 20px;
}
.badge-available {
  background: rgba(76,175,122,0.15);
  color: var(--available);
  border: 1px solid rgba(76,175,122,0.3);
}
.badge-reserved {
  background: rgba(232,169,77,0.15);
  color: var(--reserved);
  border: 1px solid rgba(232,169,77,0.3);
}
.badge-sold {
  background: rgba(107,122,141,0.15);
  color: var(--sold);
  border: 1px solid rgba(107,122,141,0.3);
}
.badge-pending {
  background: rgba(232,169,77,0.1);
  color: var(--reserved);
  border: 1px solid rgba(232,169,77,0.25);
}
.badge-confirmed {
  background: rgba(76,175,122,0.1);
  color: var(--available);
  border: 1px solid rgba(76,175,122,0.25);
}
.badge-released {
  background: rgba(107,122,141,0.1);
  color: var(--sold);
  border: 1px solid rgba(107,122,141,0.25);
}
.badge-hot  { background: rgba(220,80,80,0.12);  color: #E07070; border: 1px solid rgba(220,80,80,0.3); }
.badge-warm { background: rgba(232,169,77,0.12); color: var(--reserved); border: 1px solid rgba(232,169,77,0.25); }
.badge-cold { background: rgba(139,164,188,0.1); color: var(--muted); border: 1px solid rgba(139,164,188,0.2); }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--navy-line);
  margin: 2rem 0;
}

.gold-line {
  width: 48px;
  height: 1px;
  background: var(--gold);
  margin: 1rem 0 1.5rem;
}

/* ── Section titles ────────────────────────────────────────── */
.section-title {
  margin-bottom: 0.5rem;
}
.section-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

/* ── Filters bar ───────────────────────────────────────────── */
.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--navy-mid);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
}
.filters select,
.filters input {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  color: var(--off-white);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: var(--gold);
}
.filters select option {
  background: var(--navy-card);
}

/* ── Units Grid ────────────────────────────────────────────── */
.units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.unit-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.unit-card__visual {
  height: 200px;
  position: relative;
  overflow: hidden;
}
.unit-card__visual svg {
  width: 100%;
  height: 100%;
}
.unit-card__status {
  position: absolute;
  top: 1rem;
  right: 1rem;
}
.unit-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.unit-card__collection {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
}
.unit-card__name {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--white);
  margin-top: -0.2rem;
}
.unit-card__specs {
  display: flex;
  gap: 1.2rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.unit-card__spec {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.unit-card__price {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--gold-lt);
  margin-top: auto;
}
.unit-card__view-tag {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.unit-card.is-sold { opacity: 0.55; }
.unit-card.is-sold:hover { transform: none; }

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
}
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: var(--serif); color: var(--muted); font-size: 1.4rem; }

/* ── Form ──────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.9rem;
  transition: border-color 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,169,106,0.1);
}
.form-group input::placeholder { color: var(--navy-line); }
.form-group textarea { resize: vertical; min-height: 90px; }
.form-error {
  font-size: 0.78rem;
  color: #E07070;
  margin-top: 0.25rem;
}

/* ── KPI Cards (admin) ─────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.kpi-card {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
}
.kpi-card__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.kpi-card__value {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--white);
  line-height: 1;
}
.kpi-card__value.is-gold { color: var(--gold); }
.kpi-card__sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--navy-line);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  background: var(--navy-mid);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--navy-line);
  white-space: nowrap;
}
tbody tr {
  border-bottom: 1px solid rgba(36,60,86,0.5);
  transition: background 0.15s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(26,45,66,0.7); }
tbody td {
  padding: 1rem 1.25rem;
  color: var(--off-white);
  vertical-align: middle;
}
.td-name { font-weight: 400; color: var(--white); }
.td-mono { font-family: monospace; font-size: 0.8rem; color: var(--muted); }
.td-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── Section tabs ──────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--navy-line);
  margin-bottom: 2rem;
}
.tab {
  padding: 0.75rem 1.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-family: var(--sans);
}
.tab.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.tab:hover:not(.is-active) { color: var(--off-white); }

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ── Unit detail page ──────────────────────────────────────── */
.unit-detail {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  align-items: start;
}
.unit-detail__floorplan {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  padding: 2rem;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.unit-detail__floorplan svg {
  width: 100%;
  height: auto;
  max-height: 500px;
}
.unit-detail__sidebar {
  position: sticky;
  top: 90px;
}
.unit-detail__price {
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 300;
  color: var(--gold-lt);
  margin: 0.75rem 0;
}
.unit-specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.unit-spec-item {
  background: var(--navy-mid);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.unit-spec-item__label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.unit-spec-item__value {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--white);
}

/* ── Reservation confirmation ──────────────────────────────── */
.confirm-box {
  max-width: 560px;
  margin: 4rem auto;
  text-align: center;
  padding: 3rem;
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
}
.confirm-icon {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
}

/* ── Loading / Spinner ─────────────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 2px solid var(--navy-line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast notifications ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}
.toast {
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--white);
  animation: slideIn 0.3s ease;
  max-width: 320px;
  box-shadow: var(--shadow);
}
.toast-success { background: #1E4D35; border: 1px solid rgba(76,175,122,0.4); }
.toast-error   { background: #4D1E1E; border: 1px solid rgba(220,80,80,0.4); }
.toast-info    { background: var(--navy-card); border: 1px solid var(--gold); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 12, 22, 0.85);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--navy-card);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  transform: translateY(20px);
  transition: transform 0.25s;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.is-open .modal {
  transform: translateY(0);
}
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.modal__close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.2s;
}
.modal__close:hover { color: var(--white); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .unit-detail {
    grid-template-columns: 1fr;
  }
  .unit-detail__sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 1rem; }
  .nav__links { display: none; }
  .units-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .modal { padding: 1.5rem; }
}

/* ── Misc helpers ──────────────────────────────────────────── */
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.text-white { color: var(--white); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--navy-line); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
