body {
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  display: flex;
  min-height: 100vh;
  margin: 0;
}

.card {
  background: #fff;
  padding: 2.5rem 3rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  width: 320px;
  text-align: center;
  margin: auto;
}

.success-popup {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: #d4edda;
  color: #155724;
  font-weight: bold;
  padding: 1rem 1.75rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  z-index: 1000;
}

.success-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.page-logo {
  display: block;
  height: 84px;
  margin: 0 auto 1.2rem;
}

.admin-header-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-header-logo {
  height: 52px;
}

.verify-page {
  width: 100%;
  max-width: 480px;
  margin: auto;
  padding: 2.5rem 3rem;
  box-sizing: border-box;
  text-align: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.verify-page.wide {
  max-width: 700px;
}

/* the long detail form is a normal labeled form, not a confirmation dialog —
   keep it left-aligned for readability */
#verify-form {
  text-align: left;
}

.verify-success-message {
  text-align: center;
  margin-top: 1.5rem;
  color: #666;
  font-size: 1rem;
}

#challenge-form label,
#challenge-form .section-note {
  text-align: center;
}

#error-message {
  margin-top: 0;
  text-align: center;
  font-size: 1rem;
}

h1 {
  color: #222;
  margin-bottom: 0.5rem;
}

p.subtitle,
div.subtitle {
  color: #666;
  margin-bottom: 1.8rem;
}

.required-note {
  color: #666;
  font-size: 0.85rem;
  margin-top: -1.4rem;
  margin-bottom: 1.4rem;
  text-align: left;
}

.required-mark {
  color: #6a1b9a;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

fieldset:disabled {
  opacity: 0.5;
}

legend {
  width: 100%;
  font-size: 1.05rem;
  font-weight: bold;
  color: #6a1b9a;
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #6a1b9a;
  text-align: left;
}

.slide-group {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}

.slide-group.open {
  grid-template-rows: 1fr;
}

.slide-inner {
  overflow: hidden;
}

.section-note {
  color: #666;
  font-size: 0.85rem;
  margin-top: -0.6rem;
  margin-bottom: 1.2rem;
  text-align: left;
}

.section-note-error {
  color: #c62828;
  font-weight: bold;
}

.skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 480px;
}

