/**
 * RaceDesk - DataGrid & Accordion Stylesheet
 * Sortable columns, search/filter bar, double pagination, expandable race accordion rows
 */

.datagrid-container {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: 100%;
}

/* =========================================
   1. TOOLBAR / SEARCH & FILTERS (Universal List Standard)
   ========================================= */
.datagrid-toolbar,
.list-toolbar {
  padding: 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.datagrid-toolbar-main,
.toolbar-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box {
  flex: 1 1 280px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-box svg,
.search-box i {
  position: absolute;
  left: 12px;
  color: var(--color-text-subtle);
  pointer-events: none;
  font-size: 14px;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 38px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 14px;
  background: var(--color-surface-bg);
  transition: all 0.15s ease;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Filter Toggle Button */
.btn-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-navy);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn-filter-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #f8fafc;
}

.btn-filter-toggle.open {
  background: var(--color-ice-blue);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-filter-toggle.has-active-filters {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #eff6ff;
}

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  background: var(--color-primary);
  color: #ffffff;
  margin-left: 2px;
}

/* Filter Reset Button */
.btn-filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #c2410c;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}

.btn-filter-reset:hover {
  background: #ffedd5;
  border-color: #f97316;
  color: #9a3412;
}

/* Collapsible Filter Panel (unterhalb des Suchfeldes) */
.datagrid-filter-panel,
.toolbar-drawer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  animation: filterSlideDown 0.15s ease-out;
}

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

.filter-drawer-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 130px;
}

.filter-tabs,
.sport-filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab,
.sport-tab,
.owner-filter-tab {
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-text-main);
  padding: 6px 12px;
  min-height: 32px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.filter-tab:hover,
.sport-tab:hover,
.owner-filter-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-tab.active,
.sport-tab.active,
.owner-filter-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
}

/* =========================================
   2. PAGINATION BAR (Top & Bottom)
   ========================================= */
.datagrid-pagination {
  padding: 12px 18px;
  background: var(--color-surface-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--color-text-muted);
  gap: 16px;
}

.datagrid-pagination.top {
  border-bottom: 1px solid var(--color-border);
}

.datagrid-pagination.bottom {
  border-top: 1px solid var(--color-border);
}

/* Linker Bereich: Datensatz-Info */
.pagination-info {
  flex: 1;
  text-align: left;
  font-weight: 500;
  color: var(--color-text-main);
  min-width: 200px;
}

/* Mittlerer Bereich: Einträge pro Seite zentriert */
.pagination-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pagination-pagesize {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--color-text-main);
}

.pagination-select,
.pagesize-select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-main);
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.pagination-select:focus,
.pagesize-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Rechter Bereich: Navigations-Buttons */
.pagination-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

/* Grössere und einheitliche Pagination-Buttons */
.btn-page {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-navy);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  user-select: none;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-page:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: #ffffff;
  background: var(--color-primary);
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.3);
}

.btn-page:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: #f8fafc;
  color: var(--color-text-muted);
  border-color: var(--color-border);
  box-shadow: none;
}

.pagination-current {
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .datagrid-pagination {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .pagination-info,
  .pagination-center,
  .pagination-nav {
    flex: auto;
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* =========================================
   3. TABLE STYLES & ACCORDION
   ========================================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.datagrid-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.datagrid-table th {
  background: #f1f5f9;
  color: var(--color-text-main);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 14px 18px;
  border-bottom: 2px solid var(--color-border);
  user-select: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.datagrid-table th:hover {
  background: #e2e8f0;
}

.datagrid-table th.non-sortable {
  cursor: default;
}
.datagrid-table th.non-sortable:hover {
  background: #f1f5f9;
}

.th-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.sort-icon {
  font-size: 10px;
  color: var(--color-text-subtle);
}
.sort-icon.active {
  color: var(--color-primary);
  font-weight: bold;
}

/* Universal Table Rows & Cells (Applies to all DataGrids: Users, Events, etc.) */
.datagrid-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.15s ease;
}

.datagrid-table tbody tr:hover {
  background-color: #f8fafc;
}

.datagrid-table tbody td {
  padding: 16px 18px;
  font-size: 14px;
  color: var(--color-text-main);
  vertical-align: middle;
  line-height: 1.5;
}

/* Parent Event Row */
.event-row {
  cursor: pointer;
}

.event-row.expanded {
  background-color: var(--color-ice-blue);
  border-bottom-color: var(--color-primary-light);
}

.event-row td {
  padding: 16px 18px;
  font-size: 14px;
  color: var(--color-text-main);
  vertical-align: middle;
}

.event-expand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-weight: bold;
  font-size: 13px;
  margin-right: 8px;
  transition: transform 0.2s ease, background-color 0.15s ease;
}

.event-row.expanded .event-expand-icon {
  transform: rotate(90deg);
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.event-name-container {
  display: flex;
  align-items: center;
}

.event-title {
  font-weight: 600;
  color: var(--color-text-main);
}

.event-location {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-muted);
}

/* Accordion Child Expansion Row */
.accordion-row {
  display: none;
  background-color: #f8fafc;
  border-bottom: 2px solid var(--color-border);
}

.accordion-row.open {
  display: table-row;
}

.accordion-content {
  padding: 16px 20px 20px 20px;
  background: #f8fafc;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
}

/* Subtable for Competitions within Event Accordion */
.races-subtable {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  table-layout: auto;
}

.races-subtable th {
  background: #f1f5f9;
  color: var(--color-text-main);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 9px 10px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.races-subtable td {
  padding: 9px 10px;
  font-size: 13px;
  color: var(--color-text-main);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.races-subtable tbody tr:last-child td {
  border-bottom: none;
}

.races-subtable tbody tr:hover {
  background-color: #f8fafc;
}

.races-card-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.races-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.races-header-bar h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-navy);
  margin: 0;
}

.races-header-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}


/* Individual Race Item Card in Accordion */
.race-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  gap: 16px;
  flex-wrap: wrap;
  transition: border-color 0.15s ease, transform 0.1s ease;
}

