:root {
  color-scheme: light;
  --ink: #17211d;
  --ink-soft: #30423a;
  --muted: #69746c;
  --faint: #8d958b;
  --canvas: #f6efe3;
  --canvas-deep: #ead7bd;
  --surface: rgba(255, 253, 247, 0.92);
  --surface-solid: #fffdf7;
  --surface-warm: #fff6e7;
  --navy: #10253a;
  --navy-soft: #183d54;
  --green: #1f6e4a;
  --green-strong: #135235;
  --teal: #5d9c93;
  --gold: #dca44f;
  --gold-soft: #f3d397;
  --clay: #b76245;
  --danger: #c93a2f;
  --line: rgba(66, 58, 43, 0.13);
  --line-strong: rgba(66, 58, 43, 0.22);
  --shadow-soft: 0 16px 36px rgba(48, 36, 22, 0.08);
  --shadow-card: 0 24px 60px rgba(47, 35, 20, 0.12);
  --shadow-lift: 0 30px 72px rgba(44, 33, 21, 0.17);
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --font-display: Constantia, Georgia, "Times New Roman", serif;
  --font-body: Candara, Aptos, "Trebuchet MS", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #efe1cc;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 9% 5%, rgba(255, 238, 202, 0.9), transparent 25rem),
    radial-gradient(circle at 85% 12%, rgba(166, 210, 196, 0.55), transparent 24rem),
    radial-gradient(circle at 58% 88%, rgba(220, 164, 79, 0.28), transparent 30rem),
    linear-gradient(145deg, #fbf4e8 0%, #efe0cc 48%, #ddc4a7 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(23, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 29, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 76%);
}

body::after {
  content: "";
  position: fixed;
  width: 34rem;
  height: 34rem;
  right: -16rem;
  top: 8rem;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 236, 190, 0.9) 0 12%, rgba(255, 236, 190, 0.18) 13% 35%, transparent 36%);
  filter: blur(2px);
}

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

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

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

body.is-locked {
  overflow: hidden;
}

.login-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-gate__panel {
  position: relative;
  overflow: hidden;
  width: min(560px, 100%);
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 38px;
  background:
    linear-gradient(135deg, rgba(13, 34, 52, 0.86), rgba(13, 53, 54, 0.7)),
    url("lighthouse-banner.png") center 28% / cover no-repeat;
  color: #fffaf0;
  box-shadow: var(--shadow-lift);
}

.login-gate__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 231, 170, 0.42), transparent 16rem),
    linear-gradient(180deg, rgba(9, 26, 40, 0.12), rgba(9, 26, 40, 0.58));
}

.login-gate__panel > * {
  position: relative;
  z-index: 1;
}

.login-gate__panel h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 10vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.32);
}

.login-gate__panel .subhead {
  margin: 18px 0 0;
  color: rgba(255, 250, 240, 0.88);
}

.login-gate__form {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  background: rgba(255, 253, 247, 0.9);
  color: var(--ink);
  box-shadow: 0 18px 34px rgba(9, 26, 40, 0.18);
}

.page {
  width: min(100%, 1720px);
  margin: 0 auto;
  padding: 34px 26px 92px;
}

.page-main {
  min-width: 0;
}

.eyebrow,
.hero__card-label,
.summary-label,
.hero__label {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.73rem;
  font-weight: 800;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 332px;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 32px;
  scroll-margin-top: 28px;
}

.hero__content {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 40px;
  background:
    linear-gradient(135deg, rgba(13, 34, 52, 0.82), rgba(13, 53, 54, 0.58)),
    url("lighthouse-banner.png") center 25% / cover no-repeat;
  color: #fffaf0;
  box-shadow: var(--shadow-lift);
}

.hero__content::before,
.hero__content::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero__content::before {
  inset: 0;
  background:
    radial-gradient(circle at 16% 22%, rgba(255, 231, 170, 0.45), transparent 18rem),
    linear-gradient(90deg, rgba(9, 26, 40, 0.52), rgba(9, 26, 40, 0.08) 52%, rgba(9, 26, 40, 0.42));
}

.hero__content::after {
  width: 52rem;
  height: 52rem;
  right: -25rem;
  top: -23rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 225, 156, 0.38);
  box-shadow:
    0 0 0 54px rgba(255, 225, 156, 0.07),
    0 0 0 118px rgba(255, 225, 156, 0.045),
    0 0 0 190px rgba(255, 225, 156, 0.03);
}

.hero__banner {
  display: none;
}

.hero__content > *:not(.hero__banner) {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 22px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  color: #ffe7b7;
  background: rgba(8, 28, 38, 0.32);
  backdrop-filter: blur(10px);
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.6rem, 7.5vw, 7.4rem);
  line-height: 0.88;
  letter-spacing: -0.065em;
  text-wrap: balance;
  text-shadow: 0 8px 34px rgba(0, 0, 0, 0.32);
}

.subhead {
  max-width: 650px;
  margin: 24px 0 0;
  color: rgba(255, 250, 240, 0.88);
  font-size: clamp(1.05rem, 1.55vw, 1.24rem);
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero__link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fffaf0;
  text-decoration: none;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(12px);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.hero__link:hover,
.hero__link:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.2);
}

.hero__link:focus-visible {
  /* hero__content clips overflow, so the ring is drawn inside the tile */
  outline: 3px solid var(--app-gold, #c99a4b);
  outline-offset: -4px;
}

.hero__card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(255, 244, 225, 0.88)),
    radial-gradient(circle at 100% 0%, rgba(93, 156, 147, 0.24), transparent 38%);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
}

.hero__card::before {
  content: "";
  display: block;
  width: 58px;
  height: 58px;
  margin-bottom: 2px;
  border-radius: 18px 18px 26px 26px;
  background:
    linear-gradient(90deg, transparent 42%, rgba(255, 255, 255, 0.68) 43% 57%, transparent 58%),
    linear-gradient(180deg, var(--navy), var(--green-strong));
  box-shadow:
    0 12px 24px rgba(19, 82, 53, 0.18),
    0 -10px 24px rgba(220, 164, 79, 0.18);
}

