.admin-panel {
  border-bottom: 0;
}

.admin-panel .panel-inner {
  gap: 24px;
}

.admin-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-page {
  flex: 1;
  display: flex;
  background: #f9f6ef;
}

.admin-page .admin-panel {
  flex: 1;
  align-items: flex-start;
}

.admin-panel .join-form input:not([type="checkbox"]):focus,
.admin-panel .join-form textarea:focus,
.admin-panel .join-form .join-select:focus {
  transform: none;
  box-shadow: none;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.admin-sections {
  display: grid;
  gap: 28px;
  width: 100%;
}

.admin-section {
  display: grid;
  gap: 14px;
}

.admin-section-header h2 {
  margin: 0;
}

.admin-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease, color 0.2s ease;
}

.admin-card:hover,
.admin-card:focus-visible {
  transform: translate(-6px, -6px);
  box-shadow: var(--shadow-lg);
}

.admin-card h3 {
  margin: 0;
}

.admin-card p {
  margin: 0;
}

.admin-card .btn {
  align-self: flex-start;
}

.admin-email-asset-list {
  display: grid;
  gap: 18px;
  padding: 0;
  margin: 0;
  list-style: none;
  width: min(50%, 32rem);
}

.admin-email-asset-item {
  margin: 0;
}

.admin-email-asset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.admin-email-asset-row a {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .admin-email-asset-list {
    width: 100%;
  }

  .admin-email-asset-row {
    grid-template-columns: 1fr;
    justify-items: start;
  }
}

.admin-volunteer-events-grid {
  width: 100%;
}

.admin-doc-intro {
  max-width: 72ch;
}

.admin-docs-toc {
  padding-bottom: 20px;
}

.admin-doc-section {
  width: 100%;
}

.admin-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.admin-doc-block {
  display: grid;
  gap: 10px;
  align-content: start;
  background: #fff;
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px;
}

.admin-doc-block h3 {
  margin: 0;
}

.admin-doc-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.admin-doc-list--routes {
  overflow-wrap: anywhere;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95rem;
}

.admin-volunteer-event-card {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 21.6rem;
  padding: 16px 18px 18px;
  gap: 8px;
}

.admin-volunteer-event-meta {
  display: grid;
  gap: 4px;
  min-height: calc(1.4em * 2);
}

.admin-volunteer-event-meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.admin-volunteer-event-location {
  font-weight: 700;
}

.admin-volunteer-event-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-volunteer-event-stat-field {
  min-width: 0;
  margin: 0;
  padding: 10px 12px 12px;
  border: 3px solid var(--line);
  background: #f9f6ef;
}

.admin-volunteer-event-stat-field legend {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-volunteer-event-stat-value {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.admin-volunteer-event-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.5em * 3);
  line-height: 1.5;
  margin: 0;
}

.admin-volunteer-event-card h3 {
  margin: 0;
}

.admin-volunteer-event-card .admin-volunteer-event-actions {
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  margin-top: 28px;
  align-self: end;
}

@supports (grid-template-rows: subgrid) {
  .admin-volunteer-events-grid {
    /* Repeat a shared five-row skeleton for each band of cards. */
    grid-auto-rows: auto auto auto auto auto;
  }

  .admin-volunteer-event-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: subgrid;
    grid-row: span 5;
    min-height: 0;
    row-gap: 8px;
    column-gap: 0;
  }

  .admin-volunteer-event-card > h3 {
    grid-row: 1;
  }

  .admin-volunteer-event-meta {
    grid-row: 2;
  }

  .admin-volunteer-event-stats {
    grid-row: 3;
  }

  .admin-volunteer-event-summary {
    grid-row: 4;
  }

  .admin-volunteer-event-actions {
    grid-row: 5;
  }
}

.admin-news-form {
  display: grid;
  gap: 18px;
  width: min(900px, 100%);
}

.admin-volunteer-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-volunteer-readonly-grid > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-field-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-choice-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.admin-choice-chip input[type="radio"],
.admin-choice-chip input[type="checkbox"] {
  margin: 0;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  accent-color: var(--primary);
  cursor: pointer;
}

.admin-emails-mode-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-emails-mode-row {
  align-items: center;
}

