:root {
  /* MFS brand — pulled from the Pick Your Market hero */
  --mfs-blue:        #2563eb;   /* primary action — buttons, links, accent */
  --mfs-blue-dark:   #1d4ed8;   /* hover, pressed */
  --mfs-blue-deep:   #1e3a8a;   /* deep brand / accents on dark */
  --mfs-blue-tint:   #eff6ff;   /* very pale brand wash */

  --bg:      #f1f5f9;   /* cool slate page background */
  --card:    #ffffff;
  --text:    #0f172a;   /* near-black headings */
  --body:    #475569;   /* body / secondary text */
  --muted:   #64748b;   /* tertiary / timestamps */
  --border:  #e2e8f0;
  --border-strong: #cbd5e1;

  --success: #15803d;
  --warn:    #b45309;
  --error:   #b91c1c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

h1, h2, h3 { margin-top: 0; }
h1 { font-size: 24px; }
h2 { font-size: 18px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: white;
}
input:focus, textarea:focus { outline: 2px solid var(--mfs-blue); }

button, .btn {
  display: inline-block;
  background: var(--mfs-blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--mfs-blue-dark); }
button:disabled { background: var(--muted); cursor: not-allowed; }

.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f1f5f9; }

.error { color: var(--error); font-size: 14px; margin-top: 8px; }
.muted { color: var(--muted); font-size: 13px; }

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill { height: 100%; background: var(--mfs-blue); }

.checklist-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.checklist-item:last-child { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-done { background: #dcfce7; color: var(--success); }
.badge-pending { background: #fef3c7; color: var(--warn); }
.badge-self { background: #dbeafe; color: var(--mfs-blue); }
.badge-caleb { background: #e0e7ff; color: #4338ca; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }

.login-shell {
  max-width: 380px;
  margin: 80px auto;
}

/* Make admin dashboard wider than the default 1100px so cards can grid out nicely */
body.admin-dashboard .container,
.container.wide { max-width: 1400px; }

/* ---------- Admin dashboard ---------- */

body.admin-dashboard {
  background: var(--bg);
  color: var(--text);
}
body.admin-dashboard,
body.admin-dashboard input {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
}
body.admin-dashboard .num,
body.admin-dashboard .mono {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-feature-settings: 'tnum', 'zero', 'ss01';
}

/* Page header — MFS brand mark + serif H1 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 8px 0 18px;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.page-pretitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mfs-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--mfs-blue);
  color: white;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.02em;
  border-radius: 6px;
  flex-shrink: 0;
}
.page-pretitle .crumbs {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  color: var(--body);
}
.page-pretitle .crumbs strong {
  color: var(--text);
  font-weight: 600;
}
.page-pretitle .crumbs .sep {
  margin: 0 6px;
  color: var(--muted);
}
.page-header h1 {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  color: var(--text);
}
.page-header h1 .accent { color: var(--mfs-blue); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
body.admin-dashboard button,
body.admin-dashboard .btn,
body.admin-dashboard .btn-secondary {
  border-radius: 6px;
  padding: 9px 16px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0;
  border: 1px solid var(--mfs-blue);
  background: var(--mfs-blue);
  color: white;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
body.admin-dashboard button:hover { background: var(--mfs-blue-dark); border-color: var(--mfs-blue-dark); }
body.admin-dashboard .btn-secondary {
  background: white;
  color: var(--text);
  border-color: var(--border-strong);
}
body.admin-dashboard .btn-secondary:hover {
  background: var(--mfs-blue-tint);
  border-color: var(--mfs-blue);
  color: var(--mfs-blue-dark);
}

/* Compact meta line */
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 13.5px;
  margin: 18px 0 28px;
  color: var(--body);
}
.meta-line strong {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  margin-right: 5px;
  color: var(--text);
  font-feature-settings: 'tnum';
}
.meta-line .sep {
  color: var(--border-strong);
  font-family: 'Source Serif 4', serif;
}

/* Section heading — italic serif + hairline rule */
.container > h2.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  font-style: italic;
  color: var(--text);
  text-transform: none;
  letter-spacing: -0.005em;
  margin: 28px 0 14px;
  padding: 0;
  border: none;
}
.section-heading .rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Card grid */
.closer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.empty-state {
  padding: 32px;
  text-align: center;
  background: white;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  grid-column: 1 / -1;
  font-style: italic;
  font-family: 'Source Serif 4', Georgia, serif;
}

/* Each closer card */
.closer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  cursor: pointer;
  position: relative;
}
.closer-card:hover {
  border-color: var(--mfs-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.18);
}
.closer-card.archived {
  background: #f8fafc;
  border-color: var(--border);
}
.closer-card.archived:hover {
  border-color: var(--border-strong);
  box-shadow: none;
  transform: none;
}
.closer-card.archived .closer-name { color: var(--muted); }

/* Card header — name (serif) + status label (italic right) */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.card-name { flex: 1; min-width: 0; }
.closer-name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.closer-email {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
  font-feature-settings: 'tnum';
}
.status-label {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 4px;
}
.status-label.status-cleared { color: var(--success); }
.status-label.status-green   { color: var(--success); }
.status-label.status-yellow  { color: var(--warn); }
.status-label.status-red     { color: var(--error); }

/* Overall progress row */
.overall-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.overall-progress {
  flex: 1;
  height: 6px;
  background: var(--bg);
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.overall-progress-fill {
  height: 100%;
  background: var(--mfs-blue);
  transition: width 200ms ease;
}
.closer-card.status-cleared .overall-progress-fill { background: var(--success); }
.overall-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--body);
  min-width: 56px;
  text-align: right;
  font-feature-settings: 'tnum';
}
.overall-count strong { color: var(--text); font-weight: 500; }

/* Section grid */
.sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
}
.section-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.section-row .label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--body);
}
.section-row .label .name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
}
.section-row .count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--body);
  font-feature-settings: 'tnum';
}
.section-row.full .label .name { color: var(--success); }
.section-row.full .count { color: var(--success); font-weight: 500; }
.section-row.empty .count { color: var(--muted); }

.dots {
  display: flex;
  gap: 3px;
  align-items: center;
}
.dot {
  width: 10px; height: 10px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  transition: background 120ms ease, border-color 120ms ease;
}
.dot.filled {
  background: var(--mfs-blue);
  border-color: var(--mfs-blue);
}
.section-row.full .dot.filled {
  background: var(--success);
  border-color: var(--success);
}

/* Card footer */
.card-footer {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  font-feature-settings: 'tnum';
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 50;
  align-items: center;
  justify-content: center;
}
.modal-card {
  max-width: 480px;
  width: 90%;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}

body.admin-dashboard input[type=text],
body.admin-dashboard input[type=email] {
  border-radius: 6px;
  border-color: var(--border-strong);
  font-family: 'IBM Plex Sans', sans-serif;
}
body.admin-dashboard input:focus { outline: 2px solid var(--mfs-blue); outline-offset: -1px; }
body.admin-dashboard .error {
  font-style: italic;
  color: var(--error);
}

@media (max-width: 600px) {
  .closer-grid { grid-template-columns: 1fr; }
  .sections { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 34px; }
}
