/* =========================================================
   Building Display System Styles
   Shared public, admin, display, and slideshow styling.
   Cascade order is intentionally preserved during Phase 6.5 cleanup.
   ========================================================= */
* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f1ea;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #6b7280;
  --border: #d7d2c8;
  --dark: #202020;
  --dark-soft: #343434;
  --accent: #7b2f2f;
  --accent-dark: #5f2323;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
}

/* =========================================================
   Shared page layout, headers, hero panels, cards, and buttons
   ========================================================= */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.site-header h1 {
  margin: 4px 0 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.current-date {
  min-width: 210px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: right;
  box-shadow: var(--shadow);
}

.current-date span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.current-date strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--dark), var(--dark-soft));
  color: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
}

.hero-panel p {
  max-width: 680px;
  margin: 0;
  color: #e5e7eb;
  font-size: 1.05rem;
  line-height: 1.5;
}

.primary-action,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.primary-action:hover,
.button:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--border);
}

.button.secondary:hover {
  background: #f3f4f6;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 20px;
  margin-bottom: 20px;
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 4px 0 12px;
  font-size: 1.4rem;
}

.card > p {
  color: var(--muted);
  line-height: 1.5;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.section-heading a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.section-heading a:hover {
  text-decoration: underline;
}

/* =========================================================
   Shared event cards, lists, and content blocks
   ========================================================= */
.event-list {
  display: grid;
  gap: 12px;
}

.event-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.event-card h3,
.event-row h3 {
  margin: 4px 0 6px;
  font-size: 1.1rem;
}

.event-card p,
.event-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.event-time {
  color: var(--accent) !important;
  font-weight: 700;
}

.event-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.event-row:last-child {
  border-bottom: 0;
}

.event-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 10px;
  background: #f3f4f6;
  color: var(--muted);
  font-weight: 700;
}

.muted {
  opacity: 0.85;
}

.button-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

/* =========================================================
   Shared form controls, form grids, messages, and buttons
   ========================================================= */
.form {
  display: grid;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.form textarea {
  resize: vertical;
}

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

.checkbox-label {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
}

.checkbox-label input {
  width: auto;
}

.form-messages {
  display: none;
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
}

.form-messages p {
  margin: 0;
}

.form-messages p + p {
  margin-top: 6px;
}

.form-messages.error {
  display: block;
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fecaca;
}

.form-messages.success {
  display: block;
  background: #dcfce7;
  color: #14532d;
  border: 1px solid #bbf7d0;
}

.small-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
}

.small-button:hover {
  background: #f3f4f6;
}

.small-muted {
  margin-top: 8px !important;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 820px) {
  .site-header,
  .hero-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .current-date {
    text-align: left;
  }

  .dashboard-grid,
  .lower-grid {
    grid-template-columns: 1fr;
  }

  .primary-action {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.detail-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.detail-list p {
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

.event-card h3 a {
  color: var(--ink);
  text-decoration: none;
}

.event-card h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.form-divider {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* =========================================================
   Request dashboard and detail panel styles
   ========================================================= */
.request-card {
  cursor: pointer;
}

.request-card:hover,
.request-card:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.request-detail {
  display: grid;
  gap: 18px;
}

.request-detail h3 {
  margin: 0;
  font-size: 1.35rem;
}

.detail-section {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: start;
}

.detail-row strong {
  color: var(--ink);
}

.detail-row span {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

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

@media (max-width: 700px) {
  .detail-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

.hidden {
  display: none !important;
}

.approval-panel {
  margin-top: 20px;
}

.button.danger {
  background: #8b1e1e;
  color: #fff;
  border-color: #8b1e1e;
}

.button.danger:hover,
.button.danger:focus {
  background: #6f1717;
  border-color: #6f1717;
}

.nested-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.65);
}

.checkbox-grid {
  display: grid;
  gap: 8px;
}

@media (min-width: 700px) {
  .checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   Building display layout and display-card styles
   ========================================================= */
.display-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(191, 163, 94, 0.22), transparent 30%),
    linear-gradient(135deg, #101827 0%, #1f2937 45%, #111827 100%);
  color: #f8fafc;
}

.display-page {
  width: min(1500px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  gap: 28px;
}

.display-top-bar,
.display-hero,
.display-footer,
.display-panel {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(248, 250, 252, 0.16);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.display-top-bar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px 32px;
}

.display-top-bar h1,
.display-hero h2,
.display-panel h2 {
  margin: 0;
  color: #f8fafc;
}

.display-top-bar h1 {
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  letter-spacing: -0.05em;
}

.display-eyebrow {
  margin: 0 0 8px;
  color: #facc15;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 800;
}

.display-clock {
  display: grid;
  gap: 4px;
  text-align: right;
}

.display-clock span {
  color: #cbd5e1;
  font-size: clamp(1rem, 2vw, 1.35rem);
}

.display-clock strong {
  color: #f8fafc;
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1;
}

.display-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 34px 36px;
}

.display-hero h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.04em;
}

.display-hero p {
  color: #cbd5e1;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  max-width: 850px;
}

.display-status-card {
  min-width: 220px;
  padding: 24px;
  border-radius: 22px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  display: grid;
  gap: 4px;
}

.display-status-card strong {
  color: #f8fafc;
  font-size: 1.7rem;
}

.display-status-card span {
  color: #cbd5e1;
}

.display-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: start;
}

.display-middle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 28px;
  align-items: stretch;
}

.display-middle-row .display-panel {
  min-height: 420px;
}

.display-panel {
  padding: 28px;
  min-height: 420px;
}

.display-panel-heading {
  margin-bottom: 22px;
}

.display-panel-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.display-event-list {
  display: grid;
  gap: 18px;
}

.display-event-card {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(248, 250, 252, 0.08);
  border: 1px solid rgba(248, 250, 252, 0.14);
}

.display-event-card.recurring {
  border-color: rgba(250, 204, 21, 0.38);
  background: rgba(250, 204, 21, 0.1);
}

.display-event-card.muted {
  background: rgba(148, 163, 184, 0.1);
}

.display-event-card p {
  margin: 0;
  color: #facc15;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.display-event-card h3 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(1.35rem, 2.3vw, 2.15rem);
  line-height: 1.05;
}

.display-event-card span {
  color: #e2e8f0;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
}

.display-event-card small {
  color: #94a3b8;
  font-size: 0.95rem;
}

.display-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 22px 28px;
}