.skeleton-bar {
  height: 1rem;
  border-radius: 4px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-bar:nth-child(1) { width: 55%; }
.skeleton-bar:nth-child(2) { width: 90%; }
.skeleton-bar:nth-child(3) { width: 75%; }

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.field-invalid {
  border-color: #c62828 !important;
  background: #fdecea;
}

label {
  font-weight: bold;
  color: #333;
  display: block;
  margin-bottom: 0.4rem;
  text-align: left;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  text-align: left;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 0.2rem;
  accent-color: #6a1b9a;
}

.checkbox-group label {
  font-weight: normal;
  margin-bottom: 0;
}

.consent-statement {
  font-weight: normal;
  color: #333;
  margin-bottom: 0.6rem;
}

.radio-group {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
  padding: 0.4rem;
  border: 1px solid transparent;
  border-radius: 4px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: normal;
  margin-bottom: 0;
}

.radio-group input[type="radio"] {
  accent-color: #6a1b9a;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1.2rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: 1rem;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6a1b9a;
  box-shadow: 0 0 0 2px rgba(106, 27, 154, 0.2);
}

.password-field-wrap {
  position: relative;
  margin-bottom: 1.2rem;
}

.password-field-wrap input[type="password"],
.password-field-wrap input[type="text"] {
  padding-right: 3.75rem;
  margin-bottom: 0;
}

.password-toggle-btn {
  position: absolute;
  right: 0.5rem;
  top: 0;
  height: 100%;
  width: auto;
  display: flex;
  align-items: center;
  background: none;
  border: none;
  color: #6a1b9a;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 0 0.4rem;
  margin: 0;
  cursor: pointer;
}

.password-toggle-btn:hover {
  background: none;
  text-decoration: underline;
}

button,
.btn {
  display: block;
  width: 100%;
  padding: 0.7rem;
  background: #6a1b9a;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  margin-bottom: 0.8rem;
}

button:hover,
.btn:hover {
  background: #4a148c;
}

.btn-secondary {
  background: #fff;
  color: #6a1b9a;
  border: 1px solid #6a1b9a;
}

.btn-secondary:hover {
  background: #f3e5f5;
}

.footer-text {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #666;
}

.footer-text a {
  color: #6a1b9a;
  text-decoration: none;
}

.footer-text a:hover {
  text-decoration: underline;
}

body.admin-body {
  display: block;
}

.admin-page {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.admin-header h1 {
  margin: 0;
}

.admin-username {
  margin-right: 1rem;
  color: #666;
  font-size: 0.9rem;
}

.admin-logout {
  display: inline-block;
  width: auto;
  padding: 0.5rem 1rem;
  margin-bottom: 0;
}

.table-search-wrap {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 0 1.5rem;
}

.table-search {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.7rem 2.5rem 0.7rem 1rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
}

.table-search:focus {
  outline: none;
  border-color: #6a1b9a;
  box-shadow: 0 0 0 2px rgba(106, 27, 154, 0.2);
}

.table-search-clear-btn {
  position: absolute;
  top: 50%;
  right: 0.4rem;
  transform: translateY(-50%);
  width: auto;
  margin: 0;
  padding: 0.2rem 0.5rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.table-search-clear-btn:hover {
  background: none;
  color: #6a1b9a;
}

.bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.bulk-select-all {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  color: #333;
  margin-bottom: 0;
  white-space: nowrap;
}

.bulk-select-all input[type="checkbox"] {
  accent-color: #6a1b9a;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bulk-selected-count {
  color: #666;
  white-space: nowrap;
}

.bulk-actions .btn {
  display: inline-block;
  width: auto;
  padding: 0.4rem 0.9rem;
  margin-bottom: 0;
  font-size: 0.85rem;
}

.select-th,
.select-td {
  width: 1%;
}

.select-td input[type="checkbox"] {
  accent-color: #6a1b9a;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.18s ease;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid #eee;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #6a1b9a;
}

.modal-close {
  display: block;
  width: auto;
  background: none;
  color: #666;
  padding: 0;
  margin: 0;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: none;
  color: #222;
}

.modal-body {
  padding: 1rem 1.5rem 1.5rem;
  overflow-y: auto;
  color: #333;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}

.history-list li:last-child {
  border-bottom: none;
}

.history-date {
  font-weight: bold;
  color: #222;
}

.history-by {
  color: #666;
}

.history-remove-btn {
  display: inline-block;
  width: auto;
  padding: 0.3rem 0.7rem;
  margin: 0;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.attendance-mode-select {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.attendance-mode-btn {
  display: block;
  width: 100%;
  background: #fff;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 0;
}

.attendance-mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  background: #fff;
}

.attendance-mode-btn h2 {
  margin: 0 0 0.5rem;
  color: #6a1b9a;
  font-size: 1.1rem;
}

.attendance-mode-btn p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.attendance-mode-back {
  display: inline-block;
  width: auto;
  padding: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

.attendance-sort {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.attendance-sort-label {
  color: #666;
  font-size: 0.9rem;
}

.attendance-date-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.attendance-date-mode label {
  margin: 0;
  color: #666;
  font-weight: normal;
  font-size: 0.9rem;
}

.attendance-date-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  margin: 0;
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.attendance-date-step:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.attendance-date-step:disabled:hover {
  background: #fff;
}

#attendance-date-filter {
  width: auto;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.attendance-sort-btn {
  display: inline-block;
  width: auto;
  padding: 0.4rem 0.9rem;
  margin-bottom: 0;
  font-size: 0.85rem;
  background: #fff;
  color: #6a1b9a;
  border: 1px solid #6a1b9a;
  border-radius: 4px;
  cursor: pointer;
}

.attendance-sort-btn:hover {
  background: #f3e5f5;
}

.attendance-sort-btn.active {
  background: #6a1b9a;
  color: #fff;
}

.attendance-results {
  display: grid;
  gap: 0.75rem;
}

.attendance-results .section-note {
  text-align: center;
}

.attendance-person-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.attendance-person-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.attendance-person-row.row-selected {
  background: #ead7f2;
}

.attendance-person-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.attendance-person-name {
  font-weight: bold;
  color: #222;
}

.attendance-person-meta {
  color: #666;
  font-size: 0.85rem;
}

.attendance-person-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  text-align: right;
}

.attendance-stat-count {
  font-weight: bold;
  color: #6a1b9a;
  font-size: 0.9rem;
}

.attendance-stat-last {
  color: #666;
  font-size: 0.8rem;
}

.attendance-history-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.attendance-history-panel .btn {
  display: inline-block;
  width: auto;
  padding: 0.4rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.attendance-history-panel h2 {
  margin: 0 0 1rem;
  color: #6a1b9a;
  font-size: 1.2rem;
}

.medical-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.medical-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1.25rem 1.5rem;
  border-left: 4px solid transparent;
}

.medical-card-alert {
  border-left-color: #6a1b9a;
}

.medical-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.medical-card-name {
  font-weight: bold;
  font-size: 1.1rem;
  color: #222;
}

.medical-card-meta {
  color: #666;
  font-size: 0.85rem;
}

.medical-card-row {
  margin-bottom: 0.4rem;
  color: #444;
}

.medical-card-label {
  font-weight: bold;
  color: #222;
  margin-right: 0.3rem;
}

.medical-card-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}

.medical-flag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: bold;
}

.medical-flag-alert {
  background: #fdecea;
  color: #c62828;
}

.medical-card-detail {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.3rem;
}

.medical-card-consent {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  font-weight: bold;
}

.medical-consent-ok {
  color: #2e7d32;
}

.medical-consent-warning {
  color: #c62828;
}

.bulk-email-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.bulk-email-recipients {
  flex: 1 1 0;
  min-width: 0;
}

.bulk-email-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.bulk-email-filters select {
  width: auto;
  min-width: 180px;
  margin-bottom: 0;
}

.activity-date-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: normal;
  color: #333;
  margin-bottom: 0;
  white-space: nowrap;
}

.activity-date-label input[type="date"] {
  width: auto;
  margin-bottom: 0;
}

.export-sort-direction-btn {
  display: inline-block;
  width: auto;
  margin-bottom: 0;
  padding: 0.6rem 1rem;
}

.bulk-email-compose {
  flex: 2 1 0;
  position: sticky;
  top: 1.5rem;
}

@media (max-width: 800px) {
  .bulk-email-layout {
    flex-direction: column;
  }

  .bulk-email-compose {
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
    position: static;
  }
}

.bulk-email-compose label {
  margin-top: 1rem;
}

.bulk-email-compose label:first-of-type {
  margin-top: 0;
}

.bulk-email-compose textarea {
  resize: vertical;
}

.bulk-email-progress-wrap {
  margin-bottom: 1.2rem;
}

.bulk-email-progress-track {
  width: 100%;
  height: 10px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}

.bulk-email-progress-bar {
  height: 100%;
  width: 0%;
  background: #6a1b9a;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.bulk-email-progress-label {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: #666;
}

.bulk-email-compose .btn {
  display: inline-block;
  width: auto;
  padding: 0.6rem 1.5rem;
}

#bulk-email-attachments {
  width: 100%;
  padding: 0.5rem 0;
  margin-bottom: 0.4rem;
  box-sizing: border-box;
  font-size: 0.85rem;
}

.bulk-email-attachment-list {
  margin-bottom: 1rem;
}

.bulk-email-attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  background: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #333;
  margin-bottom: 0.4rem;
}

.bulk-email-attachment-remove {
  display: inline-block;
  width: auto;
  background: none;
  color: #999;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.bulk-email-attachment-remove:hover {
  background: none;
  color: #c62828;
}

.bulk-email-person-row {
  cursor: pointer;
}

.bulk-email-checkbox-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bulk-email-person-checkbox {
  width: auto;
  margin: 0;
  accent-color: #6a1b9a;
  flex-shrink: 0;
}

.admin-table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #eee;
  text-align: left;
}

