/* A/E Volleyball Association - Shared Styles */

/* CSS Variables - Public Pages (AE Volleyball Blue/Gold Theme) */
:root {
  --gform-primary: #0a3d8f;
  --gform-primary-dark: #072d6f;
  --gform-gold: #f5b700;
  --gform-gold-dark: #d49b00;
  --gform-bg: #f0f4fb;
  --gform-card-bg: #ffffff;
  --gform-border: #d0dceb;
  --gform-text: #1a1f2e;
  --gform-text-secondary: #4a5568;
  --gform-error: #c5221f;
  --gform-radius: 8px;
  --gform-purple: var(--gform-primary);
  --gform-purple-dark: var(--gform-primary-dark);
}

/* CSS Variables - Admin Pages (Light Teal Theme) */
body.admin-body {
  --gform-primary: #007b83;
  --gform-primary-dark: #00686e;
  --gform-gold: #f5b700;
  --gform-gold-dark: #d49b00;
  --gform-bg: #e8f4f5;
  --gform-card-bg: #ffffff;
  --gform-border: #b2d8da;
  --gform-text: #1a2a2c;
  --gform-text-secondary: #4a5d5f;
  --gform-error: #c62828;
  --gform-radius: 6px;
  --gform-purple: var(--gform-primary);
  --gform-purple-dark: var(--gform-primary-dark);
}

/* Reset / Base */
* { box-sizing: border-box; }

body {
  font-family: 'Open Sans', Arial, sans-serif;
  background: var(--gform-bg);
  margin: 0;
  color: var(--gform-text);
}

/* Admin body uses different theme via CSS variables */
body.admin-body {
  background: var(--gform-bg);
  color: var(--gform-text);
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

/* ---------- Form Page Styles ---------- */

.header-card {
  background: var(--gform-card-bg);
  border-top: 10px solid var(--gform-primary);
  border-radius: var(--gform-radius);
  padding: 24px 24px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.header-card h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.3;
}

.header-card p {
  font-size: 14px;
  color: var(--gform-text-secondary);
  margin: 0;
  line-height: 1.5;
}

.field-card {
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  padding: 22px 24px 26px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
/* Prevent horizontal overflow on mobile summary table */
  .registrations-summary.summary-table .summary-table-wrap {
    overflow: visible;
    width: 100%;
    max-width: 100%;
  }

  

  .registrations-summary.summary-table .summary-table-inner thead {
    display: none;
  }

  .registrations-summary.summary-table .summary-table-inner tbody {
    display: block;
  }

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

@media (min-width: 768px) {
  .page {
    max-width: 800px;
  }
  
  .fieldset.field-card .field-card textarea {
    min-height: 140px;
  }
}

fieldset.field-card {
  padding: 24px;
  border: 1px solid var(--gform-border);
}

fieldset.field-card > legend.field-label {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gform-border);
  color: var(--gform-text);
}

fieldset.field-card .field-card {
  background: var(--gform-bg);
  box-shadow: none;
  border: 1px solid var(--gform-border);
  margin-bottom: 12px;
  padding: 16px 20px;
}

fieldset.field-card .field-row {
  margin-bottom: 12px;
}

fieldset.field-card .field-row .field-card {
  margin-bottom: 0;
}

.field-label {
  font-size: 15px;
  font-weight: 400;
  margin-bottom: 12px;
  display: block;
}

.required-mark { color: var(--gform-error); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 16px;
  padding: 12px 16px;
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  background: var(--gform-card-bg);
  color: var(--gform-text);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  box-sizing: border-box;
  line-height: 1.5;
  resize: vertical;
}

textarea:focus {
  border-color: var(--gform-primary);
  box-shadow: 0 0 0 2px rgba(10, 61, 143, 0.2);
}

select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3e%3cpath d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right center;
  padding-right: 20px;
  min-height: 44px;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  border-bottom: 2px solid var(--gform-primary);
  padding-bottom: 7px;
}

input.invalid {
  border-bottom: 2px solid var(--gform-error);
}

.error-text {
  color: var(--gform-error);
  font-size: 12px;
  margin-top: 6px;
  display: none;
}

.error-text.show { display: block; }

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
  flex-direction: column;
  gap: 12px;
}

button[type="submit"] {
  background: var(--gform-primary);
  color: white;
  border: none;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

button[type="submit"]:hover { background: var(--gform-primary-dark); }
button[type="submit"]:active { box-shadow: 0 1px 4px rgba(10, 61, 143, 0.5); }
button[type="submit"]:disabled { background: #c4c4c4; cursor: default; }

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  cursor: pointer;
  font-size: 15px;
  min-height: 44px;
}

.radio-option input[type="radio"] {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--gform-primary);
  cursor: pointer;
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  background: var(--gform-card-bg);
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  min-height: 44px;
  transition: border-color 0.2s, background 0.2s;
}

.checkbox-option:hover {
  border-color: var(--gform-primary);
}

.checkbox-option input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--gform-primary);
  cursor: pointer;
}

.checkbox-option:has(input:checked) {
  background: var(--gform-bg);
  border-color: var(--gform-primary);
}

#status {
  margin-top: 14px;
  font-size: 14px;
  color: var(--gform-text-secondary);
  text-align: center;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

#payLink {
  display: inline-block;
  margin-top: 12px;
  padding: 12px 28px;
  background: var(--gform-gold);
  color: var(--gform-text);
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  line-height: 20px;
  transition: background 0.15s ease;
}

#payLink:hover {
  background: var(--gform-gold-dark);
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--gform-text-secondary);
  padding: 8px 24px 24px;
}

/* ---------- Events Page Styles ---------- */

.events-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-card {
  display: block;
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid var(--gform-border);
}

.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(60,64,67,0.2), 0 2px 8px rgba(60,64,67,0.15);
  border-color: var(--gform-primary);
}

.event-card:active {
  transform: translateY(0);
}

.event-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-card-content h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--gform-primary);
}

.event-card-content h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--gform-primary);
}

.event-card-content p {
  margin: 0;
  font-size: 14px;
  color: var(--gform-text-secondary);
}

.event-cta {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gform-gold);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.event-cta::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid var(--gform-gold);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}

.event-card:hover .event-cta::after {
  transform: translateX(4px);
}

/* Admin Dashboard Styles */
.admin-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}

.back-link {
  color: var(--gform-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.back-link:hover {
  text-decoration: underline;
}

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.event-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

@media (max-width: 480px) {
  .page { padding: 8px; }
  .header-card, .field-card { padding: 18px 18px 20px; border-radius: 6px; }
  .header-card h1 { font-size: 22px; }
  .events-grid { grid-template-columns: 1fr; }
  .admin-header { flex-direction: column; align-items: flex-start; }
}


.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gform-bg);
  border-top: 2px solid var(--gform-primary);
  border-radius: 50%;
  margin-right: 8px;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}

.spinner.show { display: inline-block; }

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: var(--gform-primary);
  }
}

/* ---------- Admin Page Styles ---------- */

.admin-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.admin-page h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.admin-page .subtitle { color: var(--gform-text-secondary); font-size: 13px; margin: 0 0 20px; }

.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  padding: 14px 18px;
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  min-width: 110px;
}
.stat-card .label { font-size: 12px; color: var(--gform-text-secondary); }
.stat-card .value { font-size: 22px; font-weight: 500; }