.display-footer p {
  margin: 0;
  color: #cbd5e1;
}

.display-footer .button.secondary {
  background: rgba(248, 250, 252, 0.1);
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.24);
}

.display-footer .button.secondary:hover,
.display-footer .button.secondary:focus {
  background: rgba(248, 250, 252, 0.18);
}

@media (max-width: 900px) {
  .display-top-bar,
  .display-hero,
  .display-footer {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  .display-clock {
    text-align: left;
  }

  .display-grid,
  .display-middle-row {
    grid-template-columns: 1fr;
  }
}

.small-muted {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.event-card .small-muted {
  margin-top: 6px;
}

.form h3 {
  margin: 6px 0 0;
  color: var(--ink);
}

.button-stack {
  flex-wrap: wrap;
}

.site-header .button-stack {
  justify-content: flex-end;
}

.event-card a {
  color: inherit;
}

.event-card a:hover,
.event-card a:focus {
  color: var(--accent);
}

.card .section-heading {
  gap: 16px;
}

.form-messages.success {
  border-color: rgba(22, 101, 52, 0.28);
  background: rgba(22, 101, 52, 0.08);
  color: #14532d;
}

.form-messages.error {
  border-color: rgba(153, 27, 27, 0.28);
  background: rgba(153, 27, 27, 0.08);
  color: #7f1d1d;
}

@media (max-width: 850px) {
  .site-header {
    align-items: flex-start;
  }

  .site-header .button-stack {
    justify-content: flex-start;
  }
}

/* =========================================================
   Status badges and announcement card basics
   ========================================================= */
.status-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-active {
  background: rgba(31, 122, 63, 0.18);
  color: #1f7a3f;
}

.status-inactive {
  background: rgba(168, 50, 50, 0.18);
  color: #8b1e1e;
}

.meta-text {
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.75;
}

.announcement-card {
  display: grid;
  gap: 1rem;
}

.announcement-body {
  line-height: 1.6;
}

.list-card-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 1rem;
}

.announcement-card {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

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

.announcement-card-header h3 {
  margin: 4px 0 0;
}

.announcement-body p {
  margin: 0;
}

.announcement-actions {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.display-panel-wide {
  grid-column: 1 / -1;
}

.display-event-card.announcement {
  border-left: 0.35rem solid rgba(255, 255, 255, 0.42);
}

.display-event-card.announcement h3 {
  font-size: clamp(1.5rem, 2.4vw, 2.3rem);
}

.display-event-card.announcement span {
  font-size: clamp(1rem, 1.5vw, 1.4rem);
  line-height: 1.5;
}

.announcements-section {
  margin-top: 24px;
  margin-bottom: 24px;
}

.form-field {
  margin-bottom: 1rem;
}

.form-field label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
}

.display-past-officer-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(210, 220, 240, 0.18);
  border-radius: 1.25rem;
  padding: 1.5rem;
}

.display-past-officer-image-wrap {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
}

.display-past-officer-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.display-past-officer-info h3 {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 4vw, 4rem);
}

