/* WAN Realty — shared styles
   Palette pulled from the team's logo drafts: deep maroon + navy on warm white. */

:root {
  --maroon: #8C1D24;
  --maroon-dark: #6B151B;
  --maroon-light: #F3E4E3;
  --navy: #16233E;
  --navy-light: #1F3357;
  --bg: #FAF8F5;
  --card: #FFFFFF;
  --border: #E7E1D8;
  --text: #24262B;
  --text-muted: #6B6F76;
  --ok: #2F7A4D;
  --warn: #B9791A;
  --danger: #B3261E;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 35, 62, 0.06), 0 4px 16px rgba(22, 35, 62, 0.05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-word {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}

a { color: var(--maroon); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 20px;
}
.brand .brand-word { color: #fff; font-size: 20px; }
.brand .brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover; object-position: center 30%;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: rgba(255,255,255,0.78);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:hover { background: rgba(255,255,255,0.08); text-decoration: none; color: #fff; }
.nav-links a.active { background: rgba(255,255,255,0.14); color: #fff; }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--maroon);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}

.btn-ghost-light {
  background: transparent; border: 1px solid rgba(255,255,255,0.3);
  color: #fff; padding: 7px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.btn-ghost-light:hover { background: rgba(255,255,255,0.1); }

main.page {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 30px; margin: 0 0 6px; }
.page-header p { color: var(--text-muted); margin: 0; font-size: 15px; }

/* ---------- Cards / tables ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.stat-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 30px; font-family: 'Fraunces', serif; color: var(--navy); margin-top: 6px; }
.stat-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:hover { background: #FBF7F2; }
tbody tr:last-child td { border-bottom: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.pill-ok { background: #E8F3EC; color: var(--ok); }
.pill-warn { background: #FBF0DC; color: var(--warn); }
.pill-danger { background: #FBEAE9; color: var(--danger); }
.pill-neutral { background: #EFEEEA; color: var(--text-muted); }
.pill-navy { background: #E9ECF3; color: var(--navy); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-danger { background: var(--danger); }

/* ---------- Forms / buttons ---------- */
input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--maroon-light); border-color: var(--maroon); }
label { font-size: 13px; font-weight: 600; color: var(--navy); display: block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--maroon); color: #fff; }
.btn-primary:hover { background: var(--maroon-dark); }
.btn-secondary { background: #fff; border-color: var(--border); color: var(--navy); }
.btn-secondary:hover { background: #F5F3EF; }
.btn-danger-outline { background: #fff; border-color: #EFC9C7; color: var(--danger); }
.btn-danger-outline:hover { background: #FBEAE9; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.search-input { max-width: 260px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22,35,62,0.45);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto; padding: 26px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal h2 { margin-top: 0; font-size: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- Login page ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, #22335a 0%, var(--navy) 55%, #0f1830 100%);
  padding: 20px;
}
.auth-card {
  background: #fff; border-radius: 16px; padding: 40px 36px; width: 100%; max-width: 380px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
  text-align: center;
}
.auth-mark {
  width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 16px;
  object-fit: cover; object-position: center 30%;
  box-shadow: 0 4px 16px rgba(140, 29, 36, 0.25);
}
.auth-card h1 { font-size: 22px; margin: 0 0 4px; }
.auth-card .tagline { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }
.auth-card form { text-align: left; }
.auth-error {
  background: #FBEAE9; color: var(--danger); border-radius: 8px; padding: 10px 12px;
  font-size: 13px; margin-bottom: 14px; display: none;
}
.auth-error.show { display: block; }
.auth-hint { font-size: 12px; color: var(--text-muted); margin-top: 18px; line-height: 1.5; }

/* ---------- Config warning banner ---------- */
.config-warning {
  background: #FBF0DC; border-bottom: 1px solid #EAD9AE; color: #6B4E12;
  font-size: 13px; padding: 10px 24px; text-align: center; display: none;
}
.config-warning.show { display: block; }
.config-warning code { background: rgba(0,0,0,0.06); padding: 1px 6px; border-radius: 4px; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }
.empty-state h3 { color: var(--navy); margin-bottom: 6px; }

/* ---------- Bio / contact cards ---------- */
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 860px) { .people-grid { grid-template-columns: 1fr; } }
.person-card { padding: 24px; text-align: center; }
.person-avatar {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--maroon-light); color: var(--maroon);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 26px; font-weight: 700;
}
.person-card h3 { margin: 0 0 2px; font-size: 18px; }
.person-role { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.person-bio { font-size: 13.5px; color: var(--text); line-height: 1.55; text-align: left; }
.person-bio dt { font-weight: 600; color: var(--navy); margin-top: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.person-bio dd { margin: 2px 0 0; }
.person-contact { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; margin: 36px 0 14px; }
.section-title:first-child { margin-top: 0; }

footer.site-footer {
  text-align: center; padding: 24px; color: var(--text-muted); font-size: 12px;
}