.table-wrap {
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  overflow-x: auto;
}
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gform-border);
  white-space: nowrap;
}
th {
  background: var(--gform-bg);
  font-weight: 600;
  position: sticky;
  top: 0;
}
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.badge-paid { background: #e6f4ea; color: #1e7e34; }
.badge-pending { background: #fef7e0; color: #b06000; }
.badge-waitlist { background: #fce8e6; color: #c5221f; }
.badge-other { background: #f1f3f4; color: var(--gform-text-secondary); }

.empty { padding: 24px; color: var(--gform-text-secondary); text-align: center; }

.section-heading {
  margin-top: 36px;
  font-size: 18px;
  font-weight: 500;
}

.config-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
}
.config-inline-form input[type="text"] {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 13px;
  padding: 5px 8px;
  border: 1px solid var(--gform-border);
  border-radius: 4px;
  background: #fff;
}
.config-inline-form input[name="value"] { width: 100%; min-width: 140px; }
.config-inline-form button,
.add-config-form button {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-save { background: var(--gform-primary); color: white; }
.btn-delete { background: #fce8e6; color: #c5221f; }

.add-config-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  padding: 14px 16px;
  margin-top: 12px;
}
.add-config-form input[type="text"] {
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 13px;
  padding: 7px 10px;
  border: 1px solid var(--gform-border);
  border-radius: 4px;
}
.add-config-form input[name="key"] { width: 220px; }
.add-config-form input[name="value"] { flex: 1; min-width: 160px; }

.config-textarea {
  font-family: 'Monospace', monospace;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid var(--gform-border);
  border-radius: 4px;
  background: #fff;
  color: var(--gform-text);
  resize: vertical;
  min-height: 80px;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.5;
}

.config-textarea:focus {
  outline: none;
  border-color: var(--gform-primary);
  box-shadow: 0 0 0 2px rgba(10, 61, 143, 0.2);
}

.config-inline-form {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.config-inline-form .config-textarea {
  flex: 1;
  min-width: 200px;
}

/* Division table specific styles */
.status-col { text-align: center; min-width: 60px; }
.available { text-align: center; font-weight: 500; }
.available.high { color: #1e7e34; }
.available.med { color: #b06000; }
.available.low { color: #c5221f; }
.available.zero { color: #c5221f; font-weight: 700; }

/* Info icon tooltip styles for table headers */
th {
  position: relative;
}
th[data-tooltip] {
  cursor: help;
}
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  vertical-align: middle;
  color: var(--gform-text-secondary);
  flex-shrink: 0;
}
th[data-tooltip]:hover .info-icon {
  color: var(--gform-primary);
}

/* JavaScript tooltip element */
.tooltip {
  position: fixed;
  background: var(--gform-text);
  color: var(--gform-card-bg);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 1000;
  pointer-events: none;
  max-width: 300px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.tooltip::before {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--gform-text);
}
.tooltip.show {
  opacity: 1;
  visibility: visible;
}

/* Sortable table headers */
th[data-col] {
  cursor: pointer;
  user-select: none;
}
th[data-col]:hover {
  background: var(--gform-bg);
}
th[data-col].sort-asc::after,
th[data-col].sort-desc::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 6px;
  vertical-align: middle;
}
th[data-col].sort-asc::after {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid var(--gform-primary);
}
th[data-col].sort-desc::after {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gform-primary);
}

/* Filter row */
tr.filter-row th {
  background: var(--gform-bg);
  padding: 8px 14px;
  border-bottom: 1px solid var(--gform-border);
}
tr.filter-row input.filter-input:focus {
  outline: none;
  border-color: var(--gform-primary);
  box-shadow: 0 0 0 2px rgba(10, 61, 143, 0.2);
}
.event-card {
  /* Base state - slightly muted for enabled cards */
  opacity: 0.95;
}

.event-card:not(.disabled):hover {
  opacity: 1;
}

/* Disabled state - greyed out (public pages only) */
body:not(.admin-body) .event-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: var(--gform-bg);
  border-color: var(--gform-border);
}

body:not(.admin-body) .event-card.disabled:hover {
  transform: none;
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  border-color: var(--gform-border);
  opacity: 0.5;
}

body:not(.admin-body) .event-card.disabled .event-card-content h2,
body:not(.admin-body) .event-card.disabled .event-card-content h3 {
  color: var(--gform-text-secondary);
}

body:not(.admin-body) .event-card.disabled .event-card-content p {
  color: var(--gform-text-secondary);
}

body:not(.admin-body) .event-card.disabled .event-cta {
  display: none;
}

body:not(.admin-body) .event-card:not(.disabled) .event-cta {
  color: var(--gform-gold);
}

/* Admin: disabled events remain clickable but visually distinct */
body.admin-body .event-card.disabled {
  opacity: 0.7;
  background: var(--gform-bg);
  border-color: var(--gform-border);
}

body.admin-body .event-card.disabled:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(60,64,67,0.2), 0 2px 8px rgba(60,64,67,0.15);
  border-color: var(--gform-primary);
  opacity: 0.9;
}

body.admin-body .event-card.disabled .event-card-content h3 {
  color: var(--gform-text-secondary);
}

body.admin-body .event-card.disabled .event-cta {
  color: var(--gform-text-secondary);
}

body.admin-body .event-card:not(.disabled) .event-cta {
  color: var(--gform-primary);
}

.event-disabled {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gform-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  background: var(--gform-bg);
  padding: 6px 12px;
  border-radius: 4px;
}

/* Enabled state - brighter/more prominent */
.event-card:not(.disabled) {
  background: var(--gform-card-bg);
}

.event-card:not(.disabled) .event-card-content h2,
.event-card:not(.disabled) .event-card-content h3 {
  color: var(--gform-primary);
}

.event-card:not(.disabled) .event-cta {
  color: var(--gform-gold);
}

/* Badge for disabled events in admin */
.badge-disabled { background: var(--gform-bg); color: var(--gform-text-secondary); }

/* Admin: disabled badge uses distinct color */
body.admin-body .badge-disabled { background: #fff3e0; color: #e65100; }

/* ==========================================================================
   Admin Dashboard Event Cards - Mobile Enhancements
   ========================================================================== */

@media (max-width: 640px) {
  .admin-page .events-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .admin-page .event-card {
    border: 2px solid var(--gform-border);
    border-radius: var(--gform-radius);
    box-shadow: 0 2px 6px rgba(60,64,67,0.15);
    background: var(--gform-card-bg);
    display: block;
  }
  
  .admin-page .event-card:not(.disabled) {
    border-left: 4px solid var(--gform-primary);
  }
  
  .admin-page .event-card.disabled {
    border-left: 4px solid var(--gform-text-secondary);
    opacity: 0.85;
    background: var(--gform-card-bg);
  }
  
  .admin-page .event-card-content {
    padding: 20px;
  }
  
  .admin-page .event-card-content h3 {
    font-size: 18px;
    margin-bottom: 4px;
  }
  
  .admin-page .event-meta {
    margin: 8px 0;
  }
  
  .admin-page .event-meta .badge {
    font-size: 12px;
    padding: 4px 10px;
  }
  
  .admin-page .section-heading {
    margin-top: 28px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gform-border);
    font-size: 16px;
  }
  
  /* Add section labels for Team vs Individual on mobile */
  .admin-page .section-heading::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
  }
  
  .admin-page h2.section-heading:first-of-type::before {
    background: var(--gform-primary);
  }
  
  .admin-page h2.section-heading:nth-of-type(2)::before {
    background: #673ab7;
  }
}

@media (max-width: 480px) {
  .admin-page .event-card {
    border-width: 2px;
  }
  
  .admin-page .event-card-content {
    padding: 16px;
  }
  
  .admin-page .event-card-content h3 {
    font-size: 17px;
  }
}

/* ==========================================================================
   Mobile Enhancements
   ========================================================================== */

/* Sticky submit row on long forms */
@media (max-width: 640px) {
  .submit-row {
    position: sticky;
    bottom: 0;
    background: var(--gform-bg);
    padding: 16px;
    margin: 0 -24px -24px;
    border-top: 1px solid var(--gform-border);
    border-radius: 0 0 var(--gform-radius) var(--gform-radius);
    z-index: 10;
    box-shadow: 0 -4px 12px rgba(60,64,67,0.1);
  }
  
  .submit-row button[type="submit"] {
    width: 100%;
  }

  /* Event card grid - fluid sizing */
  .events-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  /* Admin table → card layout */
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) {
    overflow: visible;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }
  
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) table {
    display: block;
  }
  
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) thead {
    display: none;
  }
  
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) tbody {
    display: block;
  }
  
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) tr[data-row] {
    display: block;
    background: var(--gform-card-bg);
    border-radius: var(--gform-radius);
    margin-bottom: 16px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    border: 1px solid var(--gform-border);
  }
  
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--gform-border);
    white-space: normal;
    font-size: 14px;
  }
  
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) td:last-child {
    border-bottom: none;
  }
  
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--gform-text-secondary);
    font-size: 13px;
    flex-shrink: 0;
    margin-right: 12px;
  }
  
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) td[data-tooltip]::after {
    content: attr(data-tooltip);
    font-size: 11px;
    color: var(--gform-text-secondary);
    font-weight: 400;
    margin-left: 8px;
    opacity: 0.8;
  }
  
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) td:first-child::before {
    content: "#";
  }
  
  /* Enhanced admin_events page table cards */
  .admin-page .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) tr[data-row] {
    border: 2px solid var(--gform-border);
    box-shadow: 0 2px 6px rgba(60,64,67,0.15);
  }
  
  .admin-page .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) tr[data-row]:not(.archived) {
    border-left: 4px solid var(--gform-primary);
  }
  
  .admin-page .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) tr[data-row].archived {
    border-left: 4px solid var(--gform-text-secondary);
    opacity: 0.85;
  }
  
  .admin-page .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) td {
    padding: 12px 0;
    font-size: 14px;
  }
  
  .admin-page .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) td::before {
    font-size: 12px;
    font-weight: 600;
  }
  
  .admin-page .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) .event-type-badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  .admin-page .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) .badge {
    font-size: 11px;
    padding: 3px 8px;
  }
  
  .admin-page .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) td[data-label="Actions"] {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 2px solid var(--gform-border);
    margin-top: 8px;
  }
  
  .admin-page .table-wrap:not(.division-table-wrap):not(.schema-table-wrap) td[data-label="Actions"]::before {
    display: none;
  }
  
  .admin-page .table-wrap:not(.division-table-wrap):not(.schema-table-wrap) td[data-label="Actions"] .btn-save,
  .admin-page .table-wrap:not(.division-table-wrap):not(.schema-table-wrap) td[data-label="Actions"] .btn-delete {
    font-size: 13px;
    padding: 10px 16px;
    min-height: 44px;
    width: auto;
  }
  
  /* Hide filter row on mobile (use search instead if needed) */
  tr.filter-row {
    display: none;
  }
  
  /* Division table card layout */
  .division-table-wrap tr[data-row] {
    display: block;
    background: var(--gform-card-bg);
    border-radius: var(--gform-radius);
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  }
  
  .division-table-wrap td {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--gform-border);
  }
  
  .division-table-wrap td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--gform-text-secondary);
    font-size: 13px;
  }
  
  .division-table-wrap td[data-tooltip]::after {
    content: attr(data-tooltip);
    font-size: 11px;
    color: var(--gform-text-secondary);
    font-weight: 400;
    margin-left: 8px;
    opacity: 0.8;
  }
  
  .division-table-wrap td:last-child {
    border-bottom: none;
  }
  
  /* Schema table card layout */
  .schema-table-wrap tr {
    display: block;
    background: var(--gform-card-bg);
    border-radius: var(--gform-radius);
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  }
  
  .schema-table-wrap td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--gform-border);
    font-size: 13px;
  }
  
  .schema-table-wrap td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--gform-text-secondary);
    font-size: 12px;
  }
  
  .schema-table-wrap td[data-tooltip]::after {
    content: attr(data-tooltip);
    font-size: 10px;
    color: var(--gform-text-secondary);
    font-weight: 400;
    margin-left: 8px;
    opacity: 0.8.
  }
  
  .schema-table-wrap td:last-child {
    border-bottom: none;
  }

  /* Form field spacing */
  .field-card {
    padding: 18px 20px 20px;
  }
  
  .header-card {
    padding: 20px 20px 16px;
  }
  
  .header-card h1 {
    font-size: 24px;
  }

  /* Improve filter inputs */
  .filter-input {
    font-size: 16px !important;
    min-height: 40px !important;
    padding: 8px 12px !important;
  }

  /* Admin page padding */
  .admin-page {
    padding: 16px;
  }

  /* Stats cards full width on mobile */
  .stats {
    flex-direction: column;
  }
  
  .stat-card {
    min-width: 100%;
  }

  /* Config form stacking */
  .add-config-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .add-config-form input[name="key"] {
    width: 100%;
  }
  
  .config-inline-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .config-inline-form .config-textarea {
    min-width: 100%;
    width: 100%;
  }

  /* Diff cards stacking */
  .field-card > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

/* Prevent iOS zoom on focus for inputs with font-size >= 16px */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
  }
}