.display-past-officer-info p {
  margin: 0 0 0.75rem;
  font-size: clamp(1.25rem, 2vw, 2rem);
}

.display-past-officer-info span {
  color: var(--muted-text);
  font-size: 0.95rem;
  word-break: break-word;
}

@media (max-width: 800px) {
  .display-past-officer-card {
    grid-template-columns: 1fr;
  }

  .display-past-officer-image-wrap {
    max-width: 320px;
  }
}

.production-display-body {
  height: 100vh;
  overflow: hidden;
}

.production-display-page {
  width: 100vw;
  height: 100vh;
  padding: 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
}

.production-display-header,
.production-display-footer,
.production-slide {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(248, 250, 252, 0.16);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.production-display-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 24px 30px;
}

.production-display-header h1 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(2.2rem, 4.5vw, 4.2rem);
  letter-spacing: -0.05em;
}

.production-slide-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.production-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
  padding: 34px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
  overflow: hidden;
}

.production-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.production-slide-heading h2 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(2.8rem, 6vw, 6rem);
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.production-slide-content {
  display: grid;
  gap: 22px;
  align-content: start;
  min-height: 0;
  overflow: hidden;
}

.production-slide-content .display-event-card {
  padding: 30px;
}

.production-slide-content .display-event-card h3 {
  font-size: clamp(2rem, 4vw, 4.2rem);
}

.production-slide-content .display-event-card span {
  font-size: clamp(1.3rem, 2.5vw, 2.1rem);
}

.production-slide-content .display-event-card small {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.production-officer-card {
  height: 100%;
  grid-template-columns: minmax(300px, 0.7fr) minmax(0, 1fr);
}

.production-officer-card .display-past-officer-info h3 {
  font-size: clamp(3rem, 7vw, 7rem);
}

.production-officer-card .display-past-officer-info p {
  font-size: clamp(1.5rem, 3vw, 3rem);
}

.production-display-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 16px 24px;
  color: #cbd5e1;
}

.production-display-footer p {
  margin: 0;
}

@media (max-width: 900px) {
  .production-display-body {
    height: auto;
    overflow: auto;
  }

  .production-display-page {
    height: auto;
    min-height: 100vh;
  }

  .production-slide-frame {
    min-height: 720px;
  }

  .production-officer-card {
    grid-template-columns: 1fr;
  }
}

.production-display {
  min-height: 100vh;
  overflow-x: hidden;
}

.production-display .display-page {
  width: min(1600px, calc(100% - 40px));
  min-height: 100vh;
  padding: 24px 0;
  gap: 20px;
}

.production-display .display-top-bar {
  padding: 22px 28px;
}

.production-display .display-top-bar h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.production-display .display-clock strong {
  font-size: clamp(2.2rem, 4.4vw, 4rem);
}

.production-display .display-panel {
  padding: 24px;
  min-height: 0;
}

.production-display .display-panel-heading {
  margin-bottom: 16px;
}

.production-display .display-panel-heading h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
}

.production-display .display-event-list {
  gap: 14px;
}

.production-display .display-event-card {
  padding: 18px;
}

.production-display .display-event-card h3 {
  font-size: clamp(1.25rem, 2vw, 1.9rem);
  line-height: 1.1;
}

.production-display .display-event-card span {
  font-size: clamp(0.95rem, 1.4vw, 1.2rem);
  line-height: 1.35;
}

.production-display .display-middle-row {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.75fr);
  gap: 20px;
}

.production-display .display-middle-row .display-panel {
  min-height: 360px;
}

.production-display .display-past-officer-card {
  grid-template-columns: minmax(170px, 220px) 1fr;
  gap: 1.4rem;
  padding: 1.2rem;
}

.production-display .display-past-officer-info h3 {
  font-size: clamp(1.7rem, 3vw, 3.2rem);
  line-height: 1;
}

.production-display .display-past-officer-info p {
  font-size: clamp(1rem, 1.7vw, 1.5rem);
}

.production-display .display-footer {
  padding: 16px 22px;
}

.production-display .display-footer p {
  line-height: 1.35;
}

.production-display .display-footer .button-stack {
  margin-top: 0;
}

@media (min-width: 1000px) {
  .production-display .display-page {
    grid-template-rows: auto auto auto auto auto;
  }
}

@media (max-width: 900px) {
  .production-display .display-page {
    width: min(100% - 24px, 760px);
    padding: 16px 0;
  }

  .production-display .display-middle-row {
    grid-template-columns: 1fr;
  }

  .production-display .display-past-officer-card {
    grid-template-columns: 1fr;
  }
}

.production-display .display-panel-heading:has(.display-eyebrow:only-child) {
  margin-bottom: 12px;
}

.production-display .display-panel-heading .display-eyebrow:only-child {
  margin-bottom: 0;
  font-size: 0.9rem;
}

