/* ============================================================
   Atlanta Division Sales Tracker — Phase 1 Visual Redesign
   Stanley Martin Homes · SMH Brand System
   ============================================================ */

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Brand primaries */
  --sm-dark-blue:       #1e4d60;
  --sm-dark-blue-hover: #173d4d;
  --sm-light-blue:      #6a8a9c;
  --sm-light-blue-soft: #e4ecf0;

  /* Brand highlights — sparing use */
  --sm-pink:        #ec008c;
  --sm-orange:      #f2a900;
  --sm-green-accent:#b5be00;

  /* Neutrals */
  --ink-900: #0f1b20;
  --ink-700: #2e4952;
  --ink-500: #6a7c83;
  --ink-300: #c3cfd4;
  --ink-100: #eef2f4;
  --surface: #ffffff;
  --canvas:  #dfe4e7;

  /* Semantic state */
  --success:      #16a34a;
  --success-soft: #dcfce7;
  --danger:       #b42318;
  --danger-soft:  #fde6e4;
  --warning:      #b86b00;
  --warning-soft: #fdf1dc;

  /* Leaderboard podium */
  --medal-gold:   #d4a846;
  --medal-silver: #a8afb5;
  --medal-bronze: #b07a4f;

  /* Spacing */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* Typography */
  --fs-xs:   12px;
  --fs-sm:   14px;
  --fs-base: 16px;
  --fs-md:   18px;
  --fs-lg:   22px;
  --fs-xl:   28px;
  --fs-2xl:  36px;
  --fs-3xl:  48px;

  /* Radii */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-pill: 999px;

  /* Elevation */
  --elev-1:     0 1px 3px rgba(15,27,32,.10), 0 2px 6px rgba(15,27,32,.07);
  --elev-2:     0 4px 16px rgba(15,27,32,.13);
  --elev-modal: 0 24px 48px rgba(15,27,32,.26);
}

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

/* ── BASE ──────────────────────────────────────────────────── */
body {
  font-family: 'Lato', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--canvas);
  background-image: radial-gradient(circle, rgba(30,77,96,.06) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink-900);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── VISIBILITY UTILS ──────────────────────────────────────── */
.hidden     { display: none !important; }
.is-hidden  { display: none !important; }
.is-visible { display: block; }

/* ── LAYOUT UTILS ──────────────────────────────────────────── */
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.mt-4  { margin-top: var(--sp-4); }
.mt-6  { margin-top: var(--sp-6); }
.mb-4  { margin-bottom: var(--sp-4); }
.gap-2 { gap: var(--sp-2); }
.flex  { display: flex; }
.items-center { align-items: center; }

/* ── GRID HELPERS ──────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-6);
}

.need-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-4);
}

/* ── LOGIN ─────────────────────────────────────────────────── */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--sm-dark-blue-hover) 0%, var(--sm-dark-blue) 60%, #2a6480 100%);
  padding: var(--sp-6);
}

.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  gap: var(--sp-6);
}

.login-logo {
  height: 52px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--sp-10) var(--sp-8);
  width: 100%;
  box-shadow: var(--elev-modal);
  text-align: center;
}

.login-card h2 {
  color: var(--sm-dark-blue);
  font-size: var(--fs-lg);
  font-weight: 700;
  margin-bottom: var(--sp-1);
}

.login-card p {
  color: var(--ink-500);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-8);
}

/* ── FORM ELEMENTS ─────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--sp-4);
  text-align: left;
}

label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-700);
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px var(--sp-3);
  border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-sm);
  font-family: 'Lato', Arial, sans-serif;
  font-size: var(--fs-sm);
  color: var(--ink-900);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: auto;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--sm-dark-blue);
  box-shadow: 0 0 0 3px rgba(30,77,96,.12);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sm-dark-blue);
  cursor: pointer;
}

/* Goal input cell — consistent sizing for inline table inputs */
.goal-input-cell {
  width: 80px;
  padding: var(--sp-1) var(--sp-2) !important;
}