/* Touch target improvements for small screens */
@media (max-width: 480px) {
  .radio-option {
    min-height: 48px;
    padding: 12px 8px;
  }
  
  .radio-option input[type="radio"] {
    width: 28px;
    height: 28px;
  }
  
  .event-card-content {
    padding: 20px;
  }
  
  .event-card-content h2,
  .event-card-content h3 {
    font-size: 20px;
  }
  
  .page {
    padding: 12px;
  }
}

/* Landscape phone adjustments */
@media (max-height: 500px) and (orientation: landscape) {
  .submit-row {
    position: static;
    box-shadow: none;
    margin: 0;
    padding: 8px 4px;
    border-radius: 0;
    border-top: none;
  }
  
  .header-card {
    padding: 16px 20px 12px;
  }
  
  .header-card h1 {
    font-size: 22px;
  }
  
  .field-card {
    padding: 16px 18px 18px;
  }
}

/* ==========================================================================
   Admin Layout with Sidebar
   ========================================================================== */

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--gform-card-bg);
  border-right: 1px solid var(--gform-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 2px 0 8px rgba(60,64,67,0.08);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--gform-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gform-primary);
  font-weight: 600;
  font-size: 16px;
}

.sidebar-brand:hover {
  opacity: 0.85;
}

.brand-icon {
  flex-shrink: 0;
}

.brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 8px;
  color: var(--gform-text-secondary);
  cursor: pointer;
  border-radius: var(--gform-radius);
}

.sidebar-toggle:hover {
  background: var(--gform-bg);
  color: var(--gform-text);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

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

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--gform-radius);
  color: var(--gform-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}

.nav-link:hover {
  background: var(--gform-bg);
  color: var(--gform-primary);
}

.nav-link.active {
  background: var(--gform-primary);
  color: white;
  box-shadow: 0 2px 6px rgba(0, 123, 131, 0.3);
}

.nav-link.active:hover {
  background: var(--gform-primary-dark);
  color: white;
}

.nav-link svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.nav-badge {
  margin-left: auto;
  background: var(--gform-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.nav-link.active .nav-badge {
  background: rgba(255,255,255,0.2);
  color: white;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--gform-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gform-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-name {
  font-weight: 500;
  font-size: 13px;
  color: var(--gform-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--gform-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

.admin-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  transition: margin-left 0.25s ease;
}

.admin-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--gform-card-bg);
  border-bottom: 1px solid var(--gform-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.mobile-menu-btn {
  background: none;
  border: none;
  padding: 8px;
  color: var(--gform-text);
  cursor: pointer;
  border-radius: var(--gform-radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn:hover {
  background: var(--gform-bg);
}

.mobile-page-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 16px;
}

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

.admin-content {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-header h1 {
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 4px;
}

.admin-header .subtitle {
  color: var(--gform-text-secondary);
  font-size: 14px;
  margin: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gform-primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  margin-top: 4px;
}

.back-link:hover {
  text-decoration: underline;
}

.messages {
  margin-bottom: 16px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--gform-radius);
  font-size: 14px;
  margin-bottom: 8px;
}

.alert-error {
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #e6f4ea;
  color: #1e7e34;
  border: 1px solid #81c995;
}

.alert-warning {
  background: #fef7e0;
  color: #b06000;
  border: 1px solid #f9c846;
}

.alert-info {
  background: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #8ab4f8;
}

/* Desktop: sidebar always visible */
@media (min-width: 1024px) {
  .admin-sidebar {
    transform: translateX(0);
    transition: width 0.25s ease, padding 0.25s ease;
  }
  
  .admin-sidebar.collapsed {
    width: 72px;
    min-width: 72px;
    padding-left: 8px;
    padding-right: 8px;
  }
  
  .admin-sidebar.collapsed .brand-text,
  .admin-sidebar.collapsed .nav-link span,
  .admin-sidebar.collapsed .nav-badge,
  .admin-sidebar.collapsed .sidebar-footer,
  .admin-sidebar.collapsed .user-info {
    display: none;
  }
  
  .admin-sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 12px 8px;
  }
  
  .admin-sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px 8px;
  }
  
  .admin-sidebar.collapsed .nav-link svg {
    margin: 0;
  }
  
  .admin-sidebar.collapsed .sidebar-toggle {
    display: flex;
    justify-content: center;
    margin: 0 auto;
  }
  
  .admin-main {
    margin-left: 260px;
    transition: margin-left 0.25s ease;
  }
  
  .admin-sidebar.collapsed ~ .admin-main {
    margin-left: 72px;
  }
  
  .admin-mobile-header {
    display: none;
  }
  
  .sidebar-overlay {
    display: none !important;
  }
}

/* Mobile: sidebar slides in */
@media (max-width: 1023px) {
  .admin-sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(60,64,67,0.15);
  }
  
  .admin-sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-toggle {
    display: flex;
  }
  
  .admin-main {
    margin-left: 0;
  }
  
  .admin-mobile-header {
    display: flex;
  }
  
  .admin-content {
    padding: 16px;
  }
  
  .admin-header {
    margin-bottom: 16px;
  }
  
  .admin-header h1 {
    font-size: 22px;
  }
}

@media (max-width: 640px) {
  .sidebar-header {
    padding: 12px;
  }
  
  .sidebar-brand {
    font-size: 15px;
  }
  
  .nav-link {
    padding: 14px 16px;
    font-size: 15px;
  }
  
  .sidebar-footer {
    padding: 12px;
  }
  
  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  
  .mobile-page-title {
    font-size: 15px;
  }
}

/* ==========================================================================
   Dashboard Task Cards
   ========================================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.dashboard-card {
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  border: 1px solid var(--gform-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(60,64,67,0.15), 0 2px 8px rgba(60,64,67,0.1);
  border-color: var(--gform-primary);
}

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

.dashboard-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dashboard-card-icon svg {
  width: 24px;
  height: 24px;
}

.dashboard-card-icon.events { background: #e0f2f1; color: #007b83; }
.dashboard-card-icon.registrations { background: #e8eaf6; color: #3f51b5; }
.dashboard-card-icon.schema { background: #fff3e0; color: #f57c00; }
.dashboard-card-icon.settings { background: #f3e5f5; color: #7b1fa2; }

.dashboard-card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.dashboard-card-subtitle {
  font-size: 13px;
  color: var(--gform-text-secondary);
  margin: 4px 0 0;
}

.dashboard-card-stats {
  display: flex;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gform-border);
}

.dashboard-stat {
  flex: 1;
  text-align: center;
}

.dashboard-stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--gform-text);
  line-height: 1;
}

.dashboard-stat-label {
  font-size: 11px;
  color: var(--gform-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.dashboard-card-action {
  margin-top: 20px;
  text-align: center;
}

.dashboard-card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--gform-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--gform-radius);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s ease;
}

.dashboard-card-link:hover {
  background: var(--gform-primary-dark);
}

.dashboard-card-link.secondary {
  background: transparent;
  color: var(--gform-primary);
  border: 1px solid var(--gform-primary);
}

.dashboard-card-link.secondary:hover {
  background: var(--gform-bg);
}

@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .dashboard-card {
    padding: 20px;
  }
  
  .dashboard-card-stats {
    flex-direction: column;
    gap: 12px;
  }
}

/* ==========================================================================
   Events Page - Tabs & Expandable Rows
   ========================================================================== */

.events-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--gform-border);
  padding-bottom: 4px;
}

.events-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gform-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.events-tab:hover {
  color: var(--gform-primary);
}

.events-tab.active {
  color: var(--gform-primary);
  border-bottom-color: var(--gform-primary);
}

.events-tab-badge {
  background: var(--gform-primary);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
}

.events-tab.active .events-tab-badge {
  background: white;
  color: var(--gform-primary);
}

.events-table-container {
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  border: 1px solid var(--gform-border);
  overflow: hidden;
}

.events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.events-table thead {
  background: var(--gform-bg);
}

.events-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--gform-text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--gform-border);
  white-space: nowrap;
}

.events-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gform-border);
  vertical-align: middle;
}

.events-table tbody tr {
  transition: background 0.1s ease;
}

.events-table tbody tr:hover {
  background: var(--gform-bg);
}

.events-table tbody tr.archived {
  opacity: 0.6;
}

.events-table tbody tr.archived:hover {
  background: var(--gform-bg);
}

.events-table tbody tr.expanded {
  background: var(--gform-bg);
}

.event-row-main {
  cursor: pointer;
}

.event-row-main td:first-child {
  font-weight: 500;
}

.expand-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--gform-text-secondary);
  transition: transform 0.2s ease, background 0.15s ease;
  flex-shrink: 0;
}

.expand-toggle:hover {
  background: var(--gform-border);
  color: var(--gform-primary);
}

.expand-toggle svg {
  width: 18px;
  height: 18px;
}

.expand-toggle.expanded {
  transform: rotate(180deg);
}

.event-expanded-row {
  display: none;
}

.event-expanded-row.show {
  display: table-row;
}

.event-expanded-content {
  padding: 20px 24px;
  background: var(--gform-bg);
  border-top: 1px solid var(--gform-border);
}

.divisions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.division-card {
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  border: 1px solid var(--gform-border);
  padding: 16px;
  transition: border-color 0.15s ease;
}

.division-card:hover {
  border-color: var(--gform-primary);
}

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

.division-card-name {
  font-weight: 600;
  font-size: 14px;
}

.division-card-status {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 10px;
}