.production-display .display-top-bar .display-eyebrow {
  display: none;
}

/* =========================================================
   Public calendar month view
   ========================================================= */

.calendar-heading {
  align-items: center;
}

.calendar-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: end;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.calendar-month-buttons {
  margin-top: 0;
}

.calendar-jump-form {
  display: grid;
  gap: 6px;
}

.calendar-jump-form label {
  color: var(--ink);
  font-weight: 700;
}

.calendar-jump-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.calendar-jump-row input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.calendar-month-list {
  display: grid;
  gap: 20px;
}

.calendar-date-section {
  display: grid;
  gap: 10px;
}

.calendar-date-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--dark);
  color: #fff;
}

.calendar-date-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.calendar-date-heading p {
  margin: 0;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 700;
}

.calendar-date-events {
  display: grid;
  gap: 10px;
}

.calendar-event-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.calendar-event-card h4 {
  margin: 4px 0 6px;
  font-size: 1.08rem;
}

.calendar-event-card h4 a {
  color: var(--ink);
  text-decoration: none;
}

.calendar-event-card h4 a:hover,
.calendar-event-card h4 a:focus {
  color: var(--accent);
  text-decoration: underline;
}

.calendar-event-main {
  min-width: 0;
}

.calendar-event-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.calendar-empty-state {
  text-align: left;
}

@media (max-width: 760px) {
  .calendar-controls {
    grid-template-columns: 1fr;
  }

  .calendar-event-card {
    grid-template-columns: 1fr;
  }

  .calendar-event-action {
    justify-content: flex-start;
  }

  .calendar-date-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

/* =========================================================
   Officer image record admin list
   ========================================================= */

.officer-list-controls {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.officer-list-controls label {
  font-weight: 700;
}

.officer-list-controls select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.officer-record-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.officer-record-image-wrap {
  width: 110px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f3f4f6;
}

.officer-record-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.officer-record-image-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.officer-record-details {
  min-width: 0;
}

.officer-record-details h3 {
  margin: 4px 0 6px;
  font-size: 1.15rem;
}

.officer-record-details p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.officer-record-details p + p {
  margin-top: 4px;
}

@media (max-width: 700px) {
  .officer-record-card {
    grid-template-columns: 1fr;
  }

  .officer-record-image-wrap {
    width: 140px;
  }
}

/* =========================================================
   Multiple current officer display fallback
   ========================================================= */

.display-past-officer-image-fallback {
  width: 100%;
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 1rem;
  color: #cbd5e1;
  font-weight: 800;
  text-align: center;
  background: rgba(148, 163, 184, 0.12);
}

/* =========================================================
   Announcement scheduling, priority, emergency, and archive styling
   ========================================================= */

.status-badge-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.status-upcoming {
  background: rgba(37, 99, 235, 0.16);
  color: #1d4ed8;
}

.status-expired {
  background: rgba(107, 114, 128, 0.18);
  color: #4b5563;
}

.status-archived {
  background: rgba(75, 85, 99, 0.18);
  color: #374151;
}

.status-emergency {
  background: rgba(185, 28, 28, 0.18);
  color: #991b1b;
}

.status-priority-normal {
  background: rgba(107, 114, 128, 0.14);
  color: #4b5563;
}

.status-priority-high {
  background: rgba(217, 119, 6, 0.18);
  color: #92400e;
}

.status-priority-urgent {
  background: rgba(194, 65, 12, 0.2);
  color: #9a3412;
}

.announcement-card-archived {
  opacity: 0.72;
}

.announcement-card-archived h3 {
  color: var(--muted);
}

.announcement-card-archived .announcement-body {
  color: var(--muted);
}

.display-event-card.announcement-priority-high {
  border-left-color: rgba(250, 204, 21, 0.9);
  background: rgba(250, 204, 21, 0.12);
}

.display-event-card.announcement-priority-urgent {
  border-left-color: rgba(251, 146, 60, 0.95);
  background: rgba(251, 146, 60, 0.14);
}

.display-event-card.announcement-emergency {
  border-left-color: rgba(248, 113, 113, 1);
  background:
    linear-gradient(135deg, rgba(127, 29, 29, 0.42), rgba(248, 113, 113, 0.14)),
    rgba(248, 250, 252, 0.08);
  border-color: rgba(248, 113, 113, 0.5);
}

.display-event-card.announcement-emergency p {
  color: #fecaca;
}

.display-event-card.announcement-emergency h3 {
  color: #fff7ed;
}

.display-event-card.announcement-emergency span {
  color: #fee2e2;
}

@media (max-width: 700px) {
  .announcement-card-header {
    flex-direction: column;
  }

  .status-badge-group {
    justify-content: flex-start;
  }
}

.announcement-list-controls {
  display: grid;
  gap: 6px;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

/* =========================================================
   Media library admin styles
   ========================================================= */

.media-selected-preview {
  display: grid;
  gap: 12px;
}

.media-selected-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  display: block;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f3f4f6;
}

.media-preview-fallback {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: #f3f4f6;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.media-list {
  display: grid;
  gap: 16px;
}

.media-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fafafa;
}

.media-card-archived {
  opacity: 0.72;
}

.media-thumbnail-wrap {
  width: 180px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f3f4f6;
}

.media-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-edit-form {
  display: grid;
  gap: 14px;
  min-width: 0;
}

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

.media-card-header h3 {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.media-card .small-muted {
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .media-card {
    grid-template-columns: 1fr;
  }

  .media-thumbnail-wrap {
    width: 100%;
    max-width: 260px;
  }

  .media-card-header {
    flex-direction: column;
  }
}

.media-library-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 280px) auto;
  gap: 14px;
  align-items: end;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.media-library-controls label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.media-library-controls input,
.media-library-controls select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.media-archive-toggle {
  margin-bottom: 10px;
}

@media (max-width: 860px) {
  .media-library-controls {
    grid-template-columns: 1fr;
  }

  .media-archive-toggle {
    margin-bottom: 0;
  }
}

/* =========================================================
   Public media slideshow layout
   ========================================================= */

.slideshow-body {
  min-height: 100vh;
  overflow: hidden;
}

.slideshow-page {
  width: min(1700px, calc(100% - 48px));
  height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 20px;
}

.slideshow-top-bar,
.slideshow-stage,
.slideshow-footer {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(248, 250, 252, 0.16);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.slideshow-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
}

.slideshow-top-bar h1 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(2rem, 4vw, 3.8rem);
  letter-spacing: -0.05em;
}

