:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #121826;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.16);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --font-xs: 0.75rem;
  --font-sm: 0.875rem;
  --font-base: 1rem;
  --font-lg: 1.125rem;
  --font-xl: 1.4rem;
  --font-2xl: 1.8rem;
  --width: 1200px;
  --card: var(--surface);
  --accent: var(--primary);
}

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

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, #f8f7f4 0%, #eef1f6 60%, #e9edf3 100%);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body.modal-open {
  overflow: hidden;
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.3px;
  font-size: var(--font-lg);
}

.brand a {
  color: inherit;
  text-decoration: none;
}

.nav {
  display: flex;
  justify-content: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link,
.nav button {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--font-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
}

.dropdown-toggle::after {
  content: "▾";
  margin-left: 0.35rem;
  font-size: 0.7rem;
}

.dropdown-toggle.hamburger-toggle::after {
  content: "";
  margin-left: 0;
}

.nav-link:hover,
.nav button:hover,
.nav-link.active {
  background: rgba(29, 78, 216, 0.12);
  color: var(--primary);
}

.nav-user {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.nav-email-status {
  font-size: 0.7rem;
}

.nav-active-event {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.nav-email {
  color: var(--muted);
  font-size: var(--font-sm);
}

.nav-version {
  color: var(--muted);
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}

.nav-version-button {
  border: none;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-version-button:hover {
  background: #e2e8f0;
  color: var(--text);
}

.billing-tabs {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.billing-tabs .tab-button {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--font-sm);
}

.billing-tabs .tab-button.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.billing-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.billing-row-approver {
  background: rgba(15, 23, 42, 0.03);
}

.billing-approver-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.12);
  color: #475569;
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge.approver {
  background: rgba(30, 64, 175, 0.12);
  color: #1e3a8a;
}

.approval-authority-row {
  background: rgba(15, 118, 110, 0.03);
}

.approval-toggle .approval-label {
  margin-left: 0.4rem;
}

.billing-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.billing-save-state {
  font-size: 0.75rem;
  color: #64748b;
  min-width: 70px;
}

.billing-notes-input {
  width: 100%;
  min-width: 160px;
  resize: vertical;
}

.billing-notes-cell {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.billing-notes-text {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  max-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fee-tier-wide {
  min-width: 190px;
}

.fee-tier-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.modal-label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}


.billing-save-state.is-saving {
  color: #0f172a;
}

.billing-save-state.is-saved {
  color: #16a34a;
}

.billing-save-state.is-error {
  color: #dc2626;
}

.billing-not_set {
  background: #e5e7eb;
  color: #374151;
}

.billing-ready {
  background: #fef3c7;
  color: #b45309;
}

.billing-sent {
  background: #dbeafe;
  color: #1d4ed8;
}

.billing-paid {
  background: #dcfce7;
  color: #166534;
}


.billing-email_failed {
  background: #fee2e2;
  color: #b91c1c;
}

.alert-list {
  display: grid;
  gap: 0.75rem;
}

.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff7f7;
}

/* Banner shown on Mail Config when outgoing emails are disabled */
.mail-disabled-banner {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #fff1f2; /* pastel red */
  border: 1px solid #fecaca;
  color: #7f1d1d;
  font-weight: 700;
  margin-bottom: 1rem;
}

.dev-controls-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  grid-column: 1 / -1;
}

.dev-controls-bar-header {
  margin-left: auto;
}

.dev-controls-title {
  font-weight: 600;
  color: var(--text);
}

.dev-controls-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dev-email-warning {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 200;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}


.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.billing-form {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stacked-fields {
  display: grid;
  gap: 0.35rem;
  min-width: 140px;
}

.radio-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 600;
}

.radio-field input {
  margin-top: 0.2rem;
}

[data-reset-email-options][aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.activity-filters {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-group {
  display: grid;
  gap: 0.3rem;
  min-width: 140px;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: var(--font-sm);
  cursor: pointer;
}

.chip input {
  margin: 0;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
}

.severity-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.severity-pill.info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.severity-pill.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.severity-pill.high {
  background: rgba(239, 68, 68, 0.18);
  color: #b91c1c;
}

.meta-pre {
  white-space: pre-wrap;
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
  font-weight: 600;
}

.hamburger-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}

.hamburger-icon span {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 20;
}

.dev-controls-menu {
  right: 0;
  left: auto;
  min-width: 260px;
}

.dev-controls-form {
  display: grid;
  gap: 0.75rem;
}

.dev-controls-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.dropdown.open .dropdown-menu {
  display: grid;
  gap: 0.25rem;
}

.dropdown-menu.grouped {
  min-width: 240px;
  max-height: 70vh;
  overflow-y: auto;
}

.dropdown-section {
  display: grid;
  gap: 0.25rem;
  padding: 0.35rem 0;
}

.dropdown-section + .dropdown-section {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.dropdown-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 0.25rem 0.65rem 0.15rem;
}

.dropdown-section-label.active {
  color: var(--primary);
}

.dropdown-menu a {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: var(--font-sm);
}

.dropdown-menu a:hover,
.dropdown-menu a.active {
  background: rgba(29, 78, 216, 0.1);
  color: var(--primary);
}

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: auto auto;
  }

  .nav {
    position: absolute;
    top: 68px;
    left: 1rem;
    right: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-md);
    display: none;
  }

  .nav.open {
    display: block;
  }

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

  .nav-link,
  .nav button {
    width: 100%;
    text-align: left;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding-left: 0.5rem;
  }

  .dropdown-menu.grouped {
    max-height: none;
    width: 100%;
  }

  .dropdown-section + .dropdown-section {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .nav-user {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.nav-user {
  display: flex;
  justify-content: flex-end;
}

.nav-email {
  color: var(--muted);
}

.container {
  max-width: var(--width);
  margin: 2.5rem auto;
  padding: 0 2rem 3rem;
}

.page-shell {
  max-width: var(--width);
  margin: 0 auto;
  width: 100%;
}

body[data-path="/admin/system/officer-dashboard"] .container {
  max-width: 1600px;
}

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.card-header,
.card-body,
.card-footer {
  padding: 1.75rem;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  background: #fafbff;
}

.card-body {
  background: var(--surface);
}

.card-footer {
  border-top: 1px solid var(--border);
  background: #fafbff;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0;
  font-size: var(--font-2xl);
  line-height: 1.2;
}

.preview-title {
  margin: 0 0 6px;
  font-size: var(--font-2xl);
  font-weight: 600;
  line-height: 1.2;
}

.page-subtitle {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: var(--font-sm);
}

.approver-panel {
  min-width: 220px;
  max-width: 320px;
  text-align: right;
}

.approver-title {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1f2937;
}

.approver-list {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.approver-name-button {
  background: none;
  border: none;
  padding: 0 4pt;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: right;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.approver-name-button:hover,
.approver-name-button:focus-visible {
  text-decoration: underline;
}

.approver-panel .approver-name-button:hover,
.approver-panel .approver-name-button:focus-visible {
  color: #fff;
}

.approver-list li + li {
  margin-top: 0.3rem;
}

.approver-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.section-title {
  margin: 1.5rem 0 0.75rem;
  font-size: var(--font-lg);
}

@media (max-width: 720px) {
  .container {
    padding: 0 1rem 2.5rem;
  }

  .card-header,
  .card-body,
  .card-footer {
    padding: 1.25rem;
  }

  .page-header {
    flex-direction: column;
  }

  .approver-panel {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.85rem 1rem;
  }

  .nav-user {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .page-subtitle {
    font-size: 0.95rem;
  }

  .nav-email {
    font-size: 0.85rem;
  }

  button,
  input,
  select,
  textarea {
    min-height: 44px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-actions,
  .action-row,
  .table-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .page-actions > *,
  .action-row > * {
    width: 100%;
  }

  .table-search {
    width: 100%;
    min-width: 0;
  }

  .form-grid button {
    width: 100%;
  }

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

  .decision-form .decision-row {
    flex-direction: column;
    width: 100%;
  }

  .decision-form .decision-row select,
  .decision-form .decision-row button {
    width: 100%;
  }

  .decision-form input[type="text"] {
    min-width: 0;
  }

  .alert-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal {
    padding: 1rem;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
    padding: 1rem;
  }

  .modal-body {
    max-height: 65vh;
  }
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  margin: 0 0 0.75rem;
}

a {
  color: var(--primary);
}

button,
.btn {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  font-weight: 600;
  font-size: var(--font-sm);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  box-shadow: 0 10px 18px rgba(29, 78, 216, 0.2);
}

button:hover,
.btn:hover {
  background: var(--primary-hover);
}

button:active,
.btn:active {
  transform: translateY(1px);
}

button:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.btn-secondary,
button.secondary {
  background: #e5e7eb;
  color: var(--text);
  box-shadow: none;
}

.btn-secondary:hover,
button.secondary:hover {
  background: #d1d5db;
}

.btn-ghost,
button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.btn-danger,
button.danger {
  background: var(--danger);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(220, 38, 38, 0.2);
}

.btn-danger:hover,
button.danger:hover {
  background: #b91c1c;
}

button.ghost.danger {
  background: #ffffff;
  border-color: var(--danger);
  color: var(--danger);
  box-shadow: none;
}

button.icon-button {
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  font-size: var(--font-sm);
  box-shadow: none;
}

label {
  font-weight: 600;
  display: grid;
  gap: 0.45rem;
  font-size: var(--font-sm);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: var(--font-base);
  background: #f7f8fb;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-with-toggle {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-toggle input {
  padding-right: 3rem;
}

.password-toggle {
  position: absolute;
  right: 0.6rem;
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 600;
  padding: 0.2rem 0.3rem;
  cursor: pointer;
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(29, 78, 216, 0.6);
  outline-offset: 2px;
  border-radius: 6px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(29, 78, 216, 0.6);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
  background: #ffffff;
}

.help-text {
  font-size: var(--font-xs);
  color: var(--muted);
}

.hint-warning {
  font-size: var(--font-xs);
  color: #7f1d1d;
  margin-top: 0.35rem;
  display: inline-block;
}

.helper-hint {
  margin-top: 0.35rem;
}

.field-error {
  border-color: rgba(220, 38, 38, 0.5);
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.field-error-message {
  font-size: var(--font-xs);
  color: var(--danger);
  margin-top: 0.35rem;
}

.modal-alert {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: #fef2f2;
  color: var(--danger);
  margin-bottom: 1rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

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

.inline-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
}

.inline-radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.inline-toggle-label {
  font-weight: 600;
}

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

.flash-list {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  display: none;
}

.flash {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  color: var(--text);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.flash.success {
  background: #ecfdf3;
  color: var(--success);
  border-color: rgba(22, 163, 74, 0.2);
}

.flash.warning {
  background: #fff7ed;
  color: var(--warning);
  border-color: rgba(217, 119, 6, 0.25);
}

.flash.error,
.flash.danger {
  background: #fef2f2;
  color: var(--danger);
  border-color: rgba(220, 38, 38, 0.25);
}

.flash-dismiss {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
}
}


.wizard-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.wizard-steps {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.wizard-steps .step {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: var(--font-sm);
  color: var(--muted);
  background: #ffffff;
}

.wizard-steps .step.active {
  background: rgba(29, 78, 216, 0.1);
  color: var(--primary);
  border-color: rgba(29, 78, 216, 0.4);
}

.wizard-step h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.wizard-feature-toggle-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.75rem;
}

.wizard-feature-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 0.75rem;
  align-items: start;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.wizard-feature-toggle-copy {
  display: grid;
  gap: 0.2rem;
  text-align: left;
}

.wizard-feature-toggle-label {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text);
}

.wizard-feature-toggle-meta {
  font-size: var(--font-xs);
  color: var(--muted);
  line-height: 1.35;
}

.wizard-feature-toggle .toggle-switch {
  margin-top: 0;
  align-self: start;
}

.wizard-feature-toggle .toggle-switch input:disabled + .toggle-slider {
  background: #cbd5e1;
  opacity: 0.85;
}

.wizard-feature-toggle .toggle-switch input:disabled + .toggle-slider::before {
  box-shadow: none;
}

.mapping-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.mapping-controls-heading {
  grid-column: 1 / -1;
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.required-progress {
  font-weight: 600;
  color: var(--accent);
}

.header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chip {
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  cursor: grab;
  color: var(--text);
}

.badge.required {
  background: #fff7ed;
  color: #b45309;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  margin-left: 0.4rem;
}

.required-marker {
  color: #dc2626;
  margin-left: 0;
  display: inline;
  white-space: nowrap;
  vertical-align: baseline;
}

.badge.alert {
  background: #fee2e2;
  color: #b91c1c;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  margin-left: 0.4rem;
}

.badge.helper {
  background: #e0e7ff;
  color: #3730a3;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  margin-left: 0.4rem;
}

.badge.attending {
  background: #dcfce7;
  color: #166534;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  margin-left: 0.4rem;
}

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

.setup-fee-add-card {
  width: 100%;
  margin-top: 1rem;
  border: 1px dashed #c5cfdd;
  background: #f8fbff;
  color: #42526b;
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.setup-fee-add-card:hover {
  border-color: #aab9cf;
  background: #f3f8ff;
}

.setup-fee-add-card-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wizard-step .table td input.setup-fee-edit[data-field="amount"] {
  max-width: 120px;
}

.wizard-step .table td input.setup-fee-edit[data-field="dhq_pay_url"] {
  min-width: 340px;
  width: 100%;
}

.result-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-bottom: 1rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.stats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 1.5rem 0 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  color: var(--muted);
  font-size: var(--font-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 2.1rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

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

.people-pill-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-basis: 100%;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.table-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
  justify-content: flex-end;
}

.table-search {
  min-width: 220px;
  width: min(320px, 100%);
}

.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: var(--font-sm);
}

[data-person-row][data-person-approver="1"] td {
  background: #fff7e6;
}

.helper-roles-title {
  color: var(--muted);
  font-size: var(--font-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.helper-roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.helper-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #f7f7f7;
  font-size: var(--font-sm);
}

.helper-role-pill input {
  margin: 0;
}

.housing-summary-inline {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 280px;
}

.housing-summary-label {
  color: var(--muted);
  font-size: var(--font-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.housing-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  gap: 0.4rem 0.75rem;
}

.housing-summary-item {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  white-space: nowrap;
}

.housing-summary-title {
  color: var(--muted);
  font-size: var(--font-sm);
}

.housing-summary-value {
  font-weight: 700;
  font-size: 1rem;
}

@media (max-width: 980px) {
  .housing-summary-inline {
    order: 3;
    width: 100%;
  }

  .housing-summary-grid {
    grid-template-columns: repeat(2, minmax(80px, 1fr));
  }
}

.short-field select {
  min-width: 90px;
}

.input-group {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.suffix {
  padding: 0.3rem 0.5rem;
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.ghost-button {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: var(--font-sm);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ghost-button:hover {
  background: rgba(29, 78, 216, 0.08);
  border-color: rgba(29, 78, 216, 0.35);
  color: var(--primary);
}

.table td .ghost-button {
  margin-top: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
}

.ghost-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

.toast-stack {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  position: relative;
  background: #1f2937;
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
  pointer-events: auto;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.7);
  transform-origin: left center;
  animation: toast-countdown 8s linear forwards;
}

.toast.is-paused .toast-timer {
  animation-play-state: paused;
}

@keyframes toast-countdown {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.modal-form label {
  font-weight: 600;
}

.rooming-setup .card-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rooming-setup .card-body,
.rooming-setup .card-subsection {
  font-size: 0.9rem;
}

.rooming-scheme-load {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-end;
}

.rooming-scheme-load-form {
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rooming-scheme-load-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.rooming-scheme-load-form select {
  min-width: 280px;
}

.rooming-scheme-empty {
  margin: 0;
  text-align: right;
}

.rooming-tabs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.rooming-tab {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

.rooming-tab.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.rooming-panel {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
}

.rooming-panel.active {
  display: flex;
}

.rooming-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.rooming-setup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.rooming-setup-create {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rooming-setup-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rooming-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.rooming-tools-menu {
  position: relative;
}

.rooming-tools-menu > summary {
  list-style: none;
}

.rooming-tools-menu > summary::-webkit-details-marker {
  display: none;
}

.rooming-tools-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 220px;
  z-index: 12;
  background: #ffffff;
  border: 1px solid #dbe4f2;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
  padding: 0.4rem;
  display: grid;
  gap: 0.35rem;
}

.rooming-tools-dropdown .ghost {
  justify-content: flex-start;
  width: 100%;
}

.rooming-aux-page .card-body {
  padding-top: 0.75rem;
}

.rooming-scheme-card,
.rooming-import-card {
  max-width: 760px;
}

.rooming-switch-row {
  justify-content: space-between;
}

.rooming-list-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rooming-village-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rooming-village-chip.is-dragging {
  opacity: 0.25;
}

.rooming-village-chip,
.rooming-village-chip .rooming-accordion,
.rooming-village-chip .rooming-accordion-summary {
  cursor: pointer;
}

.rooming-village-list [data-village-chip]:not(.is-dragging) {
  opacity: 1 !important;
}

.rooming-village-drop-indicator {
  border-top: 2px dashed #94a3b8;
  margin: 0.1rem 0 0.45rem;
}

.rooming-lodge-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-left: 0.85rem;
}

.rooming-lodge-details {
  display: block;
  width: 100%;
}

.rooming-location-sub.rooming-lodge-details {
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.rooming-lodge-details > summary {
  list-style: none;
}

.rooming-lodge-details > summary::-webkit-details-marker {
  display: none;
}

.rooming-lodge-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
}

.rooming-lodge-body {
  margin-top: 0.55rem;
  width: 100%;
}

.rooming-room-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-left: 0.9rem;
  width: calc(100% - 0.9rem);
  box-sizing: border-box;
  padding: 0.55rem;
  border-radius: 10px;
  background: #f1f5f9;
}

.rooming-room-chip {
  background: #e7edf5;
  width: 100%;
  box-sizing: border-box;
  flex-wrap: nowrap;
}

.rooming-room-chip.is-dragging {
  opacity: 0.25;
}

.rooming-room-list [data-room-chip]:not(.is-dragging) {
  opacity: 1 !important;
}

.rooming-room-drop-indicator {
  border-top: 2px dashed #94a3b8;
  margin: 0.05rem 0 0.35rem;
}

.rooming-add-room-chip {
  border: 2px dashed #cbd5e1;
  background: #fcfdff;
  justify-content: center !important;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.rooming-add-room-chip [data-room-create-open-lodge] {
  margin: 0 auto;
}

.rooming-add-village-card {
  border: 2px dashed #cbd5e1;
  background: #fcfdff;
  cursor: pointer;
}

.rooming-accordion.rooming-add-village-card {
  border: 2px dashed #cbd5e1 !important;
}

.rooming-add-village-card .rooming-accordion-summary {
  justify-content: center;
}

.rooming-add-village-cta {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.rooming-add-village-card .rooming-drag-handle {
  display: none !important;
}

.rooming-add-lodge-chip {
  border: 2px dashed #cbd5e1;
  background: #fcfdff;
  justify-content: center !important;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.rooming-add-lodge-chip [data-lodge-create-open] {
  margin: 0 auto;
}

.rooming-lodge-chip {
  align-items: center;
}

.rooming-lodge-chip.is-dragging {
  opacity: 0.25;
}

.rooming-lodge-list [data-lodge-chip]:not(.is-dragging) {
  opacity: 1 !important;
}

.rooming-lodge-drop-indicator {
  border-top: 2px dashed #94a3b8;
  margin: 0.05rem 0 0.35rem;
}

.rooming-accordion {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  background: #fff;
}

.rooming-accordion-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}

.rooming-village-summary-main {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.45rem;
}

.rooming-village-summary-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

.rooming-lodge-summary-main {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  flex: 1;
}

.rooming-village-note {
  font-size: 0.82rem;
  font-weight: 500;
}

.rooming-drag-handle {
  cursor: grab;
  margin-top: 0.05rem;
}

.rooming-drag-handle:active {
  cursor: grabbing;
}

.rooming-village-summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.rooming-room-capacity {
  white-space: nowrap;
}

.rooming-add-room-chip {
  width: 100%;
  box-sizing: border-box;
}

.rooming-accordion:not([open]) .rooming-village-summary-text {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
}

.rooming-accordion-body {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rooming-inline-row {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
}

.rooming-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rooming-location {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-subsection.compact {
  padding: 0.9rem;
}

.form-grid.compact {
  gap: 0.7rem;
}

.rooming-location-sub.compact {
  padding: 0.4rem 0.6rem;
}

.rooming-location-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.rooming-lodges,
.rooming-room {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rooming-location-sub,
.rooming-room {
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Lodge details must stack summary + body vertically (not side-by-side like generic chips). */
.rooming-location-sub.rooming-lodge-details {
  display: block !important;
  width: 100%;
  box-sizing: border-box;
}

.rooming-location-sub.rooming-lodge-details .rooming-lodge-summary {
  width: 100%;
}

.rooming-location-sub.rooming-lodge-details .rooming-lodge-body {
  display: block;
  width: 100%;
}

.rooming-location-sub.rooming-lodge-details .rooming-room-list {
  width: calc(100% - 1rem);
  margin-left: 1rem;
}

.inline-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.inline-form input {
  min-width: 140px;
}

.rooming-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.rooming-actions .danger {
  color: #b91c1c;
}

.import-summary {
  margin-top: 1rem;
  display: grid;
  gap: 0.35rem;
  color: #1f2937;
}

.import-errors ul {
  margin: 0.3rem 0 0 1rem;
}

.rooming-board-page .card-body {
  padding: 1.5rem;
}

.rooming-board-page {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.rooming-board-page .card-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #fff;
}

.rooming-board-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

body.rooming-fullscreen .site-header {
  display: grid;
}

body.rooming-fullscreen .container {
  max-width: none;
  width: 100vw;
  height: 100vh;
  padding: 0 1.5rem;
}

body.rooming-fullscreen .rooming-board-page {
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
}

body.rooming-fullscreen .rooming-board-page .card-body {
  padding: 1rem;
  height: calc(100vh - 180px);
}

body.rooming-fullscreen .rooming-board-body {
  height: 100%;
}

body.rooming-fullscreen .rooming-board-area {
  max-height: none;
}

body.rooming-sidebar-collapsed .rooming-left-panel {
  display: none;
}

body.rooming-sidebar-collapsed .rooming-board-body {
  grid-template-columns: 1fr 260px;
}

.rooming-board-body {
  display: grid;
  grid-template-columns: 320px 1fr 260px;
  grid-template-rows: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.rooming-left-panel {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: sticky;
  top: 1rem;
  align-self: start;
  max-height: 100%;
  height: 100%;
  min-height: 0;
}

.rooming-left-scroll {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 0.2rem;
}

.rooming-search input {
  width: 100%;
}

.rooming-filters {
  display: grid;
  gap: 0.6rem;
}

.rooming-unassigned-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rooming-unassigned-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 0;
  max-height: min(42vh, 320px);
  overflow: auto;
}

.rooming-unassigned-panel {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rooming-unassigned-panel.is-drop-hover {
  border: 1px dashed #0f172a;
  border-radius: 12px;
  padding: 0.35rem;
  background: rgba(15, 23, 42, 0.05);
}

.rooming-lodging-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rooming-lodging-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rooming-lodging-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.rooming-lodging-title h4 {
  margin: 0;
  font-size: 0.95rem;
}

.rooming-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  font-size: 0.75rem;
  color: #64748b;
  background: #f8fafc;
}

.rooming-lodging-bins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.rooming-lodging-bin {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 0.5rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 120px;
  position: relative;
}

.rooming-lodging-bin.is-drop-hover {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.15);
  background: rgba(15, 23, 42, 0.06);
}

.rooming-lodging-bin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.rooming-lodging-count {
  background: #e2e8f0;
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.7rem;
  color: #334155;
}

.rooming-lodging-bin-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: auto;
  max-height: 160px;
}

.rooming-lodging-bin .rooming-card {
  padding: 0.4rem 0.5rem;
}

.rooming-lodging-bin .rooming-card-name {
  font-size: 0.85rem;
}

.rooming-lodging-bin .rooming-card-meta {
  font-size: 0.75rem;
}

.rooming-bin-empty {
  font-size: 0.75rem;
}

.rooming-lodging-drop-hint {
  position: absolute;
  bottom: 0.4rem;
  right: 0.4rem;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.rooming-lodging-bin.is-drop-hover .rooming-lodging-drop-hint {
  opacity: 1;
  transform: translateY(0);
}

.rooming-board-area {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.rooming-board-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.rooming-board-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.rooming-view-toggle {
  display: inline-flex;
  gap: 0.4rem;
  background: #f1f5f9;
  padding: 0.25rem;
  border-radius: 999px;
}

.rooming-view-toggle .ghost {
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

.rooming-view-toggle .ghost.is-active {
  background: #1d4ed8;
  color: #fff;
}

.rooming-grid-actions {
  display: inline-flex;
  gap: 0.5rem;
}

.rooming-drop-toggle.is-hidden {
  display: none;
}

.rooming-drop-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.rooming-drop-toggle input[type="checkbox"] {
  appearance: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.rooming-drop-toggle input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.rooming-drop-toggle input[type="checkbox"]:checked {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.rooming-drop-toggle input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.rooming-village-header {
  display: grid;
  gap: 0.35rem;
  cursor: pointer;
}

.rooming-village-title {
  font-weight: 700;
}

.rooming-village-meta {
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
}

.rooming-progress {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.rooming-progress-bar {
  height: 100%;
  background: #1d4ed8;
  border-radius: 999px;
}

.rooming-board {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow: auto;
  min-height: 0;
  padding-bottom: 0.5rem;
  flex: 1;
  height: 100%;
}

.rooming-village {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.rooming-village-header {
  font-weight: 700;
  font-size: 1.05rem;
}

.rooming-village-header.is-drop-target,
.rooming-village-row.is-drop-target {
  outline: 2px solid rgba(15, 23, 42, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.14);
  border-radius: 12px;
}

.rooming-lodges-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rooming-lodge {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.75rem;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
}

.rooming-lodge-header {
  font-weight: 600;
  color: #334155;
  display: grid;
  gap: 0.35rem;
}

.rooming-village-header-top,
.rooming-lodge-header-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.rooming-lodge-title {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.rooming-lodge-stats {
  display: inline-flex;
  gap: 0.6rem;
  align-items: center;
}

.rooming-lodge.is-collapsed .rooming-room-grid {
  display: none;
}

.rooming-lodge-toggle {
  font-size: 0.85rem;
  padding: 0.2rem 0.35rem;
}

.rooming-lodge-meta {
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
}

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

.rooming-room-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

.rooming-room-card.over-capacity {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.rooming-room-card.is-drop-hover {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.22);
}

.rooming-room-card.just-dropped {
  animation: roomingPulse 0.8s ease;
  outline: 2px solid rgba(15, 23, 42, 0.6);
}

@keyframes roomingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.4);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(29, 78, 216, 0);
  }
}

.rooming-room-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
}

.rooming-room-restriction {
  margin-left: 0.4rem;
  font-size: 0.72rem;
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.rooming-room-count {
  font-weight: 600;
  color: #1f2937;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.rooming-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #16a34a;
}

.rooming-status-dot.warn {
  background: #f59e0b;
}

.rooming-status-dot.block {
  background: #dc2626;
}

.rooming-room-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.rooming-chip {
  font-size: 0.7rem;
  background: rgba(15, 23, 42, 0.08);
  color: #1f2937;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rooming-room-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rooming-room-list.compact {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.rooming-card.compact {
  padding: 0.35rem 0.5rem;
  border-radius: 10px;
  font-size: 0.8rem;
  display: grid;
  gap: 0.1rem;
  min-width: 120px;
}

.rooming-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  min-height: 52px;
  height: auto;
  cursor: grab;
  color: var(--text);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.rooming-card.is-selected {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18);
}

body.rooming-dragging .rooming-card.is-selected {
  border-style: solid;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.24);
}

.rooming-drag-count-preview {
  position: fixed;
  top: -1000px;
  left: -1000px;
  min-width: 124px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
  pointer-events: none;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.35);
  z-index: 9999;
}

.rooming-card.is-highlight {
  border-color: rgba(239, 68, 68, 0.9);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35);
  animation: rooming-highlight 1.2s ease-in-out 0s 2;
}

@keyframes rooming-highlight {
  0% {
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  50% {
    border-color: rgba(239, 68, 68, 0.2);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15);
  }
  100% {
    border-color: rgba(239, 68, 68, 0.9);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
}

.rooming-unassigned-list .rooming-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.rooming-unassigned-list .rooming-card-name {
  font-size: 0.9rem;
}

.rooming-unassigned-list .rooming-card-meta {
  font-size: 0.74rem;
}

.rooming-card.warning {
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.1);
}

.rooming-card:active {
  cursor: grabbing;
}

.rooming-card-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: #111111;
  line-height: 1.3;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rooming-card-meta {
  font-size: 0.74rem;
  color: #555555;
  line-height: 1.3;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.85;
}

.rooming-card:hover {
  border-color: #94a3b8;
}

.rooming-card:hover .rooming-card-name {
  color: #0f172a;
}

.rooming-card:hover .rooming-card-meta {
  color: #475569;
}

.rooming-person-card {
  width: min(360px, 90vw);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  scrollbar-width: none;
}

.rooming-person-card.rooming-person-popover {
  position: fixed;
  margin: 0;
}

.rooming-person-card::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.rooming-card.type-delegate {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
}

.rooming-card.type-officer,
.rooming-card.type-approver {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
}

.rooming-card.type-staff {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
}

.rooming-card.type-other {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.35);
}

.rooming-card.is-selected,
.rooming-card.type-delegate.is-selected,
.rooming-card.type-officer.is-selected,
.rooming-card.type-approver.is-selected,
.rooming-card.type-staff.is-selected,
.rooming-card.type-other.is-selected {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.2);
}

.rooming-helper-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rooming-room-empty {
  font-size: 0.78rem;
  color: #94a3b8;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 0.45rem;
  text-align: center;
}

.rooming-list-panel {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  min-height: 0;
}

.rooming-cabin-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow: auto;
  max-height: 100%;
  padding-right: 0.2rem;
}

.rooming-village-row {
  font-weight: 700;
  color: #1f2937;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid #e2e8f0;
  display: grid;
  gap: 0.2rem;
  cursor: pointer;
}

.rooming-village-row-top,
.rooming-cabin-row-top,
.rooming-panel-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.rooming-village-row-meta {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
}

.rooming-cabin-row {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.5rem 0.6rem;
  display: grid;
  gap: 0.35rem;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rooming-cabin-row.is-active {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}

.rooming-cabin-row.is-drop-target {
  border-color: #0f172a;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.25);
}

.rooming-cabin-row-meta {
  font-size: 0.8rem;
  color: #64748b;
  white-space: nowrap;
}

.rooming-room-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1rem;
  overflow: auto;
  min-height: 0;
}

.rooming-panel-header {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.rooming-panel-title {
  font-weight: 700;
  font-size: 1rem;
}

.rooming-inline-note {
  margin-left: 0.45rem;
  font-size: 0.85em;
  font-weight: 500;
}

.rooming-panel-meta {
  font-size: 0.85rem;
  color: #64748b;
  white-space: nowrap;
}

.toast-action {
  margin-left: 0.8rem;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  font-size: 0.75rem;
}

.rooming-person-meta {
  display: grid;
  gap: 0.4rem;
  color: #1f2937;
}

.rooming-inspector {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 1rem;
  background: #fff;
  position: sticky;
  top: 1.5rem;
}

.rooming-inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.rooming-inspector-body {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 0.8rem;
  max-height: calc(100vh - 12rem);
  overflow: auto;
  scrollbar-width: none;
}

.rooming-inspector-body::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.rooming-inspector-meta {
  display: grid;
  gap: 0.4rem;
  color: #1f2937;
}

.rooming-inspector-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rooming-inspector-list {
  display: grid;
  gap: 0.5rem;
}

.rooming-inspector-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  background: #f8fafc;
  border-radius: 10px;
}

.rooming-mismatch-list {
  margin: 0 0 0.75rem 1.25rem;
  color: #111827;
}

@media (max-width: 1200px) {
  .rooming-board-body {
    grid-template-columns: 1fr;
  }

  .rooming-inspector {
    position: static;
  }

  .rooming-left-panel {
    position: static;
  }

  .rooming-board-area {
    max-height: none;
  }

  body.rooming-sidebar-collapsed .rooming-left-panel {
    display: none;
  }

  body.rooming-sidebar-collapsed .rooming-board-body {
    grid-template-columns: 1fr;
  }

  .rooming-setup-grid,
  .rooming-rooms-grid {
    grid-template-columns: 1fr;
  }

  .rooming-rooms-form {
    position: static;
  }

  .rooming-scheme-load {
    align-items: stretch;
  }

  .rooming-scheme-load-form {
    justify-content: flex-start;
  }

  .rooming-scheme-load-form select {
    min-width: 0;
    width: 100%;
  }

  .rooming-scheme-empty {
    text-align: left;
  }
}

.copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  align-items: start;
}

.copy-row textarea,
.copy-row input {
  width: 100%;
}

.email-list {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}

.email-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.email-card-header {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

#email-fallback-modal.has-multiple #email-fallback-single {
  display: none;
}

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

.reminder-actions button {
  padding: 0.35rem 0.7rem;
  font-size: 0.85rem;
}

.reminder-actions button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.health-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.health-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.card-subsection {
  margin-top: 1.5rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0;
  table-layout: auto;
}

.table.resizable-sortable {
  table-layout: fixed !important;
}

.table.resizable-sortable th,
.table.resizable-sortable td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: auto;
}

.table.resizable-sortable th {
  position: relative;
}

.table.resizable-sortable th.sortable {
  cursor: pointer;
}

.sort-indicator {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 6px;
  cursor: col-resize;
  user-select: none;
  z-index: 2;
}

.col-resizer::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 20%;
  width: 2px;
  height: 60%;
  background: #d3c8bb;
  opacity: 0.6;
}

.table.resizable-sortable th:hover .col-resizer::after {
  opacity: 1;
}

.table.resizable-sortable[data-disable-resize="1"] {
  table-layout: auto !important;
}

.table input,
.table select {
  padding: 0.4rem 0.6rem;
  font-size: var(--font-sm);
}

.table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-weight: 600;
}

.table th,
.table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  font-size: var(--font-sm);
}

.table tbody tr:nth-child(even) {
  background: #fbfcff;
}

.table tbody tr:hover {
  background: rgba(29, 78, 216, 0.04);
}

.table-block {
  display: grid;
  gap: 0.75rem;
}

.table .num {
  text-align: right;
}

.table .table-empty td {
  text-align: center;
  padding: 1.5rem;
}

@media (max-width: 768px) {
  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: var(--surface);
  }

  .table tbody tr:last-child {
    margin-bottom: 0;
  }

  .table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: none;
    gap: 1rem;
  }

  .table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    flex: 0 0 42%;
  }

  .table tbody tr:nth-child(even) {
    background: var(--surface);
  }

  .table tbody tr:hover {
    background: rgba(29, 78, 216, 0.03);
  }

  .table .table-empty td {
    text-align: left;
  }

  .table .table-empty td::before {
    content: "";
  }

  .table input,
  .table select {
    width: 100%;
  }

  .status-cell {
    display: none;
  }

  .table.officer-dashboard-table tbody tr {
    border-left: 4px solid transparent;
  }

  .table.officer-dashboard-table tbody tr.row-pending {
    border-left-color: #f59e0b;
  }

  .table.officer-dashboard-table tbody tr.row-approved {
    border-left-color: #16a34a;
  }

  .table.officer-dashboard-table tbody tr.row-denied {
    border-left-color: #dc2626;
  }

  .decision-tooltip {
    display: none;
  }

  .decision-cell {
    align-items: flex-start;
  }
}

.table.registrants-table {
  table-layout: auto;
}

.table.registrants-table th,
.table.registrants-table td {
  width: auto;
}

.table.registrants-table th:nth-child(1),
.table.registrants-table td:nth-child(1) {
  width: 18%;
}

.table.registrants-table th:nth-child(2),
.table.registrants-table td:nth-child(2) {
  width: 22%;
}

.table.registrants-table th:nth-child(3),
.table.registrants-table td:nth-child(3) {
  width: 12%;
}

.table.registrants-table th:nth-child(4),
.table.registrants-table td:nth-child(4) {
  width: 16%;
}

.table.registrants-table th:nth-child(5),
.table.registrants-table td:nth-child(5) {
  width: 10%;
}

.table.registrants-table th:nth-child(6),
.table.registrants-table td:nth-child(6) {
  width: 14%;
}

.table.registrants-table th:nth-child(7),
.table.registrants-table td:nth-child(7) {
  width: 8%;
}

.table.officer-dashboard-table {
  table-layout: auto;
}

.table.officer-dashboard-table tbody tr:nth-child(even) {
  background: transparent;
}

.table.officer-dashboard-table th:nth-child(1),
.table.officer-dashboard-table td:nth-child(1) {
  width: 2%;
}

.table.officer-dashboard-table th:nth-child(2),
.table.officer-dashboard-table td:nth-child(2) {
  width: 20%;
}

.table.officer-dashboard-table th:nth-child(3),
.table.officer-dashboard-table td:nth-child(3) {
  width: 26%;
}

.table.officer-dashboard-table th:nth-child(4),
.table.officer-dashboard-table td:nth-child(4) {
  width: 14%;
}

.table.officer-dashboard-table th:nth-child(5),
.table.officer-dashboard-table td:nth-child(5) {
  width: 8%;
  white-space: nowrap;
}

.table.officer-dashboard-table th:nth-child(6),
.table.officer-dashboard-table td:nth-child(6) {
  width: 30%;
  min-width: 360px;
  white-space: normal;
}

.table.officer-dashboard-table td:nth-child(6) .inline-form {
  flex-wrap: wrap;
}

.table.email-logs-table {
  table-layout: auto;
}

.table.email-logs-table th,
.table.email-logs-table td {
  width: auto;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #eef2ff;
  color: #3730a3;
}

.status-pill.sent {
  background: #ecfdf3;
  color: var(--success);
}

.status-pill.failed {
  background: #fef2f2;
  color: var(--danger);
}

.table.corps-summary-table {
  table-layout: auto;
}

.table.corps-summary-table th,
.table.corps-summary-table td {
  width: auto;
}

.table.corps-summary-table th:nth-child(1),
.table.corps-summary-table td:nth-child(1) {
  width: 28%;
}

.table.corps-summary-table th:nth-child(2),
.table.corps-summary-table td:nth-child(2) {
  width: 24%;
}

.table.corps-summary-table th:nth-child(3),
.table.corps-summary-table td:nth-child(3) {
  width: 16%;
}

.table.corps-summary-table th:nth-child(4),
.table.corps-summary-table td:nth-child(4) {
  width: 16%;
}

.table.corps-summary-table th:nth-child(5),
.table.corps-summary-table td:nth-child(5) {
  width: 16%;
}

.table.corps-summary-table.roster-mode th:nth-child(1),
.table.corps-summary-table.roster-mode td:nth-child(1) {
  width: 40%;
}

.table.corps-summary-table.roster-mode th:nth-child(2),
.table.corps-summary-table.roster-mode td:nth-child(2) {
  width: 40%;
}

.table.corps-summary-table.roster-mode th:nth-child(3),
.table.corps-summary-table.roster-mode td:nth-child(3) {
  width: 20%;
}

.log-meta {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.log-body-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.log-body {
  display: grid;
  gap: 0.75rem;
}

.log-body-html {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  max-height: 320px;
  overflow: auto;
}

.log-body-text {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
}

.log-error {
  margin-top: 0.75rem;
  color: var(--danger);
}

/* ===============================
   Responsive / Mobile Layout
   =============================== */

@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .container {
    padding: 0 1rem;
  }

  .card {
    padding: 1rem;
  }

  .site-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .nav {
    flex: 1 1 100%;
    order: 3;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .nav-user {
    flex: 1 1 100%;
    order: 2;
    justify-content: flex-start;
    gap: 0.5rem;
    min-width: 0;
  }

  .nav-email {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dropdown-menu {
    max-width: 90vw;
  }

  .status-filters,
  .billing-tabs {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .status-pill,
  .tab-button {
    padding: 0.45rem 0.9rem;
  }

  .table-wrap {
    overflow-x: visible;
  }

  .table thead {
    display: none;
  }

  .table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: #ffffff;
  }

  .table tbody tr.table-empty {
    border: none;
    padding: 0;
    background: transparent;
  }

  .table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border: none;
    white-space: normal;
  }

  .table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    flex: 0 0 45%;
  }

  .table tbody td.actions-cell::before,
  .table tbody td[data-label="Actions"]::before {
    content: "Actions";
  }

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

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

  .settings-actions,
  .corps-actions,
  .action-row,
  .template-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form button,
  .form-grid button,
  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  .page-actions .ghost-button {
    width: 100%;
  }

  .modal-card {
    width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
  }
}

@media (max-width: 420px) {
  .nav-email {
    max-width: 110px;
  }

  .card {
    padding: 0.85rem;
  }
}

.status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.status-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  background: #ffffff;
  color: var(--text);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

.status-pill.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.status-pill.reset {
  background: #14532d;
  color: #ffffff;
  border-color: #14532d;
}

.status-pill.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status-col {
  width: 12px;
}

.table tr.selected td {
  background: #eef2ff;
}

.status-cell {
  padding: 0;
  position: relative;
}

.decision-cell {
  position: relative;
}

.decision-toast {
  position: absolute;
  top: -0.65rem;
  right: 0.75rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.dashboard-content {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-section {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px 16px;
}

.dashboard-note {
  border-left: 4px solid #f59e0b;
  background: #fff7ed;
}

.dashboard-footer {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.95rem;
}

.dashlet-builder {
  display: grid;
  gap: 24px;
}

.builder-wrap {
  max-width: 1560px;
  margin: 0 auto;
}

.builder-layout {
  display: grid;
  grid-template-columns: 260px minmax(640px, 1fr) 340px;
  gap: 16px;
  align-items: start;
  min-height: calc(100vh - 240px);
}

.builder-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.builder-toolbar-group {
  display: flex;
  gap: 8px;
}

.builder-suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 8px 12px;
  border-radius: 12px;
}

.builder-suggestion-actions {
  display: flex;
  gap: 8px;
}

.builder-toolbar .ghost.is-active {
  background: #e0e7ff;
  border-color: #6366f1;
}

.builder-canvas {
  display: grid;
  gap: 14px;
  height: calc(100vh - 240px);
  overflow: auto;
  padding-right: 6px;
  align-content: start;
  align-items: start;
}

.builder-preview-frame {
  display: none;
  align-self: start;
}

.preview-iframe {
  width: 100%;
  min-height: calc(100vh - 240px);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
}

.builder-library {
  position: sticky;
  top: 88px;
  align-self: start;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  height: calc(100vh - 240px);
  overflow: auto;
}

.builder-library-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.dashlet-palette-item {
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 500;
  display: grid;
  gap: 4px;
}

.dashlet-palette-item:hover,
.dashlet-palette-item:focus {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.builder-sidebar {
  position: sticky;
  top: 88px;
  align-self: start;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px;
  background: #ffffff;
  height: calc(100vh - 240px);
  overflow: auto;
}

.sidebar-empty {
  display: grid;
  gap: 8px;
}

.sidebar-panel {
  display: grid;
  gap: 16px;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sidebar-title {
  font-weight: 600;
  font-size: 1.05rem;
}

.sidebar-dirty {
  font-size: 0.75rem;
  background: #fde68a;
  color: #92400e;
  padding: 2px 8px;
  border-radius: 999px;
  align-self: center;
}

.sidebar-actions {
  display: flex;
  gap: 8px;
}

.sidebar-actions button.is-disabled,
.sidebar-actions button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

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

.sidebar-section summary {
  font-weight: 600;
  cursor: pointer;
}

.sidebar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.toggle-field {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.toggle-field.toggle-right {
  justify-content: space-between;
}

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-flex;
  align-items: center;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background 0.15s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: #4f46e5;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.sidebar-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sidebar-field {
  display: grid;
  gap: 6px;
}

.sidebar-history {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-row {
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.dashlet-zone {
  border: 1px dashed #cbd5f5;
  border-radius: 16px;
  padding: 34px 12px 12px;
  background: #f8fafc;
  position: relative;
  min-height: 0;
}

.dashlet-zone .zone-header {
  position: absolute;
  inset: 8px 12px auto 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
}

.drop-hint {
  display: none;
  font-size: 0.7rem;
  color: #64748b;
}

.dashlet-zone .zone-header h2 {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  background: #eef2ff;
  padding: 2px 8px;
  border-radius: 999px;
  margin: 0;
}

.is-dragging .drop-hint,
.dashlet-zone.is-empty .drop-hint {
  display: inline;
}

.is-dragging .dashlet-zone {
  min-height: 140px;
}

.dashlet-grid,
.dashboard-zone-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  min-height: 0;
}

.dashlet-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  position: relative;
}

.dashlet-card-child {
  background: #f8fafc;
  box-shadow: none;
}

.dashlet-card.dragging {
  opacity: 0.5;
}

.dashlet-card.is-selected {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.dashlet-sticky {
  position: sticky;
  top: var(--sticky-offset, 0px);
  z-index: 5;
}

.dashlet-placeholder {
  border: 2px dashed #94a3b8;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.12);
  min-height: 60px;
  transition: transform 140ms ease-out, opacity 140ms ease-out;
  opacity: 0.9;
  transform: scale(0.98);
}

.dashlet-placeholder.is-magnet {
  border-color: #6366f1;
  transform: scale(1);
  opacity: 1;
}

.dashlet-snap-guide {
  position: absolute;
  top: 8px;
  right: 12px;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 999px;
  pointer-events: none;
}

.dashlet-snap-guide.is-magnet {
  background: #4338ca;
}

.is-preview .drop-hint,
.is-preview .dashlet-snap-guide {
  display: none !important;
}

.is-preview .dashlet-card {
  cursor: default;
}

.is-preview .dashlet-card.is-selected {
  outline: none;
}

.is-preview .builder-library,
.is-preview .builder-sidebar {
  display: none;
}

.is-preview .builder-layout {
  grid-template-columns: 1fr !important;
  min-height: 0;
}

.is-preview .dashlet-card {
  border: none;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.is-preview .dashlet-zone {
  border: none;
  padding: 0;
  background: transparent;
}

.is-preview .zone-header {
  display: none;
}

.is-preview .builder-canvas {
  display: none;
}

.is-preview .builder-preview-frame {
  display: block;
  grid-column: 1 / -1;
}

.is-preview .dashlet-grid {
  min-height: 0;
}

.is-dragging .dashlet-grid {
  min-height: 120px;
}

.is-mobile-preview .builder-preview-frame {
  display: flex;
  justify-content: center;
}

.is-mobile-preview .preview-iframe {
  max-width: 420px;
}

.is-mobile-preview .builder-canvas {
  max-width: 420px;
  margin: 0 auto;
}

.is-mobile-preview .dashlet-grid {
  grid-template-columns: 1fr;
}

.is-mobile-preview .dashlet-grid .dashlet-card {
  grid-column: 1 / -1 !important;
}

.is-mobile-preview .dashlet-grid .dashlet-card {
  order: var(--mobile-order, 0);
}

.dashlet-editable.is-editable {
  outline: 1px dashed rgba(99, 102, 241, 0.4);
  padding: 2px 4px;
  border-radius: 6px;
}

.alert-preview {
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 6px;
}

.alert-red {
  background: #fee2e2;
  color: #991b1b;
}

.alert-amber {
  background: #fef3c7;
  color: #92400e;
}

.alert-blue {
  background: #dbeafe;
  color: #1e3a8a;
}

.list-editor-row,
.downloads-editor-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.downloads-editor-row {
  grid-template-columns: 1fr 1fr auto;
}

.dashlet-align-center {
  text-align: center;
}

.dashlet-align-right {
  text-align: right;
}

.dashlet-hide-mobile {
  display: block;
}

.dashlet-delegate-list .table-block {
  margin-top: 12px;
}

.dashlet-delegate-list {
  text-align: left;
}

.dashlet-section {
  display: grid;
  gap: 12px;
}

.dashlet-section-title {
  font-weight: 600;
}

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

.dashlet-section-stack .dashlet-section-grid {
  grid-template-columns: 1fr;
}

.dashlet-section-centered {
  max-width: 1200px;
  margin: 0 auto;
}

.dashboard-zone {
  margin-bottom: 14px;
}

.dashboard-zone:last-child {
  margin-bottom: 0;
}

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

  .builder-sidebar,
  .builder-library {
    display: none;
  }

  .builder-drawer {
    display: block;
  }
}

@media (max-width: 1100px) {
  .builder-drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(420px, 90vw);
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    padding: 16px;
    z-index: 30;
    overflow: auto;
  }

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

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

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

  .dashboard-zone-grid .dashlet-card {
    grid-column: 1 / -1 !important;
    order: var(--mobile-order, 0);
  }

  .dashlet-section-grid {
    grid-template-columns: 1fr;
  }

  .dashlet-section-grid .dashlet-card {
    order: var(--mobile-order, 0);
  }

  .dashlet-hide-mobile {
    display: none;
  }
}

.dashboard-preview {
  margin-top: 18px;
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
}

.dashboard-preview-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
}

.dashboard-preview .preview-title {
  margin: 0 0 6px;
}

.dashboard-preview .preview-intro {
  color: #475569;
  margin-bottom: 12px;
}

.dashboard-preview-table {
  margin-top: 16px;
}

.builder-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  display: grid;
  place-items: center;
  z-index: 40;
}

.builder-modal .modal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  width: min(420px, 90vw);
  display: grid;
  gap: 12px;
}

.modal-actions {
  display: grid;
  gap: 8px;
}

.decision-submitted td {
  pointer-events: none;
}

.status-bar {
  display: block;
  width: 6px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 6px;
}

.status-bar--pending {
  background: #f59e0b;
}

.status-bar--approved {
  background: #16a34a;
}

.status-bar--denied {
  background: #dc2626;
}

.row-pending {
  background: rgba(245, 158, 11, 0.08);
}

.row-approved {
  background: rgba(22, 163, 74, 0.08);
}

.row-denied {
  background: rgba(220, 38, 38, 0.08);
}

.row-pending td,
.row-approved td,
.row-denied td {
  border-top-color: rgba(15, 23, 42, 0.08);
}

.mailto-icon {
  margin-left: 0.4rem;
  font-size: 0.9rem;
  color: #6b7280;
  text-decoration: none;
}

.mailto-icon:hover {
  color: #111827;
}

.email-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.decision-form {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.decision-form .decision-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.decision-form .decision-row select,
.decision-form .decision-row button {
  width: 140px;
}

.decision-form input[type="text"] {
  width: 100%;
  min-width: 220px;
}

.decision-cell {
  position: relative;
}

.decision-tooltip {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: #111827;
  color: #ffffff;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}

.table.officer-dashboard-table tbody tr:hover .decision-tooltip {
  opacity: 1;
}

[data-decision-submit][disabled] {
  background: #cbd5f5;
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

[data-decision-submit][disabled]:hover {
  background: #cbd5f5;
}

.error-details {
  margin-top: 0.4rem;
}

.error-details summary {
  cursor: pointer;
  font-size: 0.8rem;
}

.error-details pre {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 0.6rem;
  border-radius: 8px;
  white-space: pre-wrap;
  margin-top: 0.4rem;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover {
  background: #f8fafc;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.inline-form.locked {
  opacity: 0.6;
  pointer-events: none;
}

.form-grid textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f7f8fb;
  resize: vertical;
}
.inline-form.compact {
  max-width: 240px;
}

.inline-form input[type="password"] {
  min-width: 120px;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text);
}

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.toggle-switch span:not(.toggle-slider):not(.toggle-switch-track) {
  position: relative;
  width: 38px;
  height: 20px;
  background: #e2e8f0;
  border-radius: 999px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle-switch span:not(.toggle-slider):not(.toggle-switch-track)::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + span:not(.toggle-slider):not(.toggle-switch-track) {
  background: #2563eb;
}

.toggle-switch input:checked + span:not(.toggle-slider):not(.toggle-switch-track)::after {
  transform: translateX(18px);
}

.inline-form.compact button {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.icon-button.small {
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
}

.rooming-rooms-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.rooming-rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rooming-toggle-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem 0.75rem;
  margin-top: 0.35rem;
}

.rooming-toggle-grid .inline-toggle {
  font-weight: 500;
}

.toggle-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-weight: 600;
}

.toggle-pill .toggle-switch {
  margin-left: auto;
}

.rooming-save-button {
  white-space: nowrap;
}

.rooming-rooms-form {
  position: sticky;
  top: 1rem;
}

.rooming-rooms-table {
  overflow: auto;
  width: 100%;
}

.rooming-add-room-modal-card {
  width: min(760px, 96vw);
  max-height: calc(100vh - 2rem);
  overflow: auto;
}

.compact-table th,
.compact-table td {
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.compact-table .actions-cell {
  flex-direction: row;
  gap: 0.35rem;
  min-width: auto;
}

.compact-table .truncate {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-edit-row td {
  background: #f8fafc;
}

.rooming-import {
  max-width: 720px;
  margin: 0 auto;
}

.corps-delete-form button {
  margin-left: 0;
}

.inline-form.compact input[type="text"] {
  min-width: 160px;
}

.inline-form select {
  min-width: 60px;
}

.corps-count {
  font-size: 0.85rem;
  white-space: nowrap;
}

.actions-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  min-width: 260px;
}

.actions-cell form {
  margin: 0;
}

.actions-cell .inline-form.compact {
  max-width: none;
}

.actions-cell .action-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.actions-cell button {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.actions-cell input[type="password"] {
  min-width: 140px;
}

.actions-cell .danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.match-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.match-pill.unmatched {
  background: #e5e7eb;
  color: #4b5563;
}

.match-pill.linked {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.match-pill.synced {
  background: rgba(22, 163, 74, 0.15);
  color: #166534;
}

.confidence-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.confidence-pill.high {
  background: rgba(22, 163, 74, 0.18);
  color: #166534;
}

.confidence-pill.likely {
  background: rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
}

.confidence-pill.possible {
  background: rgba(249, 115, 22, 0.18);
  color: #c2410c;
}

.confidence-pill.weak,
.confidence-pill.no-match {
  background: #e5e7eb;
  color: #4b5563;
}

.suggested-match {
  min-width: 220px;
}

.suggested-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.suggested-name {
  font-weight: 600;
}

.suggested-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.suggested-reasons summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.suggested-reasons ul {
  margin: 0.35rem 0 0 1rem;
  padding: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.sync-preview-list {
  display: grid;
  gap: 0.5rem;
}

.sync-preview-item {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.sync-preview-item .sync-field {
  font-weight: 600;
}

.sync-preview-item .sync-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.sync-preview-item.update {
  border-color: rgba(22, 163, 74, 0.35);
  background: rgba(22, 163, 74, 0.08);
}

.sync-preview-item.skip {
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(148, 163, 184, 0.12);
}

.match-indicator {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 600;
}


.search-results {
  display: grid;
  gap: 0.5rem;
}

.person-result-row,
.search-result {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  background: #ffffff;
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.person-result-row .person-result-name,
.search-result-name {
  font-weight: 600;
  color: inherit;
}

.person-result-row .person-result-meta,
.search-result-detail {
  font-size: 0.85rem;
  color: rgba(17, 17, 17, 0.65);
}

.person-result-row:hover,
.search-result:hover {
  background: rgba(0, 0, 0, 0.03);
}

.person-result-row:focus-visible,
.search-result:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.person-result-row.is-selected,
.person-result-row[aria-selected="true"],
.search-result.is-selected {
  background: #1d4ed8;
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.person-result-row.is-selected .person-result-meta,
.person-result-row[aria-selected="true"] .person-result-meta,
.search-result.is-selected .search-result-detail {
  color: rgba(255, 255, 255, 0.85);
}

.person-result-row.is-selected:hover,
.person-result-row[aria-selected="true"]:hover,
.search-result.is-selected:hover {
  background: #1e40af;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

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


.split {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 2rem;
}

.email-text {
  font-weight: 600;
  margin-bottom: 0.35rem;
  word-break: break-word;
}

.corps-link {
  display: inline-block;
  word-break: break-word;
  color: var(--primary);
  text-decoration: none;
}

.corps-link:hover {
  text-decoration: underline;
}

.table {
  background: transparent;
}

.list {
  padding-left: 1rem;
}

.corps-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.corps-list li {
  display: block;
}

.corps-form {
  flex: 0 1 auto;
}

.corps-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.corps-main {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  flex-direction: row;
}

.corps-actions {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 50;
}

.modal.open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 5, 0.4);
}

.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  width: min(1000px, 92vw);
  box-shadow: var(--shadow-lg);
  z-index: 1;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-card-sticky {
  padding: 0;
}

.modal-header-sticky,
.modal-footer-sticky {
  position: sticky;
  background: var(--surface);
  z-index: 2;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.modal-footer-sticky {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: none;
  bottom: 0;
}

.modal-header-sticky {
  top: 0;
}

.person-modal-body {
  padding: 1.2rem 1.5rem 1.5rem;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
}

.modal-subtitle {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
}

.person-form-grid {
  display: grid;
  gap: 1.2rem;
}

.person-form {
  display: grid;
  gap: 1rem;
}

.person-form label:not(.toggle-field) {
  display: block;
  font-weight: 600;
  font-size: var(--font-sm);
}

.person-form label:not(.toggle-field) > :is(input, select, textarea, .input-group) {
  margin-top: 0.45rem;
}

.person-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 15px;
}

.person-grid .full {
  grid-column: 1 / -1;
}

.required-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.section-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.section-actions .ghost.small {
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
}

.checkin-summary {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  background: #ffffff;
}

.checkin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem 1rem;
}

.checkin-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.checkin-value {
  font-weight: 600;
  color: var(--text);
}

.checkin-value[data-state="good"] {
  color: #166534;
}

.checkin-value[data-state="warn"] {
  color: #b45309;
}

.checkin-subtext {
  display: block;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.checkin-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.checkin-page .card-body {
  display: grid;
  gap: 1.5rem;
}

.checkin-toolbar {
  position: sticky;
  top: 0;
  background: var(--surface);
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1;
}

.checkin-toolbar-grid {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.checkin-toolbar-main {
  flex: 1 1 360px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}

.checkin-visibility-panel {
  flex: 0 1 280px;
  max-width: 320px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.checkin-visibility-title {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.checkin-pill-visibility {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.checkin-search input {
  width: 100%;
}

.checkin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-visibility-row {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.pill-visibility-row:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.08);
}

.pill-visibility-label {
  flex: 1;
}

.checkin-page .toggle-switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  width: auto;
  height: auto;
  gap: 0;
}

.checkin-page .toggle-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.toggle-switch-track {
  width: 44px;
  height: 22px;
  border-radius: 999px;
  background: var(--border);
  display: inline-flex;
  align-items: center;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-switch-thumb {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  left: 2px;
  top: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.checkin-page .toggle-switch input:checked + .toggle-switch-track {
  background: var(--primary);
}

.checkin-page .toggle-switch input:checked + .toggle-switch-track .toggle-switch-thumb {
  transform: translateX(20px);
}

.checkin-page .toggle-switch input:focus-visible + .toggle-switch-track {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.4);
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  background: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
}

.chip.active {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary);
}

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

.checkin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #ffffff;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.checkin-row:hover,
.checkin-row.is-selected {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

.checkin-row.is-selected {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.45);
  color: var(--text);
}

.checkin-row:hover .checkin-row-meta,
.checkin-row.is-selected .checkin-row-meta {
  color: rgba(255, 255, 255, 0.85);
}

.checkin-row.is-selected .checkin-row-meta {
  color: rgba(15, 23, 42, 0.6);
}

.checkin-row:hover .pill,
.checkin-row.is-selected .pill {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.checkin-row:hover .pill.good,
.checkin-row.is-selected .pill.good,
.checkin-row:hover .pill.warn,
.checkin-row.is-selected .pill.warn,
.checkin-row:hover .pill.info,
.checkin-row.is-selected .pill.info {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.checkin-row.is-selected .pill,
.checkin-row.is-selected .pill.good,
.checkin-row.is-selected .pill.warn,
.checkin-row.is-selected .pill.info {
  background: rgba(59, 130, 246, 0.16);
  color: var(--text);
}

.checkin-row.is-selected {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.25);
}

.checkin-row-main {
  display: grid;
  gap: 0.2rem;
}

.checkin-row-name {
  font-weight: 700;
  font-size: calc(1rem + 3pt);
}

.checkin-row-meta {
  color: rgba(15, 23, 42, 0.55);
  font-size: 0.92rem;
}

.checkin-row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.pill {
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.pill.good {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.pill.warn {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
}

.pill.info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.pill.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #b91c1c;
}

.checkin-empty {
  text-align: center;
  padding: 2rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--muted);
}

.checkin-drawer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.checkin-drawer.open {
  display: flex;
}

.checkin-drawer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 5, 0.35);
}

.checkin-drawer-card {
  position: relative;
  background: #ffffff;
  width: min(720px, 92vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-lg);
}

.checkin-drawer-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.checkin-drawer-body {
  padding: 1.2rem 1.5rem;
  display: grid;
  gap: 1.2rem;
  overflow-y: auto;
  flex: 1 1 auto;
}

.checkin-drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem 1rem;
}

.checkin-billing-link {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--surface);
  display: grid;
  gap: 0.65rem;
}

.checkin-billing-link-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.checkin-billing-link-title {
  margin: 0 0 0.15rem;
  font-size: 1rem;
}

.checkin-billing-tier {
  margin: 0;
  font-size: 0.85rem;
}

.checkin-billing-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.checkin-billing-link-reason {
  margin: 0;
  font-size: 0.85rem;
}

.checkin-billing-no-contact {
  margin: 0;
  font-size: 0.85rem;
}

.checkin-billing-inline {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  padding-top: 0.75rem;
  display: grid;
  gap: 0.6rem;
}

.checkin-billing-channels {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.checkin-billing-channel {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.checkin-billing-channel input {
  margin: 0;
}

.checkin-billing-inline-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.checkin-billing-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.85rem;
}

.checkin-billing-last-sent,
.checkin-billing-recent-note {
  margin: 0;
  font-size: 0.85rem;
}

.checkin-drawer-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.checkin-room {
  display: grid;
  gap: 0.5rem;
}

.checkin-room input {
  width: 100%;
}

.checkin-alert {
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  padding: 0.6rem 0.8rem;
}

@media (max-width: 900px) {
  .checkin-row {
    grid-template-columns: 1fr;
  }
  .checkin-row-badges {
    justify-content: flex-start;
  }
  .checkin-toolbar-grid {
    flex-direction: column;
  }
  .checkin-visibility-panel {
    max-width: none;
  }
}

.modal-section {
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
}

.modal-section-toggle {
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  box-shadow: none;
}

.modal-section-toggle:hover,
.modal-section-toggle:focus-visible {
  background: #1d4ed8;
  color: #ffffff;
}

.modal-section.is-open .modal-section-toggle {
  background: #1d4ed8;
  color: #ffffff;
}

.modal-section-icon {
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted);
  border-radius: 6px;
  position: relative;
  flex: 0 0 auto;
}

.modal-section-icon::before,
.modal-section-icon::after {
  content: "";
  position: absolute;
  background: var(--muted);
  border-radius: 2px;
}

.modal-section-icon::before {
  width: 10px;
  height: 2px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.modal-section-icon::after {
  width: 2px;
  height: 10px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
}

.modal-section-toggle:hover .modal-section-icon,
.modal-section-toggle:focus-visible .modal-section-icon,
.modal-section.is-open .modal-section-icon {
  border-color: #ffffff;
}

.modal-section-toggle:hover .modal-section-icon::before,
.modal-section-toggle:hover .modal-section-icon::after,
.modal-section-toggle:focus-visible .modal-section-icon::before,
.modal-section-toggle:focus-visible .modal-section-icon::after,
.modal-section.is-open .modal-section-icon::before,
.modal-section.is-open .modal-section-icon::after {
  background: #ffffff;
}

.modal-section.is-open .modal-section-icon::after {
  opacity: 0;
}

.modal-section-body {
  padding: 0 1rem 1rem;
  display: none;
}

.modal-section.is-open .modal-section-body {
  display: block;
}

@media (max-width: 720px) {
  .person-grid {
    grid-template-columns: 1fr;
  }
  .modal-header-sticky,
  .modal-footer-sticky,
  .person-modal-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.modal-card.wide {
  width: min(980px, 96vw);
}

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

.modal-body {
  margin-top: 1rem;
  display: grid;
  gap: 1.5rem;
  overflow-y: auto;
}

/* Preview modal phone frame styling: keep the phone bezel inside a surrounding card */
#qc-preview-modal .modal-card {
  width: auto;
  max-width: 460px;
  padding: 1rem; /* space around the phone bezel */
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  border-radius: calc(var(--radius-lg) + 6px);
}

#qc-preview-modal[data-qc-preview-size="tablet"] .modal-card {
  max-width: 860px;
}

#qc-preview-modal[data-qc-preview-size="browser"] .modal-card {
  max-width: 1120px;
}

#qc-preview-modal .modal-body {
  padding: 0.5rem;
  background: transparent;
  overflow: hidden;
  max-height: none;
  display: flex;
  justify-content: center;
}

#qc-preview-modal .modal-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
}

.qc-preview-size-toggle {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

#qc-preview-modal[data-qc-preview-size="phone"] .qc-preview-root {
  width: 360px;
  max-height: calc(90vh - 160px);
}

#qc-preview-modal[data-qc-preview-size="tablet"] .qc-preview-root {
  width: 768px;
  max-height: calc(90vh - 160px);
}

#qc-preview-modal[data-qc-preview-size="browser"] .qc-preview-root {
  width: 1000px;
  max-height: calc(90vh - 160px);
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}

.qc-preview-root {
  margin: 0 auto;
  background: #ffffff;
  border: 12px solid #000000; /* phone bezel */
  border-radius: 28px; /* rounded phone corners */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.qc-preview-root form {
  padding: 18px;
}

/* Toggle switch used across admin forms */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-track {
  width: 44px;
  height: 24px;
  background: #e6eefc;
  border-radius: 999px;
  position: relative;
  transition: background 0.15s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(16,24,40,0.12);
  transition: transform 0.15s ease;
}
.toggle input:checked + .toggle-track {
  background: var(--primary);
}
.toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

/* Pill container for toggles in the qc editor: half width */
.qc-toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15,23,42,0.03);
  border: 1px solid rgba(15,23,42,0.06);
  width: calc(50% - 12px);
}
.qc-toggle-pill .toggle-label {
  font-weight: 600;
  color: var(--text);
}

/* Question campaign options: pill-style options and right-aligned controls */
.qc-preview-root .qc-option,
.qc-public-form .qc-option {
  background: rgba(15,23,42,0.03);
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  margin: 0.45rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 6px 18px rgba(15,23,42,0.03);
}
.qc-preview-root .qc-option-label,
.qc-public-form .qc-option-label {
  color: var(--text);
  font-weight: 600;
  margin-right: 1rem;
  flex: 1 1 auto;
}
.qc-preview-root .qc-option input[type="radio"],
.qc-preview-root .qc-option input[type="checkbox"],
.qc-public-form .qc-option input[type="radio"],
.qc-public-form .qc-option input[type="checkbox"] {
  transform: scale(1.5);
  margin: 0;
  accent-color: var(--primary);
  width: 1.4em;
  height: 1.4em;
}
.qc-preview-root .qc-option input[type="text"],
.qc-public-form .qc-option input[type="text"] {
  max-width: 140px;
}
#qc-preview-modal .qc-preview-root .qc-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.06);
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 6px 18px rgba(15,23,42,0.06);
  cursor: pointer;
  font-weight: 700;
  color: var(--muted);
}
.qc-preview-root h2 {
  margin: 0 0 8px 0;
  padding-top: 6px;
  font-size: var(--font-xl);
}

/* Horizontal padding for title and section text inside the preview phone */
.qc-preview-root h2,
.qc-preview-root h3,
.qc-preview-root p {
  padding-left: 15px;
  padding-right: 15px;
}

.qc-preview-root .qc-section-title,
.qc-preview-root .qc-section-description {
  padding-left: 0;
  padding-right: 0;
}

.qc-public-main {
  margin-top: 0;
  padding-top: 1rem;
}

.qc-public-shell {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 2.5rem;
}

.qc-public-form {
  width: min(640px, 100%);
  background: transparent;
  padding: 0 1rem;
}

.qc-public-header {
  width: 100%;
  height: 140px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  margin-bottom: 1rem;
}

.qc-section-title {
  margin: 1rem 0 0.5rem;
}

.qc-section-box {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: #ffffff;
}

.qc-section-item {
  margin-left: 0;
}

.qc-section-box .qc-section-item {
  margin-left: 0.5rem;
}

.qc-section-description {
  margin: 0.25rem 0 0.75rem;
  color: var(--muted);
}

/* Google Forms-inspired editor layout */
.qc-editor .qc-tabs {
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  margin-bottom: 1.5rem;
}

.qc-editor .qc-tab {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 0 0.9rem;
  font-weight: 600;
  font-family: inherit;
  font-size: inherit;
  line-height: 1;
  margin: 0;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  appearance: none;
  height: 40px;
  border-radius: 999px;
  box-shadow: none;
}

.qc-editor .qc-tab.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.qc-editor .qc-tab:hover {
  background: #f8fafc;
}

.qc-editor .qc-tab.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.6;
}

.qc-editor .qc-tab-panel {
  display: none;
}

.qc-editor .qc-tab-panel.is-active {
  display: block;
}

.qc-editor .qc-tab-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.qc-editor .qc-form-header-card {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.qc-editor .qc-form-header-banner {
  background: linear-gradient(135deg, #e0e7ff, #f8fafc);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

.qc-editor .qc-form-header-banner.is-drop {
  outline: 2px dashed var(--primary);
  outline-offset: -8px;
}

.qc-editor .qc-header-placeholder {
  color: #475569;
  font-weight: 600;
}

.qc-editor .qc-header-image-button {
  position: absolute;
  right: 16px;
  bottom: 12px;
}

.qc-editor .qc-form-header-body {
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.qc-editor .qc-form-label {
  font-weight: 600;
  color: var(--muted);
}

.qc-editor .qc-builder-canvas {
  position: relative;
  padding-left: 3.5rem;
}

.qc-editor .qc-floating-toolbar {
  position: absolute;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: opacity 0.2s ease;
}

.qc-editor .qc-floating-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.qc-editor .qc-floating-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qc-editor .qc-card {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
  margin-bottom: 1rem;
  position: relative;
  padding: 1rem 1.25rem 0.75rem;
}

.qc-editor .qc-card.qc-drop-before::before,
.qc-editor .qc-card.qc-drop-after::after {
  content: '';
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  height: 2px;
  background: var(--primary);
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.08);
}

.qc-editor .qc-card.qc-drop-before::before {
  top: -6px;
}

.qc-editor .qc-card.qc-drop-after::after {
  bottom: -6px;
}

.qc-editor .qc-card.is-section {
  margin-left: -3.5rem;
  width: calc(100% + 3.5rem);
}

.qc-editor .qc-card.is-active {
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
}

.qc-editor .qc-card-handle {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.qc-editor .qc-drag-handle {
  border: none;
  background: none;
  cursor: grab;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border-radius: 999px;
}

.qc-editor .qc-drag-dots {
  display: inline-block;
  width: 18px;
  height: 2px;
  background: #94a3b8;
  border-radius: 999px;
  box-shadow: 0 5px 0 #94a3b8, 0 10px 0 #94a3b8;
}

.qc-editor .qc-card-summary {
  display: none;
  justify-content: space-between;
  font-weight: 600;
  color: var(--muted);
}

.qc-editor .qc-card-body {
  display: grid;
  gap: 0.75rem;
}

.qc-editor .qc-card-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.qc-editor .qc-card-footer button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
}

.qc-editor .qc-card-footer button:hover {
  background: #eef2ff;
}

.qc-editor .qc-card-main,
.qc-editor .qc-card-body,
.qc-editor .qc-card-footer {
  pointer-events: auto;
}

.qc-editor .qc-footer-pill {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
}

.qc-editor .qc-field-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr 220px;
}

.qc-editor .qc-field-row-options {
  grid-template-columns: 1fr;
}

.qc-editor .qc-option-list {
  display: grid;
  gap: 0.5rem;
}

.qc-editor .qc-option-row {
  display: grid;
  grid-template-columns: 22px 1fr 28px;
  align-items: center;
  gap: 0.5rem;
}

.qc-editor .qc-option-icon {
  width: 14px;
  height: 14px;
  border: 2px solid #b0b7c3;
  border-radius: 50%;
  display: inline-block;
}

.qc-editor .qc-option-icon-checkbox {
  border-radius: 4px;
}

.qc-editor .qc-option-add {
  border: none;
  background: none;
  color: var(--primary);
  padding: 0.2rem 0;
  cursor: pointer;
  justify-self: start;
}

.qc-editor .qc-option-remove {
  border: none;
  background: none;
  color: #64748b;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.qc-editor .qc-branch-panel {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
  display: grid;
  gap: 0.5rem;
}

.qc-editor .qc-branch-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 0.75rem;
  align-items: center;
}

.qc-editor .qc-branch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.qc-editor .qc-branch-hint {
  color: #64748b;
  font-size: 0.9rem;
}

.qc-editor .qc-card:not(.is-active) .qc-card-body,
.qc-editor .qc-card:not(.is-active) .qc-card-footer {
  display: none;
}

.qc-editor .qc-card:not(.is-active) .qc-card-summary {
  display: flex;
  margin-top: 0.25rem;
}

.qc-editor .qc-validate-result {
  margin-top: 0.5rem;
  color: #a00;
}

.qc-autosave-status {
  font-size: 0.85rem;
  color: #64748b;
  margin-left: 0.5rem;
}

.qc-card {
  position: relative;
}

.qc-drag-handle {
  cursor: grab;
}

.qc-dragging {
  opacity: 0.6;
}

.qc-drag-over {
  outline: 2px dashed var(--primary);
  outline-offset: 10px;
}

.qc-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.qc-option-label {
  flex: 1 1 auto;
  padding-right: 12px;
}

.qc-option input[type="radio"], .qc-option input[type="checkbox"] {
  flex: 0 0 auto;
  margin: 0;
}

.update-center {
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 1fr);
  align-items: start;
}

.update-summary {
  display: grid;
  gap: 0.85rem;
}

.update-status-text {
  margin: 0;
  font-weight: 600;
}

.update-error {
  margin: 0;
  color: #b91c1c;
}

.update-meta {
  display: grid;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.update-meta div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.update-label {
  font-weight: 600;
  color: #111827;
}

.update-value {
  text-align: right;
  color: var(--muted);
}

.update-notes {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  background: #ffffff;
}

.update-notes h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.update-notes pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.85rem;
  color: #111827;
  max-height: 260px;
  overflow-y: auto;
}

.update-diagnostics {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  background: #f4f6fb;
  font-size: 0.92rem;
}

.update-diagnostics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.update-diagnostics-stderr {
  margin: 0;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: "SFMono-Regular", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  color: var(--danger);
  white-space: pre-wrap;
}

.update-diagnostics-repo {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.update-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

  .update-meta div {
    flex-direction: column;
    align-items: flex-start;
  }

  .update-value {
    text-align: left;
  }
}

.settings-actions {
  display: grid;
  gap: 0.75rem;
}

.settings-actions form {
  margin: 0;
}

.settings-page {
  display: grid;
  gap: 1rem;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.settings-landing {
  display: grid;
  gap: 1.5rem;
}

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

.settings-card {
  display: grid;
  gap: 0.4rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.settings-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(59, 130, 246, 0.4);
}

.settings-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.template-editor {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) 220px;
}

.template-main {
  display: grid;
  gap: 1rem;
}

.template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tab-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.tab-button {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  line-height: 1;
  white-space: nowrap;
}

.tab-button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.template-editor.has-editing .tab-button.active {
  background: #e5e7eb;
  color: var(--text);
  border-color: #cbd5f5;
}

.template-section {
  display: none;
}

.template-section.active {
  display: grid;
  gap: 1rem;
}

.template-preview {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: #fffdf9;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.preview-body {
  line-height: 1.5;
}

.preview-subject {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.preview-attachments {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.template-section .editor-field {
  display: none;
}

.template-section.editing .editor-field {
  display: grid;
}

.template-section.editing [data-edit-toggle] {
  display: none;
}

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

.editor-field {
  display: grid;
  gap: 0.35rem;
}

.editor-field.checkbox-field {
  grid-auto-flow: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.6rem;
}

.attachment-list {
  font-size: 0.9rem;
  color: var(--muted);
}

.attachment-list ul {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
}

.attachment-list li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.attachment-delete-form {
  margin: 0;
}

.template-editor.has-editing .template-sidebar {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.field-label {
  font-weight: 600;
}

.mapping-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.75rem;
}

.mapping-list {
  display: grid;
  gap: 12px;
}

.mapping-header {
  display: grid;
  gap: 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 0 2px;
}

.mapping-row {
  display: grid;
  gap: 12px;
  align-items: center;
}

.mapping-field-group {
  display: grid;
  gap: 6px;
}

.mapping-format-select {
  font-size: 0.85rem;
}

.mapping-header.match-header,
.mapping-row.match-row {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.mapping-header.sync-header,
.mapping-row.sync-row {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(180px, 1fr) minmax(140px, 160px) auto;
}

.mapping-row .mapping-sample {
  font-size: 0.9rem;
  color: #64748b;
}

.mapping-row .mapping-remove {
  white-space: nowrap;
}

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

.template-sidebar {
  background: #fffaf3;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  height: fit-content;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.rich-editor {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
}

.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border);
  background: #f7f2ea;
}

.rich-toolbar button {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

.rich-toolbar button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.rich-toolbar button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rich-body {
  min-height: 160px;
  padding: 0.75rem;
  outline: none;
  font-weight: 400;
  resize: vertical;
  overflow: auto;
  cursor: text;
}

.rich-hidden {
  display: none;
}

.placeholder-list {
  display: grid;
  gap: 0.5rem;
}

.placeholder-chip {
  padding: 0.5rem 0.6rem;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: #ffffff;
  cursor: grab;
  font-size: 0.9rem;
}

.placeholder-chip:active {
  cursor: grabbing;
}

.drop-indicator {
  position: absolute;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
  pointer-events: none;
  opacity: 0.75;
}

.modal-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: flex-end;
}

.table.officers-table {
  table-layout: auto;
}

.table.officers-table th,
.table.officers-table td {
  width: auto;
}

.table.officers-table th:nth-child(1),
.table.officers-table td:nth-child(1) {
  width: 18%;
}

.table.officers-table th:nth-child(2),
.table.officers-table td:nth-child(2) {
  width: 32%;
}

.table.officers-table th:nth-child(3),
.table.officers-table td:nth-child(3) {
  width: 12%;
}

.table.officers-table th:nth-child(4),
.table.officers-table td:nth-child(4) {
  width: 18%;
}

.table.officers-table th:nth-child(5),
.table.officers-table td:nth-child(5) {
  width: 20%;
}

.officers-table td {
  overflow-wrap: anywhere;
}

.icon-button {
  border: 1px solid var(--border);
  background: #fffdf9;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
  width: 34px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #f1f5f9;
}

.icon-button.danger {
  border-color: #f2b2b2;
  color: #b42318;
  background: #fff5f5;
}

.icon-button.danger:hover {
  border-color: #e58b8b;
  color: #9c1a1a;
  background: #ffe4e4;
}

.portal-action-button {
  width: auto;
  min-width: 88px;
  padding: 0 12px;
  white-space: nowrap;
}

.portal-age-input {
  -moz-appearance: textfield;
}

.portal-age-input::-webkit-outer-spin-button,
.portal-age-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.portal-age-cell-input {
  width: 40px;
}

.portal-age-cell {
  display: grid;
  gap: 0.25rem;
  align-items: start;
}

.portal-age-note {
  display: block;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: normal;
}

.portal-age-note[hidden] {
  display: none;
}

.portal-center-prompt {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  padding: 1rem;
}

.portal-center-prompt-card {
  width: min(520px, 100%);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 1rem 1rem 0.9rem;
  display: grid;
  gap: 0.7rem;
}

.portal-center-prompt-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
}

.portal-center-prompt-text {
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
}

.portal-center-prompt-form {
  display: grid;
  gap: 0.7rem;
}

.portal-center-prompt-fields {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-center-prompt-error {
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.3;
}

.portal-center-prompt-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .portal-center-prompt-fields {
    grid-template-columns: 1fr;
  }
}

.portal-roster-table th:nth-child(4),
.portal-roster-table td:nth-child(4) {
  min-width: 76px;
  width: 76px;
}

.portal-gender-select {
  min-width: 64px;
  width: 64px;
}

.portal-shirt-size-select {
  width: 60px;
}

.portal-add-placeholder-row td {
  padding: 0.45rem 0.9rem;
}

.portal-add-placeholder {
  width: 100%;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  min-height: 42px;
  padding: 0.35rem 0.75rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.portal-add-placeholder:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.portal-add-placeholder:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.portal-add-placeholder-cta {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.portal-title-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-help-menu {
  position: relative;
  display: inline-flex;
}

.portal-help-toggle {
  width: 32px;
  min-width: 32px;
  height: 32px;
  border-radius: 10px;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-help-toggle:hover,
.portal-help-toggle[aria-expanded="true"] {
  border-color: #bfdbfe;
}

.portal-help-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(300px, calc(100vw - 2rem));
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
  padding: 0.75rem;
  z-index: 80;
}

.portal-help-tour-btn {
  width: 100%;
  justify-content: center;
}

.portal-help-quicktips-title {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.portal-help-quicktips-list {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.35;
  display: grid;
  gap: 0.3rem;
}

.portal-roster-tour-step {
  font-family: inherit;
}

.portal-roster-tour-step .shepherd-content {
  border-radius: 15px;
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
}

.portal-roster-tour-step .shepherd-header {
  background: #f8fafc;
  padding: 0.8rem 0.95rem 0.35rem;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
}

.portal-roster-tour-step .shepherd-title {
  font-size: 0.98rem;
  color: var(--text);
  font-weight: 700;
}

.portal-roster-tour-step .shepherd-text {
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 0.45rem 0.95rem 0.35rem;
}

.portal-tour-progress {
  margin-bottom: 0.45rem;
}

.portal-tour-progress-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.portal-tour-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.portal-tour-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d4ed8, #2563eb);
  transition: width 0.2s ease;
}

.portal-tour-step-copy {
  margin: 0;
}

.portal-roster-tour-step .shepherd-footer {
  padding: 0.55rem 0.95rem 0.95rem;
  gap: 0.45rem;
}

.portal-roster-tour-step .shepherd-button {
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.42rem 0.75rem;
  margin-right: 0.35rem;
  cursor: pointer;
}

.portal-roster-tour-step .shepherd-button:last-child {
  margin-right: 0;
}

.portal-roster-tour-step .shepherd-button.portal-tour-btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.portal-roster-tour-step .shepherd-button.portal-tour-btn-primary:hover {
  background: #1e40af;
}

.portal-roster-tour-step .shepherd-button.portal-tour-btn-secondary {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border);
}

.portal-roster-tour-step .shepherd-button.portal-tour-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.portal-roster-tour-step .shepherd-cancel-icon {
  color: var(--muted);
  padding: 0.2rem 0.3rem;
}

.portal-roster-tour-step .shepherd-cancel-icon:hover {
  color: var(--text);
}

.preset-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}

.preset-label {
  font-size: 0.9rem;
  color: #0f172a;
}

.preset-title {
  border-color: #c7d2fe;
}

.preset-text {
  border-color: #e2e8f0;
}

.preset-list {
  border-color: #bbf7d0;
}

.preset-downloads {
  border-color: #bae6fd;
}

.preset-alert {
  border-color: #fecaca;
}

.dashlet-card.preset-alert .dashboard-section,
.dashlet-card.preset-alert .preview-text {
  border-left: 4px solid #ef4444;
}

.sms-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr);
  gap: 24px;
}

.sms-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sms-recipient-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sms-recipient-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.sms-token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sms-token {
  font-size: 12px;
}

.sms-recipient-options input[type="radio"],
.sms-recipient-table input[type="checkbox"] {
  width: auto;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.sms-recipient-options input[type="radio"] {
  margin-right: 6px;
}

.sms-meta-row {
  display: flex;
  gap: 16px;
}

.sms-preview {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 16px;
  background: #f8fafc;
}

.sms-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.sms-preview-body {
  min-height: 120px;
  white-space: pre-wrap;
  line-height: 1.4;
}

.sms-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sms-test-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sms-template-actions {
  margin-top: -8px;
}

.sms-confirm-message {
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #f9fafb;
  padding: 12px;
  border-radius: 10px;
  white-space: pre-wrap;
  margin-bottom: 12px;
}

.sms-confirm-list {
  max-height: 180px;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  background: #ffffff;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.sms-confirm-list-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.sms-filter-results {
  margin-top: 12px;
}

.sms-filter-results-meta {
  margin-bottom: 8px;
}

.sms-campaign-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.sms-message-preview {
  margin-top: 12px;
}

.sms-reply-card {
  max-width: 520px;
  margin: 0 auto;
}

.notice.warning {
  background: #fef3c7;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
}

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

  .sms-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
/* Roster spreadsheet */
.roster-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: calc(100vh - 120px);
}

.roster-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.roster-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.roster-toolbar .ghost {
  border: 1px solid #cbd5f5;
  border-radius: 10px;
  padding: 8px 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.roster-toolbar .ghost:hover {
  border-color: #1d4ed8;
  color: #1d4ed8;
}

.roster-search input {
  min-width: 280px;
}

.roster-table-wrap {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  background: #fff;
}

.roster-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.roster-table th,
.roster-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  vertical-align: middle;
}

.roster-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.roster-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.roster-table th.roster-draggable {
  cursor: grab;
}

.roster-table th.roster-draggable.is-dragging {
  opacity: 0.6;
}

.roster-table th.roster-drop-left::before,
.roster-table th.roster-drop-right::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: #1d4ed8;
}

.roster-table th.roster-drop-left::before {
  left: 2px;
}

.roster-table th.roster-drop-right::after {
  right: 2px;
}

.roster-cell {
  position: relative;
  cursor: text;
}

.roster-cell.is-readonly {
  color: #6b7280;
  cursor: default;
}

.roster-cell .cell-display {
  display: block;
  min-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-cell .cell-input {
  display: none;
  width: 100%;
  border: 1px solid #cbd5f5;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
}

.roster-cell.is-editing .cell-display {
  display: none;
}

.roster-cell.is-editing .cell-input {
  display: block;
}

.roster-cell .cell-status {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 12px;
}

.roster-cell.is-saving {
  background: #fff9c4;
}

.roster-cell.is-error {
  background: #fee2e2;
}

.roster-cell.is-saved {
  background: #dcfce7;
}

.roster-footer {
  font-size: 12px;
  color: #6b7280;
}

.roster-modal-card {
  max-width: 760px;
}

.roster-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.roster-modal-section {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.roster-modal-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 10px;
}

.roster-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roster-toggle {
  border: 1px solid #cbd5f5;
  border-radius: 999px;
  background: #fff;
  padding: 6px 12px;
  font-size: 12px;
  color: #111827;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.roster-toggle.is-active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.officer-inline-enabled [data-display] {
  display: none;
}

.inline-edit-control {
  display: none;
  width: 100%;
  min-width: 120px;
}

.officer-inline-enabled .inline-edit-control {
  display: inline-block;
}

.officer-inline-enabled .actions-cell .inline-form {
  display: none;
}

body.officer-inline-fullwidth[data-path="/admin/officers"] .container {
  max-width: none;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory] .card-body {
  padding-left: 1rem;
  padding-right: 1rem;
}

body.officer-inline-fullwidth[data-path="/admin/officers"] .table-wrap {
  overflow-x: auto;
}

body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] {
  min-width: 1460px;
}

body[data-path="/admin/officers"] [data-officer-directory-table] {
  --officer-sticky-col-1-width: 180px;
  --officer-sticky-col-2-width: 180px;
  border-collapse: separate;
  border-spacing: 0;
}

@media (min-width: 981px) {
  body[data-path="/admin/officers"] [data-officer-directory-table] th:nth-child(1),
  body[data-path="/admin/officers"] [data-officer-directory-table] td:nth-child(1) {
    position: sticky;
    left: 0;
    min-width: var(--officer-sticky-col-1-width);
    width: var(--officer-sticky-col-1-width);
    overflow: hidden;
    background-clip: padding-box;
  }

  body[data-path="/admin/officers"] [data-officer-directory-table] th:nth-child(2),
  body[data-path="/admin/officers"] [data-officer-directory-table] td:nth-child(2) {
    position: sticky;
    left: var(--officer-sticky-col-1-width);
    min-width: var(--officer-sticky-col-2-width);
    width: var(--officer-sticky-col-2-width);
    overflow: hidden;
    background-clip: padding-box;
    isolation: isolate;
    z-index: 6;
    border-right: 1px solid #cbd5e1;
    box-shadow: 6px 0 10px -9px rgba(15, 23, 42, 0.55);
  }

  body[data-path="/admin/officers"] [data-officer-directory-table] thead th:nth-child(1),
  body[data-path="/admin/officers"] [data-officer-directory-table] thead th:nth-child(2) {
    z-index: 8;
    background: #f8fafc;
  }

  body[data-path="/admin/officers"] [data-officer-directory-table] tbody td:nth-child(1),
  body[data-path="/admin/officers"] [data-officer-directory-table] tbody td:nth-child(2) {
    z-index: 6;
    background: #ffffff;
  }

  body[data-path="/admin/officers"] [data-officer-directory-table] tbody tr:nth-child(even) td:nth-child(1),
  body[data-path="/admin/officers"] [data-officer-directory-table] tbody tr:nth-child(even) td:nth-child(2) {
    background: #fbfcff;
  }

  body[data-path="/admin/officers"] [data-officer-directory-table] tbody tr:hover td:nth-child(1),
  body[data-path="/admin/officers"] [data-officer-directory-table] tbody tr:hover td:nth-child(2) {
    background: #eef4ff;
  }

}

@media (max-width: 980px) {
  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] th:nth-child(1),
  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] td:nth-child(1) {
    position: sticky;
    left: 0;
    min-width: var(--officer-sticky-col-1-width);
    width: var(--officer-sticky-col-1-width);
    overflow: hidden;
    background-clip: padding-box;
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] th:nth-child(2),
  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] td:nth-child(2) {
    position: sticky;
    left: var(--officer-sticky-col-1-width);
    min-width: var(--officer-sticky-col-2-width);
    width: var(--officer-sticky-col-2-width);
    overflow: hidden;
    background-clip: padding-box;
    isolation: isolate;
    z-index: 6;
    border-right: 1px solid #cbd5e1;
    box-shadow: 6px 0 10px -9px rgba(15, 23, 42, 0.55);
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] thead th:nth-child(1),
  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] thead th:nth-child(2) {
    z-index: 8;
    background: #f8fafc;
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] tbody td:nth-child(1),
  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] tbody td:nth-child(2) {
    z-index: 6;
    background: #ffffff;
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] tbody tr:nth-child(even) td:nth-child(1),
  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] tbody tr:nth-child(even) td:nth-child(2) {
    background: #fbfcff;
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] tbody tr:hover td:nth-child(1),
  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] tbody tr:hover td:nth-child(2) {
    background: #eef4ff;
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] thead {
    display: table-header-group;
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] {
    display: table;
    width: 100%;
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] tbody {
    display: table-row-group;
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] tr {
    display: table-row;
    border: none;
    margin: 0;
    padding: 0;
    background: transparent;
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] th,
  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] td {
    display: table-cell;
    width: auto;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border);
  }

  body.officer-inline-fullwidth[data-path="/admin/officers"] [data-officer-directory-table] td::before {
    content: none;
  }
}