.division-card-status.active { background: #e6f4ea; color: #1e7e34; }
.division-card-status.archived { background: #f5f5f5; color: #9e9e9e; }

.division-capacity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.division-capacity-bar {
  flex: 1;
  height: 8px;
  background: var(--gform-border);
  border-radius: 4px;
  overflow: hidden;
}

.division-capacity-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease, background 0.3s ease;
}

.division-capacity-fill.ok { background: #1e7e34; }
.division-capacity-fill.warn { background: #f57c00; }
.division-capacity-fill.full { background: #c5221f; }

.division-capacity-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--gform-text-secondary);
  min-width: 50px;
  text-align: right;
}

.division-capacity-text.full { color: #c5221f; }

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

.event-actions .btn-save,
.event-actions .btn-delete {
  font-size: 12px;
  padding: 8px 12px;
}

@media (max-width: 640px) {
  .events-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin-bottom: 16px;
  }
  
  .events-tab {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .events-table-container {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  .events-table th,
  .events-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .division-card {
    padding: 14px;
  }
  
  .divisions-grid {
    grid-template-columns: 1fr;
  }
  
  .event-actions {
    flex-direction: column;
  }
  
  .event-actions .btn-save,
  .event-actions .btn-delete {
    width: 100%;
    text-align: center;
  }
  
  .expand-toggle {
    width: 36px;
    height: 36px;
  }
}

/* ==========================================================================
   Event Detail Page - Tabs
   ========================================================================== */

.event-detail-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--gform-border);
  padding-bottom: 4px;
  flex-wrap: wrap;
}

.event-detail-tab {
  padding: 12px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gform-text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.event-detail-tab:hover {
  color: var(--gform-primary);
}

.event-detail-tab.active {
  color: var(--gform-primary);
  border-bottom-color: var(--gform-primary);
}

.event-detail-tab-panel {
  display: none;
}

.event-detail-tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.event-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.event-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.event-status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.event-status-badge.enabled { background: #e6f4ea; color: #1e7e34; }
.event-status-badge.disabled { background: #f5f5f5; color: #9e9e9e; }
.event-status-badge.archived { background: #fff3e0; color: #e65100; }

.event-type-badge {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.event-type-badge.team { background: #e8eaf6; color: #3f51b5; }
.event-type-badge.individual { background: #e0f2f1; color: #007b83; }

.event-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  border: 1px solid var(--gform-border);
  text-align: center;
}

.stat-card.primary { border-left: 4px solid var(--gform-primary); }
.stat-card.success { border-left: 4px solid #1e7e34; }
.stat-card.warning { border-left: 4px solid #f57c00; }
.stat-card.danger { border-left: 4px solid #c5221f; }

.stat-card-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-card.primary .stat-card-value { color: var(--gform-primary); }
.stat-card.success .stat-card-value { color: #1e7e34; }
.stat-card.warning .stat-card-value { color: #f57c00; }
.stat-card.danger .stat-card-value { color: #c5221f; }

.stat-card-label {
  font-size: 12px;
  color: var(--gform-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.divisions-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.divisions-summary-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--gform-bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gform-text-secondary);
  border-bottom: 1px solid var(--gform-border);
}

.divisions-summary-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gform-border);
}

.divisions-summary-table tbody tr:hover {
  background: var(--gform-bg);
}

.capacity-bar-cell {
  min-width: 200px;
}

.capacity-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.capacity-bar {
  flex: 1;
  height: 10px;
  background: var(--gform-border);
  border-radius: 5px;
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 0.3s ease, background 0.3s ease;
}

.capacity-fill.ok { background: #1e7e34; }
.capacity-fill.warn { background: #f57c00; }
.capacity-fill.full { background: #c5221f; }

.capacity-text {
  font-size: 13px;
  font-weight: 500;
  min-width: 60px;
  text-align: right;
}

.capacity-text.full { color: #c5221f; }

@media (max-width: 640px) {
  .event-detail-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  
  .event-detail-tab {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .event-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .event-header-actions {
    width: 100%;
  }
  
  .event-header-actions .btn-save,
  .event-header-actions .btn-delete {
    flex: 1;
    text-align: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .divisions-summary-table {
    font-size: 13px;
  }
  
  .divisions-summary-table th,
  .divisions-summary-table td {
    padding: 10px 12px;
  }
  
  .capacity-bar-cell {
    min-width: 150px;
  }
}

/* ==========================================================================
   Registrations Summary - Compact Table
   ========================================================================== */

.registrations-summary.summary-table {
  background: var(--gform-card-bg);
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  padding: 16px;
  margin-bottom: 20px;
}

.registrations-summary.summary-table .summary-header {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.registrations-summary.summary-table .summary-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--gform-text);
}

.registrations-summary.summary-table .summary-subtitle {
  font-size: 12px;
  color: var(--gform-text-secondary);
  margin: 0;
}

/* Toggle switch for Show Disabled Events */
.toggle-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gform-text);
  white-space: nowrap;
}

.toggle-wrapper input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--gform-border);
  border-radius: 12px;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}

.toggle-wrapper input[type="checkbox"]:checked + .toggle-slider {
  background: var(--gform-purple);
}

.toggle-wrapper input[type="checkbox"]:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 12px;
  color: var(--gform-text-secondary);
}

/* Disabled event rows */
.summary-table-inner tbody tr.disabled-event {
  opacity: 0.5;
}

.summary-table-inner tbody tr.disabled-event td {
  background: var(--gform-bg) !important;
}

.summary-table-wrap {
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px;
}

.summary-table-inner {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}

.summary-table-inner thead th {
  text-align: left;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gform-text-secondary);
  border-bottom: 2px solid var(--gform-border);
  background: var(--gform-bg);
  white-space: nowrap;
}

.summary-table-inner tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gform-border);
  vertical-align: middle;
  white-space: nowrap;
}

.summary-table-inner tbody tr:last-child td {
  border-bottom: none;
}

.summary-table-inner tbody tr.full td {
  background: rgba(217, 48, 37, 0.05);
}

.summary-table-inner tbody tr.warn td {
  background: rgba(245, 158, 11, 0.05);
}

.summary-table-inner tbody tr.ok td {
  background: rgba(16, 185, 129, 0.03);
}

.summary-table-inner tbody td:first-child {
  font-weight: 500;
}

.summary-table-inner tbody td:nth-child(2) {
  color: var(--gform-text-secondary);
}

.summary-table-inner tbody td:nth-child(4),
.summary-table-inner tbody td:nth-child(5),
.summary-table-inner tbody td:nth-child(6),
.summary-table-inner tbody td:nth-child(7) {
  font-family: monospace;
  text-align: center;
  width: 70px;
}

.summary-table-inner tbody td.negative {
  color: var(--gform-error);
}

.summary-table-inner tbody td.low {
  color: var(--gform-warning, #f59e0b);
}

.progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.progress-bar-mini {
  flex: 1;
  max-width: 100px;
  height: 6px;
  background: var(--gform-border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-mini .progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s, background 0.15s;
}

.summary-table-inner tbody tr.full .progress-fill {
  background: var(--gform-error);
}

.summary-table-inner tbody tr.warn .progress-fill {
  background: var(--gform-warning, #f59e0b);
}

.summary-table-inner tbody tr.ok .progress-fill {
  background: var(--gform-success, #10b981);
}

.progress-cell span {
  font-size: 11px;
  color: var(--gform-text-secondary);
  font-family: monospace;
}

.text-muted {
  color: var(--gform-text-secondary) !important;
}

.summary-empty {
  text-align: center;
  color: var(--gform-text-secondary);
  padding: 20px;
  margin: 0;
}

/* ==========================================================================
   Registrations List Page
   ========================================================================== */

.registrations-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.table-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.table-actions .btn-save--primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--gform-radius);
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.table-actions .btn-save--primary svg {
  flex-shrink: 0;
}

.registrations-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gform-text-secondary);
  white-space: nowrap;
}

.filter-group select,
.filter-group input {
  padding: 8px 12px;
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  background: var(--gform-card-bg);
  font-size: 13px;
  min-width: 160px;
}

.filter-group input[type="search"] {
  min-width: 200px;
}

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

.registrations-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.registrations-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--gform-bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gform-text-secondary);
  border-bottom: 1px solid var(--gform-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.registrations-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gform-border);
  vertical-align: middle;
}

.registrations-table tbody tr:hover {
  background: var(--gform-bg);
}

.registration-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.registration-status.paid { background: #e6f4ea; color: #1e7e34; }
.registration-status.pending { background: #fef7e0; color: #b06000; }
.registration-status.waitlist { background: #fce8e6; color: #c5221f; }
.registration-status.cancelled { background: #f5f5f5; color: #9e9e9e; }

.name-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.name-info {
  line-height: 1.3;
}

.name-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.registration-actions {
  display: flex;
  gap: 6px;
}

.registration-actions .btn-save,
.registration-actions .btn-delete,
.name-actions .btn-save {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: var(--gform-radius);
}

.btn-save--sm {
  font-size: 11px !important;
  padding: 5px 10px !important;
  border-radius: var(--gform-radius);
}

.btn-save--teal {
  background: var(--gform-teal, #007b83) !important;
  color: white !important;
}

.btn-save--teal:hover {
  background: var(--gform-teal-dark, #00666e) !important;
}



@media (max-width: 640px) {
  /* ==========================================================================
     Registration Summary - Mobile Card Layout (prevents tiny text zoom)
     ========================================================================== */

  .registrations-summary.summary-table .summary-table-wrap {
    overflow: visible;
    width: 100%;
    max-width: 100%;
    contain: layout style;
  }

  .registrations-summary.summary-table .summary-table-inner,
  .registrations-summary.summary-table .summary-table-inner thead,
  .registrations-summary.summary-table .summary-table-inner tbody,
  .registrations-summary.summary-table .summary-table-inner tr,
  .registrations-summary.summary-table .summary-table-inner th,
  .registrations-summary.summary-table .summary-table-inner td {
    display: contents !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  .registrations-summary.summary-table .summary-table-inner thead {
    display: none !important;
  }

  .registrations-summary.summary-table .summary-table-inner tbody {
    display: block !important;
  }

  /* Card layout for summary rows */
  .registrations-summary.summary-table tbody tr.summary-row {
    display: block !important;
    background: var(--gform-card-bg);
    border: 1px solid var(--gform-border);
    border-radius: var(--gform-radius);
    margin-bottom: 8px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  }

  .registrations-summary.summary-table tbody tr.summary-row:not(.disabled-event) {
    border-left: 3px solid var(--gform-primary);
  }

  .registrations-summary.summary-table tbody tr.summary-row.disabled-event {
    opacity: 0.7;
    border-left: 3px solid var(--gform-text-secondary);
    background: var(--gform-bg);
  }

  /* Hidden disabled events (controlled by Show Disabled toggle) */
  .registrations-summary.summary-table tbody tr.summary-row.disabled-event[style*="display: none"] {
    display: none !important;
  }

  /* Hide all td by default */
  .registrations-summary.summary-table tbody tr.summary-row td {
    display: none !important;
  }

  /* Show: Event (1st), Division (2nd), Registered (4th), Available (7th), % Full (8th) */
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(1),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(2),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8) {
    display: block !important;
  }

  /* Layout: Event + Division on top row */
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(1) {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    line-height: 1.3;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(1)::before {
    display: none !important;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(2) {
    font-size: 13px;
    color: var(--gform-text-secondary);
    margin-bottom: 10px;
    line-height: 1.3;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(2)::before {
    display: none !important;
  }

  /* Stats row: Registered / Available+Max + progress */
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8) {
    display: inline-flex !important;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-right: 10px;
    line-height: 1.3;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4)::before,
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7)::before,
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8)::before {
    font-weight: 600;
    color: var(--gform-text-secondary);
    font-size: 12px;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4)::before {
    content: "Reg:";
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7)::before {
    content: "Avail:";
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7)::after {
    content: " / " attr(data-max);
    font-weight: 400;
    color: var(--gform-text-secondary);
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8)::before {
    content: "";
  }

  /* Progress bar */
  .registrations-summary.summary-table tbody tr.summary-row .progress-cell {
    display: flex !important;
    align-items: center;
    gap: 8px;
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-bar-mini {
    flex: 1;
    max-width: 100px;
    height: 6px;
    background: var(--gform-border);
    border-radius: 3px;
    overflow: hidden;
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-fill {
    background: var(--gform-primary);
  }
  .registrations-summary.summary-table tbody tr.summary-row.warn .progress-fill {
    background: #f59e0b;
  }
  .registrations-summary.summary-table tbody tr.summary-row.full .progress-fill {
    background: var(--gform-error);
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-cell span {
    font-size: 11px;
    font-family: monospace;
    color: var(--gform-text-secondary);
  }

  .registrations-summary.summary-table tbody tr.summary-row td.negative {
    color: var(--gform-error);
    font-weight: 700;
  }
  .registrations-summary.summary-table tbody tr.summary-row td.low {
    color: var(--gform-warning, #f59e0b);
    font-weight: 600;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(3) .badge {
    font-size: 11px;
    padding: 3px 8px;
  }


  .registrations-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .registrations-filters {
    flex-direction: column;
  }
  
  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-group select,
  .filter-group input {
    width: 100%;
    min-width: 0;
  }
  
  .registrations-table {
    font-size: 13px;
  }
  
  .registrations-table th,
  .registrations-table td {
    padding: 10px 12px;
  }

  /* Name cell mobile */
  .name-cell {
    gap: 4px;
  }

  .name-actions {
    gap: 4px;
  }

  .name-actions .btn-save {
    padding: 4px 8px;
    font-size: 10px;
  }

  /* Summary table on mobile - use card layout instead of horizontal scroll */
  .registrations-summary.summary-table {
    padding: 0;
    margin-bottom: 20px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .registrations-summary.summary-table .summary-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gform-card-bg);
    border: 1px solid var(--gform-border);
    border-radius: var(--gform-radius);
    margin-bottom: 12px;
  }

  .registrations-summary.summary-table .summary-title {
    font-size: 15px;
    margin: 0;
  }

  .registrations-summary.summary-table .summary-subtitle {
    font-size: 12px;
    margin: 2px 0 0;
  }

  .toggle-wrapper {
    font-size: 13px;
    margin-left: auto;
  }

  .toggle-slider {
    width: 44px;
    height: 24px;
  }

  .toggle-slider::before {
    width: 20px;
    height: 20px;
  }

  .toggle-wrapper input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
  }

  .summary-table-wrap {
    overflow: visible;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .summary-table-inner {
    display: block;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
  }

  .summary-table-inner thead {
    display: none;
  }

  .summary-table-inner tbody {
    display: block;
  }

  /* Mobile compact card layout for summary rows */
    /* Mobile compact card layout for summary rows */
  .registrations-summary.summary-table tbody tr.summary-row {
    display: block;
    background: var(--gform-card-bg);
    border: 1px solid var(--gform-border);
    border-radius: var(--gform-radius);
    margin-bottom: 8px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  }

  .registrations-summary.summary-table tbody tr.summary-row:not(.disabled-event) {
    border-left: 3px solid var(--gform-primary);
  }

  .registrations-summary.summary-table tbody tr.summary-row.disabled-event {
    opacity: 0.7;
    border-left: 3px solid var(--gform-text-secondary);
    background: var(--gform-bg);
  }

  /* Hidden disabled events (controlled by Show Disabled toggle) */
  .registrations-summary.summary-table tbody tr.summary-row.disabled-event[style*="display: none"] {
    display: none !important;
  }

  /* Hide all td by default - we'll show only key ones */
  .registrations-summary.summary-table tbody tr.summary-row td {
    display: none;
  }

  /* Show: Event (1st), Division (2nd), Registered (4th), Available (7th), % Full (8th) */
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(1),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(2),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8) {
    display: block;
  }

  /* Layout: Event + Division on top row */
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(1) {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
    line-height: 1.3;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(1)::before {
    display: none;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(2) {
    font-size: 13px;
    color: var(--gform-text-secondary);
    margin-bottom: 10px;
    line-height: 1.3;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(2)::before {
    display: none;
  }

  /* Stats row: Registered / Available+Max + progress */
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8) {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    margin-right: 10px;
    line-height: 1.3;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4)::before,
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7)::before,
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8)::before {
    font-weight: 600;
    color: var(--gform-text-secondary);
    font-size: 12px;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4)::before {
    content: "Reg:";
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7)::before {
    content: "Avail:";
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7)::after {
    content: " / " attr(data-max);
    font-weight: 400;
    color: var(--gform-text-secondary);
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8)::before {
    content: "";
  }

  /* Progress bar compact */
  .registrations-summary.summary-table tbody tr.summary-row .progress-cell {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-bar-mini {
    flex: 1;
    max-width: 100px;
    height: 6px;
    background: var(--gform-border);
    border-radius: 3px;
    overflow: hidden;
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-fill {
    background: var(--gform-primary);
  }
  .registrations-summary.summary-table tbody tr.summary-row.warn .progress-fill {
    background: #f59e0b;
  }
  .registrations-summary.summary-table tbody tr.summary-row.full .progress-fill {
    background: var(--gform-error);
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-cell span {
    font-size: 11px;
    font-family: monospace;
    color: var(--gform-text-secondary);
  }

  .registrations-summary.summary-table tbody tr.summary-row td.negative {
    color: var(--gform-error);
    font-weight: 700;
  }
  .registrations-summary.summary-table tbody tr.summary-row td.low {
    color: var(--gform-warning, #f59e0b);
    font-weight: 600;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(3) .badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  /* Hide all td by default - we'll show only key ones */
  .registrations-summary.summary-table tbody tr.summary-row td {
    display: none;
  }

  /* Show only: Event (1st), Division (2nd), Registered (4th), Available (7th), % Full (8th) */
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(1),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(2),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8) {
    display: block;
  }

  /* Layout: Event + Division on top row */
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(1) {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(1)::before {
    display: none;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(2) {
    font-size: 12px;
    color: var(--gform-text-secondary);
    margin-bottom: 8px;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(2)::before {
    display: none;
  }

  /* Stats row: Registered / Available + progress */
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7),
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8) {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    margin-right: 8px;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4)::before,
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7)::before,
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8)::before {
    font-weight: 600;
    color: var(--gform-text-secondary);
    font-size: 11px;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(4)::before {
    content: "Reg:";
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(7)::before {
    content: "Avail:";
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(8)::before {
    content: "";
  }

  /* Progress bar compact */
  .registrations-summary.summary-table tbody tr.summary-row .progress-cell {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-bar-mini {
    flex: 1;
    max-width: 80px;
    height: 5px;
    background: var(--gform-border);
    border-radius: 3px;
    overflow: hidden;
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-fill {
    background: var(--gform-primary);
  }
  .registrations-summary.summary-table tbody tr.summary-row.warn .progress-fill {
    background: #f59e0b;
  }
  .registrations-summary.summary-table tbody tr.summary-row.full .progress-fill {
    background: var(--gform-error);
  }
  .registrations-summary.summary-table tbody tr.summary-row .progress-cell span {
    font-size: 10px;
    font-family: monospace;
    color: var(--gform-text-secondary);
  }

  .registrations-summary.summary-table tbody tr.summary-row td.negative {
    color: var(--gform-error);
    font-weight: 700;
  }
  .registrations-summary.summary-table tbody tr.summary-row td.low {
    color: var(--gform-warning, #f59e0b);
    font-weight: 600;
  }
  .registrations-summary.summary-table tbody tr.summary-row td:nth-child(3) .badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .summary-table-inner tbody td:nth-child(2) {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  /* Table actions mobile */
  .table-actions {
    gap: 8px;
    margin-bottom: 12px;
  }

  .table-actions .btn-save--primary {
    padding: 8px 12px;
    font-size: 13px;
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  /* ==========================================================================
     Admin Registrations - Mobile Improvements
     ========================================================================== */

  /* Summary section collapsible */
  .registrations-summary.summary-table.collapsed #summaryContent {
    display: none !important;
  }

  .registrations-summary.summary-table .summary-header {
    cursor: pointer;
    user-select: none;
  }

  .registrations-summary.summary-table .summary-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }

  .registrations-summary.summary-table .summary-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .summary-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .summary-toggle-icon {
    font-size: 14px;
    color: var(--gform-text-secondary);
    transition: transform 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
  }

  .registrations-summary.summary-table.collapsed .summary-toggle-icon {
    transform: rotate(-90deg);
  }

  /* Collapsible filter toolbar on mobile */
  .registrations-toolbar {
    background: var(--gform-card-bg);
    border: 1px solid var(--gform-border);
    border-radius: var(--gform-radius);
    margin-bottom: 16px;
    overflow: hidden;
  }

  .registrations-toolbar.collapsed #filterContent {
    display: none !important;
  }

  .toolbar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gform-bg);
    border-bottom: 1px solid var(--gform-border);
    cursor: pointer;
    user-select: none;
  }

  .toolbar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gform-text);
  }

  .toolbar-toggle-icon {
    font-size: 14px;
    color: var(--gform-text-secondary);
    transition: transform 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
  }

  .registrations-toolbar.collapsed .toolbar-toggle-icon {
    transform: rotate(-90deg);
  }

  .registrations-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .filter-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gform-text-secondary);
  }

  .filter-group select,
  .filter-group input {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 12px;
  }

  .filter-search-group {
    order: -1;
  }

  /* Registration row as card on mobile */
  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) tr.registration-row {
    border: 2px solid var(--gform-border);
    box-shadow: 0 2px 6px rgba(60,64,67,0.15);
  }

  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) tr.registration-row[data-row] {
    border-left: 4px solid var(--gform-primary);
  }

  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) tr.registration-row td {
    padding: 12px 0;
    font-size: 14px;
  }

  .table-wrap:not(.summary-table-wrap):not(.division-table-wrap):not(.schema-table-wrap) tr.registration-row td::before {
    font-size: 12px;
    font-weight: 600;
  }

  /* Name cell wrapper */
  .name-cell-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .name-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
  }

  .name-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }

  .name-info strong {
    font-size: 16px;
  }

  .expand-toggle {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gform-text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--gform-radius);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .expand-toggle:hover {
    background: var(--gform-bg);
  }

  /* Registration status badges - larger touch targets */
  .registration-status {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Division badge with capacity */
  .division-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--gform-bg);
    border-radius: var(--gform-radius);
    font-weight: 500;
    font-size: 13px;
    border: 1px solid var(--gform-border);
  }

  .division-badge .capacity-indicator {
    font-size: 11px;
    color: var(--gform-text-secondary);
    font-weight: 400;
    font-family: monospace;
  }

  .division-badge.division-full {
    background: #fce8e6;
    border-color: #f5c6cb;
    color: #c5221f;
  }

  .division-badge.division-full .capacity-indicator {
    color: #c5221f;
  }

  .division-badge.division-low {
    background: #fff3e0;
    border-color: #ffe0b2;
    color: #e65100;
  }

  .division-badge.division-low .capacity-indicator {
    color: #e65100;
  }

  /* Secondary info expandable */
  .registration-secondary {
    background: var(--gform-bg);
    border-radius: var(--gform-radius);
    padding: 12px;
    margin-top: 8px;
    border: 1px solid var(--gform-border);
  }

  .secondary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--gform-border);
    font-size: 13px;
  }

  .registration-secondary .secondary-row:last-child {
    border-bottom: none;
  }

  .secondary-label {
    color: var(--gform-text-secondary);
    font-weight: 500;
    font-size: 12px;
  }

  .secondary-value {
    color: var(--gform-text);
    font-family: monospace;
    font-size: 12px;
    word-break: break-all;
  }

  .secondary-value.reg-id {
    background: var(--gform-card-bg);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--gform-border);
  }

  /* Secondary status badges */
  .secondary-status-paid {
    color: #1e7e34;
    font-weight: 600;
  }
  .secondary-status-pending {
    color: #b06000;
    font-weight: 600;
  }
  .secondary-status-waitlist {
    color: #c5221f;
    font-weight: 600;
  }
  .secondary-status-cancelled {
    color: #9e9e9e;
    font-weight: 600;
  }

  /* Copy buttons in secondary info */
  .secondary-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .secondary-value-copy {
    flex: 1;
    word-break: break-all;
  }

  .copy-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border: 1px solid var(--gform-border);
    border-radius: var(--gform-radius);
    background: var(--gform-card-bg);
    color: var(--gform-text-secondary);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
  }

  .copy-btn:hover {
    background: var(--gform-bg);
    border-color: var(--gform-primary);
    color: var(--gform-primary);
  }

  .copy-btn:active {
    transform: scale(0.95);
  }

  .copy-btn.copied {
    background: #e6f4ea;
    border-color: #81c995;
    color: #1e7e34;
  }

  /* Team name display in registration cards */
  .team-name-row {
    margin-bottom: 4px;
  }

  .team-name-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gform-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .team-name-value {
    font-size: 14px;
    color: var(--gform-primary);
    font-weight: 600;
  }

  .captain-name-row {
    margin-top: 2px;
  }

  .captain-name-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--gform-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .captain-name-row strong {
    font-size: 15px;
    color: var(--gform-text);
  }

  /* Actions cell */
  .actions-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
  }

  .division-move-inline {
    flex: 1;
    min-width: 180px;
  }

  .division-move-select {
    width: 100%;
    min-height: 44px;
    font-size: 14px;
    padding: 8px 12px;
    border: 1px solid var(--gform-border);
    border-radius: var(--gform-radius);
    background: var(--gform-card-bg);
    color: var(--gform-text);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3e%3cpath d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='1.5' fill='none' fill-rule='evenodd'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
  }

  .division-move-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .division-move-select option[disabled] {
    color: var(--gform-text-secondary);
  }

  /* Button touch targets */
  .btn-action {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-action.promote-waitlist {
    flex: 1;
  }

  /* Promote button special styling */
  .promote-waitlist {
    background: var(--gform-primary) !important;
  }

  .promote-waitlist:hover {
    background: var(--gform-primary-dark) !important;
  }

  /* Event type badge */
  .event-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    min-width: 70px;
    text-align: center;
  }

  .event-type-badge.team {
    background: #e8eaf6;
    color: #3f51b5;
  }

  .event-type-badge.individual {
    background: #e0f2f1;
    color: #007b83;
  }

  /* Summary table mobile improvements */
  .summary-table-inner tbody td:first-child {
    font-weight: 600;
  }

  .summary-table-inner tbody td:nth-child(2) {
    font-weight: 500;
  }
}

@media (max-width: 480px) {
  .name-info strong {
    font-size: 15px;
  }

  .registration-status {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 72px;
  }

  .division-badge {
    padding: 5px 10px;
    font-size: 12px;
  }

  .btn-action {
    padding: 10px 12px;
    font-size: 12px;
  }

  .expand-toggle {
    font-size: 16px;
  }

  .secondary-row {
    font-size: 12px;
  }
}

/* Desktop: keep summary expanded by default */
@media (min-width: 641px) {
  .registrations-summary.summary-table.collapsed #summaryContent {
    display: block !important;
  }

  /* Hide summary collapse/expand toggle on desktop - always expanded */
  .registrations-summary.summary-table .summary-toggle-icon {
    display: none;
  }

  .registrations-toolbar {
    position: static;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0 0 16px;
    box-shadow: none;
  }

  .registrations-toolbar .toolbar-header {
    display: none;
  }

  .registrations-toolbar #filterContent {
    display: flex !important;
    padding: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
  }

  .registrations-toolbar .filter-group {
    flex-direction: row;
    align-items: center;
    min-width: 180px;
  }

  .registrations-toolbar .filter-group label {
    margin-right: 8px;
    white-space: nowrap;
  }

  .registrations-toolbar .filter-group select,
  .registrations-toolbar .filter-group input {
    min-height: 36px;
    font-size: 13px;
    padding: 6px 10px;
    flex: 1;
  }

  .registrations-toolbar .filter-search-group {
    order: 0;
    flex: 1;
    min-width: 250px;
  }

  /* Table actions sticky on mobile only */
  #tableActions {
    position: static;
  }

  /* Registration Summary - Desktop: compact table layout */
  .registrations-summary.summary-table .summary-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  .registrations-summary.summary-table .summary-table-inner {
    display: table;
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 600px;
  }

  .registrations-summary.summary-table .summary-table-inner thead {
    display: table-header-group !important;
  }

  .registrations-summary.summary-table .summary-table-inner tbody {
    display: table-row-group !important;
  }

  .registrations-summary.summary-table .summary-table-inner tr {
    display: table-row !important;
  }

  .registrations-summary.summary-table .summary-table-inner th,
  .registrations-summary.summary-table .summary-table-inner td {
    display: table-cell !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 8px 10px;
    line-height: 1.4;
    white-space: nowrap;
  }

  .registrations-summary.summary-table .summary-table-inner thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gform-text-secondary);
    border-bottom: 2px solid var(--gform-border);
    background: var(--gform-bg);
    font-weight: 600;
    padding: 8px 10px;
  }

  .registrations-summary.summary-table .summary-table-inner tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gform-border);
    vertical-align: middle;
  }

  .registrations-summary.summary-table .summary-table-inner tbody tr:last-child td {
    border-bottom: none;
  }

  .registrations-summary.summary-table .summary-table-inner tbody tr.full td {
    background: rgba(217, 48, 37, 0.05);
  }

  .registrations-summary.summary-table .summary-table-inner tbody tr.warn td {
    background: rgba(245, 158, 11, 0.05);
  }

  .registrations-summary.summary-table .summary-table-inner tbody tr.ok td {
    background: rgba(16, 185, 129, 0.03);
  }

  .registrations-summary.summary-table .summary-table-inner tbody td:first-child {
    font-weight: 500;
  }

  .registrations-summary.summary-table .summary-table-inner tbody td:nth-child(2) {
    color: var(--gform-text-secondary);
  }

  .registrations-summary.summary-table .summary-table-inner tbody td:nth-child(4),
  .registrations-summary.summary-table .summary-table-inner tbody td:nth-child(5),
  .registrations-summary.summary-table .summary-table-inner tbody td:nth-child(6),
  .registrations-summary.summary-table .summary-table-inner tbody td:nth-child(7) {
    width: 70px;
    padding: 8px 10px;
    font-family: monospace;
    text-align: center;
  }

  .registrations-summary.summary-table .summary-table-inner tbody td.negative {
    color: var(--gform-error);
  }

  .registrations-summary.summary-table .summary-table-inner tbody td.low {
    color: var(--gform-warning, #f59e0b);
  }

  .progress-cell {
    gap: 8px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-wrap: nowrap;
  }

  .progress-bar-mini {
    display: flex;
    flex: 1;
    max-width: 100px;
    height: 6px;
  }

  .progress-cell span {
    font-size: 11px;
    font-family: monospace;
  }

  .registrations-summary.summary-table .summary-table-inner tbody td:nth-child(3) .badge {
    font-size: 11px;
    padding: 3px 8px;
  }

  .registrations-summary.summary-table .summary-table-inner tbody td:nth-child(2) {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
  }

  .registrations-summary.summary-table .summary-table-inner tbody tr.disabled-event {
    opacity: 0.5;
  }

  .registrations-summary.summary-table .summary-table-inner tbody tr.disabled-event[style*="display: none"] {
    display: none !important;
  }

  .registrations-summary.summary-table .summary-table-inner tbody tr.disabled-event td {
    background: var(--gform-bg) !important;
  }

  .registrations-summary.summary-table .summary-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
  }

  .registrations-summary.summary-table .summary-title {
    font-size: 15px;
  }

  .registrations-summary.summary-table .summary-subtitle {
    font-size: 12px;
  }

  .toggle-wrapper {
    font-size: 13px;
  }

  .toggle-slider {
    width: 44px;
    height: 24px;
  }

  .toggle-slider::before {
    width: 20px;
    height: 20px;
  }

  .toggle-wrapper input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(20px);
  }


}

