/* Humber UBF Ministry Tracking — Humber UBF branding.
   Deep indigo #3F35AF, bright blue #0099FF, yellow #F1DF01, Segoe UI. */

:root {
  --indigo: #3f35af;
  --indigo-dark: #322a8f;
  --blue: #0099ff;
  --yellow: #f1df01;
  --bg: #f4f4fa;
  --surface: #ffffff;
  --text: #1f1f2e;
  --muted: #5a5a72;
  --border: #d9d9e8;
  --danger: #b3261e;
  --success: #1b7a3d;
  --radius: 10px;
}

[data-theme="dark"] {
  --bg: #14142a;
  --surface: #1e1e3a;
  --text: #f0f0fa;
  --muted: #a9a9c4;
  --border: #3a3a5e;
}

* { box-sizing: border-box; }

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

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); }
.success { color: var(--success); }

/* ---------- Header ---------- */
.site-header {
  background: var(--indigo);
  color: #fff;
  padding: 1rem 1rem 1.25rem;
  border-bottom: 4px solid var(--yellow);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.logo {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: #fff;
  flex-shrink: 0;
}
.header-text { flex: 1; min-width: 0; }
.header-text h1 {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  line-height: 1.2;
}
.header-sub {
  font-weight: 400;
  color: var(--yellow);
}
.verse {
  margin: 0;
  font-style: italic;
  font-size: 0.95rem;
  border-left: 3px solid var(--yellow);
  padding-left: 0.75rem;
  color: #e8e8ff;
}
.verse cite { display: block; font-style: normal; font-size: 0.8rem; color: var(--yellow); margin-top: 0.2rem; }
.header-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.header-actions button {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}
.header-actions button:hover { background: rgba(255, 255, 255, 0.3); }

/* ---------- Layout ---------- */
main { max-width: 960px; margin: 0 auto; padding: 1rem; }
.view { margin-top: 0.5rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.card h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.site-footer { max-width: 960px; margin: 0 auto; padding: 0 1rem 2rem; text-align: center; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.6rem 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.tab.active { color: var(--indigo); border-bottom-color: var(--indigo); font-weight: 600; }
[data-theme="dark"] .tab.active { color: var(--yellow); border-bottom-color: var(--yellow); }

/* ---------- Forms ---------- */
form label { display: block; margin-bottom: 0.75rem; font-weight: 600; font-size: 0.95rem; }
form input, form select, form textarea {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
form input:focus, form select:focus, form textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}
.form-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.form-row label { flex: 1; min-width: 140px; }
.filters label { font-weight: 400; }
button { font-family: inherit; cursor: pointer; }
.primary {
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
}
.primary:hover { background: var(--indigo-dark); }
.secondary {
  background: transparent;
  color: var(--indigo);
  border: 1px solid var(--indigo);
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
}
[data-theme="dark"] .secondary { color: var(--yellow); border-color: var(--yellow); }
.link-button {
  background: none;
  border: none;
  color: var(--blue);
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}
.inline-form { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form .grow { flex: 1; min-width: 180px; }
.button-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* ---------- Attendance ---------- */
.check-fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem 1rem;
  margin: 0 0 0.75rem;
}
.check-fieldset legend { font-weight: 600; font-size: 0.95rem; padding: 0 0.4rem; }
.check-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4rem 1rem;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}
.check-item input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--indigo);
  flex-shrink: 0;
}
.guest-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.guest-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(63, 53, 175, 0.1);
  border-radius: 999px;
  padding: 0.25rem 0.35rem 0.25rem 0.75rem;
  margin: 0 0.4rem 0.4rem 0;
  font-size: 0.95rem;
}
[data-theme="dark"] .guest-list li { background: rgba(241, 223, 1, 0.15); }
.guest-list button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
}

/* ---------- Stats ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.stat-card .stat-number { font-size: 1.8rem; font-weight: 700; color: var(--indigo); }
[data-theme="dark"] .stat-card .stat-number { color: var(--yellow); }
.stat-card .stat-label { color: var(--muted); font-size: 0.9rem; }

/* ---------- Tables & lists ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; }
.record-list, .member-list { list-style: none; margin: 0; padding: 0; }
.record-list li, .member-list li {
  padding: 0.6rem 0.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.record-list li:last-child, .member-list li:last-child { border-bottom: none; }
.record-main { flex: 1; min-width: 200px; }
.record-kind {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--indigo);
  background: rgba(63, 53, 175, 0.12);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-right: 0.4rem;
}
[data-theme="dark"] .record-kind { color: var(--yellow); background: rgba(241, 223, 1, 0.15); }
.record-meta { color: var(--muted); font-size: 0.85rem; }
.record-actions, .member-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.record-actions button, .member-actions button {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.25rem 0.6rem;
  color: var(--text);
  font-size: 0.85rem;
}
.record-actions button.danger, .member-actions button.danger { color: var(--danger); border-color: var(--danger); }
.member-name { flex: 1; min-width: 140px; font-weight: 600; }
.member-list input[type="text"] {
  padding: 0.4rem 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text);
}
.prayer-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.answered { text-decoration: line-through; color: var(--muted); }
.login-card { max-width: 460px; margin: 1rem auto; }

@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; }
  .logo { width: 56px; height: 56px; }
  .header-text h1 { font-size: 1.25rem; }
}
