:root {
  --ink: #17211b;
  --muted: #637069;
  --quiet: #7a837e;
  --paper: #fffdf7;
  --glass: rgba(255, 253, 247, 0.96);
  --cream: #f6f3ea;
  --line: #ddd6c8;
  --soft-line: rgba(221, 214, 200, 0.72);
  --green: #2f644b;
  --gold: #b9924b;
  --blue: #263f5f;
  --purple: #5b2b82;
  --red: #b54747;
  --shadow: 0 16px 36px rgba(23, 33, 27, 0.1);
  --deep-shadow: 0 24px 70px rgba(7, 15, 30, 0.24);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--cream); font-family: "Segoe UI", Arial, Helvetica, sans-serif; line-height: 1.5; font-weight: 400; }
button, input, textarea, select { font: inherit; }
a { color: inherit; font-weight: 650; text-decoration: none; }

.member-page {
  background:
    linear-gradient(180deg, rgba(31, 13, 57, 0.18), rgba(246, 243, 234, 0.88) 66%, rgba(246, 243, 234, 1)),
    url("assets/ministry-cross-bg.png") center top / cover fixed;
}
.member-shell { min-height: 100vh; padding: clamp(16px, 3vw, 28px); }
.topbar, .dashboard-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar {
  width: min(980px, 100%);
  margin: 0 auto 18px;
  padding: 12px 14px;
  color: white;
  background: rgba(35, 16, 55, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand > span { display: grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--green); border-radius: 8px; font-weight: 700; }
.brand > img { width: 46px; height: 46px; object-fit: cover; border: 2px solid rgba(255,255,255,.78); border-radius: 50%; box-shadow: 0 8px 22px rgba(0,0,0,.16); }
.sidebar .brand > img { width: 58px; height: 58px; }
.brand strong { display: block; font-size: .96rem; line-height: 1.15; font-weight: 650; }
.brand small { display: block; color: var(--muted); }
.topbar .brand small { color: rgba(255,255,255,.76); }
.sidebar .brand small { color: rgba(255,255,255,.68); }
.hero, .checkin-card { width: min(760px, 100%); margin: 0 auto; }
.hero {
  padding: 24px 0 16px;
  color: white;
  text-shadow: 0 2px 18px rgba(38, 18, 58, .42);
}
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: .7rem; font-weight: 600; text-transform: uppercase; }
h1, h2 { margin: 0; color: var(--blue); font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.02; letter-spacing: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
p, span, h1, h2, h3, strong, small { overflow-wrap: anywhere; }
.hero h1 { color: white; }
.hero .eyebrow { color: #f7c96b; }
.hero p:not(.eyebrow) { max-width: 520px; color: rgba(255,255,255,.9); font-size: .98rem; font-weight: 400; }
.entry p, .pill-list, .member-list, .login-card p { color: var(--muted); }
.checkin-card, .login-card, .metric-grid article, .panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.checkin-card {
  background: var(--glass);
  border-color: rgba(255,255,255,.55);
  box-shadow: 0 24px 70px rgba(45, 18, 68, 0.24);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.checkin-card, .login-card, .panel { padding: clamp(18px, 3vw, 28px); }
.card-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: -2px 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--soft-line);
}
.card-intro .eyebrow { margin-bottom: 5px; color: var(--gold); text-shadow: none; }
.card-intro h2 { font-size: clamp(1.35rem, 3vw, 2.1rem); }
.card-intro > span {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--blue);
  background: rgba(185,146,75,.14);
  border: 1px solid rgba(185,146,75,.22);
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 650;
}
form { display: grid; gap: 16px; }
.form-section {
  display: grid;
  gap: 13px;
  padding: 16px;
  background: rgba(255, 255, 255, .58);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}