.hero__card-label {
  margin: 0 0 2px;
  color: var(--green);
}

.hero__stat {
  display: grid;
  gap: 8px;
  padding: 17px;
  border: 1px solid rgba(66, 58, 43, 0.11);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

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

.hero__value {
  font-family: var(--font-display);
  font-size: 2.05rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.hero__staff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
}

.hero__staff .hint {
  margin: 0;
  padding: 7px 12px;
  border: 1px solid rgba(66, 58, 43, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
}

.grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  min-width: 0;
}

.grid > *,
.card {
  min-width: 0;
}

.span-2,
.grid .card.span-2 {
  grid-column: span 2;
}

#staff-dashboard-card {
  order: 2;
}

#quick-actions-card {
  order: 1;
}

#add-member-card {
  order: 3;
}

#redeem-card {
  order: 4;
}

#member-checkin-card {
  order: 5;
}

#task-award-card {
  order: 6;
}

#rewards-history-card {
  order: 7;
}

#members-card {
  order: 7;
}

#summary-card {
  order: 8;
}

#resources-card {
  order: 9;
}

#items-card {
  order: 10;
}

#admin-records-card {
  order: 11;
}

#corrections-card {
  order: 12;
}

#staff-logs {
  order: 13;
}

.card {
  position: relative;
  overflow: visible;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, var(--surface), rgba(255, 247, 234, 0.88)),
    radial-gradient(circle at 94% 0%, rgba(220, 164, 79, 0.13), transparent 34%);
  box-shadow: var(--shadow-card);
  scroll-margin-top: 28px;
  backdrop-filter: blur(14px);
}

.card::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 0;
  width: min(220px, calc(100% - 56px));
  height: 5px;
  border-radius: 0 0 999px 999px;
  background: linear-gradient(90deg, var(--green), var(--teal), var(--gold));
}

.card--action::before {
  background: linear-gradient(90deg, var(--gold), var(--green));
}

.card--reference::before {
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.card--admin::before,
#admin-log::before,
#undo-section::before {
  background: linear-gradient(90deg, var(--clay), var(--gold));
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.48rem, 2.1vw, 2.05rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.card h2::before {
  content: "";
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--green), var(--gold));
  box-shadow: 0 0 0 6px rgba(31, 110, 74, 0.08);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
  margin-bottom: 18px;
}

.card__header h2 {
  margin-bottom: 0;
}

.hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.form,
.people,
.table,
.todo-list,
.profile-sheet {
  display: grid;
  gap: 14px;
}

.form {
  margin-top: 4px;
}

label,
.field,
.form-field {
  display: grid;
  gap: 7px;
  color: var(--ink-soft);
  font-weight: 800;
}

.field-label,
.field__label,
.profile-label {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 47px;
  padding: 11px 14px;
  border: 1px solid rgba(57, 47, 34, 0.18);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 2px rgba(34, 28, 20, 0.045),
    0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9c978d;
}