.admin-emails-mode-chip {
  padding: 6px 10px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.95rem;
}

.admin-emails-mode-chip input[type="radio"] {
  width: 14px;
  height: 14px;
}

.admin-choice-chip--readonly {
  cursor: default;
  opacity: 0.7;
}

.admin-choice-chip--readonly input[type="checkbox"] {
  cursor: default;
}

.admin-hero-image-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-hero-image-panel[hidden] {
  display: none;
}

.admin-help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: help;
  outline: none;
}

.admin-help-tooltip__icon {
  display: block;
}

.admin-help-tooltip__bubble {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  width: min(18rem, 60vw);
  padding: 10px 12px;
  border: 2px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 20;
}

.admin-help-tooltip:hover .admin-help-tooltip__bubble,
.admin-help-tooltip:focus-visible .admin-help-tooltip__bubble {
  opacity: 1;
  visibility: visible;
}

.admin-help-tooltip:focus-visible {
  color: var(--ink);
}

.admin-form-row {
  display: grid;
  gap: 16px;
}

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

@media (max-width: 720px) {
  .admin-help-tooltip__bubble {
    left: 0;
    top: calc(100% + 8px);
    transform: none;
    width: min(18rem, 80vw);
  }
}

.admin-news-form > div:not(.admin-events-actions):not(.admin-volunteer-readonly-grid):not(.admin-form-inline-row):not(.admin-form-row) {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-news-form > .admin-form-row > .admin-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-news-form > .admin-form-inline-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-news-form > .admin-form-inline-row > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-news-form {
  width: 100%;
}

.admin-events-filters {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 3px solid var(--line);
  background: #fff;
}

.admin-events-filters legend {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 14px;
  padding: 0 8px;
}

.admin-filter-disclosure {
  border: 2px solid var(--line);
  background: #f9f6ef;
  box-shadow: var(--shadow-sm);
}

.admin-filter-disclosure summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
}

.admin-filter-disclosure summary::-webkit-details-marker {
  display: none;
}

.admin-filter-disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 600;
}

.admin-filter-disclosure-summary-chevron {
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.14s ease;
  flex: 0 0 auto;
}

.admin-filter-disclosure[open] .admin-filter-disclosure-summary-chevron {
  transform: rotate(225deg);
}

.admin-filter-disclosure .admin-choice-row {
  padding: 0 12px 12px;
}

.admin-signups-event-info {
  margin: 0;
  width: 75%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 12px;
  border: 3px solid var(--line);
  min-width: 0;
}

.admin-signups-section-lede {
  margin-bottom: -10px;
}

.admin-signups-event-info .admin-choice-row {
  width: 100%;
  justify-content: space-between;
}

.admin-signups-event-info .admin-form-field {
  flex: 1 1 0;
  align-items: center;
  text-align: center;
}

.admin-signups-event-info .admin-form-field label {
  white-space: nowrap;
}

.admin-signups-stat-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  min-height: 2.5rem;
}

.admin-signups-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.admin-signups-loading-copy {
  display: none;
}

.admin-signups-loading-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-signups-spinner {
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: admin-promote-spin 0.7s linear infinite;
}

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

.admin-events-filter-row > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-events-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 16px;
}

.admin-notice-chip {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: 0.01em;
}

.admin-notice-chip--success {
  background: #d9f7d6;
  color: #12451b;
  border-color: #12451b;
  --offset-shadow: #12451b;
}

.admin-notice-chip--error {
  background: #ffd9d6;
  color: #7f1d1d;
  border-color: #7f1d1d;
  --offset-shadow: #7f1d1d;
}

.admin-news-form label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 14px;
}

.admin-news-form input,
.admin-news-form select,
.admin-news-form textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 16px;
  border-radius: 0;
  border: 4px solid var(--line);
  font-size: 18px;
  font-family: inherit;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.admin-news-form textarea {
  resize: vertical;
  min-height: 140px;
}

.admin-news-form input:focus,
.admin-news-form select:focus,
.admin-news-form textarea:focus {
  background: #fdf7e6;
}