.goal-input-cell input {
  width: 80px;
  padding: 4px var(--sp-2);
  font-size: var(--fs-sm);
}

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 9px var(--sp-5);
  min-height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Lato', Arial, sans-serif;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--sm-dark-blue);
  color: var(--surface);
}
.btn-primary:hover {
  background: var(--sm-dark-blue-hover);
}

.btn-gold {
  background: var(--sm-orange);
  color: var(--surface);
}
.btn-gold:hover {
  background: #d99700;
}

.btn-outline {
  background: transparent;
  color: var(--ink-700);
  border: 1.5px solid var(--ink-300);
}
.btn-outline:hover {
  background: var(--ink-100);
}

.btn-danger {
  background: var(--danger);
  color: var(--surface);
}
.btn-danger:hover {
  opacity: 0.88;
}

.btn-sm {
  padding: 5px var(--sp-3);
  font-size: var(--fs-xs);
  min-height: 30px;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ── TOP NAV ───────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topnav {
  background: var(--sm-dark-blue);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-6);
  height: 60px;
  gap: var(--sp-2);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  width: 100%;
}

.topnav img {
  height: 34px;
  margin-right: var(--sp-4);
}

.topnav .nav-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.18);
  margin: 0 var(--sp-2);
}

.topnav .spacer { flex: 1; }

.nav-link {
  color: rgba(255,255,255,0.70);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 6px var(--sp-3);
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.nav-link:hover {
  color: var(--surface);
  background: rgba(255,255,255,0.10);
}

.nav-link.active {
  color: var(--surface);
  background: rgba(255,255,255,0.10);
}

/* Active indicator — bottom border */
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: var(--sp-3);
  right: var(--sp-3);
  height: 2px;
  background: var(--sm-pink);
  border-radius: var(--radius-pill);
}

.nav-user {
  color: rgba(255,255,255,0.60);
  font-size: var(--fs-xs);
  margin-right: var(--sp-2);
}

/* Sign-out button inherits .btn-outline but on dark background */
.topnav .btn-outline {
  color: rgba(255,255,255,0.80);
  border-color: rgba(255,255,255,0.25);
}
.topnav .btn-outline:hover {
  background: rgba(255,255,255,0.12);
  color: var(--surface);
}

/* ── PAGE LAYOUT ───────────────────────────────────────────── */
.page {
  display: none;
  padding: var(--sp-8) var(--sp-8);
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

.page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-5);
  border-bottom: 2px solid rgba(30,77,96,.10);
}

.page-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--sm-dark-blue);
}

.page-subtitle {
  font-size: var(--fs-sm);
  color: var(--ink-500);
  margin-top: 2px;
}

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(15,27,32,.09);
  box-shadow: var(--elev-1);
  padding: var(--sp-5);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(30,77,96,.03);
  margin: calc(-1 * var(--sp-5));
  margin-bottom: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: 1.5px solid rgba(30,77,96,.10);
}

.card-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--ink-900);
  padding-left: var(--sp-3);
  border-left: 3px solid var(--sm-dark-blue);
  line-height: 1.2;
}

/* Danger card variant — used for Terminations card */
.card--danger .card-header {
  background: var(--danger);
  color: var(--surface);
  margin: calc(-1 * var(--sp-5));
  margin-bottom: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border-bottom: none;
}

.card--danger .card-title {
  color: var(--surface);
}

/* ── STAT CARDS ────────────────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(15,27,32,.09);
  border-top: 4px solid var(--sm-dark-blue);
  box-shadow: var(--elev-1);
  padding: var(--sp-5);
  background-image: linear-gradient(180deg, rgba(30,77,96,.03) 0%, transparent 50%);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--elev-2);
}

.stat-card.gold  { border-top-color: #d4699a; }
.stat-card.green { border-top-color: var(--success); }
.stat-card.amber { border-top-color: var(--sm-dark-blue); }

.stat-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-500);
  margin-bottom: var(--sp-1);
}

.stat-value {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--sm-dark-blue);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-top: var(--sp-1);
}

.stat-pct {
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-top: var(--sp-1);
  font-variant-numeric: tabular-nums;
}

.pct-good { color: var(--success); }
.pct-mid  { color: var(--warning); }
.pct-low  { color: var(--danger); }

/* ── PROGRESS BAR ──────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--ink-100);
  border-radius: var(--radius-pill);
  height: 8px;
  margin-top: var(--sp-2);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--sm-dark-blue);
  transition: width 0.4s ease;
}

.progress-bar-fill.gold  { background: #d4699a; }
.progress-bar-fill.green { background: var(--success); }

/* ── CHART CONTAINER ───────────────────────────────────────── */
.chart-container {
  position: relative;
  height: 260px;
}