.admin-table th {
  background: #f3e5f5;
  color: #6a1b9a;
}

.admin-row-disabled {
  background: #f5f5f5;
  color: #999;
}

.admin-row-disabled td {
  color: #999;
}

.admin-status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

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

.admin-status-disabled {
  background: #f8d7da;
  color: #721c24;
}

.floating-table-head {
  position: fixed;
  top: 0;
  overflow: hidden;
  z-index: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: none;
}

.floating-table-head table {
  border-collapse: collapse;
  font-size: 0.9rem;
}

.floating-table-head th {
  background: #f3e5f5;
  color: #6a1b9a;
  padding: 0.6rem 1rem;
  text-align: left;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Checkbox + Actions columns stay pinned to the left of the table's
   horizontal scroll (View All). Cells need opaque backgrounds so the
   scrolled columns don't show through them. */
.sticky-col {
  position: sticky;
  z-index: 2;
}

.sticky-col-select {
  left: 0;
}

.sticky-col-actions {
  left: var(--sticky-actions-left, 0px);
  /* Thin frame drawn as inset shadows: collapsed table borders don't
     travel with sticky cells. */
  box-shadow: inset 1px 0 0 #ce93d8, inset -1px 0 0 #ce93d8, 4px 0 6px -4px rgba(0, 0, 0, 0.2);
}

.admin-table tbody tr:last-child td.sticky-col-actions {
  box-shadow: inset 1px 0 0 #ce93d8, inset -1px 0 0 #ce93d8, inset 0 -1px 0 #ce93d8, 4px 0 6px -4px rgba(0, 0, 0, 0.2);
}

.admin-table td.sticky-col {
  background: #fff;
}

.admin-table tbody tr:hover td.sticky-col {
  background: #f9f9f9;
}

.admin-table tbody tr.row-selected td.sticky-col {
  background: #ead7f2;
}

.admin-table tbody tr.row-selected:hover td.sticky-col {
  background: #e1bee7;
}

.admin-table th.sortable-column {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.admin-table th.sortable-column:hover {
  background: #f8d7ce;
}

.admin-table tbody tr:hover {
  background: #f9f9f9;
}

.admin-table tbody tr {
  transition: background-color 0.15s ease, opacity 0.3s ease, transform 0.3s ease;
}

.admin-table tbody tr.row-selected {
  background: #ead7f2;
}

.admin-table tbody tr.row-selected:hover {
  background: #e1bee7;
}

.admin-table tbody tr.row-fade-out {
  opacity: 0;
  transform: scale(0.97);
}

.admin-table td.status-pending {
  background: #fff3cd;
  color: #856404;
  font-weight: bold;
}

.admin-table td.status-verified {
  background: #d4edda;
  color: #155724;
  font-weight: bold;
}

.admin-table td.status-awaiting {
  background: #d1ecf1;
  color: #0c5460;
  font-weight: bold;
}

.admin-table td.status-expired {
  background: #f8d7da;
  color: #721c24;
  font-weight: bold;
}

.admin-table td.status-lastseen-green {
  background: #d4edda;
  color: #155724;
}

.admin-table td.status-lastseen-yellow {
  background: #fff3cd;
  color: #856404;
}

.admin-table td.status-lastseen-red {
  background: #f8d7da;
  color: #721c24;
}

.admin-row-actions {
  white-space: nowrap;
}

.admin-row-actions .btn {
  display: inline-block;
  width: auto;
  padding: 0.35rem 0.7rem;
  margin-bottom: 0;
  font-size: 0.85rem;
}

.admin-table .row-edit-input,
.admin-table .award-level-select {
  width: auto;
  min-width: 90px;
  padding: 0.3rem 0.5rem;
  margin-bottom: 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.admin-table .staff-qualifications {
  min-width: 160px;
  max-width: 280px;
}

.staff-qualifications-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.staff-qualifications-fieldset legend {
  width: auto;
  padding: 0;
  margin-bottom: 0.4rem;
  border: 0;
  font-size: 1rem;
  font-weight: bold;
  color: #333;
}

.staff-qualification-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.staff-qualification-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

.staff-qualification-option input {
  width: auto;
  margin: 0;
}

.admin-table .staff-qualification-option {
  font-size: 0.85rem;
  white-space: nowrap;
}

.staff-qualifications-none {
  margin: 0;
}

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-pill {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
}

.attendance-date-count {
  margin-bottom: 1.5rem;
  width: fit-content;
}

.stat-count {
  font-size: 1.4rem;
  font-weight: bold;
}

.stat-label {
  font-size: 0.85rem;
}

.stat-pending {
  background: #fff3cd;
  color: #856404;
}

.stat-awaiting {
  background: #d1ecf1;
  color: #0c5460;
}

.stat-expired {
  background: #f8d7da;
  color: #721c24;
}

.stat-verified {
  background: #d4edda;
  color: #155724;
}

.stat-signed-in-today {
  background: #e2d9f3;
  color: #4b2e83;
}

.admin-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.admin-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}

.admin-menu-item {
  display: block;
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.admin-menu-item:hover,
button.admin-menu-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.admin-menu-hidden-toggle {
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  border: 2px dashed #ddd;
}

.admin-menu-hidden-toggle h2 {
  color: #888;
}

.admin-menu-item-hidden {
  opacity: 0.55;
}

.admin-menu-item h2 {
  margin: 0 0 0.5rem;
  color: #6a1b9a;
  font-size: 1.1rem;
}

.admin-menu-item p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.admin-menu-item-disabled {
  opacity: 0.6;
  cursor: default;
}

.admin-menu-soon {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: bold;
  color: #6a1b9a;
  background: #f3e5f5;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.trip-top-actions {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.trip-new-btn {
  max-width: 260px;
  margin-bottom: 0;
  text-align: center;
}

.trip-archived-link {
  width: auto;
  align-self: center;
}

.trip-section {
  margin-bottom: 2rem;
}

.trip-section-title {
  color: #6a1b9a;
  font-size: 1.2rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #eee;
}

.trip-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.trip-card {
  display: block;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.trip-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.trip-card-inner-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.trip-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.trip-card-btn {
  width: auto;
  margin: 0;
  font-size: 0.85rem;
  padding: 0.4rem 0.9rem;
}

.trip-card h3 {
  margin: 0 0 0.5rem;
  color: #6a1b9a;
  font-size: 1.1rem;
}

.trip-card-date {
  margin: 0 0 0.5rem;
  color: #444;
  font-size: 0.9rem;
}

.trip-card-meta {
  margin: 0;
  color: #666;
  font-size: 0.85rem;
}

.trip-wizard {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1.75rem;
  max-width: 640px;
}

.trip-view-layout {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
}

.trip-view-main,
.trip-view-side {
  flex: 1 1 0;
  min-width: 0;
}

.trip-view-main .trip-wizard,
.trip-view-side .trip-wizard {
  max-width: none;
}

@media (max-width: 800px) {
  .trip-view-layout {
    flex-direction: column;
  }
}

.trip-view-card {
  margin-bottom: 1.5rem;
}

.trip-view-card:last-child {
  margin-bottom: 0;
}

.trip-wizard-step-label {
  margin: 0 0 1.25rem;
  color: #6a1b9a;
  font-weight: bold;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trip-wizard-section-title {
  margin: 0 0 1rem;
  font-weight: bold;
  color: #222;
  font-size: 1rem;
}

.trip-time-select-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.trip-time-select-group select {
  width: auto;
  min-width: 70px;
  margin-bottom: 0;
}

.trip-time-select-group span {
  font-weight: bold;
  color: #666;
}

.trip-contact-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.trip-contact-row input {
  flex: 1 1 0;
  min-width: 0;
}

.trip-contact-remove {
  flex-shrink: 0;
  width: auto;
  background: none;
  border: none;
  color: #c62828;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.4rem;
  margin-bottom: 1.2rem;
}

.trip-view-form-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: auto;
}

.trip-view-form-arrow {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.trip-view-form-btn[aria-expanded="true"] .trip-view-form-arrow {
  transform: rotate(180deg);
}

.trip-participant-current-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

.trip-participant-current-row .trip-contact-remove {
  margin-bottom: 0;
}

.trip-participant-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.trip-participant-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trip-signed-form-detail {
  background: #f9f9f9;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0 0 0.75rem;
}

.trip-signed-form-detail .trip-summary-row {
  padding: 0.4rem 0;
}

.trip-participant-actions .btn {
  width: auto;
  margin-bottom: 0;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
}

.trip-status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: bold;
}

.trip-status-pending {
  background: #fff3cd;
  color: #856404;
}

.trip-status-not-sent {
  background: #e9ecef;
  color: #495057;
}

.trip-status-confirmed {
  background: #d4edda;
  color: #155724;
}

.trip-status-declined {
  background: #f8d7da;
  color: #721c24;
}

.trip-participants-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.trip-participants-header .trip-wizard-section-title {
  margin-bottom: 0;
}

.trip-participants-header .btn {
  width: auto;
  margin-bottom: 0;
}

.trip-send-all-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.trip-export-menu-wrap {
  position: relative;
  display: inline-block;
}

.trip-export-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.35rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  min-width: 210px;
  z-index: 20;
  overflow: hidden;
}

.trip-export-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.9rem;
  background: none;
  border: none;
  font-size: 0.9rem;
  color: #333;
  cursor: pointer;
}

.trip-export-menu-item:hover {
  background: #f1f3f5;
}

.trip-export-menu-item + .trip-export-menu-item {
  border-top: 1px solid #f1f3f5;
}

.trip-contact-remove:hover {
  background: none;
  color: #8e0000;
}

.trip-add-contact-btn {
  width: auto;
  margin: 0.25rem 0 1.2rem;
}

.trip-wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

.trip-wizard-actions .btn {
  width: auto;
  margin-bottom: 0;
}

.trip-wizard-actions #trip-back-btn {
  margin-right: auto;
}

.trip-approval-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.trip-approval-actions .btn {
  width: auto;
  margin-bottom: 0;
}

.trip-summary-row {
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
  color: #444;
  line-height: 1.5;
}

.trip-summary-row:last-child {
  border-bottom: none;
}

.trip-summary-label {
  font-weight: bold;
  color: #222;
  display: block;
}

.export-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.export-group {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1.25rem 1.5rem;
}

.export-group-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: #6a1b9a;
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #6a1b9a;
}

