:root {
  --navy: #10294a;
  --royal: #164f91;
  --gold: #d7b46a;
  --gold-soft: #f6e4b7;
  --ink: #18212c;
  --muted: #607086;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --line: rgba(16, 41, 74, 0.12);
  --success: #1f7a52;
  --danger: #a63d40;
  --shadow: 0 24px 60px rgba(10, 25, 47, 0.16);
}

* { box-sizing: border-box; }
html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(215, 180, 106, 0.35), transparent 28%),
    radial-gradient(circle at top right, rgba(22, 79, 145, 0.20), transparent 30%),
    linear-gradient(180deg, #f5f1e5 0%, #edf3fb 46%, #f8fbff 100%);
  font-family: Georgia, "Times New Roman", serif;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.site-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.brand-mark { display: flex; flex-direction: column; gap: 0.15rem; }
.brand-kicker, .eyebrow {
  font-family: "Segoe UI", Tahoma, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--royal);
}

.brand-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--navy);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.site-nav a, .nav-button, .secondary-link { color: var(--navy); font-weight: 600; }
.nav-button { border: 0; background: transparent; cursor: pointer; padding: 0; }
.nav-badge-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.6rem;
}
.nav-count-badge {
  position: absolute;
  top: -0.9rem;
  right: -0.85rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.32rem;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  line-height: 1.05rem;
  text-align: center;
  font-weight: 800;
}

.page-frame { display: grid; gap: 1.5rem; }

.hero-panel, .card-panel {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1.5rem;
  padding: 2rem;
}

.hero-signin { min-height: 72vh; align-items: center; }

.hero-copy h1, .page-card h1 {
  margin: 0.2rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 0.95;
  color: var(--navy);
}

.lede, .muted-copy, .content-list p, .member-card p, .meta-copy {
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--muted);
  line-height: 1.6;
}

.feature-list {
  margin: 1.4rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.65rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card, .signin-card, .member-card {
  padding: 1.25rem;
  border-radius: 24px;
  background: var(--surface-strong);
  border: 1px solid rgba(215, 180, 106, 0.35);
}

.stat-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.5rem;
  color: var(--navy);
}

