/* Hallmark · macrostructure: Long Document · genre: editorial · theme: custom (navy / parchment / brass)
 * Hallmark · pre-emit critique: P4 H5 E4 S4 R5 V4
 * Palette anchored on the Deeper Life Bible Church crest. */

:root {
  --paper: #f7f4ec;
  --paper-2: #fffdf8;
  --paper-3: #f1ece0;
  --ink: #1b2436;
  --ink-2: #5a6272;
  --navy: #1b2c50;
  --navy-2: #12203d;
  --navy-line: #34446c;
  --brass: #a97b35;
  --brass-2: #d9b876;
  --brass-wash: #f3ead8;
  --red: #a83b3b;
  --blue: #2f6fa8;
  --success: #2f6b4f;
  --line: #e3ddcf;
  --line-2: #d3cbb8;
  --white: #ffffff;
  --shadow-color: rgba(27, 44, 80, 0.10);
  --focus: #c08f3e;

  --font-display: Georgia, "Times New Roman", serif;
  --font-body: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;

  --radius: 14px;
  --shadow: 0 14px 36px var(--shadow-color), 0 2px 6px var(--shadow-color);

  --step-sm: 0.78rem;
  --step-base: 0.94rem;
  --step-lg: 1.12rem;
  --step-xl: 2.1rem;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--step-base);
  color: var(--ink);
  background:
    radial-gradient(900px 460px at 0% -10%, var(--brass-wash), transparent 62%),
    radial-gradient(800px 420px at 100% 4%, var(--paper-3), transparent 58%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  overflow-wrap: anywhere;
  min-width: 0;
  margin: 0;
}

a { color: var(--navy); }

.shell {
  width: min(1160px, 100% - 40px);
  margin: 0 auto;
  padding: 32px 0 64px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.shell-wide { grid-template-columns: minmax(0, 1fr); max-width: 1060px; }

/* ---------- Side rail ---------- */
.rail { min-width: 0; }

.rail-inner {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 18px;
  background: var(--navy);
  color: var(--white);
  box-shadow: var(--shadow);
}

.rail-inner::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -140px;
  top: -150px;
  border-radius: 50%;
  background: var(--navy-2);
}

.rail-inner > * { position: relative; }

.brand-lockup { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }

.logo {
  display: block;
  flex: 0 0 auto;
  width: 80px;
  height: 80px;
  padding: 7px;
  border-radius: 12px;
  background: var(--paper-2);
}

.logo-small { width: 76px; height: 76px; background: transparent; padding: 0; }

.eyebrow {
  display: block;
  color: var(--brass-2);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand-text h1 {
  margin-top: 6px;
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 1.9rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.rail-copy { margin: 20px 0 0; color: var(--paper-3); font-size: 0.88rem; line-height: 1.6; text-align: center; }

.date-card {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--navy-line);
  border-left: 3px solid var(--brass-2);
  border-radius: 10px;
  background: var(--navy-2);
}

.date-card span { display: block; color: var(--brass-2); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.date-card strong { display: block; margin-top: 5px; font-size: 0.92rem; }

.progress-block { margin-top: 22px; }
.progress-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.74rem; color: var(--paper-3); }
.progress-head span:last-child { color: var(--brass-2); font-weight: 700; }
.progress-track { height: 6px; margin-top: 8px; border-radius: 99px; background: var(--navy-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; border-radius: inherit; background: var(--brass-2); transition: width 0.25s ease; }

.live-stats { margin-top: 24px; border-top: 1px solid var(--navy-line); }
.live-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--navy-line);
  font-size: 0.8rem;
  color: var(--paper-3);
}
.live-stat strong { font-size: 1.18rem; color: var(--white); font-variant-numeric: tabular-nums; }
.live-grand strong { color: var(--brass-2); }
.live-stat strong.bump { transform: scale(1.12); transition: transform 0.16s ease; }

.rail-note { margin: 18px 0 0; font-size: 0.74rem; color: var(--paper-3); opacity: 0.85; }

/* ---------- Content panels ---------- */
.content { min-width: 0; }

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 15px 17px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
}
.alert-success { border-left: 4px solid var(--success); }
.alert-error { border-left: 4px solid var(--red); }
.alert-icon {
  display: grid; place-items: center; flex: 0 0 24px; height: 24px;
  border-radius: 50%; background: var(--success); color: var(--white); font-weight: 800; font-size: 0.8rem;
}
.alert-error .alert-icon { background: var(--red); }
.alert div { display: grid; gap: 3px; font-size: 0.86rem; }
.alert span { color: var(--ink-2); }
.alert a { color: var(--navy); font-weight: 700; text-decoration: underline; margin-top: 2px; }