.export-group .checkbox-group {
  margin-bottom: 0.6rem;
}

.export-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.export-actions .btn {
  display: inline-block;
  width: auto;
  margin-bottom: 0;
}

#register-status {
  font-size: 1.3rem;
  color: #666;
  text-align: center;
  margin-top: 3rem;
}

.register-search-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 2rem;
}

.register-search {
  display: block;
  width: 100%;
  margin: 0;
  padding: 1rem 2.75rem 1rem 1.25rem;
  font-size: 1.2rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
}

.register-search:focus {
  outline: none;
  border-color: #6a1b9a;
  box-shadow: 0 0 0 2px rgba(106, 27, 154, 0.2);
}

.register-search-clear-btn {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: auto;
  margin: 0;
  padding: 0.25rem 0.6rem;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.register-search-clear-btn:hover {
  background: none;
  color: #6a1b9a;
}

.register-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.register-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  text-align: center;
}

.register-name {
  font-size: 1.2rem;
  font-weight: bold;
  color: #222;
  margin-bottom: 1rem;
}

.register-sign-in-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  margin-bottom: 0;
}

.dashboard-order-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid #eee;
  background: #fff;
  cursor: grab;
  user-select: none;
}

.dashboard-order-row:last-child {
  border-bottom: none;
}

.dashboard-order-row.dashboard-order-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.dashboard-order-handle {
  flex-shrink: 0;
  color: #aaa;
}