.slideshow-stage {
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.slideshow-slide {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0;
}

.slideshow-image-wrap {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.25);
}

.slideshow-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.slideshow-caption-panel {
  padding: 22px 28px;
  border-top: 1px solid rgba(248, 250, 252, 0.14);
  background: rgba(15, 23, 42, 0.9);
}

.slideshow-caption-panel h2 {
  margin: 0 0 8px;
  color: #f8fafc;
  font-size: clamp(1.7rem, 3vw, 3rem);
  line-height: 1.05;
}

.slideshow-caption-panel p {
  margin: 0;
  color: #cbd5e1;
  font-size: clamp(1rem, 1.6vw, 1.4rem);
  line-height: 1.4;
}

.slideshow-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 24px;
  color: #cbd5e1;
}

.slideshow-footer p {
  margin: 0;
}

.slideshow-footer .button-stack {
  margin-top: 0;
}

.slideshow-footer .button.secondary {
  background: rgba(248, 250, 252, 0.1);
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.24);
}

.slideshow-footer .button.secondary:hover,
.slideshow-footer .button.secondary:focus {
  background: rgba(248, 250, 252, 0.18);
}

.slideshow-fallback-card,
.slideshow-missing-image {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 36px;
  text-align: center;
}

.slideshow-fallback-card h2,
.slideshow-missing-image h2 {
  margin: 0;
  color: #f8fafc;
  font-size: clamp(2.5rem, 5vw, 5rem);
  letter-spacing: -0.05em;
}

.slideshow-fallback-card span,
.slideshow-missing-image span {
  max-width: 900px;
  color: #cbd5e1;
  font-size: clamp(1.1rem, 2vw, 1.7rem);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .slideshow-body {
    overflow: auto;
  }

  .slideshow-page {
    width: min(100% - 24px, 760px);
    height: auto;
    min-height: 100vh;
    padding: 16px 0;
  }

  .slideshow-top-bar,
  .slideshow-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .slideshow-stage {
    min-height: 520px;
  }

  .slideshow-slide {
    min-height: 520px;
  }
}

/* =========================================================
   Full-screen simplified slideshow display
   ========================================================= */

.simple-slideshow-page {
  width: 100vw;
  height: 100vh;
  padding: 0;
  position: relative;
  display: block;
}

.slideshow-back-link {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.28);
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(6px);
}

.slideshow-back-link:hover,
.slideshow-back-link:focus {
  background: rgba(15, 23, 42, 0.92);
}

.simple-slideshow-stage {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: rgba(2, 6, 23, 0.86);
  box-shadow: none;
}

.simple-slideshow-slide {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.simple-slideshow-image-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 0;
  background: #020617;
}

.simple-slideshow-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.simple-slideshow-caption-panel {
  max-height: 24vh;
  overflow: hidden;
  padding: 22px 32px;
  border-top: 1px solid rgba(248, 250, 252, 0.14);
  background: rgba(15, 23, 42, 0.92);
  text-align: center;
}

