:root {
  --navy: #1f3864;
  --navy-dark: #14264a;
  --border: #dfe3ea;
  --bg: #f6f7fb;
  --text: #1c2333;
  --muted: #6b7280;
  --danger-bg: #f8d7da;
  --danger-text: #842029;
  --success-bg: #d1e7dd;
  --success-text: #0f5132;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.navbar {
  background: var(--navy);
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: white;
}

.navbar nav a {
  color: #d8def0;
  margin-left: 1rem;
  font-size: 0.92rem;
}

.navbar nav a:hover { color: white; }

.container {
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2.5rem;
  box-sizing: border-box;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card.narrow {
  max-width: 420px;
  margin: 3rem auto;
}

.hidden-form { display: none; }

.inline-field {
  padding: 0.3rem 0.4rem;
  font-size: 0.82rem;
  min-width: 8rem;
}

h1 { font-size: 1.5rem; margin-top: 0; }
h2 { font-size: 1.15rem; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.flash.error { background: var(--danger-bg); color: var(--danger-text); }
.flash.success { background: var(--success-bg); color: var(--success-text); }

label { display: block; font-size: 0.85rem; font-weight: 600; margin: 0.75rem 0 0.25rem; }

input[type=text], input[type=email], input[type=password], input[type=date], input[type=tel],
select, textarea {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
}

textarea { min-height: 70px; resize: vertical; }

button, .btn {
  display: inline-block;
  background: var(--navy);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 1rem;
}
button:hover, .btn:hover { background: var(--navy-dark); text-decoration: none; }

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

.btn.danger { background: white; color: var(--danger-text); border: 1px solid var(--danger-text); }
.btn.danger:hover { background: var(--danger-bg); }

.btn.small { padding: 0.3rem 0.6rem; font-size: 0.8rem; margin-top: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th { background: #eef1f8; font-weight: 700; white-space: nowrap; }

.table-wrap { overflow-x: auto; }

/* Keep the Save/Details actions reachable without horizontal scrolling —
   on a long, unfiltered table the scrollbar for .table-wrap only appears
   once you've scrolled all the way to the bottom of the page, which made
   the action buttons practically undiscoverable. */
.table-wrap table td:last-child,
.table-wrap table th:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
  box-shadow: -2px 0 4px rgba(0, 0, 0, 0.08);
  white-space: nowrap;
}
.table-wrap table td:last-child { background: #fff; }
.table-wrap table th:last-child { background: #eef1f8; }

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill.status-not-contacted { background: #e5e7eb; color: #374151; }
.pill.status-contacted { background: #dbeafe; color: #1e40af; }
.pill.status-awaiting-response { background: #fef3c7; color: #92400e; }
.pill.status-accepted { background: #d1e7dd; color: #0f5132; }
.pill.status-declined { background: #f8d7da; color: #842029; }
.pill.status-no-donations-accepted { background: #e5e7eb; color: #6b7280; }

.pill.tier-1 { background: #ede9fe; color: #5b21b6; }
.pill.tier-2 { background: #e0e7ff; color: #3730a3; }
.pill.tier-3 { background: #f1f5f9; color: #475569; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 1rem;
}
.filters .field { min-width: 160px; }
.filters label { margin-top: 0; }

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.stat {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
}
.stat strong { display: block; font-size: 1.2rem; color: var(--navy); }

.muted { color: var(--muted); font-size: 0.85rem; }

.help-text { color: var(--muted); font-size: 0.82rem; margin-top: 0.15rem; }

.top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sticky-heading {
  position: sticky;
  top: var(--navbar-height, 60px);
  z-index: 40;
  background: var(--bg);
  padding: 0.75rem 0;
  margin-bottom: 0;
  box-shadow: 0 4px 6px -6px rgba(0, 0, 0, 0.2);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 1rem;
  padding: 0.75rem 1rem 1rem;
}
legend { font-weight: 700; font-size: 0.85rem; color: var(--navy); padding: 0 0.3rem; }

.video-embed {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
  margin-top: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