/* Mobile: sticky table actions at top */
@media (max-width: 640px) {
  #tableActions {
    position: sticky;
    top: 0;
    background: var(--gform-card-bg);
    border-bottom: 1px solid var(--gform-border);
    padding: 12px 16px;
    margin: 0 -16px 16px;
    border-radius: var(--gform-radius) var(--gform-radius) 0 0;
    box-shadow: 0 4px 12px rgba(60,64,67,0.1);
    z-index: 20;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  #tableActions .btn-save--primary {
    flex: 1;
    min-width: 140px;
    justify-content: center;
    padding: 12px 16px;
    font-size: 14px;
    min-height: 44px;
  }

  #tableActions .btn-save--primary svg {
    margin-right: 6px;
  }
}

/* ==========================================================================
   Schema Sync Page
   ========================================================================== */

.schema-selector {
  margin-bottom: 20px;
}

.schema-selector select {
  padding: 10px 14px;
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  background: var(--gform-card-bg);
  font-size: 14px;
  max-width: 350px;
}

.schema-status {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--gform-radius);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.schema-status.synced {
  background: #e6f4ea;
  border: 1px solid #81c995;
}

.schema-status.out-of-sync {
  background: #fef7e0;
  border: 1px solid #f9c846;
}

.schema-status-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.schema-status.synced .schema-status-icon { background: #e6f4ea; color: #1e7e34; }
.schema-status.out-of-sync .schema-status-icon { background: #fef7e0; color: #b06000; }

.schema-status-text {
  flex: 1;
  min-width: 200px;
}

.schema-status-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}

.schema-status.synced .schema-status-title { color: #1e7e34; }
.schema-status.out-of-sync .schema-status-title { color: #b06000; }

.schema-status-desc {
  font-size: 13px;
  color: var(--gform-text-secondary);
  margin: 0;
}

.schema-diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.schema-diff-card {
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  padding: 20px;
  border-left: 4px solid;
}

.schema-diff-card.matching { border-left-color: #1e7e34; }
.schema-diff-card.missing { border-left-color: #b06000; }
.schema-diff-card.extra { border-left-color: #c5221f; }
.schema-diff-card.reordered { border-left-color: #1a73e8; }

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

.schema-diff-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gform-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.schema-diff-count {
  font-size: 24px;
  font-weight: 700;
}

.schema-diff-card.matching .schema-diff-count { color: #1e7e34; }
.schema-diff-card.missing .schema-diff-count { color: #b06000; }
.schema-diff-card.extra .schema-diff-count { color: #c5221f; }
.schema-diff-card.reordered .schema-diff-count { color: #1a73e8; }

.schema-diff-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--gform-text-secondary);
  padding: 4px 0;
}

.schema-diff-details ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--gform-text);
}

.schema-diff-details li { margin-bottom: 4px; }

.schema-definition-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.schema-definition-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--gform-bg);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gform-text-secondary);
  border-bottom: 1px solid var(--gform-border);
}

.schema-definition-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gform-border);
}

.schema-definition-table tbody tr:hover {
  background: var(--gform-bg);
}

@media (max-width: 640px) {
  .schema-status {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .schema-status-text {
    min-width: 0;
  }
  
  .schema-diff-grid {
    grid-template-columns: 1fr;
  }
  
  .schema-definition-table {
    font-size: 12px;
  }
  
  .schema-definition-table th,
  .schema-definition-table td {
    padding: 8px 10px;
  }
}

/* ==========================================================================
   Settings Page
   ========================================================================== */

.settings-section {
  background: var(--gform-card-bg);
  border-radius: var(--gform-radius);
  box-shadow: 0 1px 2px rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  border: 1px solid var(--gform-border);
  margin-bottom: 24px;
  overflow: hidden;
}

.settings-section-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gform-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.settings-section-desc {
  font-size: 13px;
  color: var(--gform-text-secondary);
  margin: 4px 0 0;
}

.settings-section-body {
  padding: 24px;
}

.env-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.env-status-card {
  background: var(--gform-bg);
  border-radius: var(--gform-radius);
  padding: 20px;
  border: 1px solid var(--gform-border);
}

.env-status-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.env-status-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.env-status-icon.ok { background: #e6f4ea; color: #1e7e34; }
.env-status-icon.warn { background: #fef7e0; color: #b06000; }
.env-status-icon.error { background: #fce8e6; color: #c5221f; }

.env-status-info {
  flex: 1;
}

.env-status-name {
  font-weight: 600;
  font-size: 14px;
}

.env-status-desc {
  font-size: 12px;
  color: var(--gform-text-secondary);
  margin-top: 2px;
}

.env-status-value {
  font-family: monospace;
  font-size: 13px;
  background: var(--gform-card-bg);
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--gform-border);
  word-break: break-all;
}

.env-status-value-wrap {
  display: flex;
  align-items: center;
}

.env-value-masked {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 13px;
  background: var(--gform-card-bg);
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid var(--gform-border);
  word-break: break-all;
  flex: 1;
}

.masked-text {
  flex: 1;
  letter-spacing: 2px;
}

.reveal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--gform-border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--gform-text-secondary);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.reveal-btn:hover {
  background: var(--gform-purple);
  border-color: var(--gform-purple);
  color: white;
}

.reveal-btn:focus {
  outline: 2px solid var(--gform-purple);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .env-value-masked {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .reveal-btn {
    align-self: flex-start;
  }
}

@media (max-width: 640px) {
  .settings-section-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  
  .settings-section-body {
    padding: 16px;
  }
  
  .env-status-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gform-text-secondary);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  color: var(--gform-border);
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--gform-text);
}

.empty-state-desc {
  font-size: 14px;
  margin: 0 0 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--gform-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--gform-radius);
  font-weight: 600;
  font-size: 14px;
}

.empty-state-action:hover {
  background: var(--gform-primary-dark);
}

/* ==========================================================================
   Admin Event Edit Page
   ========================================================================== */

/* Layout: two-column on desktop, stacked on mobile */
.event-edit-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .event-edit-layout {
    grid-template-columns: 360px 1fr;
    align-items: start;
  }
  .event-details-panel {
    position: sticky;
    top: 24px;
  }
}

/* Cards */
.event-details-card,
.divisions-card,
.division-summary-card {
  background: var(--gform-card-bg);
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gform-border);
  background: var(--gform-bg);
}

