/* admin/css/admin.css — C21 Alliance Properties Team Portal
   On-brand: Dark bg · Relentless Gold · Playfair Display + Inter
   ---------------------------------------------------------------- */

:root {
  --gold:       #beaf87;
  --gold-dim:   #a89b70;
  --grey:       #c4c4c5;
  --bg-dark:    #111113;
  --bg-card:    #1c1c1e;
  --bg-input:   #2a2a2e;
  --bg-hover:   #242428;
  --text:       #f8f7f4;
  --text-muted: #9a9a9c;
  --border:     rgba(190,175,135,0.15);
  --radius:     8px;
  --shadow:     0 2px 12px rgba(0,0,0,0.4);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ─── LOGIN ─────────────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(190,175,135,0.06) 0%, transparent 70%), var(--bg-dark);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 48px 44px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow);
}

.login-logo {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  color: var(--gold);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.login-logo span { font-size: 1.1rem; vertical-align: super; }

.login-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 36px;
}

.login-card form { display: flex; flex-direction: column; gap: 12px; }

.login-card input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.login-card input::placeholder { color: var(--text-muted); }
.login-card input:focus { border-color: var(--gold); }

.login-card button[type="submit"] {
  background: var(--gold);
  color: #111;
  border: none;
  border-radius: var(--radius);
  padding: 13px;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}
.login-card button[type="submit"]:hover  { background: var(--gold-dim); }
.login-card button[type="submit"]:active { transform: scale(0.98); }
.login-card button[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }

.error-msg { color: #e57373; font-size: 13px; min-height: 18px; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.hidden { display: none !important; }

.admin-app { min-height: 100vh; display: flex; flex-direction: column; }

/* NAV */
.admin-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  height: 58px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.admin-nav-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--gold);
  white-space: nowrap;
  margin-right: 4px;
}
.admin-nav-brand span { font-size: 0.7rem; vertical-align: super; }

.admin-nav-tabs { display: flex; gap: 2px; flex: 1; }

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 7px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.15s;
}
.tab-btn:hover  { color: var(--text); background: rgba(255,255,255,0.05); }
.tab-btn.active { color: var(--gold); background: rgba(190,175,135,0.1); }

.admin-nav-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }

.user-email { color: var(--text-muted); font-size: 12px; }

.sign-out-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}
.sign-out-btn:hover { color: var(--text); border-color: rgba(190,175,135,0.4); }

/* MAIN LAYOUT */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr 268px;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 58px);
}

.admin-main {
  padding: 28px 24px;
  overflow-y: auto;
}

.admin-sidebar {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 24px 20px;
  overflow-y: auto;
}

/* ─── PANELS ─────────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.panel-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 600;
}

.count-badge {
  background: rgba(190,175,135,0.12);
  color: var(--gold);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}

/* ─── CARDS ──────────────────────────────────────────────── */
.card-list { display: flex; flex-direction: column; gap: 10px; }

.lead-card, .subscriber-card, .contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.lead-card:hover, .contact-card:hover { border-color: rgba(190,175,135,0.3); background: var(--bg-hover); }

.card-info { flex: 1; min-width: 0; }

.card-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-meta {
  color: var(--text-muted);
  font-size: 12px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.card-message {
  color: var(--grey);
  font-size: 13px;
  margin-top: 9px;
  line-height: 1.55;
  white-space: pre-line;
}

.card-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }

/* ─── STATUS ─────────────────────────────────────────────── */
.status-badge {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.status-new        { background: rgba(99,179,237,0.14); color: #63b3ed; }
.status-contacted  { background: rgba(190,175,135,0.14); color: var(--gold); }
.status-follow_up  { background: rgba(252,211,77,0.14); color: #fcd34d; }
.status-converted  { background: rgba(72,187,120,0.14); color: #48bb78; }
.status-owner      { background: rgba(190,175,135,0.14); color: var(--gold); }
.status-tenant     { background: rgba(99,179,237,0.14); color: #63b3ed; }
.status-prospect   { background: rgba(196,196,197,0.14); color: var(--grey); }

.status-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.status-select:focus { border-color: var(--gold); }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn-gold {
  background: var(--gold);
  color: #111;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-gold:hover { background: var(--gold-dim); }

.btn-ghost {
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { color: var(--text); border-color: rgba(190,175,135,0.4); }

/* ─── SIDEBAR ────────────────────────────────────────────── */
.admin-sidebar h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.sidebar-sub { color: var(--text-muted); font-size: 12px; margin-bottom: 16px; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

.date-item {
  border-left: 2px solid var(--gold);
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: 0 6px 6px 0;
  background: rgba(190,175,135,0.04);
}
.date-item-label { font-size: 13px; font-weight: 500; }
.date-item-name  { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.date-item-days  { font-size: 11px; color: var(--gold); margin-top: 3px; }

/* QUICK STATS */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.stat-item {
  background: rgba(190,175,135,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.stat-num   { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--gold); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
.modal-card h3 {
  font-family: 'Playfair Display', serif;
  color: var(--gold);
  font-size: 1.2rem;
  margin-bottom: 20px;
}
.modal-fields { display: flex; flex-direction: column; gap: 14px; }
.modal-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.modal-fields select,
.modal-fields textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s;
  resize: vertical;
}
.modal-fields select:focus,
.modal-fields textarea:focus { border-color: var(--gold); }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ─── UTILS ──────────────────────────────────────────────── */
.loading { color: var(--text-muted); font-size: 13px; font-style: italic; }
.empty   { color: var(--text-muted); font-size: 13px; font-style: italic; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 860px) {
  .admin-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .admin-main { height: auto; }
  .admin-sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
    height: auto;
  }
  .user-email { display: none; }
}