.dashboard-order-title {
  flex: 1 1 0;
  min-width: 0;
}

.dashboard-order-row.dashboard-order-hidden {
  opacity: 0.45;
}

.dashboard-order-visibility-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 0.3rem;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
}

.dashboard-order-visibility-btn:hover {
  background: none;
  color: #6a1b9a;
}

.field-list-values {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.field-list-values li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #eee;
}

.field-list-values li span {
  overflow-wrap: anywhere;
}

.field-list-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.field-rename-form {
  display: flex;
  gap: 0.4rem;
  width: 100%;
}

.field-rename-form .field-rename-input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.field-rename-form .btn,
.field-list-values .field-edit-btn,
.field-list-values .field-remove-btn {
  width: auto;
  margin-bottom: 0;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

.field-list-empty {
  color: #666;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.field-add-form {
  display: flex;
  gap: 0.5rem;
}

.field-add-form .field-add-input {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.field-add-form .field-add-btn {
  width: auto;
  margin-bottom: 0;
}

.field-list-message {
  margin-top: 0.6rem;
  margin-bottom: 0;
}

.manual-signin-person-list {
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.manual-signin-person-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  margin: 0;
  font-weight: normal;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.manual-signin-person-row:last-child {
  border-bottom: none;
}

.manual-signin-person-row:hover {
  background: #f3e5f5;
}

.manual-signin-no-matches {
  margin: 0;
  padding: 0.6rem;
  color: #777;
}

.manual-signin-selected-count {
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
  color: #555;
}

.role-permission-desc {
  color: #666;
  font-size: 0.85rem;
}

.role-services-cell {
  white-space: normal;
  min-width: 220px;
  max-width: 420px;
}

.role-kiosk-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: bold;
  color: #6a1b9a;
  border: 1px solid #6a1b9a;
  border-radius: 4px;
  padding: 0 0.3rem;
  margin-left: 0.25rem;
}

.role-editor-modal {
  max-width: 560px;
}


/* Food orders — leader page */

.food-new-order-btn {
  width: auto;
  padding: 0.8rem 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: bold;
}

.food-create-modal {
  max-width: 520px;
  max-height: 90vh;
}

.food-order-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 0.9rem;
}

.food-order-card {
  border: 1px solid #e0e0e0;
  border-left: 4px solid #6a1b9a;
  border-radius: 6px;
  padding: 1rem 1.1rem;
  background: #fff;
}

.food-order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.food-order-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: #222;
}