.admin-news-form input:disabled,
.admin-news-form select:disabled,
.admin-news-form textarea:disabled {
  background: #ddd2c4;
  color: #6b5a73;
  border-color: #7c6a8d;
  cursor: not-allowed;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 3px solid var(--line);
  box-shadow: var(--shadow);
  background: #fff;
}

.admin-table-wrap--flat {
  box-shadow: none;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.admin-table th,
.admin-table td {
  border: 2px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}

td.admin-event-url-cell {
  text-align: center;
}

.admin-news-action-cell {
  text-align: center;
}

.admin-compact-btn {
  --btn-lift: 3px;
  --btn-shadow-x: 6px;
  --btn-shadow-y: 6px;
}

.admin-compact-btn .btn__face {
  padding: 10px 14px;
  font-size: 12px;
}

.admin-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.admin-pagination [aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}

.admin-promote-indicator {
  display: none;
}

.admin-promote-spinner {
  display: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: admin-promote-spin 0.7s linear infinite;
}

.admin-promote-btn[aria-busy="true"] .admin-promote-copy {
  display: none;
}

.admin-promote-btn[aria-busy="true"] .admin-promote-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-promote-btn[aria-busy="true"] .admin-promote-spinner {
  display: inline-block;
}

@keyframes admin-promote-spin {
  to {
    transform: rotate(360deg);
  }
}

.admin-news-form.htmx-request .admin-submit-btn .admin-submit-copy,
.admin-submit-btn.htmx-request .admin-submit-copy {
  display: none;
}

.admin-news-form.htmx-request .admin-submit-btn .admin-submit-indicator,
.admin-submit-btn.htmx-request .admin-submit-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-news-form.htmx-request .admin-submit-btn .admin-submit-spinner,
.admin-submit-btn.htmx-request .admin-submit-spinner {
  display: inline-block;
}

.admin-submit-indicator {
  display: none;
}

.admin-submit-spinner {
  display: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: admin-promote-spin 0.7s linear infinite;
}

.admin-submit-btn[aria-busy="true"] .admin-submit-copy {
  display: none;
}

.admin-submit-btn[aria-busy="true"] .admin-submit-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-submit-btn[aria-busy="true"] .admin-submit-spinner {
  display: inline-block;
}

.admin-back-indicator {
  display: none;
}

.admin-back-spinner {
  display: none;
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 999px;
  animation: admin-promote-spin 0.7s linear infinite;
}

.admin-back-btn[aria-busy="true"] {
  pointer-events: none;
}

.admin-back-btn[aria-busy="true"] .admin-back-copy {
  display: none;
}

.admin-back-btn[aria-busy="true"] .admin-back-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-back-btn[aria-busy="true"] .admin-back-spinner {
  display: inline-block;
}

.admin-event-link-icon {
  font-size: 24px;
  line-height: 1;
}

.admin-event-url-cell a {
  display: inline-flex;
  padding: 6px;
  color: var(--primary);
  transition: background 0.15s ease, color 0.15s ease;
}

.admin-event-url-cell a:hover {
  background: var(--accent-2);
  color: var(--ink);
}

.admin-table th {
  background: var(--accent-2);
  font-weight: 800;
}

.admin-home-news-form {
  display: grid;
  gap: 16px;
}

.admin-home-checkbox {
  width: 22px;
  height: 22px;
}

.admin-home-order-input,
.admin-home-href-input {
  width: 100%;
  max-width: 220px;
  border: 2px solid var(--line);
  border-radius: 0;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

@media (max-width: 1040px) {
  .admin-events-filter-row {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-volunteer-readonly-grid {
    grid-template-columns: 1fr;
  }

  .admin-events-filter-row {
    grid-template-columns: 1fr;
  }

  /* Most inline rows stack on narrow screens; opt-out rows must declare that intent. */
  .admin-news-form > .admin-form-inline-row {
    grid-template-columns: 1fr;
  }

  .admin-news-form > .admin-form-inline-row.admin-form-inline-row--persist-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-form-row--stack-mobile {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .admin-news-form > .admin-form-inline-row.admin-form-inline-row--persist-2,
  .admin-form-row--persist-2 {
    grid-template-columns: 1fr;
  }
}