.stat-label {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card-panel { padding: 1.5rem; }
.card-header-block h2, .page-card h1 { margin: 0.2rem 0 0.5rem; color: var(--navy); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.wide-card { grid-column: 1 / -1; }
.content-list, .member-grid { display: grid; gap: 0.9rem; }

.list-row, .member-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.list-row h3, .member-card h3 { margin: 0 0 0.3rem; color: var(--ink); }

.pill-tag {
  display: inline-flex;
  align-items: center;
  height: fit-content;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-soft), #fff7e3);
  color: #7c5a13;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}
.danger-pill {
  background: rgba(166, 61, 64, 0.12);
  color: var(--danger);
}

.stack-form { display: grid; gap: 0.75rem; }
.stack-form label {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
  color: var(--navy);
}

.stack-form input, .stack-form textarea, .stack-form select, .inline-role-form select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.stack-form textarea {
  resize: vertical;
  min-height: 120px;
}

.primary-button, .mini-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
}

.primary-button, .mini-button {
  background: linear-gradient(135deg, #184e92, #0f2d53);
  color: white;
}

.primary-button { padding: 0.95rem 1.2rem; margin-top: 0.4rem; }
.mini-button { padding: 0.75rem 1rem; }
.action-link { display: inline-flex; align-items: center; justify-content: center; }
.ghost-button, .ghost-link {
  padding: 0.7rem 1rem;
  background: rgba(16, 41, 74, 0.07);
  color: var(--navy);
  border: 1px solid rgba(16, 41, 74, 0.1);
}
.signin-actions {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}
.signup-form {
  margin: 0;
}
.signin-signup-button {
  justify-content: center;
  width: 100%;
  padding: 0.95rem 1.2rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 800;
  font-size: 1rem;
}

.field-error {
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--danger);
  font-size: 0.9rem;
}

.alert-card {
  margin: 0.8rem 0 1rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 600;
}

.error-alert { background: rgba(166, 61, 64, 0.12); color: var(--danger); }
.success-alert { background: rgba(31, 122, 82, 0.12); color: var(--success); }

.page-card { display: grid; gap: 1rem; }
.table-shell { overflow-x: auto; }

.member-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.member-table th, .member-table td {
  padding: 0.95rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.member-table th {
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.member-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.member-profile-card {
  display: grid;
  gap: 0.8rem;
  align-content: start;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(16, 41, 74, 0.08);
}
.member-profile-card h2 { margin: 0; color: var(--navy); }
.member-profile-photo,
.member-profile-photo-placeholder {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
}
.member-profile-photo { object-fit: cover; }
.member-profile-photo-placeholder {
  display: grid;
  place-items: center;
  background: var(--gold-soft);
  color: var(--navy);
  font-size: 1.8rem;
  font-weight: 800;
}

.inline-role-form { display: flex; gap: 0.65rem; align-items: center; }
.member-access-actions { display: grid; gap: 0.65rem; min-width: 15rem; }
.member-access-actions .inline-role-form { align-items: stretch; }
.member-access-actions input[type="datetime-local"] {
  min-width: 11rem;
  padding: 0.72rem 0.8rem;
  border-radius: 16px;
  border: 1px solid var(--line);
}
.secondary-link { display: inline-block; margin-top: 1rem; }
.form-card { background: rgba(255, 255, 255, 0.68); padding: 1rem; border-radius: 24px; }
.row-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rich-row { padding: 1rem; border-radius: 24px; background: rgba(255, 255, 255, 0.72); border: 1px solid rgba(16, 41, 74, 0.06); }
.button-row { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.ghost-link { display: inline-flex; align-items: center; border-radius: 999px; }
.events-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.5rem;
}
.calendar-shell {
  padding: 1.1rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(16, 41, 74, 0.08);
}
.calendar-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.calendar-header h2 {
  margin: 0;
  text-align: center;
  color: var(--navy);
}
.calendar-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(16, 41, 74, 0.08);
  font-size: 1.5rem;
}
.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.45rem;
}
.calendar-weekdays {
  margin-bottom: 0.55rem;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
}
.calendar-day {
  min-height: 4.5rem;
  padding: 0.7rem 0.35rem;
  border-radius: 18px;
  border: 1px solid rgba(16, 41, 74, 0.08);
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
}
.calendar-day-outside {
  opacity: 0.35;
}
.calendar-day-selected {
  background: #e7f0ff;
  border-color: #4a6cf7;
  box-shadow: inset 0 0 0 1px rgba(74, 108, 247, 0.16);
}
.calendar-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #4a6cf7;
}
.selected-events-panel {
  display: grid;
  gap: 1rem;
  align-self: start;
}
.profile-photo-card {
  display: flex;
  justify-content: center;
}
.profile-photo-preview,
.profile-photo-placeholder {
  width: 9rem;
  height: 9rem;
  border-radius: 32px;
  object-fit: cover;
  border: 1px solid rgba(16, 41, 74, 0.08);
  background: rgba(255, 255, 255, 0.82);
}
.profile-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--muted);
}
.auth-page-card {
  max-width: 42rem;
  margin: 0 auto;
}
.active-filter {
  background: var(--navy);
  color: white;
}
.two-column-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.checkbox-row { display: flex; gap: 0.65rem; align-items: center; }
.checkbox-row input { width: auto; }
.inset-card { background: rgba(255,255,255,0.72); }
.button-row form { margin: 0; }
.prayer-card { border-width: 1px; border-style: solid; }
.prayer-card-prayed {
  background: linear-gradient(180deg, rgba(223, 244, 232, 0.95), rgba(255, 255, 255, 0.88));
  border-color: rgba(31, 122, 82, 0.22);
}
.prayer-card-unprayed {
  background: linear-gradient(180deg, rgba(255, 241, 207, 0.92), rgba(255, 255, 255, 0.88));
  border-color: rgba(154, 106, 17, 0.2);
}
.prayer-card-urgent {
  background: linear-gradient(180deg, rgba(254, 226, 226, 0.96), rgba(255, 255, 255, 0.9));
  border-color: rgba(166, 61, 64, 0.42);
  box-shadow: 0 18px 42px rgba(166, 61, 64, 0.14);
}
.prayer-card-featured {
  background: linear-gradient(180deg, rgba(219, 234, 254, 0.96), rgba(255, 255, 255, 0.9));
  border-color: rgba(22, 79, 145, 0.36);
  box-shadow: 0 18px 42px rgba(22, 79, 145, 0.12);
}
.priority-copy {
  margin: 0.35rem 0 0;
  color: var(--navy) !important;
  font-weight: 800;
}
.prayer-state-pill {
  display: inline-flex;
  margin-bottom: 0.6rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}
.prayer-state-pill-prayed {
  background: rgba(31, 122, 82, 0.12);
  color: #1f7a52;
}
.prayer-state-pill-unprayed {
  background: rgba(154, 106, 17, 0.12);
  color: #9a6a11;
}
.prayer-state-pill-urgent {
  background: rgba(166, 61, 64, 0.14);
  color: #8f2428;
}
.prayer-state-pill-featured {
  background: rgba(22, 79, 145, 0.12);
  color: #164f91;
}
button:disabled { opacity: 0.5; cursor: not-allowed; }
code {
  padding: 0.18rem 0.42rem;
  border-radius: 8px;
  background: rgba(16, 41, 74, 0.08);
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9em;
}

@media (max-width: 900px) {
  .hero-panel, .dashboard-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .site-header, .list-row, .member-card, .inline-role-form, .row-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .events-layout { grid-template-columns: 1fr; }
  .two-column-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-shell { width: min(100% - 1rem, 1180px); }
  .hero-panel, .card-panel { border-radius: 24px; padding: 1.2rem; }
  .hero-stats { grid-template-columns: 1fr; }
}