.simple-slideshow-caption-panel h2 {
  margin: 0 0 8px;
  color: #f8fafc;
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  line-height: 1.05;
}

.simple-slideshow-caption-panel p {
  margin: 0;
  color: #cbd5e1;
  font-size: clamp(1.05rem, 1.7vw, 1.45rem);
  line-height: 1.35;
}

.simple-slideshow-stage .slideshow-fallback-card,
.simple-slideshow-stage .slideshow-missing-image {
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
}

@media (max-width: 900px) {
  .simple-slideshow-page {
    height: 100vh;
    min-height: 100vh;
  }

  .simple-slideshow-stage {
    min-height: 100vh;
  }

  .simple-slideshow-slide {
    min-height: 100vh;
  }

  .simple-slideshow-caption-panel {
    max-height: 32vh;
  }
}

/* =========================================================
   Slideshow image scaling correction
   ========================================================= */

.simple-slideshow-image-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.simple-slideshow-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center center;
}

/* =========================================================
   Media group assignment controls
   ========================================================= */

.media-group-assignment-panel {
  display: grid;
  gap: 10px;
}

.media-group-checkbox-grid {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.media-group-checkbox {
  align-items: flex-start;
  font-weight: 600;
}

.media-group-checkbox input {
  margin-top: 3px;
}

@media (min-width: 900px) {
  .media-group-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.media-upload-group-panel {
  display: grid;
  gap: 10px;
}
/* =========================================================
   Final display, public page, and admin usability overrides
   These overrides are intentionally grouped at the end so the
   existing cascade remains intact.
   ========================================================= */

/* General button consistency */
button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
.button:disabled,
.small-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.primary-action,
.button {
  border: 1px solid transparent;
  cursor: pointer;
}

.button:focus-visible,
.primary-action:focus-visible,
.small-button:focus-visible,
.slideshow-back-link:focus-visible {
  outline: 3px solid rgba(123, 47, 47, 0.35);
  outline-offset: 2px;
}

/* Make form-field based admin pages match .form based pages */
#group-form,
#pastOfficerForm {
  display: grid;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 6px;
  margin-bottom: 0;
}

.form-field label {
  margin-bottom: 0;
}

.form-field input,
.form-field textarea,
.form-field select,
.media-edit-form input,
.media-edit-form textarea,
.media-edit-form select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.form-field textarea,
.media-edit-form textarea {
  resize: vertical;
}

/* Message and status consistency */
.form-messages.info {
  display: block;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.28);
}

.status-message {
  padding: 12px;
  border-radius: 10px;
  font-weight: 700;
}

.status-message ul {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.status-message.error {
  background: rgba(153, 27, 27, 0.08);
  color: #7f1d1d;
  border: 1px solid rgba(153, 27, 27, 0.28);
}

/* Empty states should look intentional even when rendered as plain paragraphs */
.empty-state {
  color: var(--muted);
  line-height: 1.45;
}

/* Header navigation polish */
.site-header .button-stack {
  margin-top: 0;
  align-items: center;
}

.hero-panel .primary-action {
  flex-shrink: 0;
}

/* Detail sections can contain long filenames, email addresses, URLs, and paths */
.detail-section,
.detail-list,
.small-muted,
.event-card,
.record-card,
.media-card,
.announcement-card,
.officer-record-card {
  overflow-wrap: anywhere;
}

/* Group admin record cards */
.record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
  margin-top: 12px;
}

.record-card h3 {
  margin: 4px 0 6px;
  font-size: 1.15rem;
}

.record-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.record-card p + p {
  margin-top: 6px;
}

.record-card .button-stack {
  margin-top: 0;
  justify-content: flex-end;
}

/* Admin list controls */
.announcement-list-controls,
.officer-list-controls,
.media-library-controls,
.calendar-controls {
  box-shadow: none;
}

/* Media library polish */
.media-upload-group-panel,
.media-group-assignment-panel {
  background: #fafafa;
}

.media-card .button-stack {
  margin-top: 0;
}

.media-card-archived .media-thumbnail-wrap {
  filter: grayscale(0.35);
}

.media-filter-summary,
#mediaFilterSummary {
  margin-bottom: 14px !important;
}

/* Officer image record polish */
.officer-record-card.muted {
  opacity: 0.72;
}

.officer-record-card .button-stack {
  margin-top: 12px;
}

/* Calendar/public action buttons */
.calendar-event-action .small-button {
  text-decoration: none;
}

/* Display fallback text */
.display-event-card.muted {
  opacity: 1;
}

/* Slideshow back link should stay visible but not dominate the image */
.slideshow-back-link {
  opacity: 0.72;
  transition: opacity 0.18s ease, background 0.18s ease;
}

.slideshow-back-link:hover,
.slideshow-back-link:focus {
  opacity: 1;
}