.panel {
  margin-bottom: 18px;
  padding: 26px 28px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.panel-head { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.panel-index {
  display: grid; place-items: center; flex: 0 0 36px; height: 36px;
  border: 1px solid var(--brass-2); border-radius: 50%;
  color: var(--brass); font-family: var(--font-display); font-size: 0.95rem; font-weight: 700;
}
.panel-head h2 { font-size: var(--step-lg); }
.panel-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.82rem; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-wide { margin-bottom: 18px; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field label { color: var(--ink); font-size: 0.8rem; font-weight: 700; }
.req { color: var(--red); margin-left: 2px; }

.field input, .field select {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 13px;
  font: inherit;
  font-size: var(--step-base);
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.field input::placeholder { color: var(--line-2); }
.field select { appearance: none; cursor: pointer; padding-right: 34px; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 15px; top: 18px;
  width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: rotate(45deg); pointer-events: none;
}

.field input:hover, .field select:hover { border-color: var(--brass-2); background: var(--paper-2); }
.field input:focus-visible, .field select:focus-visible { border-color: var(--brass); box-shadow: 0 0 0 4px var(--brass-wash); }
.field input:active, .field select:active { background: var(--paper); }
.field input:disabled, .field select:disabled { opacity: 0.55; cursor: not-allowed; }
.field input.is-valid, .field select.is-valid { border-color: var(--success); }
.field input.is-invalid, .field select.is-invalid { border-color: var(--red); background: var(--paper-2); }
.field input.is-invalid:focus-visible, .field select.is-invalid:focus-visible { box-shadow: 0 0 0 4px var(--brass-wash); }
.field-error { margin: 0; color: var(--red); font-size: var(--step-sm); font-weight: 600; }

.inline-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; padding: 11px 14px; border-radius: 9px;
  background: var(--paper-3); color: var(--ink-2); font-size: 0.82rem;
}
.inline-total strong { color: var(--navy); font-size: 1.02rem; font-variant-numeric: tabular-nums; }

.categories { display: grid; gap: 14px; }
.category { padding: 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.category h3 { margin-bottom: 15px; font-size: 1rem; }
.category h3::after { content: ""; display: block; width: 26px; height: 2px; margin-top: 7px; background: var(--brass); }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; }
.required-note { margin: 0; color: var(--ink-2); font-size: var(--step-sm); }

.submit-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px;
  border: 0; border-bottom: 3px solid var(--brass); border-radius: 9px;
  background: var(--navy); color: var(--white);
  font: inherit; font-weight: 700; font-size: var(--step-base); white-space: nowrap;
  cursor: pointer; transition: transform 0.16s ease, background 0.16s ease;
}
.submit-btn:hover { background: var(--navy-2); transform: translateY(-2px); }
.submit-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.submit-btn:active { transform: translateY(0); }
.submit-btn:disabled { cursor: not-allowed; opacity: 0.6; transform: none; }
.submit-btn.is-loading .btn-label { opacity: 0.8; }
.submit-btn.is-loading .btn-spinner { display: block; }
.submit-btn.is-success { background: var(--success); border-bottom-color: var(--brass-2); }
.btn-spinner { display: none; width: 16px; height: 16px; border: 2px solid var(--navy-line); border-top-color: var(--white); border-radius: 50%; animation: spin 0.7s linear infinite; }

.page-footer { margin-top: 26px; text-align: center; }
.page-footer a, .back-link { color: var(--navy); font-weight: 700; font-size: 0.86rem; text-decoration: none; white-space: nowrap; }
.page-footer a:hover, .back-link:hover { text-decoration: underline; }

/* ---------- List page ---------- */
.list-head {
  display: flex; align-items: center; gap: 16px;
  padding: 22px 26px; margin-bottom: 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper-2); box-shadow: var(--shadow);
}
.list-head h1 { font-size: 1.6rem; }
.list-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 0.84rem; }
.back-link { margin-left: auto; }

.table-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-2); box-shadow: var(--shadow); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.84rem; white-space: nowrap; }
th, td { padding: 13px 15px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child, th:nth-child(2), td:nth-child(2) { text-align: left; }
th { background: var(--paper-3); color: var(--ink-2); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--paper); }
td.grand { color: var(--brass); font-weight: 800; }
.muted { color: var(--ink-2); }

.empty-state { padding: 58px 20px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--paper-2); }
.empty-icon { font-size: 2rem; color: var(--brass-2); }
.empty-state h2 { margin: 12px 0 6px; font-size: 1.1rem; }
.empty-state p { margin: 0; color: var(--ink-2); font-size: 0.86rem; }

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

/* ---------- Responsive: 768 / 414 / 375 / 320 ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 18px; }
  .rail { position: static; }
  .rail-inner { padding: 22px; }
  .rail-copy { display: none; }
  .live-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border-top: 0; }
  .live-stat { flex-direction: column; gap: 4px; border-bottom: 0; border-top: 1px solid var(--navy-line); }
  .live-stat strong { font-size: 1.05rem; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1160px); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 20px 17px 22px; }
  .panel-head { gap: 11px; }
  .category { padding: 15px; }
  .list-head { flex-wrap: wrap; padding: 18px; }
  .back-link { margin-left: 0; }
}

@media (max-width: 420px) {
  .shell { width: calc(100% - 20px); padding-top: 12px; padding-bottom: 40px; }
  .rail-inner { padding: 18px; }
  .logo { width: 68px; height: 68px; }
  .date-card strong { font-size: 0.84rem; }
  .live-stat strong { font-size: 0.96rem; }
  .live-stat { font-size: 0.72rem; }
  .form-footer { flex-direction: column; align-items: stretch; }
  .required-note { text-align: center; }
  .submit-btn { width: 100%; padding: 0 14px; }
  .panel-head h2 { font-size: 1rem; }
  .list-head h1 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
