:root {
  --bg: #f7fbff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --text: #233043;
  --muted: #6d7889;
  --blue: #7eb6d9;
  --blue-deep: #416f93;
  --gold: #c7a25a;
  --rose: #cfa9b4;
  --green: #88a98f;
  --line: rgba(65, 111, 147, 0.16);
  --shadow: 0 24px 70px rgba(53, 94, 128, 0.16);
}

body.dark {
  --bg: #101820;
  --surface: rgba(22, 32, 42, 0.9);
  --surface-strong: #182431;
  --text: #eef6ff;
  --muted: #a8b6c6;
  --blue: #80b9dd;
  --blue-deep: #a7d0ed;
  --gold: #d7b86d;
  --rose: #d2a8b7;
  --green: #9ec3a7;
  --line: rgba(231, 240, 249, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(126, 182, 217, 0.22), transparent 35%),
    linear-gradient(180deg, var(--bg), #fff8ef 120%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px;
  background: rgba(255, 255, 255, 0.58);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

body.dark .sidebar {
  background: rgba(16, 24, 32, 0.72);
}

.brand {
  display: flex;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(199, 162, 90, 0.45);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #dff0fb 55%, #f6ead0);
  color: var(--blue-deep);
  font-family: Georgia, serif;
  font-size: 1.7rem;
  box-shadow: 0 14px 34px rgba(126, 182, 217, 0.24);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 3px;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-link {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 13px 14px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(126, 182, 217, 0.14);
}

body.dark .nav-link:hover,
body.dark .nav-link.active {
  background: rgba(126, 182, 217, 0.2);
}

.member-card,
.daily-card,
.content-preview,
.metric-panel,
.notification-panel,
.devotional-card,
.calendar-panel,
.wide-panel,
.stat-card,
.wall-card,
.pricing-card,
.admin-editor,
.admin-metrics,
.admin-table {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.member-card {
  margin-top: auto;
  padding: 18px;
}

.member-card span,
.soft-label,
.eyebrow,
.daily-card span,
.metric-panel span,
.notification-panel span,
.stat-card span,
.pricing-card span,
.devotional-kicker,
.mission-strip span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.member-card p,
.content-preview p,
.metric-panel p,
.notification-panel p,
.welcome-panel p,
.pricing-card p,
.calendar-panel p,
.wall-card p,
.wall-card li {
  color: var(--muted);
  line-height: 1.7;
}

main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.05;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.55rem);
  line-height: 1.12;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

h3 {
  font-size: 1.1rem;
}

.topbar-actions,
.hero-actions,
.devotional-actions,
.community-actions,
.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button,
.text-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
  padding: 13px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-deep), var(--blue));
  box-shadow: 0 14px 30px rgba(65, 111, 147, 0.25);
  text-decoration: none;
}

.secondary-button,
.ghost-button {
  padding: 12px 16px;
  background: rgba(126, 182, 217, 0.12);
  color: var(--blue-deep);
  border: 1px solid var(--line);
}

.small {
  padding: 10px 14px;
}

.icon-button {
  width: 42px;
  height: 42px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--blue-deep);
}

.text-button {
  padding: 0;
  color: var(--blue-deep);
  background: transparent;
  font-weight: 700;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.view {
  display: none;
  animation: fadeUp 320ms ease both;
}

.view.active {
  display: block;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.welcome-panel {
  min-height: 390px;
  padding: clamp(26px, 5vw, 58px);
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    url("assets/marian-window.svg") center right / contain no-repeat,
    var(--surface-strong);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.dark .welcome-panel {
  background:
    linear-gradient(120deg, rgba(22, 32, 42, 0.95), rgba(22, 32, 42, 0.82)),
    url("assets/marian-window.svg") center right / contain no-repeat,
    var(--surface-strong);
}

.welcome-panel p {
  max-width: 660px;
  font-size: 1.06rem;
}

.daily-card {
  padding: 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 390px;
}

.card-header,
.reading-time,
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

blockquote {
  margin: 28px 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1.4;
}

.section-grid,
.dashboard-grid,
.community-layout,
.pricing-grid,
.admin-grid {
  display: grid;
  gap: 18px;
}

.section-grid {
  grid-template-columns: 1.35fr 0.8fr 0.85fr;
}

.content-preview,
.metric-panel,
.notification-panel,
.stat-card,
.wall-card,
.pricing-card,
.admin-metrics,
.admin-table {
  padding: 24px;
}

.progress-ring {
  width: 116px;
  height: 116px;
  margin: 18px auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--gold) 0 42%, rgba(126, 182, 217, 0.18) 42% 100%);
  position: relative;
}

.progress-ring::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--surface-strong);
}