.card-header--with-action {
  flex-wrap: wrap;
  gap: 12px;
}

.section-heading {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--gform-text);
}

/* Event Details Form */
.admin-form .form-group {
  margin-bottom: 20px;
}

.admin-form .form-group--primary {
  padding: 16px;
  background: var(--gform-bg);
  border-radius: var(--gform-radius);
  border: 1px solid var(--gform-border);
  margin-bottom: 20px;
}

.form-divider {
  border: none;
  border-top: 1px solid var(--gform-border);
  margin: 16px -20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gform-text);
  margin-bottom: 6px;
}

.admin-form input[type="text"],
.admin-form input[type="url"],
.admin-form input[type="number"],
.admin-form input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  background: var(--gform-card-bg);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-form input:focus {
  outline: none;
  border-color: var(--gform-purple);
  box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.15);
}

.admin-form input[disabled] {
  background: var(--gform-bg);
  color: var(--gform-text-secondary);
  cursor: not-allowed;
}

.form-help {
  display: block;
  font-size: 12px;
  color: var(--gform-text-secondary);
  margin-top: 4px;
}

/* Toggle switch */
.toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 12px;
  border-radius: var(--gform-radius);
  transition: background 0.15s;
}

.toggle-label:hover {
  background: var(--gform-bg);
}