.slideshow-manual-controls {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  gap: 10px;
  opacity: 0.72;
  transition: opacity 0.18s ease;
}

.slideshow-manual-controls:hover,
.slideshow-manual-controls:focus-within {
  opacity: 1;
}

.slideshow-control-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.74);
  color: #f8fafc;
  border: 1px solid rgba(248, 250, 252, 0.28);
  font-weight: 800;
  text-decoration: none;
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.slideshow-control-button:hover,
.slideshow-control-button:focus {
  background: rgba(15, 23, 42, 0.92);
}

.slideshow-control-button:focus-visible {
  outline: 3px solid rgba(250, 204, 21, 0.45);
  outline-offset: 2px;
}

.slideshow-emergency-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  width: min(1200px, calc(100vw - 48px));
  transform: translateX(-50%);
  display: grid;
  gap: 6px;
  padding: 18px 24px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(127, 29, 29, 0.96), rgba(185, 28, 28, 0.92)),
    rgba(15, 23, 42, 0.96);
  color: #fff7ed;
  border: 2px solid rgba(254, 202, 202, 0.88);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  text-align: center;
  backdrop-filter: blur(8px);
}

.slideshow-emergency-banner strong {
  color: #fecaca;
  font-size: clamp(1rem, 1.6vw, 1.45rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.slideshow-emergency-banner span {
  color: #fff7ed;
  font-size: clamp(1.25rem, 2.4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.25;
}

@media (max-width: 700px) {
  .slideshow-emergency-banner {
    bottom: 14px;
    width: calc(100vw - 24px);
    padding: 14px 16px;
    border-radius: 18px;
  }
}

/* Print is not a primary use, but keeps admin pages readable if printed */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .button-stack,
  .primary-action,
  .small-button,
  .slideshow-back-link,
  .slideshow-manual-controls,
  .slideshow-emergency-banner {
    display: none !important;
  }

  .card,
  .hero-panel,
  .current-date {
    box-shadow: none;
  }
}

/* Responsive fixes for admin cards with action columns */
@media (max-width: 760px) {
  .record-card {
    grid-template-columns: 1fr;
  }

  .record-card .button-stack {
    justify-content: flex-start;
  }

  .site-header .button-stack {
    width: 100%;
  }

  .site-header .button-stack .button {
    flex: 1 1 auto;
  }
}

/* Keep display controls usable on touch displays */
@media (pointer: coarse) {
  .button,
  .primary-action,
  .small-button,
  .slideshow-control-button {
    min-height: 44px;
  }
}

.group-slideshow-source-panel {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.group-source-checkbox-grid {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.group-source-checkbox {
  align-items: flex-start;
  font-weight: 600;
}

.group-source-checkbox input {
  margin-top: 3px;
}

.group-source-checkbox small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

@media (min-width: 900px) {
  .group-source-checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   Public home page cleanup
   ========================================================= */

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

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

/* =========================================================
   Public form clarity
   ========================================================= */

.required-marker {
  display: inline;
  color: var(--accent);
  font-weight: 900;
}

.form label .required-marker {
  margin-left: 4px;
}

/* =========================================================
   Public mobile navigation and action polish
   ========================================================= */

@media (max-width: 700px) {
  .page {
    padding: 24px 14px 36px;
  }

  .site-header h1 {
    font-size: clamp(1.85rem, 10vw, 2.6rem);
  }

  .site-header .button-stack,
  .hero-panel .button-stack {
    width: 100%;
  }

  .site-header .button-stack .button,
  .hero-panel .primary-action,
  .hero-panel .button-stack .button {
    width: 100%;
  }

  .button-stack {
    gap: 8px;
  }

  .card {
    padding: 20px;
  }

  .hero-panel {
    padding: 24px;
  }
}

/* Keep required markers on the same line as their label text */
#eventRequestForm label {
  display: block;
  font-weight: 700;
}

#eventRequestForm label input,
#eventRequestForm label textarea,
#eventRequestForm label select {
  margin-top: 6px;
}

#eventRequestForm .checkbox-label {
  display: flex !important;
}

/* =========================================================
   Public request success actions
   ========================================================= */

.request-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 700px) {
  .request-success-actions {
    display: grid;
  }

  .request-success-actions .button {
    width: 100%;
  }
}

/* Keep cancellation request required markers on the same line as their label text */
#cancellationForm label {
  display: block;
  font-weight: 700;
}

#cancellationForm label input,
#cancellationForm label textarea,
#cancellationForm label select {
  margin-top: 6px;
}

/* =========================================================
   Admin dashboard polish
   ========================================================= */

.admin-dashboard-grid .card .button-stack {
  align-items: flex-start;
}

.admin-quick-reference {
  margin-bottom: 20px;
}