/* ── NEIGHBORHOODS IN NEED ─────────────────────────────────── */
#nbhd-in-need-section {
  margin-bottom: var(--sp-6);
}

.need-block {
  border: 1px solid rgba(15,27,32,.09);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 14px var(--sp-4);
  background: linear-gradient(135deg, rgba(180,35,24,.04) 0%, var(--surface) 60%);
  box-shadow: var(--elev-1);
}

.need-name {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--sp-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.need-deficit {
  font-size: 30px;
  font-weight: 800;
  color: var(--danger);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.need-sub {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-top: var(--sp-1);
}

/* ── LEADERBOARD ───────────────────────────────────────────── */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.leaderboard-table th {
  background: var(--canvas);
  color: var(--ink-500);
  padding: var(--sp-2) 14px;
  text-align: left;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  border-bottom: 1.5px solid var(--ink-100);
}

.leaderboard-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-100);
  vertical-align: middle;
}

.leaderboard-table tr:hover td {
  background: rgba(30,77,96,.03);
}

/* Rank-1 row gold wash */
.leader-row--rank1 td {
  background: rgba(212,168,70,.09);
}
.leader-row--rank1:hover td {
  background: rgba(212,168,70,.14);
}

/* Rank badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

.rank-1     { background: var(--medal-gold);   color: var(--surface); }
.rank-2     { background: var(--medal-silver); color: var(--surface); }
.rank-3     { background: var(--medal-bronze); color: var(--surface); }
.rank-other { background: var(--ink-100);      color: var(--ink-500); }

/* Medal & crown icons */
.medal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-left: var(--sp-1);
}

.crown-icon {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: var(--sp-1);
  font-size: 14px;
  line-height: 1;
}

/* Leaderboard bar cell */
.leader-bar-cell {
  min-width: 180px;
  padding: 10px var(--sp-4) !important;
}

.leader-bar-track {
  position: relative;
  height: 16px;
  background: var(--ink-300);
  border-radius: var(--radius-sm);
  overflow: visible;
}

.leader-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.35s ease;
  background: var(--sm-light-blue);
}

/* Bar color variants */
.leader-bar--top3    { background: var(--sm-dark-blue); }
.leader-bar--default { background: var(--sm-light-blue); }

/* Goal line — dashed vertical rule */
.leader-bar-goal-line {
  position: absolute;
  top: -5px;
  height: calc(100% + 10px);
  width: 2px;
  background: repeating-linear-gradient(
    to bottom,
    var(--ink-300) 0,
    var(--ink-300) 4px,
    transparent 4px,
    transparent 7px
  );
  border-radius: 1px;
}

/* Leaderboard period filter buttons */
.leader-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px var(--sp-3);
  font-family: 'Lato', Arial, sans-serif;
  font-size: var(--fs-xs);
  font-weight: 600;
  border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-700);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.leader-filter-btn:hover {
  background: var(--ink-100);
}

.leader-filter-btn.active {
  background: var(--sm-dark-blue);
  color: var(--surface);
  border-color: var(--sm-dark-blue);
}

/* ── WEEK SELECTOR ─────────────────────────────────────────── */
.week-selector {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px var(--sp-5);
  box-shadow: var(--elev-1);
  margin-bottom: var(--sp-5);
}

.week-selector label { margin: 0; }

.week-display {
  font-weight: 700;
  color: var(--ink-900);
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
}