input:focus,
select:focus,
textarea:focus,
.search-input:focus,
.toolbar-select:focus {
  border-color: rgba(31, 110, 74, 0.58);
  background: #fff;
  box-shadow:
    0 0 0 4px rgba(31, 110, 74, 0.12),
    inset 0 1px 2px rgba(34, 28, 20, 0.04);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.search-input:focus-visible,
.toolbar-select:focus-visible {
  border-color: var(--app-accent, #1f7a8c);
  box-shadow:
    0 0 0 4px rgba(31, 122, 140, 0.28),
    inset 0 1px 2px rgba(34, 28, 20, 0.04);
}

.search-input,
.toolbar-select {
  min-height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.search-input {
  min-width: min(260px, 100%);
}

.toolbar-select {
  width: auto;
  min-width: 158px;
}

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

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

.form-actions,
.header-actions,
.member-toolbar,
.calendar-nav,
.inline-actions,
.profile-actions,
.profile-photo-actions,
.file-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

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

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

.member-toolbar,
.calendar-nav {
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.93rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(39, 31, 21, 0.1);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, border-color 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(39, 31, 21, 0.15);
}

.btn:focus-visible {
  outline: 3px solid var(--app-accent, #1f7a8c);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(180deg, #267a53, #145738);
}

.btn.secondary {
  color: #2d3d35;
  border-color: rgba(57, 47, 34, 0.14);
  background: linear-gradient(180deg, #fffaf0, #f0ddbe);
}

.btn.accent {
  color: #2d2315;
  background: linear-gradient(180deg, #f4c76f, #d99a39);
}

.btn.danger {
  color: #fff;
  background: linear-gradient(180deg, #d64b3f, #ad2e25);
}

.btn.small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: 0.82rem;
}

.btn.wide {
  width: 100%;
}

.file-input,
.profile-photo-input {
  position: absolute;
  left: -9999px;
}

.file-button.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.error {
  width: fit-content;
  max-width: 100%;
  margin: 4px 0 0;
  padding: 9px 12px;
  border: 1px solid rgba(201, 58, 47, 0.2);
  border-radius: 14px;
  color: #9f251d;
  background: rgba(255, 237, 232, 0.88);
  font-weight: 900;
}

.form-details,
.section-collapse,
.table details,
.redeem-items details,
.activity-details,
.task-details {
  border: 1px solid rgba(57, 47, 34, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.form-details {
  padding: 15px;
}

summary {
  cursor: pointer;
  list-style: none;
  font-weight: 900;
  color: var(--green-strong);
}

summary::-webkit-details-marker {
  display: none;
}

.form-details summary,
.section-collapse summary,
.table details summary,
.redeem-items summary,
.activity-details summary,
.task-details summary,
.person__details summary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-details summary::before,
.section-collapse summary::before,
.table details summary::before,
.redeem-items summary::before,
.activity-details summary::before,
.task-details summary::before,
.person__details summary::before {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 0.78rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.form-details[open] > summary::before,
.section-collapse[open] > summary::before,
.table details[open] > summary::before,
.redeem-items details[open] > summary::before,
.activity-details[open] > summary::before,
.task-details[open] > summary::before,
.person__details[open] > summary::before {
  transform: rotate(90deg);
}

.section-collapse {
  padding: 16px;
}

.section-collapse summary {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.section-collapse__content {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.section-collapse--nested {
  margin-top: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 250, 240, 0.54)),
    radial-gradient(circle at 0% 0%, rgba(31, 110, 74, 0.08), transparent 34%);
}

.dashboard-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
  align-items: start;
}

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

.subsection-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(57, 47, 34, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 249, 238, 0.6)),
    radial-gradient(circle at top right, rgba(215, 182, 118, 0.14), transparent 45%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.subsection-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.subsection-panel h3,
.section-collapse summary {
  color: var(--green-strong);
}

.subsection-panel h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 1.42rem;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.subsection-panel__header h3 {
  margin-bottom: 0;
}

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

.quick-action {
  display: grid;
  gap: 6px;
  min-height: 104px;
  align-content: center;
  padding: 16px;
  border: 1px solid rgba(31, 110, 74, 0.16);
  border-radius: 22px;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% 0%, rgba(215, 182, 118, 0.28), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 249, 238, 0.68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.quick-action span {
  color: var(--green-strong);
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.quick-action strong {
  color: var(--muted);
  font-size: 0.82rem;
}

.dashboard-alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.alert-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(31, 110, 74, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink-soft);
}

.alert-card strong {
  display: block;
  color: var(--green-strong);
}

.alert-card.warning {
  border-color: rgba(201, 58, 47, 0.18);
  background: rgba(255, 237, 232, 0.58);
}

.member-badges,
.restore-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: #6c321e;
  background: rgba(244, 199, 111, 0.34);
  font-size: 0.78rem;
  font-weight: 900;
}

.checkin-layout,
.restore-tools {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
}

.checkin-panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(57, 47, 34, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
}

.checkin-summary {
  display: grid;
  gap: 10px;
}

.checkin-stat {
  padding: 12px;
  border-radius: 16px;
  background: rgba(222, 241, 225, 0.68);
}

.compact-list {
  gap: 10px;
}

.restore-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.people > .hint,
.table > .hint,
.todo-list > .hint,
.restore-list > .hint,
.compact-list > .hint {
  width: 100%;
  padding: 16px;
  border: 1px dashed rgba(31, 110, 74, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
}

.form-section-title,
.profile-section-title {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(57, 47, 34, 0.12);
  color: var(--green-strong);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.people {
  margin-top: 16px;
}

.person,
.event-card,
.resource-card,
.table__row,
.todo-row,
.summary-item,
.person__entry {
  border: 1px solid rgba(57, 47, 34, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 248, 237, 0.72)),
    radial-gradient(circle at 100% 0%, rgba(93, 156, 147, 0.12), transparent 34%);
  box-shadow:
    0 14px 30px rgba(44, 33, 21, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 18px;
  align-items: start;
  padding: 18px;
  border-radius: 24px;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.member-card {
  grid-template-columns: minmax(220px, 340px) minmax(240px, 1fr) auto;
}

.member-card > .person__info {
  grid-column: 1 / 3;
}

.member-card > .person__actions {
  grid-column: 3;
  grid-row: 1 / span 4;
}

.member-card > .person__details {
  grid-column: 2;
}

.person:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 110, 74, 0.22);
  box-shadow: 0 22px 42px rgba(44, 33, 21, 0.11);
}

.person__info {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}

.person__copy {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

.person__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 120px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(57, 47, 34, 0.12);
  border-radius: 28px;
  color: var(--green-strong);
  background:
    linear-gradient(135deg, rgba(245, 210, 151, 0.92), rgba(234, 247, 238, 0.88)),
    radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.9), transparent 38%);
  box-shadow: 0 14px 28px rgba(44, 33, 21, 0.1);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 900;
}

.person__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 30%;
  padding: 5px;
  background: var(--surface-solid);
}

.member-card .person__avatar {
  width: clamp(220px, 24vw, 340px);
  height: clamp(190px, 21vw, 292px);
  border-radius: 34px;
}

.volunteer-card .person__avatar {
  width: clamp(190px, 20vw, 280px);
  height: clamp(190px, 20vw, 280px);
  border-radius: 34px;
}

.member-card .person__info,
.volunteer-card .person__info {
  gap: 22px;
  align-items: center;
}

.member-card .person__copy {
  flex: 1 1 210px;
}

.member-card__details-stack {
  display: grid;
  flex: 1.2 1 260px;
  gap: 9px;
  align-self: center;
  min-width: 220px;
}

.person__name {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.36rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.person__points {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--green-strong);
  background: rgba(222, 239, 224, 0.8);
  font-weight: 900;
}

.person__meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.person__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.person__details {
  grid-column: 1 / -1;
}

.person__details summary {
  width: fit-content;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid rgba(31, 110, 74, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.member-card__details-stack .person__details {
  grid-column: auto;
}

.member-card__details-stack .person__details summary {
  width: 100%;
  justify-content: flex-start;
}

.person__activity {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.person__entry {
  padding: 10px 12px;
  border-radius: 15px;
  color: var(--muted);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.profile-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: center;
}

.profile-photo-row {
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(57, 47, 34, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.48);
}

.profile-photo-wrap,
.profile-photo-preview {
  display: grid;
  gap: 12px;
}

.profile-photo,
.resource-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(57, 47, 34, 0.12);
  border-radius: 24px;
  background: var(--surface-solid);
  box-shadow: 0 14px 28px rgba(44, 33, 21, 0.08);
}

.profile-photo {
  object-fit: contain;
  object-position: center 30%;
  padding: 8px;
}

.resource-photo {
  object-fit: cover;
}

.profile-photo.placeholder {
  display: grid;
  place-items: center;
  color: var(--green-strong);
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(245, 210, 151, 0.88), rgba(223, 242, 232, 0.9));
}

.profile-input {
  min-height: 42px;
}

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

.summary-item {
  position: relative;
  overflow: hidden;
  min-height: 134px;
  padding: 20px;
  border-radius: 26px;
}

.summary-item::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(220, 164, 79, 0.22), transparent 68%);
}

.summary-label {
  position: relative;
  z-index: 1;
  color: var(--muted);
}

.summary-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 14px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
}

.table {
  margin-top: 14px;
}

.table details {
  padding: 11px;
}

.table details summary {
  margin: 0 0 10px;
}

.table__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px 170px;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 13px 15px;
  border-radius: 17px;
}

.table__row.header {
  color: #fdf7ed;
  background: linear-gradient(135deg, var(--navy), var(--green-strong));
  box-shadow: 0 12px 24px rgba(16, 37, 58, 0.16);
  font-weight: 900;
}

#activity-table .table__row,
#items-table .table__row {
  grid-template-columns: minmax(0, 1fr) 150px;
}

#staff-user-list .table__row {
  grid-template-columns: minmax(0, 1fr) 150px minmax(220px, auto);
}

#admin-table .table__row {
  grid-template-columns: minmax(0, 1fr) 190px 170px;
}