.form-section h3 {
  margin: 0;
  color: var(--blue);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: 0;
}
.saved-member-note {
  display: none;
  margin: 0;
  padding: 10px 12px;
  color: var(--green);
  background: rgba(47, 100, 75, .08);
  border: 1px solid rgba(47, 100, 75, .16);
  border-radius: 7px;
  font-size: .9rem;
  font-weight: 600;
}
.saved-member-note.visible { display: block; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 6px; color: var(--quiet); font-size: .86rem; font-weight: 450; }
input, textarea, select { width: 100%; padding: 12px 13px; color: var(--ink); background: #fffdf8; border: 1px solid var(--line); border-radius: 7px; font-weight: 400; }
select { cursor: pointer; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(185,146,75,.3); border-color: var(--gold); }
.scripture-picker { grid-template-columns: 1.2fr .9fr .9fr; }
.verse-preview {
  padding: 15px;
  background: linear-gradient(135deg, rgba(38,63,95,.08), rgba(185,146,75,.12));
  border: 1px solid rgba(38,63,95,.13);
  border-radius: 8px;
}
.verse-preview span {
  display: block;
  margin-bottom: 5px;
  color: var(--blue);
  font-size: .76rem;
  font-weight: 650;
  text-transform: uppercase;
}
.verse-preview p {
  margin: 0;
  color: #46564e;
}
.verse-preview a {
  display: inline-flex;
  margin-top: 9px;
  color: var(--blue);
  font-size: .9rem;
  font-weight: 650;
  text-decoration: underline;
}
.verse-preview small {
  display: block;
  margin-top: 8px;
  color: #69766f;
}
.verse-preview.found {
  background: #fffaf0;
  border-color: rgba(185,146,75,.34);
}
.checkbox-row { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fbfaf4; border: 1px solid var(--line); border-radius: 7px; }
.checkbox-row input { width: auto; }
.submit-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding-top: 2px; }
.primary-button, .outline-button { min-height: 44px; padding: 0 16px; border-radius: 7px; font-weight: 650; cursor: pointer; }
.primary-button { color: white; background: var(--green); border: 0; }
.outline-button { color: var(--blue); background: var(--paper); border: 1px solid var(--line); }
.text-button {
  width: fit-content;
  padding: 0;
  color: var(--blue);
  background: none;
  border: 0;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.form-status, .error { display: none; margin: 0; color: var(--green); font-weight: 600; }
.form-status.visible, .error.visible { display: block; }
.error { color: var(--red); }

.dashboard-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background:
    linear-gradient(145deg, rgba(33, 14, 55, .78), rgba(246, 243, 234, .88) 48%, rgba(246, 243, 234, .96)),
    url("assets/ministry-cross-bg.png") center top / cover fixed;
}
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px; color: white; background: linear-gradient(180deg, #1b1024, #111b16); display: flex; flex-direction: column; gap: 18px; }
.sidebar a { margin-top: auto; }
.dashboard-main { min-width: 0; padding: 28px clamp(20px, 4vw, 52px) 52px; }
.login-card { width: min(440px, 100%); margin: 12vh auto 0; display: grid; gap: 12px; }
.dashboard-content { display: none; width: min(1180px, 100%); margin: 0 auto; }
.dashboard-top {
  padding: 18px 20px;
  background: rgba(255, 253, 247, .94);
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.dashboard-top h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 14px; }
.metric-grid article { min-height: 88px; padding: 14px 16px; background: rgba(255, 253, 247, .94); }
.metric-grid span { display: block; color: var(--muted); font-size: .88rem; font-weight: 500; }
.metric-grid strong { display: block; margin-top: 8px; color: var(--blue); font-size: 1.55rem; font-weight: 600; }
.date-panel {
  margin-bottom: 16px;
}
.history-panel {
  background: rgba(255, 253, 247, .97);
  border-color: rgba(255, 255, 255, .52);
  box-shadow: 0 18px 42px rgba(45, 18, 68, .14);
  backdrop-filter: blur(12px);
}
.date-panel-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 270px);
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--soft-line);
}
.date-panel-top .eyebrow { margin-bottom: 5px; }
.panel-subtitle {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--quiet);
  font-size: .92rem;
}
.date-control {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid rgba(91, 43, 130, .24);
  border-radius: 8px;
  gap: 7px;
  box-shadow: 0 10px 24px rgba(91, 43, 130, .08);
}
.date-control span {
  color: var(--purple);
  font-size: .78rem;
  font-weight: 600;
}
.date-control input {
  min-height: 42px;
  padding: 0 2px;
  color: var(--ink);
  background: #fff;
  border: 0;
  font-size: 1.02rem;
  font-weight: 500;
  color-scheme: light;
}
.date-control input:focus { outline: 0; }
.date-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.date-summary span {
  display: block;
  min-height: 64px;
  padding: 10px 12px;
  color: var(--quiet);
  background: rgba(246, 243, 234, .76);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 400;
}
.date-summary strong {
  display: block;
  color: var(--purple);
  font-size: 1.18rem;
  font-weight: 600;
}
.daily-board {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 16px;
  align-items: start;
}
.daily-board > section {
  min-width: 0;
  padding: 16px;
  background: rgba(246, 243, 234, .58);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}
.section-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 11px;
}
.section-heading h3 {
  margin: 0;
  color: var(--blue);
  font-size: .98rem;
  font-weight: 550;
  letter-spacing: 0;
}
.section-heading small {
  color: var(--quiet);
  font-size: .84rem;
  font-weight: 400;
}
.missing-block {
  margin-top: 0;
}
.missing-block h3 {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: .96rem;
  font-weight: 600;
  letter-spacing: 0;
}
.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.panel { grid-column: span 5; }
.panel.wide { grid-column: span 7; }
.dashboard-grid .panel { background: rgba(255, 253, 247, .95); }
.panel > h2 {
  margin-bottom: 14px;
  font-size: 1.1rem;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-weight: 550;
  line-height: 1.2;
}
.date-panel > h2,
.date-panel-top h2 {
  font-size: 1.36rem;
}
.entry-list, .pill-list, .member-list { display: grid; gap: 10px; }
.compact-list { gap: 8px; }
.entry, .member-row { padding: 12px; background: var(--cream); border: 1px solid var(--line); border-radius: 8px; }
.entry div, .member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}
.entry strong, .member-row strong { display: block; color: var(--blue); font-weight: 550; }
.entry span, .member-row > span, .pill-list span { display: inline-flex; padding: 6px 9px; color: var(--blue); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; font-size: .78rem; font-weight: 500; }
.member-row div span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .86rem;
  font-weight: 400;
}
.entry small {
  display: block;
  color: var(--gold);
  font-size: .82rem;
  font-weight: 500;
}
.entry p { margin: 8px 0; font-size: .92rem; }
.entry blockquote {
  margin: 9px 0;
  padding: 10px 12px;
  color: #33433b;
  background: var(--paper);
  border-left: 3px solid var(--gold);
  border-radius: 0 7px 7px 0;
}
.pill-list { display: flex; flex-wrap: wrap; }

@media (max-width: 980px) {
  .dashboard-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .date-panel-top, .date-summary, .daily-board { grid-template-columns: 1fr; }
  .panel, .panel.wide { grid-column: span 12; }
}

@media (max-width: 680px) {
  .topbar, .dashboard-top, .card-intro { align-items: flex-start; flex-direction: column; }
  .entry div, .member-row { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .submit-row { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
  .primary-button, .outline-button { width: 100%; }
}