.week-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px var(--sp-3);
  font-family: 'Lato', Arial, sans-serif;
  font-size: var(--fs-sm);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--ink-100);
  color: var(--ink-700);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.week-btn:hover {
  background: var(--sm-light-blue-soft);
  color: var(--sm-dark-blue);
}

.week-btn.active {
  background: var(--sm-dark-blue);
  color: var(--surface);
}

/* ── SALES TABLE ───────────────────────────────────────────── */
.sales-table-wrap { overflow-x: auto; max-width: 100%; }

.sales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 900px;
}

.sales-table th {
  background: var(--sm-dark-blue);
  color: var(--surface);
  padding: 10px var(--sp-3);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sales-table td {
  padding: 10px var(--sp-3);
  border-bottom: 1px solid var(--ink-100);
  vertical-align: middle;
}

.sales-table tr:hover td {
  background: rgba(30,77,96,.03);
}

/* Terminated row — muted, line-through on name only (enforced via JS) */
.sales-table tr.terminated td {
  color: var(--ink-500);
}

.sales-table tr.terminated td .btn {
  text-decoration: none;
}

/* Status badges */
.badge {
  display: inline-block;
  padding: 3px var(--sp-2);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-signed     { background: var(--success-soft); color: var(--success); }
.badge-pending    { background: var(--warning-soft); color: var(--warning); }
.badge-terminated { background: var(--ink-100);      color: var(--ink-500); }

/* ── ADMIN TABLE ───────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.admin-table th {
  background: var(--canvas);
  color: var(--ink-500);
  padding: 9px var(--sp-3);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1.5px solid var(--ink-300);
}

.admin-table td {
  padding: 9px var(--sp-3);
  border-bottom: 1px solid var(--ink-100);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(30,77,96,.03);
}

/* ── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,27,32,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--sp-5);
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--elev-modal);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  background: var(--sm-dark-blue);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--surface);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  line-height: 1;
  padding: 0 var(--sp-1);
  transition: color 0.15s;
}

.modal-close:hover {
  color: var(--surface);
}

/* Modal body padding — legacy modals without .modal-body */
.modal > *:not(.modal-header):not(.modal-actions):not(.modal-body) {
  padding-left: var(--sp-6);
  padding-right: var(--sp-6);
}

.modal > .modal-header + *:not(.modal-body) {
  margin-top: var(--sp-6);
}

/* .modal-body — structured form container */
.modal-body {
  padding: var(--sp-5) var(--sp-6) var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* Inputs align at the bottom of each grid cell so labels of different lengths
   don't cause inputs to sit at different heights */
.modal-body .grid-2 {
  align-items: end;
}

/* gap handles vertical spacing; reset form-group bottom margin inside modal-body */
.modal-body .form-group {
  margin-bottom: 0;
}

.modal-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  padding: var(--sp-5) var(--sp-6);
  border-top: 1px solid var(--ink-100);
  margin-top: var(--sp-4);
}

/* ── ALERTS ────────────────────────────────────────────────── */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  margin-bottom: 14px;
  border-left: 3px solid transparent;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-left-color: var(--danger);
}

.alert-success {
  background: var(--success-soft);
  color: var(--success);
  border-left-color: var(--success);
}

/* ── FILTER BAR ────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
  width: auto;
}

/* ── SELECT / BULK ACTIONS ─────────────────────────────────── */
.select-rows-link {
  font-size: var(--fs-sm);
  color: var(--ink-500);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.select-rows-link:hover {
  color: var(--sm-dark-blue);
  text-decoration: underline;
}

.select-rows-link.active {
  color: var(--sm-dark-blue);
  font-weight: 600;
}

.select-controls-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.bulk-count {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--sm-dark-blue);
  font-variant-numeric: tabular-nums;
}

.bulk-hint {
  font-size: var(--fs-sm);
  color: var(--ink-300);
}

.sel-col {
  width: 36px;
  text-align: center;
  padding: 0 var(--sp-2) !important;
}

.sel-cell {
  width: 36px;
  text-align: center;
  padding: 0 var(--sp-2) !important;
}

/* ── CHECKBOX ROW ──────────────────────────────────────────── */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
}