#donor-list .table__row,
#document-list .table__row {
  grid-template-columns: minmax(0, 1fr) 170px 220px;
}

.backup-status {
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid rgba(25, 116, 58, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(222, 241, 225, 0.92), rgba(255, 250, 240, 0.95));
  color: #214f37;
  font-weight: 800;
}

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

.log-metric {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(31, 110, 74, 0.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(215, 182, 118, 0.24), transparent 48%),
    rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.log-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.log-metric strong {
  display: block;
  margin-top: 6px;
  color: var(--green-strong);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}

.log-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(160px, auto));
  gap: 10px;
  align-items: center;
}

.sensitive-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.sensitive-modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(9, 26, 40, 0.64);
  backdrop-filter: blur(8px);
}

.sensitive-modal__panel {
  position: relative;
  z-index: 1;
  width: min(500px, 100%);
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(255, 244, 225, 0.96));
  box-shadow: var(--shadow-lift);
}

.sensitive-modal__panel h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: -0.04em;
}

.sensitive-extra-fields {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(31, 110, 74, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.table__row a {
  color: var(--green-strong);
  font-weight: 900;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(57, 47, 34, 0.1);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 249, 238, 0.5)),
    radial-gradient(circle at 12% 0%, rgba(93, 156, 147, 0.13), transparent 30%);
}

.calendar-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 172px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(57, 47, 34, 0.12);
  border-radius: 999px;
  color: var(--green-strong);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-soft);
  font-family: var(--font-display);
  font-weight: 900;
}

.calendar-day {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 116px;
  padding: 11px;
  border: 1px solid rgba(57, 47, 34, 0.11);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.calendar-day:hover,
.calendar-day:focus-within {
  z-index: 8;
  transform: translateY(-2px);
  border-color: rgba(31, 110, 74, 0.22);
  box-shadow: 0 18px 32px rgba(44, 33, 21, 0.11);
}

.calendar-day--header {
  min-height: auto;
  padding: 5px;
  border: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 900;
}

.calendar-day--empty {
  background: rgba(255, 255, 255, 0.28);
  border-style: dashed;
}

.calendar-day--today {
  border-color: rgba(31, 110, 74, 0.36);
  background:
    linear-gradient(180deg, rgba(239, 249, 239, 0.86), rgba(255, 250, 235, 0.78));
}

.calendar-day--busy::after {
  content: "";
  position: absolute;
  top: 13px;
  right: 13px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(220, 164, 79, 0.18);
}

.calendar-date {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--ink-soft);
  background: rgba(238, 223, 199, 0.7);
  font-weight: 900;
}

.calendar-day--today .calendar-date {
  color: #fff;
  background: var(--green);
}

.calendar-event-wrap {
  position: relative;
}

.calendar-event {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--teal));
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: none;
  width: min(320px, 78vw);
  padding: 14px;
  border: 1px solid rgba(57, 47, 34, 0.14);
  border-radius: 20px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: var(--shadow-lift);
}

.calendar-event-wrap:hover .calendar-popover,
.calendar-event-wrap:focus-within .calendar-popover {
  display: grid;
  gap: 8px;
}

.calendar-popover__title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.14rem;
  font-weight: 900;
}

.calendar-popover__date,
.calendar-popover__description,
.calendar-popover__empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.calendar-popover__checklist {
  display: grid;
  gap: 7px;
}

.calendar-checklist-row,
.todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-more {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.calendar-events {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.event-card,
.resource-card {
  padding: 15px;
  border-radius: 22px;
}

.event-card summary,
.resource-card summary {
  color: var(--green-strong);
}

.resource-card__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.resource-card__body {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  margin-top: 15px;
}

.resource-card__details {
  display: grid;
  gap: 9px;
  color: var(--muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.item-form {
  display: none;
  margin-bottom: 18px;
}

.item-form.show {
  display: grid;
}

.redeem-items {
  display: grid;
  gap: 11px;
}

.redeem-items details {
  padding: 12px;
}

.redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 12px;
  align-items: center;
  padding: 7px 3px;
}

.redeem-row--header {
  padding: 4px 3px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.redeem-row--header > :last-child {
  text-align: center;
}

.redeem-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-weight: 800;
}

.redeem-label input,
.todo-row input,
.calendar-checklist-row input {
  width: auto;
  min-height: auto;
}

.redeem-qty {
  justify-self: center;
  max-width: 76px;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--green-strong);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  text-align: center;
}


.task-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.task-row {
  display: grid;
  gap: 9px;
  align-content: start;
  min-height: 112px;
  padding: 12px;
  border: 1px solid rgba(31, 110, 74, 0.13);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(215, 182, 118, 0.2), transparent 48%),
    rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.task-left,
.task-actions {
  display: grid;
  align-items: center;
  gap: 8px;
}

.task-left .btn {
  width: 100%;
  justify-content: center;
  white-space: normal;
}

.task-actions {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  display: none;
}

.task-buttons--remove-mode .task-actions {
  display: grid;
}

.task-buttons--remove-mode .task-row {
  border-color: rgba(201, 58, 47, 0.22);
  background:
    radial-gradient(circle at top right, rgba(201, 58, 47, 0.13), transparent 48%),
    rgba(255, 255, 255, 0.66);
}

.task-status {
  min-height: 34px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 260ms ease, transform 260ms ease;
}

.task-status .btn {
  width: 100%;
  justify-content: center;
}

.task-status.show {
  opacity: 1;
  transform: translateY(0);
}

.task-status.fade {
  opacity: 0;
  transform: translateY(-3px);
}

.task-details {
  grid-column: 1 / -1;
}

.task-details[open] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.task-details > summary {
  grid-column: 1 / -1;
}

.todo-list {
  margin-top: 6px;
}

.todo-row {
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 16px;
}

.todo-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

#calendar-card,
#members-card,
#summary-card,
#resources-card {
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.95), rgba(255, 247, 234, 0.9)),
    radial-gradient(circle at 96% 4%, rgba(93, 156, 147, 0.18), transparent 32%);
}