/* Fixed-width digits so counting numbers don't make text jiggle. */
.count-up {
  font-variant-numeric: tabular-nums;
}

.food-order-card-heading {
  margin: -0.45rem 0 0.85rem;
  color: #555;
  word-break: break-word;
}

.food-order-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.food-order-card-stats dt {
  font-size: 0.75rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.food-order-card-stats dd {
  margin: 0.15rem 0 0;
  font-size: 1.25rem;
  font-weight: bold;
  color: #222;
}

.food-order-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.food-order-card-actions .btn {
  width: auto;
  margin-bottom: 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
  white-space: nowrap;
}

.food-order-card-actions .food-order-delete {
  color: #721c24;
  border-color: #e0b4b8;
}

.food-order-card-actions .food-order-delete:hover {
  background: #f8d7da;
}

.food-order-card:has(.admin-status-disabled) {
  border-left-color: #bbb;
}

.food-order-option-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px auto;
  gap: 0.5rem;
}

.food-order-option-row .order-option-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.food-order-option-taken {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: #777;
  margin: -0.2rem 0 0.6rem;
}

.food-field-hint {
  font-size: 0.8rem;
  color: #777;
  margin: -0.9rem 0 1.2rem;
}

.food-order-option-head {
  font-size: 0.85rem;
  font-weight: bold;
  color: #555;
  margin-bottom: 0.25rem;
}

.food-order-option-head span:nth-child(2) {
  grid-column: 2;
}

.food-order-option-row input {
  margin-bottom: 0.5rem;
}

.food-order-option-row .btn {
  width: auto;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
}

.food-order-max-input {
  max-width: 120px;
}

.food-order-option-list {
  margin: 0;
  padding-left: 1.1rem;
  white-space: normal;
  min-width: 160px;
}

.food-qr-modal {
  max-width: 520px;
  max-height: 92vh;
}

.food-qr-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.food-qr-section-title {
  font-size: 0.8rem;
  font-weight: bold;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 0.5rem;
}

.food-qr-actions + .food-qr-section-title {
  margin-top: 1.4rem;
  padding-top: 1.1rem;
  border-top: 1px solid #eee;
}

.food-qr-link {
  font-size: 0.85rem;
  color: #666;
  word-break: break-all;
  margin: 0 0 0.75rem;
}

.food-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.food-qr-actions .btn {
  flex: 1 1 120px;
  width: auto;
  margin-bottom: 0;
}

.food-responses-modal {
  max-width: 760px;
  max-height: 90vh;
}

.food-totals {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.food-totals li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 0.75rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.food-totals-count {
  font-weight: bold;
  text-align: right;
}

.food-totals-bar {
  grid-column: 1 / -1;
  height: 6px;
  background: #f3e5f5;
  border-radius: 3px;
  overflow: hidden;
}

.food-totals-bar span {
  display: block;
  height: 100%;
  background: #6a1b9a;
  transition: width 0.7s cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  .food-totals-bar span {
    transition: none;
  }
}

.food-responses-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
}

.food-live-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #888;
}

.food-live-status.live {
  color: #2e7d32;
  font-weight: bold;
}

.food-live-status.live::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #2e7d32;
  animation: food-live-pulse 2s ease-in-out infinite;
}

@keyframes food-live-pulse {
  50% { opacity: 0.35; }
}

@media (prefers-reduced-motion: reduce) {
  .food-live-status.live::before {
    animation: none;
  }
}

.food-responses-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 0 0 0.75rem;
}

.food-responses-heading h3 {
  margin: 0;
  font-size: 1rem;
  color: #6a1b9a;
}

.food-responses-progress {
  font-size: 0.9rem;
  color: #666;
}

.food-response-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.75rem;
}

.food-response-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e0e0e0;
  border-left: 4px solid #6a1b9a;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  background: #fff;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.food-response-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.food-response-card h4 {
  margin: 0;
  font-size: 1rem;
  color: #222;
  word-break: break-word;
}

.food-response-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: bold;
  border-radius: 10px;
  padding: 0.1rem 0.55rem;
  background: #f3e5f5;
  color: #4a148c;
}

.food-response-card ul {
  margin: 0 0 0.5rem;
  padding-left: 1.1rem;
}

