:root {
  --bg: #f7f5ef;
  --panel: #fffef9;
  --ink: #172019;
  --muted: #6f776f;
  --soft: #ece8dc;
  --line: #d9d3c5;
  --accent: #6f2638;
  --accent-2: #183b2d;
  --ok: #1f7a4d;
  --danger: #9c2d2d;
  --shadow: 0 24px 70px rgba(23, 32, 25, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

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

.side {
  background: #111711;
  color: #f7f5ef;
  min-height: 100vh;
  padding: 1.25rem;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.brand {
  color: #f7f5ef;
  font-family: Georgia, serif;
  font-size: 1.42rem;
  letter-spacing: 0.11em;
  text-decoration: none;
}

.eyebrow {
  color: #8d958d;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  margin: 0 0 0.8rem;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 1rem;
}

.nav-section {
  display: grid;
  gap: 0.2rem;
}

.nav-section p {
  color: rgba(247, 245, 239, 0.48);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 0 0.2rem;
  padding: 0 0.8rem;
  text-transform: uppercase;
}

.nav a,
.small-link {
  border-radius: 6px;
  color: #c6cfc7;
  padding: 0.72rem 0.8rem;
  text-decoration: none;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fffef9;
}

.side-footer {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
}

.main {
  padding: clamp(1rem, 2.4vw, 2.4rem);
}

.topbar,
.section-head,
.member-hero {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

h1,
h2 {
  font-family: Georgia, serif;
  font-weight: 400;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.45rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.3rem;
}

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

.metric-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 1.3rem;
}

.metric,
.panel,
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 8.4rem;
  padding: 1rem;
}

.metric strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 2.8rem;
  font-weight: 400;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  display: block;
  margin-top: 1rem;
}

.panel {
  margin-top: 1rem;
  padding: 1rem;
}

.two-col {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.65fr);
}

.table-wrap {
  overflow-x: visible;
}

table {
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--soft);
  padding: 0.72rem;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

code {
  background: #f1ede2;
  border-radius: 4px;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 0.15rem 0.28rem;
}

.pill,
.notice {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 0.78rem;
  gap: 0.35rem;
  padding: 0.34rem 0.6rem;
}

.pill.ok {
  border-color: rgba(31, 122, 77, 0.3);
  color: var(--ok);
}

.pill.danger {
  border-color: rgba(156, 45, 45, 0.3);
  color: var(--danger);
}

.pill.warn {
  border-color: rgba(111, 38, 56, 0.35);
  color: var(--accent);
}

.notice {
  background: #f4efe3;
  border-radius: 8px;
  color: var(--ink);
  display: block;
}