.checkbox-row label {
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-900);
  margin: 0;
  cursor: pointer;
}

/* ── SPINNER ───────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(30,77,96,.20);
  border-top-color: var(--sm-dark-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Spinner on dark (inside buttons) */
.btn-primary .spinner,
.btn-gold .spinner {
  border-color: rgba(255,255,255,0.25);
  border-top-color: var(--surface);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── TOAST ─────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  background: var(--surface);
  color: var(--ink-900);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  z-index: 2000;
  max-width: 340px;
  border-left: 3px solid var(--sm-dark-blue);
  animation: toast-in 0.25s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── EMPTY STATE ───────────────────────────────────────────── */
/* Block-level empty state (standalone card or div) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) var(--sp-8);
  color: var(--ink-500);
  text-align: center;
  gap: var(--sp-3);
}

.empty-state p {
  font-size: var(--fs-sm);
  max-width: 300px;
  line-height: 1.6;
}

/* Table cell empty-state (td.empty-state) */
td.empty-state {
  display: table-cell;
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--ink-500);
  font-size: var(--fs-sm);
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .charts-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .page { padding: var(--sp-4); }
  .topnav { padding: 0 var(--sp-3); }
  .topnav img { height: 26px; margin-right: var(--sp-2); }
  .nav-link { padding: 5px var(--sp-2); font-size: var(--fs-xs); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .charts-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .week-selector { flex-wrap: wrap; }
}

@media (max-width: 480px) {
  /* Grid / stats */
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: var(--sp-8) var(--sp-5); }
  .stat-value { font-size: var(--fs-lg); }

  /* Two-row topnav — fixes the nav clipping on phone */
  .topnav {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    padding: var(--sp-2) var(--sp-3) var(--sp-1);
    align-content: center;
    gap: 0;
  }
  .topnav img      { height: 22px; margin-right: 0; }
  .topnav .nav-divider { display: none; }
  #nav-user-email  { display: none; }
  .btn-nav-signout { font-size: 11px; padding: 3px var(--sp-2); }

  /* Module switcher → full-width second row */
  #module-switcher {
    order: 10;
    flex-basis: 100%;
    margin-top: var(--sp-1);
    margin-bottom: var(--sp-1);
  }
  .module-switcher-btn { flex: 1; text-align: center; }

  /* ST nav links → scrollable full-width second row */
  .nav-group {
    display: flex;
    order: 10;
    flex-basis: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: var(--sp-1) 0 var(--sp-2);
    border-top: 1px solid rgba(255,255,255,0.15);
    gap: 2px;
  }
  .nav-group::-webkit-scrollbar { display: none; }
  .nav-link { white-space: nowrap; }

  /* BM sub-nav: even-width tabs filling full row */
  .bm-subnav { padding: 0; }
  .bm-nav-btn {
    flex: 1;
    padding: var(--sp-2) var(--sp-1);
    font-size: var(--fs-xs);
    text-align: center;
    min-height: 44px;
  }

  /* BM header: stack community name above badge */
  .bm-header { flex-direction: column; align-items: flex-start; }

  /* Walk condition buttons: touch-friendly, label won't wrap */
  .bm-walk-yn-btn { font-size: var(--fs-xs); min-height: 44px; }

  /* Prevent iOS auto-zoom on input focus (font-size < 16px triggers zoom) */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="number"],
  select,
  textarea { font-size: 16px; }

  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="date"],
  input[type="number"],
  select { min-height: 44px; }
}

/* ── PHASE 3 ADDITIONS ─────────────────────────────────────── */

/* 1. Login reset text — small centered hint below login form */
.login-reset-text {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-top: var(--sp-3);
  text-align: center;
}

/* 2. Nav sign-out button — ghost style on dark nav bar */
.btn-nav-signout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  border-radius: var(--radius-sm);
  padding: var(--sp-1) var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-nav-signout:hover {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.1);
}

/* 3. Primary stats grid row */
.stats-grid--primary {
  margin-bottom: var(--sp-4);
}