.food-response-dietary {
  font-size: 0.85rem;
  color: #8e0000;
  background: #fff3e0;
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  margin: 0 0 0.5rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.food-response-meta {
  font-size: 0.8rem;
  color: #888;
  margin: auto 0 0.6rem;
}

.food-response-actions {
  display: flex;
  gap: 0.4rem;
}

.food-response-actions .btn {
  width: auto;
  margin-bottom: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;
}

.food-response-actions .food-response-step {
  flex: 1;
  white-space: nowrap;
}

.food-response-actions .food-response-remove {
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1;
  color: #721c24;
  border-color: #e0b4b8;
}

.food-response-actions .food-response-remove:hover {
  background: #f8d7da;
}

.food-response-card.made {
  border-left-color: #1565c0;
  background: #f3f7fc;
}

.food-response-card.made .food-response-status {
  background: #e3f2fd;
  color: #0d47a1;
}

.food-response-card.completed {
  border-left-color: #2e7d32;
  background: #f6faf6;
}

.food-response-card.completed .food-response-status {
  background: #d4edda;
  color: #155724;
}

.food-response-card.completed h4,
.food-response-card.completed ul {
  color: #777;
  text-decoration: line-through;
}

.food-qr-print {
  display: none;
}

@media print {
  body.food-qr-printing {
    display: block;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: none;
  }

  body.food-qr-printing > *:not(.food-qr-print) {
    display: none !important;
  }

  body.food-qr-printing > .food-qr-print {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 99vh;
    margin: 0 auto;
    break-inside: avoid;
  }
}

.food-sold-out-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: bold;
  color: #721c24;
  background: #f8d7da;
  border-radius: 10px;
  padding: 0.05rem 0.5rem;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Food orders — public form behind the QR code */

.food-form-page {
  text-align: left;
}

.food-form-page .page-logo,
.food-form-page h1,
.food-form-page .subtitle {
  text-align: center;
}

.food-form-page textarea {
  resize: vertical;
}

.food-choice-hint {
  color: #666;
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem;
}

.food-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-weight: normal;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.food-choice input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: #6a1b9a;
}

.food-choice:has(input:checked) {
  border-color: #6a1b9a;
  background: #f3e5f5;
}

.food-choice-label {
  flex: 1;
}

.food-choice-stock {
  font-size: 0.8rem;
  color: #666;
  white-space: nowrap;
}

.food-choice:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}

.food-choice:has(input:focus-visible) {
  box-shadow: 0 0 0 2px rgba(106, 27, 154, 0.3);
}

.food-form-done {
  text-align: center;
}

.signup-done {
  text-align: center;
}

.signup-done .section-note {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1rem 0 1.5rem;
}

.food-form-done ul {
  display: inline-block;
  text-align: left;
  margin: 0 0 1.5rem;
}

@media (max-width: 600px) {
  .food-new-order-btn {
    width: 100%;
  }

  .food-orders-group {
    padding: 1rem 0.9rem;
  }


  body:has(.food-form-page) {
    padding: 0;
  }

  .food-form-page {
    padding: 1.75rem 1.25rem;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
  }
}


/* Volunteering */

.volunteer-section {
  margin-bottom: 1.5rem;
}

.volunteer-note {
  margin-top: 0;
}

.volunteer-subtext {
  color: #666;
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.volunteer-badge-draft {
  background: #eceff1;
  color: #455a64;
}

.volunteer-badge-new {
  background: #f3e5f5;
  color: #6a1b9a;
}

.volunteer-message {
  white-space: pre-wrap;
  min-width: 220px;
  max-width: 360px;
}

.volunteer-nowrap {
  white-space: nowrap;
}

.volunteer-time-row {
  display: flex;
  gap: 1rem;
}

.volunteer-time-row > div {
  flex: 1;
}

.volunteer-apps-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  width: auto;
  margin: 0;
  padding: 0.35rem 0.6rem;
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  color: #333;
  font-size: 0.9rem;
  cursor: pointer;
}

.volunteer-apps-toggle:hover,
.volunteer-apps-toggle[aria-expanded="true"] {
  background: #f3e5f5;
  border-color: #6a1b9a;
  color: #6a1b9a;
}

.volunteer-apps-caret {
  width: 0.8em;
}

.volunteer-row-expanded td {
  background: #faf5fc;
}

.volunteer-apps-row > td {
  padding: 0;
  background: #faf5fc;
}

.volunteer-apps-panel {
  padding: 0.75rem 1rem 1rem 2rem;
  border-left: 4px solid #6a1b9a;
}

.volunteer-apps-table {
  background: #fff;
}

.volunteer-apps-empty {
  margin: 0;
}

/* Four session buttons sit two to a row instead of widening the table. */
.admin-row-actions.volunteer-session-actions {
  white-space: normal;
  min-width: 10.5rem;
}

.volunteer-session-actions .btn {
  margin: 0.15rem 0;
}

/* Event, venue and activity wrap so the sessions table fits without
   sideways scrolling; dates, times and buttons stay on one line. */
.admin-table.volunteer-sessions-table {
  white-space: normal;
}

.volunteer-sessions-table .volunteer-apps-table {
  white-space: nowrap;
}

.volunteer-apps-pending {
  margin-top: 0.35rem;
}

.volunteer-linked {
  color: #2e7d32;
}

.volunteer-unlinked {
  color: #b26a00;
}

.volunteer-link-list {
  max-height: 45vh;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.volunteer-link-option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0.8rem;
  text-align: left;
  background: #fff;
  color: #222;
  border: none;
  border-bottom: 1px solid #eee;
  border-radius: 0;
  font-weight: normal;
  cursor: pointer;
}

.volunteer-link-option:last-child {
  border-bottom: none;
}

.volunteer-link-option:hover {
  background: #fafafa;
}

.volunteer-link-option.selected {
  background: #f3e5f5;
  box-shadow: inset 4px 0 0 #6a1b9a;
}

.volunteer-link-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
}

.volunteer-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.volunteer-link-actions button {
  width: auto;
  margin: 0;
}