#staff-logs,
#admin-log {
  padding: 18px;
}

#undo-section .hint {
  margin-bottom: 16px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero,
  .card {
    animation: rise-in 520ms ease both;
  }

  .grid > .card:nth-child(2n) {
    animation-delay: 60ms;
  }

  .grid > .card:nth-child(3n) {
    animation-delay: 110ms;
  }

  @keyframes rise-in {
    from {
      opacity: 0;
      transform: translateY(16px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

@media (max-width: 1180px) {
  .page-main {
    order: 1;
  }

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

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

  .hero__card::before,
  .hero__card-label,
  .hero__staff {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  body {
    font-size: 16px;
  }

  .page {
    padding: 18px 14px 72px;
  }

  .hero__content,
  .hero__card,
  .card {
    border-radius: 24px;
  }

  .hero__content {
    min-height: 480px;
    padding: 22px;
  }

  .hero h1 {
    font-size: clamp(3.1rem, 17vw, 5rem);
  }

  .hero__card,
  .grid,
  .summary-grid,
  .dashboard-panels,
  .dashboard-panels--compact,
  .quick-actions,
  .checkin-layout,
  .restore-tools,
  .log-metrics,
  .log-toolbar {
    grid-template-columns: 1fr;
  }

  .span-2,
  .grid .card.span-2 {
    grid-column: span 1;
  }

  .card {
    padding: 22px 18px;
  }

  .card::before {
    left: 18px;
    width: min(180px, calc(100% - 36px));
  }

  .card__header,
  .member-toolbar,
  .calendar-nav {
    align-items: stretch;
    justify-content: flex-start;
  }

  .card__header {
    flex-direction: column;
  }

  .subsection-panel__header {
    flex-direction: column;
    align-items: stretch;
  }

  .member-toolbar > *,
  .calendar-nav > *,
  .header-actions > *,
  .hero__link,
  .btn {
    width: 100%;
  }

  .split-fields,
  .split-fields--three,
  .todo-composer,
  .profile-row,
  .profile-photo-row,
  .resource-card__body,
  .table__row,
  #activity-table .table__row,
  #items-table .table__row,
  #staff-user-list .table__row,
  #admin-table .table__row,
  #donor-list .table__row,
  #document-list .table__row,
  .person,
  .task-row {
    grid-template-columns: 1fr;
  }

  .person__info {
    flex-direction: column;
    align-items: stretch;
  }

  .member-card .person__avatar,
  .volunteer-card .person__avatar,
  .person__avatar {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }

  .person__actions,
  .task-actions {
    align-items: stretch;
    justify-content: flex-start;
  }

  .member-card__details-stack {
    width: 100%;
    min-width: 0;
  }

  .member-card,
  .member-card > .person__info,
  .member-card > .person__actions,
  .member-card > .person__details {
    grid-column: auto;
    grid-row: auto;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, minmax(76px, 1fr));
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .calendar-day {
    min-width: 0;
    min-height: 96px;
    padding: 8px;
    border-radius: 16px;
  }

  .calendar-day--header {
    min-width: 0;
  }

  .calendar-popover {
    position: fixed;
    left: 14px;
    right: 14px;
    top: auto;
    bottom: 18px;
    width: auto;
  }
}

@media (max-width: 560px) {
  .login-gate {
    padding: 16px;
  }

  .sensitive-modal {
    padding: 14px;
  }

  .sensitive-modal__panel {
    padding: 22px;
    border-radius: 24px;
  }

  .backup-status {
    font-size: 0.92rem;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__content {
    min-height: 430px;
  }

  .subhead {
    font-size: 1rem;
  }
}

/* ==========================================================================
   Phase 1 — App shell, sidebar navigation, and refined visual system.
   Added on top of the original theme. Original tokens and classes are kept so
   existing cards, forms, and tables continue to work unchanged.
   ========================================================================== */

:root {
  --app-bg: #eef1f7;
  --app-surface: #ffffff;
  --app-surface-muted: #f5f7fb;
  --app-border: #dce3ee;
  --app-border-strong: #c6d1e0;
  --app-navy: #16293f;
  --app-navy-soft: #1f3a5f;
  --app-navy-deep: #0e1c2c;
  --app-accent: #1f7a8c;
  --app-accent-soft: #d8ecf0;
  --app-gold: #c99a4b;
  --app-gold-soft: #f0dcb4;
  --app-text: #16202a;
  --app-muted: #5c6b80;
  --app-success: #237a57;
  --app-warning: #a76800;
  --app-danger: #b42318;
  --app-shadow-sm: 0 1px 2px rgba(16, 32, 52, 0.06), 0 4px 14px rgba(16, 32, 52, 0.06);
  --app-shadow-md: 0 10px 30px rgba(16, 32, 52, 0.1);
  --app-sidebar-width: 268px;
  --app-radius: 16px;
}

/* ---------- Canvas ---------- */

body {
  background:
    radial-gradient(circle at 8% 0%, rgba(232, 240, 255, 0.92), transparent 34rem),
    radial-gradient(circle at 92% 6%, rgba(240, 220, 180, 0.34), transparent 30rem),
    linear-gradient(180deg, #f3f6fb 0%, #e8edf5 100%);
  background-attachment: fixed;
  color: var(--app-text);
}

body::after {
  background: radial-gradient(
    circle,
    rgba(201, 154, 75, 0.2) 0 12%,
    rgba(201, 154, 75, 0.05) 13% 35%,
    transparent 36%
  );
}

.page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

/* ---------- Shell ---------- */

.app-shell {
  display: grid;
  grid-template-columns: var(--app-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  align-items: start;
}

.app-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px clamp(16px, 2.4vw, 40px) 88px;
}

/* ---------- Sidebar ---------- */

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px 18px 20px;
  overflow-y: auto;
  color: #e8eefb;
  background:
    radial-gradient(circle at 12% 0%, rgba(31, 122, 140, 0.36), transparent 22rem),
    radial-gradient(circle at 92% 102%, rgba(201, 154, 75, 0.16), transparent 20rem),
    linear-gradient(180deg, var(--app-navy-soft) 0%, var(--app-navy) 46%, var(--app-navy-deep) 100%);
  border-right: 1px solid rgba(10, 22, 36, 0.55);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 0;
}

.app-brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #10202f;
  background: linear-gradient(140deg, var(--app-gold-soft), var(--app-gold));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.app-brand__text {
  display: grid;
  line-height: 1.15;
}

.app-brand__text strong {
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.app-brand__text small {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(226, 236, 250, 0.62);
}

.app-nav {
  display: grid;
  gap: 4px;
}

.app-nav__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: rgba(226, 236, 250, 0.78);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.app-nav__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--app-gold-soft), var(--app-gold));
  transform: translateY(-50%) scaleY(0);
  transition: transform 180ms ease;
}

.app-nav__link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.app-nav__link:focus-visible {
  outline: 2px solid var(--app-gold);
  outline-offset: 2px;
}

.app-nav__link.is-active {
  color: #ffffff;
  background: linear-gradient(100deg, rgba(31, 122, 140, 0.44), rgba(31, 122, 140, 0.1));
  border-color: rgba(120, 190, 205, 0.3);
}

.app-nav__link.is-active::before {
  transform: translateY(-50%) scaleY(1);
}

.app-nav__icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-sidebar__footer {
  margin-top: auto;
  padding: 14px 14px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.app-sidebar__note {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(232, 238, 251, 0.9);
}

.app-sidebar__meta {
  margin: 4px 0 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 236, 250, 0.5);
}

/* ---------- Top bar ---------- */

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px clamp(16px, 2.4vw, 40px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--app-border);
  backdrop-filter: blur(14px);
}

.app-topbar__heading {
  flex: 1;
  min-width: 0;
}

.app-topbar__eyebrow {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--app-accent);
}

.app-topbar__title {
  margin: 2px 0 0;
  font-family: var(--font-body);
  font-size: clamp(1.25rem, 2.1vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--app-navy);
}

.app-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-user__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(140deg, var(--app-accent), var(--app-navy-soft));
  box-shadow: var(--app-shadow-sm);
}