.stack {
  display: grid;
  gap: 0.85rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.filter-bar {
  align-items: end;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(14rem, 1fr) minmax(10rem, 0.35fr) auto auto auto;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 0.35rem;
}

input,
select,
textarea {
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 2.75rem;
  padding: 0.72rem 0.78rem;
  width: 100%;
}

button,
.button {
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: #fffef9;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 900;
  justify-content: center;
  letter-spacing: 0.11em;
  min-height: 2.65rem;
  padding: 0.72rem 1rem;
  text-decoration: none;
  text-transform: uppercase;
}

.ghost {
  background: transparent;
  border-color: var(--line);
  color: inherit;
}

.danger-action {
  border-color: rgba(156, 45, 45, 0.35);
  color: var(--danger);
}

.stretch {
  width: 100%;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.section-actions {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.inactive-section {
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed var(--line);
  border-radius: 8px;
  margin-top: 1rem;
  padding: 0.85rem;
}

.inactive-section > summary {
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.inactive-section[open] > summary {
  margin-bottom: 0.85rem;
}

.subtle-panel {
  background: #fbfaf6;
  box-shadow: none;
}

.record-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.record-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(15rem, 1.1fr) minmax(12rem, 0.75fr) minmax(18rem, 1.2fr) auto;
  padding: 0.9rem;
}

.record-main,
.record-meta {
  display: grid;
  gap: 0.35rem;
}

.record-main strong {
  font-size: 1rem;
}

.record-main span,
.record-details dd {
  color: var(--muted);
  font-size: 0.86rem;
}

.record-details {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.record-details dt {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.record-details dd {
  margin: 0.1rem 0 0;
  word-break: break-word;
}

.link-tools {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  width: 100%;
}

.link-tools input {
  font-size: 0.78rem;
  min-height: 2.3rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-tools .button,
.link-tools button {
  min-height: 2.15rem;
  padding: 0.45rem 0.62rem;
}

.record-link {
  min-width: 0;
}

.payment-records {
  margin-top: 0.75rem;
}

.payment-card {
  align-items: start;
  grid-template-columns: minmax(13rem, 0.9fr) minmax(11rem, 0.55fr) minmax(20rem, 1.2fr) minmax(9rem, auto);
}

.payment-card .record-meta strong {
  font-family: Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
}

.record-actions {
  align-content: start;
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
}

.record-actions form,
.record-actions a,
.record-actions button {
  width: 100%;
}

.compact-card {
  grid-template-columns: minmax(14rem, 1fr) minmax(12rem, 0.6fr) minmax(18rem, auto);
}

.edit-box {
  border-top: 1px solid var(--soft);
  margin-top: 1rem;
  padding-top: 1rem;
}

.edit-box summary {
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.timeline {
  display: grid;
  gap: 0.65rem;
}

.timeline div {
  align-items: center;
  border-bottom: 1px solid var(--soft);
  display: grid;
  gap: 0.5rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.55rem 0;
}

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

.facts {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.facts div {
  border-bottom: 1px solid var(--soft);
  display: grid;
  gap: 0.2rem;
  padding-bottom: 0.65rem;
}

.facts dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0;
}

.mini-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1rem 0;
}

.mini-grid div {
  background: #f7f5ef;
  border: 1px solid var(--soft);
  border-radius: 6px;
  padding: 0.85rem;
}

.mini-grid strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1;
}

.mini-grid span {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  margin-top: 0.45rem;
}

.event-card {
  border-left: 4px solid var(--accent-2);
}

.auth-body {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(24, 59, 45, 0.12), transparent 32%),
    var(--bg);
  display: grid;
  min-height: 100vh;
  padding: 1rem;
}

.auth-card {
  margin: auto;
  max-width: 27rem;
  padding: 1.4rem;
  width: 100%;
}

.auth-card h1 {
  margin-bottom: 0.6rem;
}

.auth-links {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 1rem 0 0;
}

.member-shell {
  margin: 0 auto;
  max-width: 72rem;
  padding: clamp(1rem, 3vw, 2.5rem);
}

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

.legal-shell {
  margin: 0 auto;
  max-width: 48rem;
  padding: clamp(1.2rem, 4vw, 3rem);
}

.legal-shell p {
  font-size: 1.05rem;
  line-height: 1.7;
}

.checkin-body {
  background: #050806;
  color: #fffef9;
  min-height: 100vh;
}

.checkin-shell {
  margin: 0 auto;
  max-width: 58rem;
  padding: 0.85rem;
}

.checkin-hero {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.7rem 0 1rem;
}

.checkin-hero h1 {
  font-size: clamp(2.4rem, 10vw, 5rem);
}

.checkin-hero p {
  color: #b9c3bb;
  margin: 0.35rem 0 0;
}

.checkin-metrics {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.checkin-metrics article,
.checkin-card {
  background: #101711;
  border: 1px solid #2f3a31;
  border-radius: 8px;
}

.checkin-metrics article {
  padding: 0.7rem;
}

.checkin-metrics strong {
  display: block;
  font-size: 1.8rem;
}

.checkin-metrics span,
.checkin-card span {
  color: #b9c3bb;
}

.checkin-filter {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 1fr auto auto;
  margin: 0.75rem 0;
}

.checkin-list {
  display: grid;
  gap: 0.65rem;
}

.checkin-card {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  padding: 0.75rem;
}

.checkin-card strong {
  display: block;
  font-size: 1.15rem;
}

.checkin-card img {
  background: #fff;
  border-radius: 6px;
  height: 5.5rem;
  width: 5.5rem;
}

.checkin-state {
  display: grid;
  gap: 0.35rem;
}

.span-2 {
  grid-column: 1 / -1;
}

@media (max-width: 980px) {
  .shell,
  .two-col,
  .member-grid {
    grid-template-columns: 1fr;
  }

  .side {
    min-height: auto;
    position: static;
  }

  .metric-grid,
  .form-grid,
  .mini-grid,
  .filter-bar,
  .record-card,
  .compact-card,
  .record-details {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head,
  .member-hero {
    display: grid;
  }

  .checkin-hero,
  .checkin-card,
  .checkin-filter {
    grid-template-columns: 1fr;
  }

  .checkin-hero {
    display: grid;
  }

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

  .checkin-card img {
    height: 7rem;
    width: 7rem;
  }
}

@media (max-width: 1180px) {
  .payment-card {
    grid-template-columns: minmax(13rem, 1fr) minmax(12rem, 0.7fr);
  }

  .record-link,
  .record-actions {
    grid-column: 1 / -1;
  }

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