.admin-quick-reference .detail-list {
  margin-top: 0;
}

/* Keep one-time event required markers on the same line as their label text */
#eventForm label {
  display: block;
  font-weight: 700;
}

#eventForm label input,
#eventForm label textarea,
#eventForm label select {
  margin-top: 6px;
}

#eventForm .checkbox-label {
  display: flex !important;
}

/* Keep group form required markers on the same line as their label text */
#group-form label {
  display: block;
  font-weight: 700;
}

#group-form label input,
#group-form label textarea,
#group-form label select {
  margin-top: 6px;
}

#group-form .checkbox-label {
  display: flex !important;
}

/* =========================================================
   Groups admin list controls
   ========================================================= */

.group-list-controls {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px 14px;
  align-items: end;
  padding: 14px;
  margin: 16px 0 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.group-list-controls label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  min-width: 0;
}

.group-list-controls input,
.group-list-controls select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

.group-list-controls .button {
  grid-column: 1 / -1;
  width: fit-content;
  justify-self: start;
}

@media (max-width: 700px) {
  .group-list-controls {
    grid-template-columns: 1fr;
  }

  .group-list-controls .button {
    width: 100%;
  }
}

/* Keep media upload required markers on the same line as their label text */
#mediaUploadForm label {
  display: block;
  font-weight: 700;
}

#mediaUploadForm label input,
#mediaUploadForm label textarea,
#mediaUploadForm label select {
  margin-top: 6px;
}

#mediaUploadForm .checkbox-label,
#mediaUploadForm .media-group-checkbox {
  display: flex !important;
}

/* Keep officer image record required markers on the same line as their label text */
#pastOfficerForm label {
  display: block;
  font-weight: 700;
}

#pastOfficerForm label input,
#pastOfficerForm label textarea,
#pastOfficerForm label select {
  margin-top: 6px;
}

/* Keep announcement required markers on the same line as their label text */
#announcement-form label {
  display: block;
  font-weight: 700;
}

#announcement-form label input,
#announcement-form label textarea,
#announcement-form label select {
  margin-top: 6px;
}

#announcement-form .checkbox-label {
  display: flex !important;
}

/* Keep request dashboard required markers on the same line as their label text */
#approvalForm label,
#denialForm label,
#cancellationApprovalForm label,
#cancellationDenialForm label {
  display: block;
  font-weight: 700;
}

#approvalForm label input,
#approvalForm label textarea,
#approvalForm label select,
#denialForm label input,
#denialForm label textarea,
#denialForm label select,
#cancellationApprovalForm label input,
#cancellationApprovalForm label textarea,
#cancellationApprovalForm label select,
#cancellationDenialForm label input,
#cancellationDenialForm label textarea,
#cancellationDenialForm label select {
  margin-top: 6px;
}

#approvalForm .checkbox-label {
  display: flex !important;
}

/* Keep recurring event required markers on the same line as their label text */
#recurringSeriesForm label,
#recurrenceExceptionForm label {
  display: block;
  font-weight: 700;
}

#recurringSeriesForm label input,
#recurringSeriesForm label textarea,
#recurringSeriesForm label select,
#recurrenceExceptionForm label input,
#recurrenceExceptionForm label textarea,
#recurrenceExceptionForm label select {
  margin-top: 6px;
}

#recurringSeriesForm .checkbox-label,
#recurrenceExceptionForm .checkbox-label {
  display: flex !important;
}

/* =========================================================
   Admin form checkbox layout safety
   ========================================================= */

.form .checkbox-label,
.form .media-group-checkbox {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.form .checkbox-label input,
.form .media-group-checkbox input {
  width: auto;
  margin-top: 0 !important;
  flex: 0 0 auto;
}

/* =========================================================
   Admin login page
   ========================================================= */

.admin-login-page {
  max-width: 980px;
}

.admin-login-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
}

@media (max-width: 820px) {
  .admin-login-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Admin authentication controls
   ========================================================= */

.admin-header-actions {
  align-items: center;
}

.admin-header-actions .current-date {
  min-width: 220px;
}

.admin-header-actions #adminLogoutButton {
  border-color: rgba(123, 47, 47, 0.28);
}

@media (max-width: 850px) {
  .admin-header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-header-actions .current-date {
    width: 100%;
    min-width: 0;
  }
}

/* =========================================================
   Admin email log page
   ========================================================= */

.email-log-list {
  display: grid;
  gap: 14px;
}

.email-log-card {
  display: grid;
  gap: 14px;
}

.email-log-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.email-log-body {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.email-log-body summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 800;
}

.email-log-body pre {
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f3f4f6;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.email-log-error {
  color: #7f1d1d !important;
}

@media (max-width: 700px) {
  .email-log-card-header {
    flex-direction: column;
  }
}