.app-user__meta {
  display: grid;
  line-height: 1.25;
}

.app-user__label {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.app-user__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--app-text);
}

.app-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

.app-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 3px auto;
  border-radius: 2px;
  background: var(--app-navy);
}

.app-menu-toggle:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
}

.app-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(11, 22, 35, 0.52);
  backdrop-filter: blur(2px);
}

/* ---------- Card refinement ---------- */

.card {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: linear-gradient(180deg, #ffffff, #fdfefe 65%, #f8fbfd);
  box-shadow: var(--app-shadow-sm);
  backdrop-filter: none;
}

.card::before {
  height: 3px;
  background: linear-gradient(90deg, var(--app-navy-soft), var(--app-accent), var(--app-gold));
}

.card h2 {
  color: var(--app-navy);
  font-size: clamp(1.3rem, 1.7vw, 1.6rem);
}

.card h2::before {
  background: linear-gradient(135deg, var(--app-accent), var(--app-gold));
  box-shadow: 0 0 0 6px rgba(31, 122, 140, 0.1);
}

/* ---------- Shared components ---------- */

.stat-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

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

.stat-card__value {
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--app-navy);
}

.empty-state__title {
  margin: 0;
  font-weight: 800;
  color: var(--app-navy);
}

.member-badge--neutral {
  background: var(--app-surface-muted);
  color: var(--app-muted);
  border-color: var(--app-border);
}

/* ---------- Member profile page ---------- */

.profile-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: linear-gradient(120deg, #f7f9fc, #ffffff 60%);
}

.profile-header__avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 20px;
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(140deg, var(--app-accent), var(--app-navy-soft));
}

.profile-header__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-header__name {
  margin: 0 0 6px;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--app-navy);
}

.profile-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.profile-panel {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow-sm);
}

.profile-panel__header h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--app-navy);
}

.profile-ledger .table__row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) 96px 96px;
}

.ledger-amount {
  font-weight: 800;
}

.ledger-amount--up {
  color: var(--app-success);
}

.ledger-amount--down {
  color: var(--app-danger);
}

.profile-visit-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--app-text);
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
}

.profile-detail {
  display: grid;
  gap: 2px;
}

.profile-detail__label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--app-muted);
}

.profile-detail__value {
  font-size: 0.95rem;
}

.profile-missing {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 24px;
  border: 1px dashed var(--app-border-strong);
  border-radius: var(--app-radius);
  background: var(--app-surface-muted);
}

/* Page ordering within the shared grid. */
#calendar-tasks-card {
  order: 2;
}

#member-profile-card {
  order: 1;
}

#reports-card {
  order: 9;
}

/* ---------- Responsive shell ---------- */

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

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    width: min(288px, 84vw);
    height: 100vh;
    transform: translateX(-102%);
    transition: transform 240ms cubic-bezier(0.22, 0.7, 0.3, 1);
    box-shadow: 0 30px 70px rgba(8, 18, 30, 0.45);
  }

  .app-shell.is-drawer-open .app-sidebar {
    transform: none;
  }

  .app-menu-toggle {
    display: block;
  }

  .app-user__meta {
    display: none;
  }
}