.toggle-label--danger:hover {
  background: rgba(239, 68, 68, 0.08);
}

.toggle-text {
  flex: 1;
  min-width: 0;
}

.toggle-text strong {
  display: block;
  font-size: 14px;
  color: var(--gform-text);
}

.toggle-text small {
  display: block;
  font-size: 12px;
  color: var(--gform-text-secondary);
  margin-top: 2px;
}

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

.toggle-slider {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--gform-border);
  transition: background 0.2s;
  flex-shrink: 0;
  margin-top: 2px;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

.toggle-input:checked + .toggle-slider {
  background: var(--gform-purple);
}

.toggle-label--danger .toggle-input:checked + .toggle-slider {
  background: var(--gform-error);
}

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

.toggle-input:disabled + .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-input:focus-visible + .toggle-slider {
  outline: 2px solid var(--gform-purple);
  outline-offset: 2px;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 8px;
}

.form-actions--sticky {
  position: sticky;
  bottom: 0;
  background: var(--gform-card-bg);
  padding: 16px 20px;
  border-top: 1px solid var(--gform-border);
  margin: 0 -20px -20px;
}

.form-actions--inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
}

.btn-save--primary {
  background: var(--gform-purple);
  color: white;
}

.btn-save--primary:hover {
  background: var(--gform-purple-dark);
}

.btn-save--sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-save--outline {
  background: transparent;
  border: 1px solid var(--gform-border);
  color: var(--gform-text);
}

.btn-save--outline:hover {
  background: var(--gform-bg);
  border-color: var(--gform-purple);
  color: var(--gform-purple);
}

.btn-delete--sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  background: var(--gform-card-bg);
  color: var(--gform-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: var(--gform-purple);
  border-color: var(--gform-purple);
  color: white;
}

/* Division Summary Card */
.division-summary-card {
  margin-top: 24px;
  padding: 16px 20px;
}

.summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat {
  text-align: center;
  padding: 12px;
  background: var(--gform-bg);
  border-radius: var(--gform-radius);
  border: 1px solid var(--gform-border);
}

