:root {
  --pine: #1F4D3D;
  --pine-light: #2F6B52;
  --paper: #F5F1E6;
  --ink: #2B2620;
  --amber: #D98E2B;
  --red: #C24B4B;
  --green: #3F8F5C;
  --line: #E3DCC8;
  --muted: #6B6354;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: "Inter", sans-serif;
}

.chalk {
  font-family: "Kalam", cursive;
}

.hidden {
  display: none !important;
}

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 10px 30px rgba(43, 38, 32, 0.08);
}

.login-title {
  font-size: 28px;
  margin: 0 0 4px 0;
  color: var(--pine);
}

.login-subtitle {
  margin: 0 0 20px 0;
  color: var(--muted);
  font-size: 14px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--paper);
  border-radius: 12px;
  padding: 4px;
}

.tab-button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 10px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.tab-button.active {
  background: var(--pine);
  color: #ffffff;
}

.login-form {
  display: flex;
  flex-direction: column;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-input {
  font-family: "Inter", sans-serif;
  font-size: 15px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  margin-bottom: 16px;
  width: 100%;
}

.field-input:focus {
  outline: 2px solid var(--pine-light);
  outline-offset: 1px;
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-col {
  flex: 1;
}

.primary-button {
  background: var(--pine);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 13px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  font-family: "Inter", sans-serif;
}

.primary-button:active {
  transform: scale(0.98);
}

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

.secondary-button {
  flex: 1;
  background: #ffffff;
  border: 2px solid var(--line);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: "Inter", sans-serif;
}

.danger-button {
  flex: 1;
  background: var(--red);
  border: none;
  color: #ffffff;
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: "Inter", sans-serif;
}

.error-text {
  color: var(--red);
  font-size: 13px;
  margin: 4px 0 0 0;
  min-height: 16px;
}

/* Board page */
.top-bar {
  background: var(--pine);
  position: sticky;
  top: 0;
  z-index: 20;
}

.top-bar-inner {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.header-title {
  color: #ffffff;
  font-size: 26px;
  margin: 16px 0 0 0;
}

.header-subtitle {
  color: #CFE3D7;
  font-size: 13px;
  margin: 4px 0 0 0;
}

.identity-row {
  align-items: center;
  padding-bottom: 14px;
  padding-top: 10px;
}

.identity-chip {
  background: var(--pine-light);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}

.admin-flag {
  color: #CFE3D7;
  font-size: 12px;
  font-weight: 600;
}

.icon-button {
  background: var(--pine-light);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  margin-top: 16px;
}

.icon-button.small {
  padding: 6px 10px;
  font-size: 11px;
  margin-top: 0;
}

.icon-button.danger {
  background: var(--red);
}

.page-content {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 110px;
}

.section-title {
  font-size: 22px;
  margin: 0 0 12px 0;
  color: var(--ink);
}

.empty-text {
  color: var(--muted);
  font-size: 14px;
}

.quiz-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(43, 38, 32, 0.06);
}

.quiz-card-top {
  display: flex;
  gap: 12px;
}

.date-chip {
  background: var(--pine);
  color: #ffffff;
  border-radius: 14px;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
}

.date-day, .date-month {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.date-num {
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.quiz-info {
  flex: 1;
  min-width: 0;
}

.quiz-info-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.quiz-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.quiz-admin-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.quiz-location {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0 0;
}

.quiz-meta {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0 0;
}

.rsvp-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.rsvp-button {
  flex: 1;
  padding: 12px 4px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  border: 2px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-family: "Inter", sans-serif;
}

.rsvp-button:active {
  transform: scale(0.96);
}

.rsvp-button.selected.rsvp-yes {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.rsvp-button.selected.rsvp-maybe {
  background: var(--amber);
  border-color: var(--amber);
  color: #ffffff;
}

.rsvp-button.selected.rsvp-no {
  background: var(--red);
  border-color: var(--red);
  color: #ffffff;
}

.roster {
  font-size: 12px;
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.roster strong {
  font-weight: 700;
}

.past-toggle-wrap {
  margin-top: 24px;
}

.past-toggle {
  background: none;
  border: none;
  font-family: "Kalam", cursive;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--pine);
  color: #ffffff;
  border: none;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  font-size: 26px;
  box-shadow: 0 4px 14px rgba(31, 77, 61, 0.4);
  cursor: pointer;
  z-index: 25;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 16px;
}

.modal {
  background: var(--paper);
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  max-height: 88vh;
  overflow-y: auto;
}

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

.modal-text {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.close-button {
  background: #ffffff;
  border: none;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  font-size: 16px;
  cursor: pointer;
}

.name-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.name-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.name-chip button {
  background: var(--paper);
  border: none;
  border-radius: 999px;
  width: 20px;
  height: 20px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  color: var(--red);
}

.name-add-row {
  align-items: flex-start;
  margin-bottom: 6px;
}

.name-add-row .field-input {
  margin-bottom: 0;
}

.name-add-row .secondary-button {
  flex: 0 0 auto;
  padding: 11px 16px;
}

/* Nav row */
.nav-row {
  padding-top: 0;
  padding-bottom: 0;
  gap: 4px;
  align-items: stretch;
}

.nav-link {
  color: #CFE3D7;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  display: inline-block;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

/* Month grouping */
.month-heading {
  font-size: 16px;
  margin: 20px 0 8px 0;
  color: var(--muted);
}

/* Capacity */
.quiz-capacity {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0 0;
  font-family: "IBM Plex Mono", monospace;
}

.quiz-capacity.capacity-full {
  color: var(--red);
  font-weight: 600;
}

/* Quiz description */
.quiz-description {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0 0;
}

/* Quiz maps link */
.quiz-maps-link {
  color: var(--pine-light);
  font-size: 12px;
  margin-left: 6px;
  text-decoration: none;
}

.quiz-maps-link:hover {
  text-decoration: underline;
}

/* RSVP error */
.rsvp-error {
  margin-top: 6px;
}

/* Success text */
.success-text {
  color: var(--green);
  font-size: 13px;
  margin: 4px 0 0 0;
}

/* Admin buttons in header */
.admin-buttons {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Past date chip (greyed out) */
.past-date-chip {
  background: var(--muted);
}