@media (max-width: 900px) {
  .profile-header {
    grid-template-columns: 1fr;
  }

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

  .profile-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .app-main {
    padding: 18px 14px 72px;
  }

  .app-topbar {
    padding: 11px 14px;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .profile-header__actions,
  .profile-header__actions .btn {
    width: 100%;
  }

  .profile-header__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .app-user .btn {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar,
  .app-nav__link,
  .app-nav__link::before {
    transition: none;
  }
}

/* ==========================================================================
   Phase 1b — Typography, density, radius normalization, and a compact
   dashboard first screen so real work is visible without scrolling.
   ========================================================================== */

:root {
  --font-body: Inter, "Source Sans 3", "Nunito Sans", system-ui, -apple-system,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-body);

  /* Align the legacy greenish neutral ramp with the blue-gray shell. */
  --muted: #5a6b80;
  --faint: #8592a6;

  /* Normalized radii: panels 20, cards 16, controls 10-12. */
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

body {
  font-size: 16px;
}

/* ---------- Density ---------- */

.app-main {
  padding: 20px clamp(16px, 2.4vw, 36px) 80px;
}

.grid {
  gap: 20px;
}

.card {
  padding: 22px;
}

.card__header {
  min-height: 44px;
  margin-bottom: 14px;
}

.app-topbar__eyebrow {
  font-size: 0.7rem;
  color: #15626f;
}

/* ---------- Radius normalization ---------- */

.hero__content,
.hero__card,
.login-gate__panel,
.profile-panel,
.profile-header {
  border-radius: 20px;
}

.subsection-panel {
  border-radius: 16px;
}

.table__row {
  border-radius: 12px;
}

.btn,
.btn.small {
  border-radius: 10px;
}

.quick-action {
  border-radius: 12px;
}

.form input:not([type="file"]),
.form select,
.form textarea,
.search-input,
.toolbar-select,
.profile-input {
  border-radius: 10px;
}

.app-nav__link,
.app-brand__mark {
  border-radius: 12px;
}

/* ---------- Compact dashboard header strip ---------- */

.hero {
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 20px;
  margin-bottom: 20px;
}

.hero__content {
  min-height: 0;
  padding: 26px 30px;
}

/* The oversized decorative ring only made sense on the tall hero. */
.hero__content::after {
  display: none;
}

.hero h1 {
  font-size: clamp(1.75rem, 3vw, 2.3rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

.subhead {
  max-width: 560px;
  margin: 10px 0 0;
  font-size: 0.98rem;
  line-height: 1.55;
}

.hero__actions {
  gap: 8px;
  margin-top: 18px;
}

.hero__link {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
}

.hero__card {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--app-border);
  background: linear-gradient(180deg, #ffffff, #f6f9fc);
  box-shadow: var(--app-shadow-sm);
  backdrop-filter: none;
}

/* Replaced by the brand mark in the sidebar. */
.hero__card::before {
  display: none;
}

.hero__card-label {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--app-accent);
}

.hero__stat {
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
  box-shadow: none;
}

.hero__label {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--app-muted);
}

.hero__value {
  font-family: var(--font-body);
  font-size: 1.3rem;
  color: var(--app-navy);
}

/* ---------- Dashboard KPI row ---------- */

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

.stat-card--attention {
  border-color: rgba(167, 104, 0, 0.34);
  background: linear-gradient(180deg, #fffdf7, #fff7e8);
}

.stat-card--attention .stat-card__value {
  color: var(--app-warning);
}

#dashboard-kpis {
  order: 1;
}

#quick-actions-card {
  order: 2;
}

#staff-dashboard-card {
  order: 3;
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .hero__content {
    min-height: 0;
    padding: 22px;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 6vw, 2rem);
  }

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

  .card {
    padding: 20px 18px;
  }
}

@media (max-width: 700px) {
  /* The stat values are short, so keep them on one row instead of stacking. */
  .hero__card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  /* Keep the hero shortcuts as a wrapping row so the banner stays short. */
  .hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .hero__link {
    flex: 1 1 auto;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.84rem;
  }
}

/* ---------- Phase 3: dashboard home panels ---------- */

.dashboard-panels--home {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.dashboard-panels--home .subsection-panel {
  background: var(--app-surface-muted);
  border-color: var(--app-border);
  box-shadow: none;
}

.dashboard-panels--home .subsection-panel__header h3 {
  margin-bottom: 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #15626f;
}

.subsection-panel__link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--app-accent);
  text-decoration: none;
  white-space: nowrap;
}

.subsection-panel__link:hover {
  text-decoration: underline;
}

.dashboard-panels--home .compact-list {
  display: grid;
  gap: 10px;
}

/* Calmer, denser entries inside the dashboard home panels. */
.dashboard-panels--home .person__entry {
  padding: 9px 11px;
  border-radius: 10px;
  border-color: var(--app-border);
  background: var(--app-surface);
  box-shadow: none;
}

.person__entry--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.person__entry--link:hover {
  border-color: var(--app-accent);
}

@media (max-width: 900px) {
  .dashboard-panels--home {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Phase 7b: calendar views ---------- */

.calendar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 12px;
}

.calendar-view {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--app-muted);
}

#calendar-nav[hidden],
#calendar-grid[hidden] {
  display: none;
}

.calendar-events:empty {
  display: none;
}

.event-card--today > summary {
  color: var(--app-accent);
  font-weight: 700;
}

/* ---------- Phase 7: resources, tasks, reports ---------- */

.resource-group__title {
  grid-column: 1 / -1;
  margin: 18px 0 0;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #15626f;
}

.resource-group__title:first-child {
  margin-top: 0;
}

.todo-due {
  display: grid;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--app-muted);
}

.todo-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--app-muted);
  white-space: nowrap;
}

.todo-status--overdue {
  color: var(--app-danger);
}

.todo-status--soon {
  color: var(--app-warning);
}

.todo-status--done {
  color: var(--app-success);
}

.todo-row--done > span:not(.todo-status) {
  text-decoration: line-through;
  color: var(--app-muted);
}

.report-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.report-controls label {
  display: grid;
  gap: 6px;
  min-width: 190px;
  font-size: 0.82rem;
  color: var(--app-muted);
}

.report-results {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

.report-table {
  display: grid;
  gap: 8px;
}

.report-table__row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 0.5fr) minmax(0, 0.6fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
  font-size: 0.9rem;
}

