@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy: #0B1B2E;
  --navy-2: #12283F;
  --navy-3: #0A1520;
  --gold: #C9A227;
  --gold-light: #E4C767;
  --cream: #F7F3EA;
  --ink: #1B1F27;
  --ink-soft: #5B6472;
  --line: rgba(11, 27, 46, 0.10);
  --red: #C24B3F;
  --green: #3E7A57;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(11, 27, 46, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

/* ── Auth (login) page ─────────────────────────────────────────────── */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(600px circle at 85% 10%, rgba(201,162,39,0.10), transparent 60%),
    linear-gradient(160deg, var(--navy), var(--navy-3));
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 40px 32px;
  text-align: center;
  backdrop-filter: blur(6px);
}

.badge {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--gold);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 20px;
}

.auth-card h1 {
  color: #fff;
  font-size: 24px;
}

.auth-card p.sub {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

.auth-card p.desc {
  color: rgba(255,255,255,0.55);
  font-size: 14px;
  margin: 20px 0 28px;
  line-height: 1.5;
}

.btn-google {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: none;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(201,162,39,0.3); }
.btn-google:disabled { opacity: 0.6; cursor: default; transform: none; }

.auth-error {
  background: rgba(194,75,63,0.15);
  border: 1px solid rgba(194,75,63,0.3);
  color: #FF9C8F;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  text-align: left;
}

.auth-note {
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  margin-top: 22px;
  line-height: 1.5;
}

/* ── Dashboard shell ───────────────────────────────────────────────── */

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, var(--navy), var(--navy-3));
  color: #fff;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}

.sidebar .brand .badge { width: 34px; height: 34px; font-size: 16px; margin: 0; border-radius: 9px; }
.sidebar .brand-text { font-family: 'Fraunces', serif; font-size: 15px; font-weight: 600; line-height: 1.2; }
.sidebar .brand-text small { display: block; font-family: 'Inter', sans-serif; font-weight: 400; font-size: 10px; letter-spacing: 0.1em; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-top: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 9px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: rgba(201,162,39,0.16); color: var(--gold-light); }
.nav-item .soon {
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.03em;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-foot img { width: 30px; height: 30px; border-radius: 50%; }
.sidebar-foot .name { font-size: 13px; font-weight: 600; color: #fff; }
.sidebar-foot .signout { font-size: 11.5px; color: rgba(255,255,255,0.4); cursor: pointer; background: none; border: none; padding: 0; text-align: left; }
.sidebar-foot .signout:hover { color: var(--gold-light); }

.main {
  padding: 32px 40px;
  overflow-x: auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-head h1 { font-size: 26px; color: var(--navy); }
.page-head p { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }

.pill-count {
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.pill-count strong { color: var(--navy); }

/* ── Toolbar / filters ─────────────────────────────────────────────── */

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  align-items: center;
}

.toolbar input[type="text"], .toolbar select {
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  color: var(--ink);
  font-family: 'Inter', sans-serif;
}
.toolbar input[type="text"] { flex: 1; min-width: 180px; }
.toolbar select { cursor: pointer; }

/* ── Table ──────────────────────────────────────────────────────────── */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #FBFAF6;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FBFAF6; }

.member-name { font-weight: 600; color: var(--navy); cursor: pointer; }
.member-name:hover { text-decoration: underline; }

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}
.status-Member { background: rgba(62,122,87,0.12); color: var(--green); }
.status-Visitor { background: rgba(201,162,39,0.14); color: #93761B; }
.status-New.Convert, .status-New-Convert { background: rgba(126,110,196,0.14); color: #6552A8; }

.row-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: background 0.15s ease;
}
.icon-btn:hover { background: #FBFAF6; border-color: var(--gold); }

.empty-state, .loading-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

/* ── Modal ──────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(11,27,46,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal h3 { font-size: 19px; color: var(--navy); margin-bottom: 4px; }
.modal p.modal-sub { color: var(--ink-soft); font-size: 13px; margin: 4px 0 20px; line-height: 1.5; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.field select, .field textarea, .field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 90px; }

.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.btn {
  flex: 1;
  padding: 11px;
  border-radius: 9px;
  border: none;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--gold); color: var(--navy); }
.btn-ghost { background: #F1EFE7; color: var(--ink); }
.btn-call { background: rgba(62,122,87,0.12); color: var(--green); }
.btn-whatsapp { background: rgba(37,143,90,0.14); color: #1F7A46; }

.contact-choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contact-choice button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}
.contact-choice button:hover { border-color: var(--gold); background: #FBFAF6; }
.contact-choice .emoji { font-size: 17px; }

.coming-soon {
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 60px 30px;
  text-align: center;
  color: var(--ink-soft);
}
.coming-soon h2 { color: var(--navy); font-size: 20px; margin-bottom: 8px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px; }
}