/* 4. Secondary stats grid row */
.stats-grid--secondary {
  margin-bottom: var(--sp-4);
}

/* 5. Table horizontal-scroll wrapper */
.table-scroll-wrap {
  overflow-x: auto;
}

/* 6. Small modal variant */
.modal--sm {
  max-width: 440px;
}

/* 7. .leader-bar--top3 — already defined above in leaderboard section */
/* 8. .leader-bar--default — already defined above in leaderboard section */

/* 9. .leader-row--rank1 — already defined above in leaderboard section */
/* NSM name cell bold within rank-1 row */
.leader-row--rank1 .nsm-name {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--sm-dark-blue);
}

/* 10. Empty state for td cells — see also td.empty-state block above */

/* ── ADDITIONAL UTILITY CLASSES ────────────────────────────── */

/* Text color semantics */
.text-success     { color: var(--success); }
.text-danger      { color: var(--danger); }
.text-muted       { color: var(--ink-500); }
.text-danger-bold { color: var(--danger); font-weight: 600; }

/* Font-weight utilities */
.fw-600 { font-weight: 600; }
.fw-bold { font-weight: 700; }

/* Font-style utilities */
.fst-italic { font-style: italic; }

/* ── NAV GROUP (transparent flex wrapper) ──────────────────── */
.nav-group { display: contents; }

/* ── MODULE SWITCHER (header quick-switch tabs) ─────────────── */

.module-switcher {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.module-switcher-btn {
  padding: var(--sp-1) var(--sp-3);
  border-radius: 3px;
  border: none;
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  background: transparent;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.module-switcher-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}

.module-switcher-btn.is-active {
  background: white;
  color: var(--sm-dark-blue);
}

/* ── MODULE SELECTOR (post-login landing screen) ────────────── */

.module-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 60px);
  padding: var(--sp-8);
  background: var(--canvas);
}

.module-selector-inner {
  text-align: center;
  max-width: 700px;
  width: 100%;
}

.module-selector-heading {
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--sm-dark-blue);
  margin-bottom: var(--sp-10);
}

.module-selector-cards {
  display: flex;
  gap: var(--sp-6);
  justify-content: center;
}

.module-card {
  flex: 1;
  max-width: 280px;
  padding: var(--sp-8) var(--sp-6);
  background: white;
  border: 2px solid var(--ink-100);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.module-card:hover {
  border-color: var(--sm-dark-blue);
  box-shadow: 0 4px 20px rgba(30,77,96,0.14);
  transform: translateY(-3px);
}

.module-card:active {
  transform: translateY(0);
  box-shadow: none;
}

.module-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--sm-dark-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-bottom: var(--sp-1);
}

.module-card-icon i,
.module-card-icon svg { width: 26px; height: 26px; }

.module-card-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--sm-dark-blue);
}

.module-card-desc {
  font-size: var(--fs-sm);
  color: var(--ink-500);
  line-height: 1.5;
}

@media (max-width: 600px) {
  .module-selector-cards { flex-direction: column; align-items: center; }
  .module-card           { max-width: 100%; }
  .module-selector-heading { font-size: var(--fs-xl); }
}

/* ══════════════════════════════════════════════════════════════
   BUILDER MEETING MODULE
══════════════════════════════════════════════════════════════ */

/* Header */
.bm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.bm-meeting-info {
  font-size: var(--fs-base);
  color: var(--ink-700);
}

.bm-community-name {
  font-weight: 700;
  color: var(--sm-dark-blue);
}

.bm-week-label {
  color: var(--ink-500);
}

.bm-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bm-badge-draft    { background: #fff3cd; color: #856404; }
.bm-badge-success  { background: #d1e7dd; color: #0f5132; }

/* Sub-navigation */
.bm-subnav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  background: var(--surface);
  padding: 0 var(--sp-6);
  width: 100%;
}

.bm-nav-btn {
  padding: var(--sp-3) var(--sp-5);
  border: none;
  background: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  min-height: 44px;
}

.bm-nav-btn:hover       { color: var(--sm-dark-blue); }
.bm-nav-btn.is-active   { color: var(--sm-dark-blue); border-bottom-color: var(--sm-dark-blue); }
.bm-nav-btn.is-hidden   { display: none; }

/* Views */
.bm-view {
  min-height: 300px;
}

/* ── Walk View ───────────────────────────────────────────── */
.bm-walk-container {
  max-width: 680px;
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-4);
}