.progress-ring strong {
  position: relative;
  z-index: 1;
  font-size: 1.5rem;
}

.devotional-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.devotional-card,
.calendar-panel,
.wide-panel,
.admin-editor {
  padding: clamp(24px, 4vw, 42px);
}

.devotional-kicker {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.verse {
  padding: 18px 20px;
  border-left: 3px solid var(--gold);
  background: rgba(199, 162, 90, 0.1);
  color: var(--text);
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.devotional-section {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.devotional-section p {
  color: var(--muted);
  line-height: 1.8;
}

.mission-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

.mission-strip div {
  padding: 18px;
  border-radius: 8px;
  background: rgba(126, 182, 217, 0.11);
}

.mission-strip strong {
  display: block;
  margin-top: 8px;
  line-height: 1.45;
}

.notes-label,
form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  resize: vertical;
  background: var(--surface-strong);
  color: var(--text);
}

.devotional-actions {
  margin-top: 14px;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 24px 0;
}

.mini-day {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
}

.mini-day.done {
  background: rgba(136, 169, 143, 0.2);
  color: var(--green);
  font-weight: 800;
}

.mini-day.today {
  background: rgba(199, 162, 90, 0.22);
  color: var(--gold);
  font-weight: 800;
}

.dashboard-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wide-panel {
  grid-column: 1 / -1;
}

.timeline {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat-card strong {
  display: block;
  margin: 12px 0 4px;
  font-size: 2.4rem;
  font-family: Georgia, serif;
}

.stat-card small {
  color: var(--muted);
}

.community-layout {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.community-layout .wide-panel {
  grid-column: 1 / -1;
}

.wall-card ul {
  padding-left: 18px;
}

.pricing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pricing-card h2 {
  margin-bottom: 0;
}

.pricing-card.featured {
  border-color: rgba(199, 162, 90, 0.55);
  background: linear-gradient(180deg, rgba(255, 252, 244, 0.96), var(--surface));
  transform: translateY(-8px);
}

body.dark .pricing-card.featured {
  background: linear-gradient(180deg, rgba(44, 38, 29, 0.72), var(--surface));
}

body.dark .brand-mark {
  background: radial-gradient(circle at 35% 30%, #f8fbff, #b9d9ed 55%, #d7b86d);
}

.pricing-card button {
  margin-top: auto;
}

.admin-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.admin-editor {
  grid-row: span 2;
}

form {
  display: grid;
  gap: 16px;
}

.metric-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.metric-row:last-child {
  border-bottom: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-grid,
  .section-grid,
  .devotional-layout,
  .dashboard-grid,
  .community-layout,
  .pricing-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card.featured {
    transform: none;
  }
}

@media (max-width: 720px) {
  main,
  .sidebar {
    padding: 18px;
  }

  .topbar,
  .card-header,
  .reading-time,
  .timeline-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions,
  .nav-list,
  .mission-strip {
    grid-template-columns: 1fr;
  }

  .nav-list {
    display: grid;
  }

  .welcome-panel {
    min-height: 430px;
    background-position: right bottom;
    background-size: 78%;
  }

  .daily-card {
    min-height: auto;
  }
}