.report-table__row--header {
  border-color: transparent;
  background: transparent;
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .report-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .report-table__row--header {
    display: none;
  }
}

@media (max-width: 560px) {
  .report-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .report-controls label {
    min-width: 0;
    width: 100%;
  }
}

/* ---------- Phase 6: points and rewards ---------- */

.rewards-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  max-width: 380px;
  padding: 14px 18px;
  border: 1px solid rgba(31, 122, 140, 0.4);
  border-radius: 14px;
  background: var(--app-surface);
  color: var(--app-text);
  font-weight: 600;
  box-shadow: 0 18px 40px rgba(14, 28, 44, 0.18);
}

@media (max-width: 560px) {
  .rewards-toast {
    right: 16px;
    left: 16px;
    bottom: 16px;
    max-width: none;
  }
}

.rewards-toast[hidden] {
  display: none;
}

.confirm-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--app-accent);
  border-radius: 14px;
  background: var(--app-surface);
}

.confirm-panel[hidden] {
  display: none;
}

.confirm-panel__title {
  margin: 0;
  color: var(--app-text);
  font-weight: 700;
}

.confirm-panel__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--app-muted);
}

.confirm-panel__row strong {
  color: var(--app-text);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.redeem-cart {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--app-border);
  border-radius: 14px;
  background: var(--app-surface-muted);
}

.redeem-cart__lines {
  display: grid;
  gap: 4px;
  font-size: 0.9rem;
  color: var(--app-text);
}

.redeem-row[hidden],
.redeem-items details[hidden] {
  display: none;
}

/* ---------- Phase 5: check-in flow ---------- */

.checkin-confirm,
.checkin-result {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--app-accent);
  border-radius: 14px;
  background: var(--app-surface);
}

.checkin-confirm[hidden],
.checkin-result[hidden] {
  display: none;
}

.checkin-result {
  border-color: rgba(31, 122, 140, 0.4);
  background: rgba(31, 122, 140, 0.08);
}

.checkin-confirm__title,
.checkin-result__title {
  margin: 0;
  color: var(--app-text);
  font-weight: 700;
}

.checkin-confirm__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--app-muted);
}

.checkin-confirm__row strong {
  color: var(--app-text);
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .checkin-confirm__row {
    flex-direction: column;
    gap: 2px;
  }

  .checkin-confirm__row strong {
    text-align: left;
  }
}

/* ---------- Phase 4: members directory ---------- */

.member-count {
  margin: 0 0 14px;
  color: var(--app-muted);
}

#member-clear-filters {
  flex: 0 0 auto;
}

.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* ==========================================================================
   Phase 8 — Accessibility: keyboard focus visibility, skip link, screen-reader
   text, invalid-field styling, and dialog ergonomics on short viewports.
   ========================================================================== */

/* Baseline keyboard focus ring. Components above opt into stronger or inset
   rings where a parent clips overflow. */
:focus-visible {
  outline: 3px solid var(--app-accent, #1f7a8c);
  outline-offset: 2px;
}

/* Scroll and programmatic focus targets should never paint a ring. */
#page-main:focus,
#page-main:focus-visible,
#app-page-title:focus,
#app-page-title:focus-visible {
  outline: none;
}

/* The login panel and the hero clip overflow, so their controls use insets. */
.login-gate__panel .btn:focus-visible {
  outline-color: #ffffff;
  outline-offset: -3px;
}

.skip-link {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 120;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--app-navy, #16293f);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--app-shadow-md, 0 10px 30px rgba(16, 32, 52, 0.1));
  transform: translateY(-220%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

/* Invalid fields carry both a ring and the inline error text. */
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"],
.search-input[aria-invalid="true"],
.toolbar-select[aria-invalid="true"] {
  border-color: var(--app-danger, #b42318);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.18);
}

.confirm-modal__details {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--app-border, #dce3ee);
  border-left: 4px solid var(--app-danger, #b42318);
  border-radius: 12px;
  background: var(--app-surface-muted, #f5f7fb);
  color: var(--app-text, #16202a);
  font-size: 0.94rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Keep dialog actions reachable on short viewports and with a phone keyboard. */
.sensitive-modal__panel {
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.form.is-busy {
  opacity: 0.72;
}

.btn[disabled],
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
  box-shadow: none;
}

/* Off-screen file inputs keep their focus ring on the visible button that
   proxies them, so keyboard users can see where they are. */
.file-input:focus-visible + .file-button,
.profile-photo-input:focus-visible + .btn {
  outline: 3px solid var(--app-accent, #1f7a8c);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .sensitive-modal__panel {
    max-height: calc(100vh - 28px);
  }
}

@media (max-width: 420px) {
  /* Staff reminder rows: let the status and action buttons drop to their own
     line instead of pushing the row past a 320px viewport. */
  .todo-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .todo-row > span:not(.todo-status) {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .todo-row > .btn {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
}

/* ==========================================================================
   Phase 9 — Phone-sized dashboard: actions reachable above the fold.

   Before this block, a 390x844 viewport pushed the Quick Actions card to
   1157px (313px below the fold): the hero shortcuts stacked one per row, the
   KPI row stacked four tall cards, and the KPI row sorted ahead of the
   actions. These rules keep every card, shorten the pre-fold stack, and put
   the actions a phone user needs first.
   ========================================================================== */

@media (max-width: 700px) {
  /* Actions before statistics on a phone: the first thing a volunteer needs
     at the door is a way to check someone in, not the weekly totals. Both
     cards keep their place in the page and stay one swipe apart. */
  #dashboard-kpis {
    order: 2;
  }

  #quick-actions-card {
    order: 1;
  }

  .hero {
    margin-bottom: 14px;
  }
}

@media (max-width: 560px) {
  /* Two shortcut buttons per row instead of four full-width rows. */
  .hero__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hero__link {
    min-width: 0;
    padding-inline: 10px;
    justify-content: center;
    text-align: center;
  }

  /* Two KPI cards per row: four now read in a 2x2 block rather than a
     400px-tall column. */
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .stat-card {
    padding: 16px 14px;
  }

  .stat-card__label {
    font-size: 0.78rem;
    overflow-wrap: anywhere;
  }
}
