:root {
  color-scheme: light;
  --ink: #1b1417;
  --muted: #706169;
  --line: #ead8bf;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --wine: #8f0f24;
  --wine-deep: #560716;
  --ember: #e56d11;
  --gold: #c58a25;
  --sage: #44584d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7efe4;
}

.attendance-page {
  padding: 24px 26px;
  background: var(--surface);
}

.attendance-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(197, 138, 37, 0.32);
}

.attendance-logo {
  width: 66px;
  height: 56px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.attendance-header strong {
  color: var(--wine-deep);
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.page-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 0 42px;
  display: grid;
  align-content: start;
  gap: 22px;
}

.sandbox-shell {
  background: var(--surface);
}

.sandbox-hero {
  min-height: 100vh;
  padding: 28px 26px clamp(42px, 7vw, 84px);
  display: grid;
  align-content: start;
  gap: clamp(34px, 6vw, 58px);
  background: var(--surface);
}

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

.project-card {
  min-height: 230px;
  padding: 24px;
  display: grid;
  align-content: start;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(86, 7, 22, 0.13);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 16px 40px rgba(86, 7, 22, 0.07);
}

.project-card:hover {
  border-color: rgba(143, 15, 36, 0.38);
  transform: translateY(-1px);
}

.project-card-disabled {
  opacity: 0.64;
}

.project-status {
  width: max-content;
  padding: 7px 9px;
  color: var(--wine-deep);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  border-radius: 8px;
  background: rgba(197, 138, 37, 0.13);
}

.project-card strong {
  color: var(--wine-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.8rem;
  font-weight: 500;
  line-height: 1;
}

.project-card small {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 900;
}

.project-card p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.demo-alert {
  width: calc(100% - 52px);
  margin: 18px auto -4px;
  padding: 14px 18px;
  color: #9c1026;
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
  border: 1px solid rgba(156, 16, 38, 0.28);
  border-radius: 8px;
  background: #fff8f5;
}

.admin-demo-alert {
  width: 100%;
  margin: 0;
}

.attendance-alert {
  width: 100%;
  margin: 0 auto 18px;
}

.hero {
  min-height: min(720px, calc(100vh - 96px));
  padding: 28px 26px clamp(42px, 7vw, 84px);
  display: grid;
  align-content: start;
  gap: clamp(34px, 6vw, 58px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -1px 0 rgba(86, 7, 22, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(197, 138, 37, 0.28);
}

.brand .admin-actions {
  margin-left: auto;
}

.brand-logo {
  width: 74px;
  height: 56px;
  flex: 0 0 auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--wine-deep);
}

.hero-copy {
  max-width: 900px;
  display: grid;
  justify-items: start;
}

.hero-logo {
  width: min(430px, 74vw);
  height: auto;
  margin: 0 0 clamp(14px, 3vw, 26px);
  mix-blend-mode: multiply;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  color: var(--wine-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 9vw, 7.4rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: 0;
}

.lead {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.7;
}

.categories-section {
  width: 100%;
  padding: 14px 26px 0;
  display: grid;
  gap: 18px;
}

.section-heading {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading p {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.section-heading h2 {
  max-width: 780px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.08;
}

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

.category-card {
  min-height: 480px;
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 18px;
  border: 1px solid rgba(86, 7, 22, 0.13);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 16px 40px rgba(86, 7, 22, 0.07);
}

.category-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(197, 138, 37, 0.28);
  background: #fffaf2;
}

.category-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.category-card-header span {
  color: var(--wine-deep);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

.category-card-header strong {
  flex: 0 0 auto;
  padding: 8px 10px;
  color: #fff7ea;
  font-size: 0.95rem;
  border-radius: 8px;
  background: var(--wine-deep);
}

.category-card > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.resource-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resource-list span {
  padding: 7px 9px;
  color: var(--wine-deep);
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 8px;
  background: rgba(197, 138, 37, 0.13);
}

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

.price-list div {
  min-height: 68px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3px 12px;
  align-items: baseline;
  border: 1px solid rgba(197, 138, 37, 0.28);
  border-radius: 8px;
  background: #fffaf2;
}

.price-list span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
}

.price-list strong {
  color: var(--wine-deep);
  font-size: 1.05rem;
  text-align: right;
}

.price-list small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
}

.home-actions {
  width: 100%;
  padding: 6px 26px 0;
  display: flex;
  justify-content: flex-end;
}

.attendance-button {
  min-height: 52px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff7ea;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--wine-deep), var(--wine));
  box-shadow: 0 16px 34px rgba(86, 7, 22, 0.18);
}

.attendance-button:hover {
  background: linear-gradient(135deg, var(--wine), var(--ember));
}

.admin-shell {
  width: 100%;
  min-height: 100vh;
  padding: 26px;
  display: grid;
  align-content: start;
  gap: 22px;
  background: var(--surface);
}

.admin-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.admin-topbar h1 {
  font-size: 3.8rem;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-actions a,
.admin-actions button,
.room-row button {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff7ea;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  border: 0;
  border-radius: 8px;
  background: var(--wine-deep);
  cursor: pointer;
}

.admin-actions button {
  background: var(--ember);
}

.message-list {
  padding: 10px 14px;
  color: var(--wine-deep);
  font-weight: 800;
  border: 1px solid rgba(197, 138, 37, 0.32);
  border-radius: 8px;
  background: #fff8f5;
}

.message-list p {
  margin: 0;
}

.metric-grid,
.admin-split,
.admin-results-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

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

.metric-card,
.admin-section,
.status-column {
  border: 1px solid rgba(86, 7, 22, 0.13);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 16px 40px rgba(86, 7, 22, 0.06);
}

.metric-card {
  min-height: 118px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.metric-card span,
.admin-section-heading span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  color: var(--wine-deep);
  font-size: 2.4rem;
  line-height: 1;
}

.compact-metric-card strong {
  font-size: clamp(1.15rem, 2vw, 1.9rem);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.admin-section {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.admin-section-heading h2 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1.1;
}

.result-chart {
  display: grid;
  grid-template-columns: minmax(118px, 148px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.result-donut {
  position: relative;
  width: 100%;
  max-width: 148px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(86, 7, 22, 0.08);
}

.result-donut::after {
  position: absolute;
  inset: 24%;
  content: "";
  border-radius: inherit;
  background: var(--surface-strong);
  box-shadow: 0 0 0 1px rgba(86, 7, 22, 0.08);
}

.result-donut-total {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.result-donut-total strong {
  color: var(--wine-deep);
  font-size: 1.7rem;
  line-height: 1;
}

.result-legend {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.result-legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.result-swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
}

.result-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.result-votes,
.result-percent {
  min-width: 42px;
  text-align: right;
}

.result-votes {
  color: var(--wine-deep);
  font-size: 1rem;
}

.result-percent {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
}

.status-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.status-column {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
  box-shadow: none;
}

.status-column-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--wine-deep);
  font-weight: 900;
}

.status-column-header span {
  min-width: 34px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff7ea;
  border-radius: 8px;
  background: var(--wine-deep);
}

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

.room-row {
  min-height: 58px;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(82px, 1fr) minmax(120px, 160px) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(197, 138, 37, 0.24);
  border-radius: 8px;
  background: #fffaf2;
}

.room-row strong,
.room-row small {
  display: block;
}

.room-row strong {
  color: var(--wine-deep);
}

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

.room-row select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid rgba(86, 7, 22, 0.18);
  border-radius: 8px;
  background: #ffffff;
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.data-table th {
  color: var(--wine-deep);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.data-table td {
  color: var(--muted);
}

.table-action {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff7ea;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
  border-radius: 8px;
  background: var(--wine-deep);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.detail-list {
  margin: 0;
  display: grid;
  gap: 10px;
}

.detail-list div {
  min-height: 58px;
  padding: 12px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(197, 138, 37, 0.24);
  border-radius: 8px;
  background: #fffaf2;
}

.detail-list dt {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  color: var(--wine-deep);
  font-size: 1.05rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.json-block {
  max-width: 100%;
  max-height: 460px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  color: var(--ink);
  font: 0.9rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  border: 1px solid rgba(197, 138, 37, 0.24);
  border-radius: 8px;
  background: #fffaf2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pagination a,
.pagination span,
.pagination strong {
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  border-radius: 8px;
}

.pagination a {
  color: #fff7ea;
  text-decoration: none;
  text-transform: uppercase;
  background: var(--wine-deep);
}

.pagination span {
  color: rgba(112, 97, 105, 0.7);
  border: 1px solid rgba(197, 138, 37, 0.2);
  background: #fffaf2;
}

.pagination strong {
  color: var(--wine-deep);
  border: 1px solid rgba(197, 138, 37, 0.28);
  background: rgba(197, 138, 37, 0.12);
}

.empty-state {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .demo-alert {
    width: calc(100% - 36px);
    margin-top: 12px;
    padding: 12px;
    font-size: 0.9rem;
  }

  .admin-demo-alert {
    width: 100%;
    margin: 0;
  }

  .attendance-page {
    padding: 18px;
  }

  .attendance-header {
    min-height: 74px;
    gap: 16px;
  }

  .attendance-logo {
    width: 56px;
    height: 48px;
  }

  .page-shell {
    padding-bottom: 12px;
  }

  .hero {
    min-height: auto;
    padding: 20px 18px 42px;
    gap: 30px;
  }

  .sandbox-hero {
    min-height: 100vh;
    padding: 20px 18px 42px;
    gap: 30px;
  }

  .brand-logo {
    width: 60px;
    height: 46px;
  }

  .brand {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .brand .admin-actions {
    width: 100%;
    margin-left: 0;
  }

  .hero-logo {
    width: min(330px, 86vw);
  }

  h1 {
    font-size: 3.5rem;
  }

  .lead {
    font-size: 1rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card strong {
    font-size: 2.2rem;
  }

  .categories-section,
  .home-actions {
    padding-left: 18px;
    padding-right: 18px;
  }

  .category-card-header {
    display: grid;
  }

  .category-card-header strong {
    width: max-content;
  }

  .home-actions {
    justify-content: stretch;
  }

  .attendance-button {
    width: 100%;
  }

  .admin-shell {
    padding: 18px;
  }

  .admin-topbar,
  .admin-actions {
    display: grid;
    justify-content: stretch;
  }

  .admin-topbar h1 {
    font-size: 3rem;
  }

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

  .metric-grid,
  .admin-split,
  .admin-results-grid,
  .detail-grid,
  .status-board {
    grid-template-columns: 1fr;
  }

  .result-chart {
    grid-template-columns: 1fr;
  }

  .result-donut {
    width: min(176px, 100%);
    max-width: none;
    justify-self: center;
  }

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