.stat-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  font-family: monospace;
  color: var(--gform-purple);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--gform-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Divisions Grid */
.divisions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px 20px 20px;
}

@media (min-width: 640px) {
  .divisions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .divisions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.division-card {
  background: var(--gform-card-bg);
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  padding: 16px;
  transition: box-shadow 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
}

.division-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--gform-purple);
}

.division-card.dragging {
  opacity: 0.5;
  background: #fff3e0;
  border-color: var(--gform-warning);
}

.division-card.archived {
  opacity: 0.6;
  background: var(--gform-bg);
}

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

.division-drag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.drag-handle {
  cursor: grab;
  color: var(--gform-text-secondary);
  padding: 4px 8px;
  user-select: none;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.drag-handle:hover {
  color: var(--gform-purple);
  background: rgba(103, 58, 183, 0.1);
}

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

.reorder-buttons {
  display: none;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 640px) {
  .drag-handle {
    display: none;
  }
  .reorder-buttons {
    display: flex;
  }
}

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

.division-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gform-text);
  margin-bottom: 4px;
}

.division-fields {
  flex: 1;
  margin-top: auto;
}

.division-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

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

.form-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gform-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-field input {
  padding: 10px 12px;
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  background: var(--gform-card-bg);
  font-size: 14px;
  font-family: inherit;
  inputmode: numeric;
}

.form-field input:focus {
  outline: none;
  border-color: var(--gform-purple);
  box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.15);
}

.division-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 20px;
  font-size: 12px;
  color: var(--gform-text-secondary);
  background: var(--gform-bg);
  border-top: 1px solid var(--gform-border);
}

.division-hint svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--gform-text-secondary);
}

.kbd {
  display: inline-block;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 11px;
  background: var(--gform-border);
  border-radius: 4px;
  color: var(--gform-text);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gform-text-secondary);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  color: var(--gform-border);
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--gform-text);
}

.empty-state-desc {
  font-size: 14px;
  margin: 0 0 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.empty-state-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--gform-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--gform-radius);
  font-weight: 600;
  font-size: 14px;
}

.empty-state-action:hover {
  background: var(--gform-primary-dark);
}

/* Responsive adjustments for event edit */
@media (max-width: 640px) {
  .event-details-panel {
    order: 1;
  }
  .divisions-panel {
    order: 2;
  }
  .division-summary-card {
    order: 3;
  }

  .admin-header {
    padding: 16px;
  }

  .admin-header h1 {
    font-size: 20px;
  }

  .card-header {
    padding: 12px 16px;
  }

  .form-group--primary {
    margin: 12px -16px 16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .form-divider {
    margin-left: -20px;
    margin-right: -20px;
  }

  .form-actions--sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-radius: 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  }

  .divisions-grid {
    padding: 12px 16px 16px;
  }

  .division-card {
    padding: 12px;
  }

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

  .division-hint {
    padding: 12px 16px;
    margin-top: 12px;
  }
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--gform-purple);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gform-purple);
  outline-offset: 2px;
}

/* ==========================================================================
   Admin Event Edit - Form Sections (additional styles)
   ========================================================================== */

.form-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gform-border);
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gform-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 16px;
}

.form-section-title svg {
  color: var(--gform-purple);
  flex-shrink: 0;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 -8px;
}

.form-row--toggles {
  flex-direction: column;
}

@media (min-width: 500px) {
  .form-row--toggles {
    flex-direction: row;
  }
}

.form-field {
  flex: 1;
  min-width: 200px;
  margin: 0 8px;
}

.form-field--toggle {
  min-width: 240px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gform-text);
  margin-bottom: 6px;
}

/* Toggle label within form-field */
.form-field .toggle-label {
  padding: 12px;
  background: var(--gform-bg);
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  transition: all 0.15s;
}

.form-field .toggle-label:hover {
  border-color: var(--gform-purple);
  background: var(--gform-card-bg);
}

.form-field .toggle-label--danger:hover {
  border-color: var(--gform-error);
  background: rgba(239, 68, 68, 0.05);
}

/* Make the Save button more prominent */
.btn-save--primary {
  width: 100%;
  justify-content: center;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
}

@media (min-width: 500px) {
  .btn-save--primary {
    width: auto;
    min-width: 200px;
  }
}

/* Improve spacing for form groups in event details */
.event-details-card .admin-form .form-group {
  margin-bottom: 20px;
}

.event-details-card .form-section {
  padding-bottom: 20px;
}

.event-details-card .form-section:last-of-type {
  padding-bottom: 8px;
}

/* Better placeholder styling */
.admin-form input::placeholder {
  color: var(--gform-text-secondary);
  opacity: 0.7;
}

/* URL input styling */
.admin-form input[type="url"] {
  font-family: 'Monospace', monospace;
  font-size: 13px;
}

/* ==========================================================================
   Admin Event Edit - Checkbox Styles (replacing toggle switches)
   ========================================================================== */

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  background: var(--gform-card-bg);
  transition: all 0.15s;
}

.checkbox-label:hover {
  border-color: var(--gform-purple);
  background: var(--gform-bg);
}

.checkbox-label:has(input:focus-visible) {
  outline: 2px solid var(--gform-purple);
  outline-offset: 2px;
}

.checkbox-label--primary:hover {
  border-color: var(--gform-primary);
  background: rgba(59, 130, 246, 0.05);
}

.checkbox-label--danger:hover {
  border-color: var(--gform-error);
  background: rgba(239, 68, 68, 0.05);
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gform-border);
  border-radius: 6px;
  background: var(--gform-card-bg);
  transition: all 0.15s;
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-label:hover .checkbox-custom {
  border-color: var(--gform-purple);
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--gform-purple);
  border-color: var(--gform-purple);
  color: white;
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '✓';
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
}

.checkbox-label--primary input:checked + .checkbox-custom {
  background: var(--gform-primary);
  border-color: var(--gform-primary);
}

.checkbox-label--danger input:checked + .checkbox-custom {
  background: var(--gform-error);
  border-color: var(--gform-error);
}

.checkbox-label input:disabled + .checkbox-custom {
  opacity: 0.5;
  cursor: not-allowed;
}

.checkbox-text {
  flex: 1;
  min-width: 0;
}

.checkbox-text strong {
  display: block;
  font-size: 14px;
  color: var(--gform-text);
  margin-bottom: 2px;
}

.checkbox-text small {
  display: block;
  font-size: 12px;
  color: var(--gform-text-secondary);
}

/* Archive field specific styling */
.form-field--archive {
  margin-top: 12px;
}

/* Form field general */
.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gform-text);
  margin-bottom: 6px;
}

/* Improve the Save button */
.btn-save--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--gform-radius);
  background: var(--gform-purple);
  color: white;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.btn-save--primary:hover {
  background: var(--gform-purple-dark);
}

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

.btn-save--primary:focus-visible {
  outline: 2px solid var(--gform-purple);
  outline-offset: 2px;
}

@media (min-width: 500px) {
  .btn-save--primary {
    width: auto;
    min-width: 220px;
  }
}

/* Make the Save button clearly a button, not a toggle */
.form-actions--sticky {
  padding: 20px 20px 16px;
  border-top: 1px solid var(--gform-border);
  margin: 0 -20px -20px;
  background: var(--gform-card-bg);
}

@media (max-width: 640px) {
  .form-actions--sticky {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-radius: 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    padding: 16px;
  }
}

/* ==========================================================================
   Admin Event Edit - Consistent field box styling
   ========================================================================== */

/* Apply boxed styling to all form fields in event details */
.event-details-card .form-field {
  margin-bottom: 0;
}

.event-details-card .form-field > label {
  /* For checkbox labels, the label IS the box */
}

.event-details-card .form-field:not(:has(.checkbox-label)) {
  /* For regular input fields, wrap in a box */
}

.event-details-card .form-group {
  margin-bottom: 0;
}

/* Boxed input wrapper */
.field-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  background: var(--gform-card-bg);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field-box:hover {
  border-color: var(--gform-purple);
}

.field-box:has(input:focus),
.field-box:has(textarea:focus),
.field-box:has(select:focus) {
  border-color: var(--gform-purple);
  box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.1);
}

.field-box label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gform-text);
  margin: 0;
}

.field-box input,
.field-box textarea,
.field-box select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gform-border);
  border-radius: var(--gform-radius);
  background: var(--gform-card-bg);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  margin: 0;
}

.field-box input:focus,
.field-box textarea:focus,
.field-box select:focus {
  outline: none;
  border-color: var(--gform-purple);
  box-shadow: 0 0 0 3px rgba(103, 58, 183, 0.15);
}

.field-box small.form-help {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gform-text-secondary);
}

/* Section spacing */
.event-details-card .form-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gform-border);
}

.event-details-card .form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

/* Ensure the sticky save button area has proper background */
.event-details-card .form-actions--sticky {
  margin: 8px -20px -20px;
  padding: 20px;
  border-top: 1px solid var(--gform-border);
  background: var(--gform-card-bg);
}

/* ==========================================================================
   Admin Events - Event name cell with inline actions
   ========================================================================== */

.event-name-cell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-name-cell strong {
  font-size: 14px;
  color: var(--gform-text);
}

.event-actions-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-action-primary {
  background: var(--gform-purple);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-action-primary:hover {
  background: var(--gform-purple-dark);
  color: #10b981;
}

.btn-action-secondary {
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #f9c846;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.btn-action-secondary:hover {
  background: #fce8e6;
  color: #c5221f;
  border-color: #c5221f;
}

/* Small button variants */
.btn-save--sm,
.btn-delete--sm {
  padding: 5px 8px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: 6px;
}

.btn-save--sm svg,
.btn-delete--sm svg {
  flex-shrink: 0;
}

/* Adjust column widths for events table */
.events-table th:nth-child(2) { /* Event Name */
  min-width: 280px;
}

.events-table td[data-label="Event Name"] {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .event-actions-inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    width: auto;
  }
  
  .btn-action-primary,
  .btn-action-secondary {
    width: auto;
    padding: 6px 10px;
    font-size: 12px;
    justify-content: center;
  }
  
  .btn-action-primary svg,
  .btn-action-secondary svg {
    width: 14px;
    height: 14px;
  }
}