.bm-walk-progress {
  margin-bottom: var(--sp-5);
}

.bm-walk-progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: var(--sp-1);
}

.bm-walk-progress-fill {
  height: 100%;
  background: var(--sm-dark-blue);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.bm-walk-progress-label {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  text-align: right;
}

.bm-walk-locked-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  color: #856404;
  margin-bottom: var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.bm-customer-locked-banner {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  color: #856404;
  margin-bottom: var(--sp-4);
}
.bm-customer-locked-banner--info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.bm-walk-section-heading {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--sm-dark-blue);
  margin: var(--sp-6) 0 var(--sp-3);
}

.bm-walk-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.bm-walk-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.bm-walk-qnum {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sm-dark-blue);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bm-walk-qlabel {
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--ink-900);
  line-height: 1.3;
}

.bm-walk-qdesc {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-top: 2px;
}

/* Condition buttons: Good / Needs Attention / Urgent */
.bm-walk-yn-group {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.bm-walk-yn-btn {
  flex: 1;
  min-height: 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  color: var(--ink-500);
}

.bm-walk-yn-btn[disabled] { opacity: 0.5; cursor: default; }

.bm-walk-btn--good-active {
  background: #d1e7dd;
  border-color: #198754;
  color: #0f5132;
}

.bm-walk-btn--needs-active {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
}

.bm-walk-btn--urgent-active {
  background: #f8d7da;
  border-color: #dc3545;
  color: #842029;
}

/* Read-only condition badges */
.bm-walk-response-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}

.bm-walk-response-badge--good            { background: #d1e7dd; color: #0f5132; }
.bm-walk-response-badge--needs_attention { background: #fff3cd; color: #856404; }
.bm-walk-response-badge--urgent          { background: #f8d7da; color: #842029; }
.bm-walk-response-badge--empty           { background: var(--bg); color: var(--ink-400); border: 1px solid var(--border); }

/* Comment textarea */
.bm-walk-comment-wrap { margin-top: var(--sp-2); }
.bm-walk-comment-wrap.is-hidden { display: none; }

.bm-walk-comment-input {
  width: 100%;
  box-sizing: border-box;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
}

.bm-walk-comment-readonly {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  color: var(--ink-600);
  white-space: pre-wrap;
}

/* Punch list */
.bm-punch-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
}

.bm-punch-item:last-child { border-bottom: none; }

.bm-punch-body {
  flex: 1;
  min-width: 0;
}

.bm-punch-desc {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-800);
  word-break: break-word;
}

.bm-punch-meta {
  font-size: var(--fs-xs);
  color: var(--ink-500);
  margin-top: 2px;
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.bm-punch-category {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--sm-light-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.bm-punch-add-form {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-top: var(--sp-3);
}

/* ── Customer View ───────────────────────────────────────── */
.bm-customer-container {
  padding: var(--sp-5) var(--sp-4);
}

.bm-customer-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.bm-customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-xs);
  white-space: nowrap;
  min-width: 1100px;
}

.bm-customer-table th {
  background: var(--sm-dark-blue);
  color: #fff;
  font-weight: 600;
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  position: sticky;
  top: 0;
}

.bm-customer-table td {
  padding: var(--sp-1) var(--sp-2);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.bm-customer-table tr:nth-child(even) td { background: var(--bg); }

.bm-customer-table input,
.bm-customer-table select,
.bm-customer-table textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: var(--fs-xs);
  font-family: inherit;
  background: var(--surface);
  min-height: 28px;
}

.bm-customer-table textarea { resize: none; min-height: 44px; }
.bm-customer-table input[disabled],
.bm-customer-table select[disabled],
.bm-customer-table textarea[disabled] { background: var(--bg); color: var(--ink-400); }

.bm-customer-saving-indicator {
  font-size: 10px;
  color: var(--ink-400);
  display: block;
  min-height: 14px;
  text-align: center;
}

/* ── Submit View ─────────────────────────────────────────── */
.bm-submit-container {
  max-width: 600px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-4);
}