.race-item-row:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.race-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 280px;
}

.race-time-badge {
  font-family: var(--font-family-mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text-main);
  background: var(--color-surface-bg);
  border: 1px solid var(--color-border);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.race-title-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.race-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-main);
}

.race-details-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.race-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Responsive Table Adaptations */
@media (max-width: 900px) {
  .hide-on-mobile {
    display: none !important;
  }
  .race-item-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .race-actions-right {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Standardized Graphical Action Buttons for Lists & Tables
   ========================================================================== */
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  border-radius: var(--radius-sm, 6px);
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: var(--color-text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.btn-action i {
  font-size: 13px;
  line-height: 1;
}

.btn-action.btn-action-with-text {
  width: auto;
  padding: 0 10px;
  gap: 6px;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.08);
}

.btn-action:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Icon-Only Variant */
.btn-action--icon {
  padding: 0;
  width: 32px;
  min-width: 32px;
}

/* Primary / Timing / Execution */
.btn-action-primary {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}
.btn-action-primary:hover {
  background: #1d4ed8;
  border-color: #1e40af;
  color: #ffffff;
}

/* Edit / Modify (Blue tint) */
.btn-action-edit {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.btn-action-edit:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
}

/* View / Impersonate / Preview (Slate / Soft-Blue tint) */
.btn-action-view {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: var(--color-primary, #2563eb);
}
.btn-action-view:hover {
  background: #eff6ff;
  border-color: var(--color-primary, #2563eb);
  color: var(--color-primary-dark, #1d4ed8);
}

/* Competitors / Indigo-Cyan tint */
.btn-action-competitors {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0284c7;
}
.btn-action-competitors:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}

/* Startlist / Green tint */
.btn-action-startlist {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}
.btn-action-startlist:hover {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* Results (Resultate) / Gold-Amber tint */
.btn-action-results-entry,
.btn-race-results {
  background: #fefce8;
  border-color: #fef08a;
  color: #a16207;
}
.btn-action-results-entry:hover,
.btn-race-results:hover {
  background: #fef9c3;
  border-color: #fde047;
  color: #854d0e;
}

/* Evaluation (Auswertung) / Light green (Emerald tint) */
.btn-action-evaluation {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}
.btn-action-evaluation:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
  color: #047857;
}

/* Danger / Delete (Red tint) */
.btn-action-danger,
.btn-action-delete {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}
.btn-action-danger:hover,
.btn-action-delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

/* Neutral / Secondary */
.btn-action-secondary {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}
.btn-action-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* =========================================
   12. RESPONSIVE OPTIMIZATIONS (Tablet & Mobile)
   ========================================= */

/* Tablet (768px – 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .datagrid-toolbar {
    padding: 12px 14px;
  }
  .datagrid-th,
  .datagrid-td {
    padding: 8px 10px;
    font-size: 13px;
  }
  .datagrid-pagination {
    padding: 10px 14px;
    font-size: 12px;
  }
  .btn-action {
    padding: 5px 8px;
    font-size: 11px;
    min-height: 30px;
  }
}

/* =========================================
   Mobile Cards View for DataGrid (Hidden on Desktop & Tablet > 768px)
   ========================================= */
.datagrid-mobile-cards {
  display: none !important;
}

.btn-expand-all.all-expanded {
  background: var(--color-ice-blue);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* =========================================
   Mobile Breakpoint (< 768px)
   ========================================= */
@media (max-width: 768px) {
  .datagrid-container {
    border-radius: var(--radius-md);
  }

  .datagrid-toolbar,
  .list-toolbar {
    padding: 12px;
    gap: 10px;
  }

  .datagrid-toolbar-main,
  .toolbar-top {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-box {
    width: 100%;
    flex: 1 1 100%;
  }

  .search-input {
    height: 42px;
    font-size: 14px;
  }

  .btn-filter-toggle,
  .btn-filter-reset {
    height: 40px;
    width: 100%;
    justify-content: center;
    font-size: 13px;
  }

  .datagrid-filter-panel,
  .toolbar-drawer {
    padding: 12px;
    gap: 10px;
  }

  .filter-drawer-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
  }

  .filter-tabs,
  .sport-filter-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 6px;
  }

  .filter-tab,
  .sport-tab,
  .owner-filter-tab {
    justify-content: center;
    height: 38px;
    padding: 6px 10px;
    font-size: 12px;
    text-align: center;
  }

  /* Table on Mobile: hide desktop table when mobile cards active */
  .datagrid-table-desktop {
    display: none !important;
  }

  .datagrid-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }

  .datagrid-table {
    min-width: 640px;
  }

  .datagrid-th,
  .datagrid-td {
    padding: 10px 8px;
    font-size: 13px;
  }

  /* Mobile Pagination */
  .datagrid-pagination {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 10px;
    text-align: center;
  }

  .pagination-info {
    font-size: 12px;
    width: 100%;
    text-align: center;
  }

  .pagination-controls {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
  }

  .pagination-btn {
    min-width: 40px;
    height: 38px;
    font-size: 13px;
  }

  .page-size-selector {
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  /* Accordion Content & Subtable on Mobile */
  .accordion-content {
    padding: 12px 10px 14px;
  }

  .races-header-bar {
    margin-bottom: 8px;
  }

  .races-header-bar h4 {
    font-size: 13px;
  }

  .races-subtable {
    min-width: 680px;
  }

  .races-subtable th,
  .races-subtable td {
    padding: 8px 10px;
    font-size: 12px;
  }

  .event-expand-icon {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: 14px;
    margin-right: 6px;
  }

  .event-title {
    font-size: 13px;
  }

  .race-sub-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 10px;
  }

  .race-sub-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
  }

  .btn-action {
    min-width: 36px;
    min-height: 36px;
    height: 36px;
    font-size: 13px;
  }

  /* Mobile Cards Layout (< 768px) */
  .datagrid-mobile-cards {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
  }

  .datagrid-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
  }

  .datagrid-card.is-expanded {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  }

  .card-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .card-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-navy);
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid #e2e8f0;
  }

  .card-sports-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
  }

  .card-title-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .card-event-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.3;
    margin: 0;
  }

  .card-event-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
  }

  .card-event-location,
  .card-event-organizer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--color-text-muted);
  }

  .card-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
  }

  .btn-card-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-ice-blue);
    color: var(--color-primary);
    border: 1px solid #bfdbfe;
    padding: 7px 12px;
    border-radius: var(--radius-sm, 6px);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .btn-card-toggle:hover {
    background: #dbeafe;
    border-color: #93c5fd;
  }

  .btn-card-toggle.expanded {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
  }

  .card-no-races {
    font-size: 12px;
    color: var(--color-text-muted);
    font-style: italic;
  }

  .card-actions-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }

  .card-nested-races {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 2px dashed #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .card-nested-races-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-navy);
  }

  .card-races-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-race-subcard {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-sm, 6px);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-race-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .mobile-race-time {
    font-family: var(--font-family-mono, monospace);
    font-weight: 700;
    font-size: 12px;
    color: var(--color-navy);
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
  }

  .mobile-race-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
  }

  .mobile-race-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .mobile-race-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-main);
  }

  .mobile-race-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--color-text-muted);
  }

  .mobile-race-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .mobile-race-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
  }

  .mobile-race-primary-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
  }

  .mobile-race-primary-actions .btn-action {
    flex: 1 1 auto;
    min-height: 36px;
    font-size: 12px;
    padding: 0 10px;
  }

  .mobile-race-manage-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* Inline Manager Box Mobile Adjustments */
  #event-add-manager-box > div:last-child,
  #race-add-manager-box > div:last-child {
    flex-direction: column;
    gap: 8px;
  }

  #event-manager-email-input,
  #race-manager-email-input {
    width: 100% !important;
    height: 40px !important;
  }

  #btn-submit-event-manager,
  #btn-cancel-event-manager-box,
  #btn-submit-race-manager,
  #btn-cancel-race-manager-box {
    width: 100%;
    min-height: 38px;
    justify-content: center;
  }
}



