:root {
  --bg: #f5efe2;
  --panel: rgba(255, 250, 241, 0.88);
  --panel-strong: #fff9ef;
  --border: rgba(81, 46, 25, 0.14);
  --text: #312116;
  --muted: #77604d;
  --accent: #8a1f11;
  --accent-soft: #d8a16d;
  --accent-2: #1f5d50;
  --ok: #2f7d4c;
  --warn: #b17211;
  --shadow: 0 18px 45px rgba(58, 36, 18, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(216, 161, 109, 0.32), transparent 30%),
    radial-gradient(circle at top right, rgba(31, 93, 80, 0.18), transparent 28%),
    linear-gradient(180deg, #f7f1e6 0%, #efe5d3 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.brand h1,
.hero h2,
.section-title,
.card-title {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.76;
}

.main-content {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.95;
  margin-bottom: 10px;
}

.hero-copy {
  max-width: 70ch;
  color: var(--muted);
  margin: 0;
}

.hero-stats,
.workspace,
.grid-2,
.grid-3,
.summary-grid,
.report-grid {
  display: grid;
  gap: 16px;
}

.hero-stats {
  grid-template-columns: 1fr;
  align-content: start;
}

.page-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), #c3532f);
  color: #fff;
}

.verse-card {
  padding: 20px;
}

.verse-date {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.verse-text {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  line-height: 1.15;
  margin: 0 0 10px;
}

.verse-ref {
  color: var(--accent);
  font-weight: 700;
}

.stat-card,
.card,
.page-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  font-size: 1.6rem;
}

.workspace {
  margin-top: 20px;
}

.page-section {
  overflow: hidden;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 22px 22px 0;
}

.section-title {
  font-size: 2rem;
}

.section-body {
  padding: 22px;
}

.card {
  padding: 18px;
}

.card-title {
  font-size: 1.6rem;
  margin-bottom: 14px;
}

.form-card-grid,
.stacked-card-grid {
  align-items: start;
}

.stacked-card-grid {
  display: grid;
  gap: 18px;
}

.detail-subcard {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(81, 46, 25, 0.08);
  box-shadow: none;
}

.subcard-title {
  margin: 0 0 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
}

.section-line {
  grid-column: span 12;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(81, 46, 25, 0.16);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.stack-form {
  display: grid;
  gap: 18px;
}

.form-actions {
  justify-content: flex-start;
}

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

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

.report-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.field,
.table-tools,
.filter-bar,
.list-shell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field[data-span="12"] {
  grid-column: span 12;
}

.field[data-span="8"] {
  grid-column: span 8;
}

.field[data-span="6"] {
  grid-column: span 6;
}

.field[data-span="4"] {
  grid-column: span 4;
}

.field[data-span="3"] {
  grid-column: span 3;
}

.field label,
.table-tools label {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  padding: 11px 12px;
  color: var(--text);
}

textarea {
  min-height: 47px !important;
  resize: vertical;
}

.button-row,
.section-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-small {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c3532f);
  color: white;
}

.btn-secondary {
  background: rgba(81, 46, 25, 0.08);
  color: var(--text);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-2), #2d8572);
  color: white;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  background: rgba(47, 125, 76, 0.12);
  color: var(--ok);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #e6e0dd;
  cursor: pointer;
}

.choice-pill input {
  width: auto;
  margin: 0;
}

.muted {
  color: var(--muted);
}

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

th,
td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(81, 46, 25, 0.08);
  text-align: left;
  vertical-align: top;
}

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

tbody tr:hover {
  background: rgba(216, 161, 109, 0.08);
}

.table-wrap {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(81, 46, 25, 0.08);
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(81, 46, 25, 0.08);
}

.metric strong {
  font-size: 1.4rem;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
}

.timeline-mark {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
}

.family-tree-card {
  display: grid;
  gap: 16px;
}

.tree-group-title {
  margin-bottom: 10px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.tree-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.tree-couple-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tree-branch {
  display: grid;
  gap: 14px;
}

.tree-children-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  align-items: start;
}

.tree-child-column {
  display: grid;
  gap: 14px;
}

.tree-connector {
  height: 26px;
  position: relative;
}

.tree-connector::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 10px;
  width: 2px;
  background: rgba(81, 46, 25, 0.16);
  transform: translateX(-50%);
}

.tree-connector::after {
  content: "";
  position: absolute;
  left: 25%;
  right: 25%;
  bottom: 10px;
  height: 2px;
  background: rgba(81, 46, 25, 0.16);
}

.tree-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.tree-person {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(81, 46, 25, 0.1);
  position: relative;
}

.tree-person-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.tree-action-stack {
  display: grid;
  gap: 8px;
}

.tree-person::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  border-radius: 18px 0 0 18px;
  background: rgba(31, 93, 80, 0.35);
}

.tree-person-head::before {
  background: linear-gradient(180deg, var(--accent), #d47d46);
}

.tree-person-spouse::before {
  background: linear-gradient(180deg, var(--accent-2), #58a38f);
}

.tree-person-child::before {
  background: linear-gradient(180deg, #d8a16d, #c97f3c);
}

.tree-role {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 700;
}

.tree-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tree-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(81, 46, 25, 0.18);
  background: rgba(255, 255, 255, 0.48);
  color: var(--muted);
}

.member-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 10px;
}

.mem-crd {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mem-crd:hover {
  transform: none;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.mem-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.mem-header h5 {
  margin: 0;
  font-size: 16px;
}

.mem-body p {
  margin: 4px 0;
  font-size: 14px;
}

.mem-footer {
  margin-top: 10px;
  text-align: right;
}

.mem-crd.male {
  border-left: 4px solid #2f2fff8f;
}

.mem-crd.female {
  border-left: 4px solid #ffc0cbb6;
}

.title-small {
  font-size: 20px;
}

.house-name {
  font-size: 32px;
  font-weight: bold;
  /* margin-left: 5px; */
}

/* .mem-crd.active {
  background: #f0fff4;
}

.mem-crd.inactive {
  opacity: 0.7;
} */

/* Status styles */
.status {
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
}

.status.active {
  background: #d4edda;
  color: #155724;
}

.status.inactive {
  background: #f8d7da;
  color: #721c24;
}

@media (max-width: 1100px) {
  .hero,
  
  .grid-3,
  .summary-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .tree-couple-row {
    grid-template-columns: 1fr;
  }

  
.grid-2{
  display: flex;
  flex-direction: column;
}

  .tree-connector {
    display: none;
  }
}

@media (max-width: 760px) {
  .main-content {
    padding: 16px;
  }

  .field[data-span] {
    grid-column: span 12;
  }
}