.volunteer-link-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.volunteer-apps-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.volunteer-apps-toolbar .volunteer-subtext {
  margin-top: 0;
}

.volunteer-apps-toolbar .btn {
  width: auto;
  margin: 0;
}

/* Make Sheet — form on the left, live A4 preview on the right; only the
   sheet prints. */

.ms-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1.5rem;
}

.ms-form-col textarea {
  resize: vertical;
}

.ms-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.ms-price-wrap {
  position: relative;
}

.ms-price-wrap span {
  position: absolute;
  left: 0.65rem;
  top: 0.6rem;
  color: #555;
}

.ms-price-wrap input[type="text"] {
  padding-left: 1.5rem;
}

.ms-actions {
  display: flex;
  gap: 0.75rem;
}

.ms-actions button {
  margin-bottom: 0.5rem;
}

.ms-preview-col {
  position: sticky;
  top: 1rem;
  min-width: 0;
}

.ms-preview-label {
  font-size: 0.8rem;
  font-weight: bold;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.ms-sheet {
  background: #fff;
  color: #222;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 2rem 2.25rem;
  aspect-ratio: 210 / 297;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  font-size: 0.9rem;
  overflow: hidden;
}

.ms-sheet-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid #6a1b9a;
}

.ms-sheet-logo {
  width: 48px;
  height: 48px;
}

.ms-sheet-title {
  font-size: 0.8rem;
  font-weight: bold;
  color: #6a1b9a;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.ms-sheet-style {
  font-size: 1.6rem;
  font-weight: bold;
  min-height: 1.9rem;
}

.ms-sheet-style.ms-is-empty {
  min-width: 22rem;
  border-bottom: 1px solid #999;
}

.ms-sheet-style.ms-is-empty::before {
  content: attr(data-empty);
  font-size: 0.75rem;
  font-weight: normal;
  color: #999;
}

/* Blank season: tick boxes to mark by hand. Hidden once a season is chosen. */
.ms-season-options {
  font-size: 0.8rem;
  color: #444;
  white-space: nowrap;
}

.ms-cell-value:not(.ms-is-empty) + .ms-season-options {
  display: none;
}

.ms-cell-value.ms-is-empty:has(+ .ms-season-options) {
  display: none;
}

/* Empty write-in boxes get faint ruled lines for handwriting. */
.ms-block-body.ms-is-empty {
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.9em - 1px), #d6d6d6 calc(1.9em - 1px), #d6d6d6 1.9em);
  background-origin: content-box;
  background-clip: content-box;
}

.ms-grid {
  display: grid;
  border: 1px solid #999;
  border-radius: 4px;
  overflow: hidden;
}

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

.ms-cell {
  padding: 0.45rem 0.65rem;
  border-right: 1px solid #ccc;
  border-bottom: 1px solid #ccc;
  min-height: 2.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.ms-cell:nth-child(3),
.ms-cell:last-child {
  border-right: none;
}

.ms-cell:nth-last-child(-n+2) {
  border-bottom: none;
}

.ms-span-2 {
  grid-column: span 2;
}

.ms-cell-label {
  font-size: 0.68rem;
  font-weight: bold;
  color: #6a1b9a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ms-cell-value {
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.ms-block {
  border: 1px solid #999;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.ms-block-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.65rem;
  background: #f3e5f5;
  border-bottom: 1px solid #ccc;
  font-size: 0.72rem;
  font-weight: bold;
  color: #6a1b9a;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ms-time {
  color: #333;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.85rem;
}

.ms-time .ms-is-empty {
  display: inline-block;
  width: 5rem;
  border-bottom: 1px solid #999;
}

.ms-block-body {
  padding: 0.5rem 0.65rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.4;
  flex: 1;
  overflow: hidden;
}

.ms-price-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding-top: 0.6rem;
  border-top: 3px solid #6a1b9a;
}

.ms-price-value {
  font-size: 1.4rem;
  font-weight: bold;
  min-width: 8rem;
  text-align: right;
}

.ms-price-value.ms-is-empty {
  height: 1.6rem;
  border-bottom: 1px solid #999;
}

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

  .ms-preview-col {
    position: static;
  }

  .ms-sheet {
    padding: 1.25rem;
    aspect-ratio: auto;
    min-height: 600px;
  }
}

@media print {
  /* Zero page margin: browsers then have no room for their own header and
     footer (URL, title, date, page number). The sheet supplies its own
     white border instead. */
  @page {
    size: A4 portrait;
    margin: 0;
  }

  html,
  body.make-sheet-body {
    width: 210mm;
    height: 297mm;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  body.make-sheet-body {
    display: block;
    min-height: 0;
    background: #fff;
  }

  body.make-sheet-body .admin-page,
  body.make-sheet-body .ms-layout,
  body.make-sheet-body .ms-preview-col {
    display: block;
    position: static;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  body.make-sheet-body .admin-header,
  body.make-sheet-body .ms-form-col,
  body.make-sheet-body .ms-preview-label {
    display: none !important;
  }

  body.make-sheet-body .ms-sheet {
    width: 210mm;
    height: 296mm;
    padding: 13mm 14mm;
    box-sizing: border-box;
    box-shadow: none;
    border-radius: 0;
    aspect-ratio: auto;
    min-height: 0;
    font-size: 11pt;
    break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