.bm-submit-info-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  color: #1e40af;
  margin-bottom: var(--sp-4);
}

/* Mobile overrides */
@media (max-width: 600px) {
  .bm-header          { padding: var(--sp-3) var(--sp-4); }
  .bm-subnav          { padding: 0 var(--sp-3); }
  .bm-nav-btn         { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-xs); }
  .bm-walk-container  { padding: var(--sp-4) var(--sp-3); }
  .bm-walk-response-btns { gap: var(--sp-1); }
}

/* ── Builder Meeting: Mobile Card Layout (Buyers view on phones) */
.bm-customer-cards-wrap {
  padding: var(--sp-3) var(--sp-4);
}

.bm-customer-card {
  background: var(--surface);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  box-shadow: var(--elev-1);
}

.bm-customer-card-header {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.bm-customer-card-lot {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--sm-dark-blue);
  flex-shrink: 0;
}

.bm-customer-card-buyer {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-700);
  flex: 1;
  min-width: 0;
}

.bm-customer-card-field {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: var(--sp-1) var(--sp-3);
  align-items: start;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--ink-100);
}

.bm-customer-card-field:last-of-type {
  border-bottom: none;
}

.bm-customer-card-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 3px;
  line-height: 1.4;
}

.bm-customer-card-value {
  min-width: 0;
}

.bm-customer-card-footer {
  margin-top: var(--sp-2);
  min-height: 16px;
}

.bm-customer-card .bm-customer-save-indicator {
  font-size: 10px;
  color: var(--ink-400);
  display: block;
  text-align: right;
}

/* ── Phase 7b: Buyers page additions ─────────────────────── */

/* Status column header */
.bm-customer-th--status-col {
  min-width: 130px;
}

/* Closed column header */
.bm-customer-th--closed-col {
  min-width: 60px;
  text-align: center;
}

/* Lot number cell — fixed narrow width */
.bm-customer-cell--number {
  min-width: 60px;
  font-variant-numeric: tabular-nums;
}

/* Closed checkbox cell */
.bm-customer-checkbox-cell {
  text-align: center;
}

/* Closed checkbox input */
.bm-customer-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--blue-600, #2563eb);
}

/* Closed Pending Survey section */
.bm-customer-section--closed {
  margin-top: var(--sp-8, 2rem);
  padding-top: var(--sp-6, 1.5rem);
  border-top: 2px solid var(--ink-100, #e5e7eb);
  background: var(--surface-subtle, #f9fafb);
  border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
  padding: var(--sp-4, 1rem);
}

.bm-customer-section--closed .bm-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-500, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--sp-4, 1rem);
}

/* + Add Homesite button bar */
.bm-add-homesite-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--sp-3, 0.75rem);
}

@media (max-width: 768px) {
  .bm-add-homesite-bar {
    justify-content: stretch;
  }
  .bm-add-homesite-btn {
    width: 100%;
    text-align: center;
  }
}

/* Add Homesite modal — reuses admin modal base */
.bm-add-homesite-modal .modal-body .form-group {
  margin-bottom: var(--sp-4, 1rem);
}

.bm-add-homesite-modal .form-error {
  display: block;
  margin-top: var(--sp-1, 0.25rem);
  font-size: 0.8rem;
  color: var(--red-600, #dc2626);
}

.bm-add-homesite-modal .form-error.is-hidden {
  display: none;
}

/* Closed row tint in main table (row that just had closed checked — brief flash before re-render) */
.bm-customer-row--closing {
  background: var(--amber-50, #fffbeb);
  transition: background 0.3s ease;
}

/* Closed section row style */
.bm-customer-row--closed {
  background: var(--surface-subtle, #f9fafb);
}
