
    :root {
      /* Bridge legacy variable names to theme system */
      --primary: var(--primary, #0EA5E9);
      --primary-dark: var(--primary-focus, #0EA5E9);
      --primary-light: var(--primary-content, #e0f0f6);
      --primary-soft: var(--base-200, #F2F2F2);
      --secondary: var(--secondary, #FC6F60);
      --secondary-dark: var(--secondary-focus, #FC6F60);
      --accent: var(--accent, #00B389);
      --accent-light: var(--accent-content, #c9f8ed);
      --accent-dark: var(--accent-focus, #00B389);
      --light: var(--base-100, #FFFFFF);
      --dark: var(--base-content, #1F2937);
      --gray-100: var(--base-100, #FFFFFF);
      --gray-200: var(--base-200, #F2F2F2);
      --gray-300: var(--base-300, #E5E6E6);
      --gray-400: #ced4da;
      --gray-500: #adb5bd;
      --gray-600: #6c757d;
      --gray-700: #495057;
      --gray-800: #343a40;
      --gray-900: #212529;
      --text: var(--base-content, #1F2937);
      --border-radius: 8px;
      --transition: all 0.3s ease;
      --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
      --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

/* Common styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--base-100);
  color: var(--base-content);
  line-height: 1.6;
  font-weight: 400;
  margin: 0;
  padding: 0;
}

/* Unified Header */
.nexum-header {
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-focus) 100%);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}
/* Brand wrapper (logo + name) */
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand-logo {
  height: 2.2rem;
  margin-right: 0.5rem;
}

.brand-name {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.tagline {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  font-weight: 400;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem .75rem;
}

.nav-item {
  margin: 0 0.8rem;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0.2rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  position: relative;
}

.nav-link:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: white;
}

.nav-link:hover:after, .nav-link.active:after {
  width: 100%;
}

.nav-link i {
  margin-right: 0.5rem;
}

.user-section {
  display: flex;
  align-items: center;
  margin-left: 1.5rem;
  gap: 1rem;
}

.user-info {
  color: white;
  margin-right: 1rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}

.user-avatar {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.5rem;
  font-weight: 600;
}

.logout-btn {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
}

.logout-btn:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

.logout-btn i {
  margin-right: 0.5rem;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Desktop guard: never show burger on large screens, even if inline styles set */
@media (min-width: 993px) {
  #menu-toggle { display: none !important; }
}

/* Mobile responsive styles */
@media (max-width: 992px) {
  .menu-toggle {
    display: block;
    padding: 0.5rem;
    transition: var(--transition);
    border-radius: 50%;
    z-index: 1010;
  }
  
  .menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
  
  .header-container {
    position: relative;
  }
  
  .header-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-dark);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    box-shadow: var(--shadow);
    z-index: 1000;
    /* Initial state - hidden but ready for transitions */
    display: flex !important; /* Force display flex even when not active */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: visibility 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 0.5rem;
  }
  
  .header-nav.active {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }
  
  .nav-menu {
    flex-direction: column;
    width: 100%;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
  }
  
  .nav-item {
    margin: 0.5rem 0;
    width: 100%;
  }
  
  .nav-link {
    padding: 0.8rem 0;
    width: 100%;
  }
  
  .user-section {
    margin: 0.5rem 0 0 0;
    width: 100%;
    justify-content: space-between;
    padding-top: 0.5rem;
  }
  
  .brand-name {
    font-size: 1.2rem;
  }
  
  .tagline {
    font-size: 0.75rem;
  }
  
  .brand-logo {
    height: 1.8rem;
  }
}

/* Main content container */
.main-container {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* Page title section */
.page-title {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-300);
}

.page-title h1 {
  font-size: 1.8rem;
  color: var(--neutral);
  margin-bottom: 0.5rem;
}

.breadcrumb {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: '/';
  margin: 0 0.5rem;
  color: var(--gray-500);
}

.breadcrumb-link {
  color: var(--primary-content);
  text-decoration: none;
}

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

.breadcrumb-item:last-child .breadcrumb-link {
  color: var(--gray-600);
  pointer-events: none;
}

/* Card components */
.card {
  background-color: var(--base-100);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  /* overflow hidden removido para não cortar dropdowns custom */
  overflow: hidden;
}
/* Permitir overflow quando necessário (ex: selects custom) */
.card.allow-overflow { overflow: visible; }

.card-header {
  padding: 1rem 1.5rem;
  background-color: var(--base-200);
  border-bottom: 1px solid var(--base-300);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  margin: 0;
  font-size: 1.2rem;
  color: var(--secondary-focus, var(--secondary));
  font-weight: 600;
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  background-color: var(--base-200);
  border-top: 1px solid var(--base-300);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-content);
  border-color: var(--primary);
}

/* Uniform icon button for card headers */
.header-icon-btn {
  --_size: 32px;
  width: var(--_size);
  height: var(--_size);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px; /* icon size */
  line-height: 1;
  border-radius: 6px;
  flex: 0 0 var(--_size);
}
.header-icon-btn i { 
  pointer-events:none; 
  display:block; /* remove inline vertical baseline quirks */
  line-height:1; 
  transform: translateY(1px); /* subtle optical adjustment to center */
}
/* Fine‑tune rotate icon which renders slightly high */
#refresh-activities.header-icon-btn i { transform: translateY(2px); }
/* Compact variation if ever needed */
.header-icon-btn.small { --_size: 28px; font-size:14px; }
/* Ensure outline variants visually balanced when square */
.header-icon-btn.btn-outline-primary,
.header-icon-btn.btn-outline-secondary,
.header-icon-btn.btn-outline-danger { padding:0; }
/* Toggle chevron rotation transition */
.card-toggle-btn i { transition: transform .25s ease; }
button[aria-expanded="false"].card-toggle-btn i.fa-chevron-up { transform: rotate(180deg); }
/* Header filter input align height with icon buttons */
.header-filter-input { 
  height:32px; 
  padding:0 0.65rem; 
  font-size:0.85rem; 
  line-height:1.1; 
  display:inline-block; 
  
}

.btn-primary:hover {
  background-color: var(--primary-focus);
  border-color: var(--primary-focus);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-content);
  border-color: var(--secondary);
}

/* Specific styling for select labels inside modals/popups */
.select-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: -2rem;
  margin-top: 0.5rem;
  color: var(--secondary-focus);
  opacity: 0.85;
}
/* Specific styling for select label groups */
.select-group {
  margin-bottom: 2rem;
}



/* Slight emphasis on focus within a form group */
.select-label:focus, .select-label:hover {
  opacity: 1;
}




.btn-secondary:hover {
  background-color: var(--secondary-focus);
  border-color: var(--secondary-focus);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover {
  background-color: var(--primary);
  color: var(--primary-content);
}

.btn-accent {
  background-color: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-accent:hover {
  background-color: #00b090;
  border-color: #00b090;
}

.btn i {
  margin-right: 0.5rem;
}

/* Link-styled button (themed) */
.btn-link {
  background: transparent;
  border: none;
  color: var(--primary);
  padding: 0;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
.btn-link:hover {
  text-decoration: underline;
  color: var(--primary-focus);
}
.btn-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn.btn-link {
  /* Ensure link appearance even if combined with .btn */
  padding: 0;
  border: none;
}

/* Icon-only small action buttons (Quiver table, etc.) */
.btn-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: .65rem;
  padding: 0;
  border: 1px solid var(--base-300);
  background: linear-gradient(135deg, rgba(var(--primary-rgb,14,165,233),0.08), rgba(var(--secondary-rgb,252,111,96),0.08));
  color: var(--primary);
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, transform .18s ease;
  position: relative;
}
.btn-icon i { margin: 0; font-size: .9rem; pointer-events: none; }
.btn-icon:hover {
  background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.18), rgba(var(--secondary-rgb,252,111,96),0.18));
  border-color: var(--primary);
}
.btn-icon:active { transform: scale(.92); }
.btn-icon:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Delete / danger variant */
.btn-icon.delete {
  color: #dc2626;
  border-color: #fca5a5;
  background: linear-gradient(135deg, rgba(220,38,38,0.10), rgba(220,38,38,0.04));
}
.btn-icon.delete:hover {
  background: linear-gradient(135deg, rgba(220,38,38,0.18), rgba(220,38,38,0.08));
  border-color: #ef4444;
  color: #b91c1c;
}
.btn-icon.delete:active { transform: scale(.9); }

/* Dark theme adjustments */
:root[data-theme$='_dark'] .btn-icon {
  background: linear-gradient(135deg, rgba(var(--base-100-rgb,15,23,42),0.55), rgba(var(--base-100-rgb,15,23,42),0.35));
  border-color: var(--base-300);
  color: var(--primary-focus);
}
:root[data-theme$='_dark'] .btn-icon:hover {
  background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.25), rgba(var(--secondary-rgb,252,111,96),0.25));
  border-color: var(--primary);
}
:root[data-theme$='_dark'] .btn-icon.delete {
  background: linear-gradient(135deg, rgba(220,38,38,0.18), rgba(220,38,38,0.06));
  border-color: #7f1d1d;
  color: #f87171;
}
:root[data-theme$='_dark'] .btn-icon.delete:hover {
  background: linear-gradient(135deg, rgba(220,38,38,0.28), rgba(220,38,38,0.12));
  border-color: #dc2626;
  color: #fca5a5;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--gray-700);
  background-color: white;
  background-clip: padding-box;
  border: 1px solid var(--gray-400);
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.form-control:focus {
  color: var(--gray-700);
  background-color: white;
  border-color: var(--primary-light);
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(0, 86, 179, 0.25);
}

/* Table */
.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  margin-bottom: 1rem;
  color: var(--text);
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  vertical-align: top;
  border-top: 1px solid var(--gray-300);
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--gray-300);
  background-color: var(--gray-100);
  color: var(--secondary);
  font-weight: 600;
}

.table tbody tr:hover {
  background-color: rgba(0, 86, 179, 0.05);
}

/* Footer */
.nexum-footer {
  background-color: var(--base-100);
  color: white;
  padding: 2rem 0;
  margin-top: 3rem;
}

/* Responsive table -> cards on small screens */
@media (max-width: 640px) {
  .table.responsive-cards thead { display: none; }
  .table.responsive-cards,
  .table.responsive-cards tbody,
  .table.responsive-cards tr,
  .table.responsive-cards td { display: block; width: 100%; }
  .table.responsive-cards tr {
    background: var(--base-100);
    border: 1px solid var(--base-300);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
  }
  .table.responsive-cards td {
    border: none !important;
    padding: .35rem 0;
  }
  .table.responsive-cards td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--gray-600);
    display: block;
    margin-bottom: .15rem;
  }
  .table.responsive-cards td.actions-cell {
    margin-top: .25rem;
    text-align: right;
  }
}

/* Quiver specific mobile card ordering */
@media (max-width: 640px) {
  #quiver-table.responsive-cards tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto 1fr auto; /* bottom row sticks to bottom */
    grid-row-gap: 6px;
    column-gap: 8px;
  }
  #quiver-table.responsive-cards td { padding: .25rem 0; }
  #quiver-table.responsive-cards td.card-type { order: 1; grid-column: 1; grid-row: 1; font-weight: 600; margin: 0 .25rem 0 0; align-self: center; }
  #quiver-table.responsive-cards td.card-name { order: 1; grid-column: 2; grid-row: 1; align-self: center; }
  #quiver-table.responsive-cards td.card-uses-inline { order: 1; grid-column: 3; grid-row: 1; white-space: nowrap; color: var(--gray-700); font-size: .95em; align-self: center; }
  #quiver-table.responsive-cards td.card-top-inline { order: 2; grid-column: 1 / -1; grid-row: 2; justify-self: start; white-space: nowrap; color: var(--gray-700); font-size: .95em; display: block; }
  /* Combined metrics (lines 2 and 3) */
  /* No combined metrics now that both are inline on line 1 */
  #quiver-table.responsive-cards td.card-combo-metrics .pair { display: grid; grid-template-rows: auto auto; }
  #quiver-table.responsive-cards td.card-combo-metrics .pair .label { font-weight: 600; color: var(--gray-600); }
  #quiver-table.responsive-cards td.card-combo-metrics .pair .value { margin-top: .1rem; }
  /* Bottom row: created (left) + actions (right) */
  #quiver-table.responsive-cards td.card-created-inline { order: 5; grid-column: 1 / 2; grid-row: 4; justify-self: start; align-self: end; }
  #quiver-table.responsive-cards td.card-created-inline .label { font-weight: 600; color: var(--gray-600); }
  #quiver-table.responsive-cards td.card-created-inline .value { color: var(--base-content); }
  #quiver-table.responsive-cards td.card-actions { order: 5; text-align: right; grid-column: 2 / -1; grid-row: 4; align-self: end; }
  /* Hide desktop-only on mobile and show mobile-only */
  #quiver-table.responsive-cards td.only-desktop { display: none !important; }
  #quiver-table.responsive-cards td.only-mobile { display: block !important; }
  /* Remove generic data-label blocks inside quiver mobile card */
  #quiver-table.responsive-cards td[data-label]::before { display: none; }
  /* Labels styling for inline uses/top like dates */
  #quiver-table.responsive-cards td.card-uses-inline .label,
  #quiver-table.responsive-cards td.card-top-inline .label { font-weight: 600; color: var(--gray-600); }
  #quiver-table.responsive-cards td.card-uses-inline .value,
  #quiver-table.responsive-cards td.card-top-inline .value { color: var(--base-content); }
}

/* Desktop default: hide mobile-only cells */
#quiver-table td.only-mobile { display: none; }

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.footer-brand {
  margin-bottom: 1.5rem;
}

.footer-brand img {
  height: 2rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  color: var(--gray-400);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}
.footer-brand h3 {
  color: var(--secondary);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.footer-links h4 {
  color: var(--secondary);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--base-content);
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--secondary);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  width: 100%;
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* Loader */
.loader {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 86, 179, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

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

/* Helper classes */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-accent { color: var(--accent); }
.text-light { color: var(--light); }
.text-dark { color: var(--dark); }
.text-muted { color: var(--gray-600); }

.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-accent { background-color: var(--accent); }
.bg-light { background-color: var(--light); }
.bg-dark { background-color: var(--dark); }

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.rounded { border-radius: var(--border-radius); }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Map playback controls */
.map-container {
  position: relative;
}

#playback-controls {
  transition: opacity 0.3s ease;
}

#playback-controls:hover {
  opacity: 1 !important;
}

#playback-controls button {
  margin: 0 2px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  line-height: 1;
  position: relative;
}

#playback-controls button i {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  line-height: 1;
}

#playback-controls .btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
}

#playback-controls .btn-secondary {
  background-color: var(--secondary);
  border-color: var(--secondary);
}

#playback-controls button:active,
#playback-controls button:focus {
  outline: none;
  box-shadow: none;
  transform: scale(0.95);
}

#playback-controls button:active i,
#playback-controls button:focus i {
  transform: translate(-50%, -50%);
}

#playback-controls input[type="range"] {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

#playback-controls input[type="range"]::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  background-color: white;
  border-radius: 50%;
  cursor: pointer;
}

#playback-controls input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background-color: white;
  border-radius: 50%;
  cursor: pointer;
}

#playback-controls .playback-buttons-group {
  display: flex;
  align-items: center;
  justify-content: center;
}

#playback-controls .playback-buttons-group button {
  margin: 0 3px;
}

/* On mobile, ensure the controls are centered properly */
@media (max-width: 768px) {
  #playback-controls {
    flex-direction: column;
    padding: 8px;
    width: 90%;
    max-width: 300px;
  }
  

  
  #playback-controls > div {
    width: 100%;
  }
  
  #playback-controls input[type="range"] {
    width: 100%;
  }
  
  .speed-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .speed-control input[type="range"] {
    flex: 1;
    margin: 0 8px;
  }
  
  .playback-buttons-group {
    justify-content: center;
    margin-bottom: 10px !important;
  }
}

/* Fix for play/pause button icons alignment */
#play-btn i,
#pause-btn i,
#reset-btn i {
  font-size: 14px;
  display: block;
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  text-align: center;
}

/* Override general button styles that might affect the icons */
.btn i {
  position: static;
  margin-right: 0.5rem;

}

#playback-controls .btn i {
  position: absolute;
  margin-right: 0;
}

/* Ensure consistent sizing when buttons are clicked */
#playback-controls button:active {
  transform: scale(0.95);
}

#playback-controls button:active i {
  transform: translate(-50%, -50%);
}

/* Filter Modal Specific Styles */
#filter-modal.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem 2rem;
  z-index: 1200;
}

#filter-modal .modal-content {
  background: rgba(var(--base-100-rgb,255,255,255),0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--base-300);
  border-radius: 1rem;
  max-width: 720px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  animation: modalFade .25s ease;
  display: flex;
  flex-direction: column;
}

#filter-modal .modal-header {
  padding: 1rem 1.25rem .75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--base-300);
}

#filter-modal .modal-header h2 { margin: 0; font-size: 1.15rem; color: var(--secondary-focus); }

#filter-modal .modal-body { padding: .75rem 1.25rem 1.25rem; overflow-y: auto; max-height: 60vh; }

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

#filter-modal .user-checkboxes {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  background-color: rgba(var(--base-100-rgb,255,255,255),0.65);
  border-radius: .75rem;
  margin-top: 5px;
  border: 1px solid var(--base-300);
  width: 100%;
  -webkit-overflow-scrolling: touch; /* Para melhor rolagem em dispositivos iOS */
}

#filter-modal .user-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  table-layout: fixed;
}

#filter-modal .user-row {
  background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.07), rgba(var(--secondary-rgb,252,111,96),0.07));
  transition: var(--transition);
  border-radius: 8px;
  height: 40px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  margin-bottom: 3px;
  border: 1px solid transparent;
}

#filter-modal .user-row:hover { background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.12), rgba(var(--secondary-rgb,252,111,96),0.12)); }

#filter-modal .user-row td {
  padding: 8px 6px;
  vertical-align: middle;
}

#filter-modal .checkbox-cell {
  width: 24px;
  text-align: center;
  padding-left: 10px;
}

#filter-modal .color-cell {
  width: 30px;
  text-align: center;
}

#filter-modal .name-cell {
  width: auto;
  padding-right: 10px;
}

#filter-modal .user-row.checked {
  background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.18), rgba(var(--secondary-rgb,252,111,96),0.18));
  border-left: 4px solid var(--primary);
  border-color: var(--primary);
}

#filter-modal .user-row.checked .user-name {
  color: var(--primary-dark);
  font-weight: 600;
}

#filter-modal input[type="checkbox"] {
  cursor: pointer;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--primary);
  transition: all 0.2s ease;
}

#filter-modal .user-color-box {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.1);
  display: inline-block;
  vertical-align: middle;
}

#filter-modal .user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  display: block;
  color: var(--gray-800);
  font-weight: 500;
}

#filter-btn {
  display: flex;
  align-items: center;
  gap: 5px;
}

.close-modal {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-600);
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.close-modal:hover {
  color: var(--gray-800);
}

#select-all-riders {
  font-size: 0.85rem;
  padding: 4px 10px;
  background-color: var(--primary);
  color: white;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

#select-all-riders:hover {
  background-color: var(--primary-dark);
}

/* Destaque para a linha que está sendo selecionada */
#filter-modal .user-row:active { background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.25), rgba(var(--secondary-rgb,252,111,96),0.25)); }

/* Dark theme refinements */
:root[data-theme$='_dark'] #filter-modal .modal-content { background: rgba(var(--base-100-rgb,15,23,42),0.78); border-color: var(--base-300); }
:root[data-theme$='_dark'] #filter-modal .user-checkboxes { background: rgba(var(--base-100-rgb,15,23,42),0.55); }
:root[data-theme$='_dark'] #filter-modal .user-row { background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.10), rgba(var(--secondary-rgb,252,111,96),0.10)); }
:root[data-theme$='_dark'] #filter-modal .user-row:hover { background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.20), rgba(var(--secondary-rgb,252,111,96),0.20)); }
:root[data-theme$='_dark'] #filter-modal .user-row.checked { background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.28), rgba(var(--secondary-rgb,252,111,96),0.28)); }

/* Upload Modal (GPX) Themed */
#edit-activity-modal.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(6px);
  z-index: 1250;
  display: none;
  overflow-y: auto;
  padding: 3.2rem 1rem 2rem;
}

#edit-activity-modal .modal-content {
  background: rgba(var(--base-100-rgb,255,255,255),0.85);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--base-300);
  border-radius: 1.05rem;
  width: 100%;
  margin: 0 auto 2rem;
  box-shadow: 0 10px 32px -6px rgba(0,0,0,0.22);
  animation: modalFade .28s ease;
  display:flex;
  flex-direction:column;
}

#edit-activity-modal .modal-header { padding: 1rem 1.25rem .6rem; border-bottom:1px solid var(--base-300); display:flex; align-items:center; justify-content:space-between; }
#edit-activity-modal .modal-title { margin:0; font-size:1.05rem; font-weight:600; color: var(--secondary-focus); }
#edit-activity-modal .modal-body { padding: .9rem 1.25rem 1.2rem; }
#edit-activity-modal .modal-footer { padding: .75rem 1.25rem 1rem; border-top:1px solid var(--base-300); display:flex; gap:.6rem; justify-content:flex-end; }

#edit-activity-modal .close { background:transparent; border:0; font-size:1.2rem; cursor:pointer; width:34px; height:34px; display:flex; align-items:center; justify-content:center; border-radius:10px; color: var(--base-content); transition: background .25s, border-color .25s, transform .18s; }
#edit-activity-modal .close:hover { background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.18), rgba(var(--secondary-rgb,252,111,96),0.18)); }
#edit-activity-modal .close:active { transform: scale(.9); }

#edit-activity-modal input.form-control, #edit-activity-modal select.form-control { font-size:.85rem; }
#edit-activity-modal label { font-size:.75rem; font-weight:600; color: var(--gray-700); letter-spacing:.3px; }
#edit-activity-modal .form-group { margin-bottom: .85rem; }

#edit-modal-loading { font-size:.8rem; color: var(--gray-600); }
#edit-modal-loading .loader { width:22px; height:22px; border:3px solid rgba(var(--primary-rgb,14,165,233),0.25); border-top-color: var(--primary); border-radius:50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg);} }

#edit-activity-modal .themed-select .ts-trigger { padding:.5rem .85rem; min-height:40px; }
#edit-activity-modal .themed-select .ts-options { max-height:210px; }

:root[data-theme$='_dark'] #edit-activity-modal .modal-content { background: rgba(var(--base-100-rgb,15,23,42),0.78); border-color: var(--base-300); box-shadow: 0 12px 40px -6px rgba(0,0,0,0.55); }
:root[data-theme$='_dark'] #edit-activity-modal label { color: var(--gray-600); }
:root[data-theme$='_dark'] #edit-modal-loading { color: var(--gray-500); }

#edit-activity-modal .btn-primary { --btn-bg: var(--primary); --btn-bg-hover: var(--primary-focus); background: var(--btn-bg); border-color: var(--primary); }
#edit-activity-modal .btn-primary:hover { background: var(--btn-bg-hover); }
#edit-activity-modal .btn-outline-secondary { border-color: var(--base-300); }
#edit-activity-modal .btn-outline-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* Tighten vertical spacing for rows */
#edit-activity-modal .row.g-3 { --bs-gutter-y: .5rem; }
#upload-modal.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  z-index: 1300;
  display: none;
  overflow-y: auto;
  padding: 3.5rem 1rem 2rem;
}

#upload-modal .upload-modal-content {
  background: rgba(var(--base-100-rgb,255,255,255),0.85);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--base-300);
  border-radius: 1.1rem;
  width: 100%;
  max-width: 760px;
  margin: 0 auto 2rem;
  box-shadow: 0 10px 32px -6px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  animation: modalFade .28s ease;
}

#upload-modal .modal-header {
  padding: 1rem 1.25rem .75rem;
  border-bottom: 1px solid var(--base-300);
  position:relative;
}
#upload-modal .modal-header h2 { margin:0; font-size:1.2rem; color: var(--secondary-focus); }

/* Close button (X) top-right themed */
#upload-modal .modal-header .close-modal {
  position:absolute;
  top:.65rem;
  right:.75rem;
  background: linear-gradient(145deg, rgba(var(--base-100-rgb,255,255,255),0.18), rgba(var(--base-100-rgb,255,255,255),0.05));
  border:1px solid var(--base-300);
  color: var(--base-content);
  width:34px; height:34px;
  display:flex; align-items:center; justify-content:center;
  border-radius:10px;
  font-size:1.05rem;
  cursor:pointer;
  line-height:1;
  padding:0;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, transform .18s ease;
}
#upload-modal .modal-header .close-modal:hover {
  background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.18), rgba(var(--secondary-rgb,252,111,96),0.18));
  border-color: var(--primary);
}
#upload-modal .modal-header .close-modal:active { transform: scale(.94); }
:root[data-theme$='_dark'] #upload-modal .modal-header .close-modal {
  background: linear-gradient(145deg, rgba(var(--base-100-rgb,15,23,42),0.42), rgba(var(--base-100-rgb,15,23,42),0.15));
  border-color: var(--base-300);
}
:root[data-theme$='_dark'] #upload-modal .modal-header .close-modal:hover {
  background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.25), rgba(var(--secondary-rgb,252,111,96),0.22));
}

#upload-modal .modal-body { padding: .9rem 1.25rem 1.4rem; }

#upload-modal .form-group { margin-bottom: 1rem; }
#upload-modal .form-label { font-weight:600; font-size:.85rem; color: var(--gray-700); }

#upload-modal input.form-control, #upload-modal select.form-control { font-size:.9rem; }

/* Custom GPX file input */
#upload-modal .file-input { position:relative; display:flex; align-items:center; gap:.75rem; background: rgba(var(--base-100-rgb,255,255,255),0.65); border:1px solid var(--base-300); border-radius:.6rem; padding:.4rem .75rem; backdrop-filter: blur(6px) saturate(1.1); }
:root[data-theme$='_dark'] #upload-modal .file-input { background: rgba(var(--base-100-rgb,15,23,42),0.55); }
#upload-modal .file-input input[type=file] { position:absolute; inset:0; opacity:0; pointer-events:none; }
#upload-modal .file-input .file-picker-trigger { width:40px; height:40px; display:flex; align-items:center; justify-content:center; border-radius:.55rem; border:1px solid var(--base-300); background: linear-gradient(135deg, rgba(var(--base-100-rgb,255,255,255),0.75), rgba(var(--base-100-rgb,255,255,255),0.35)); color: var(--primary); font-size:1.05rem; cursor:pointer; transition: background .25s ease, border-color .25s ease, box-shadow .25s ease, transform .18s ease; }
:root[data-theme$='_dark'] #upload-modal .file-input .file-picker-trigger { background: linear-gradient(135deg, rgba(var(--base-100-rgb,15,23,42),0.8), rgba(var(--base-100-rgb,15,23,42),0.35)); color: var(--primary-focus); }
#upload-modal .file-input .file-picker-trigger:hover { border-color: var(--primary); box-shadow:0 0 0 2px rgba(var(--primary-rgb,14,165,233),0.35); }
#upload-modal .file-input .file-picker-trigger:active { transform: scale(.9); }
#upload-modal .file-input .file-chosen { flex:1; font-size:.8rem; color: var(--gray-600); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
:root[data-theme$='_dark'] #upload-modal .file-input .file-chosen { color: var(--gray-500); }

#upload-modal .equipment-section { margin-top:1.25rem; padding-top:1rem; border-top:1px solid var(--base-300); }
#upload-modal .equipment-section h3 { margin:0 0 .75rem 0; font-size:1rem; color: var(--primary); }

/* Progress */
.upload-progress-container { margin-top:1rem; }
.upload-progress-container .progress { width:100%; background: var(--base-200); border-radius: 6px; height: 20px; overflow:hidden; position: relative; box-shadow: inset 0 0 0 1px var(--base-300); }
.upload-progress-container .progress-bar { width:0%; height:100%; background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%); color: var(--primary-content,#fff); font-size:.65rem; display:flex; align-items:center; justify-content:center; font-weight:600; letter-spacing:.5px; transition: width .25s ease; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.upload-progress-status { display:block; margin-top:4px; font-size:.7rem; color: var(--gray-600); }

/* Error + retry */
.refdata-error { color: var(--error); margin-top:.75rem; font-size:.75rem; font-weight:500; }
.retry-refdata-btn { margin-left:6px; padding:2px 8px; font-size:.65rem; }

/* Dark adjustments */
:root[data-theme$='_dark'] #upload-modal .upload-modal-content { background: rgba(var(--base-100-rgb,15,23,42),0.78); border-color: var(--base-300); box-shadow: 0 12px 40px -6px rgba(0,0,0,0.55); }
:root[data-theme$='_dark'] #upload-modal .form-label { color: var(--gray-600); }
:root[data-theme$='_dark'] .upload-progress-container .progress { background: var(--base-200); }
:root[data-theme$='_dark'] .upload-progress-status { color: var(--gray-600); }

/* Equipment Modal (Quiver) Themed */
#equipment-modal.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.40);
  backdrop-filter: blur(6px);
  z-index: 1260;
  display: none;
  overflow-y: auto;
  padding: 3.2rem 1rem 2rem;
}

#equipment-modal .modal-content {
  background: rgba(var(--base-100-rgb,255,255,255),0.85);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--base-300);
  border-radius: 1.05rem;
  width: 100%;
  max-width: 560px;
  margin: 0 auto 2rem;
  box-shadow: 0 10px 32px -6px rgba(0,0,0,0.22);
  animation: modalFade .28s ease;
  display:flex;
  flex-direction:column;
}

#equipment-modal .modal-header { padding: 1rem 1.1rem .6rem; border-bottom:1px solid var(--base-300); display:flex; align-items:center; justify-content:space-between; }
#equipment-modal .modal-header h2 { margin:0; font-size:1.05rem; font-weight:600; color: var(--secondary-focus); }
#equipment-modal .modal-body { padding: .9rem 1.1rem 1.2rem; }

#equipment-modal .close-modal { background:transparent; border:0; font-size:1.1rem; cursor:pointer; width:34px; height:34px; display:flex; align-items:center; justify-content:center; border-radius:10px; color: var(--base-content); transition: background .25s, border-color .25s, transform .18s; }
#equipment-modal .close-modal:hover { background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.18), rgba(var(--secondary-rgb,252,111,96),0.18)); }
#equipment-modal .close-modal:active { transform: scale(.9); }


#equipment-modal input.form-control, #equipment-modal select.form-control, #equipment-modal textarea.form-control { font-size:.85rem; }
#equipment-modal textarea.form-control { resize: vertical; min-height: 90px; }

#equipment-modal .btn-primary { background: var(--primary); border-color: var(--primary); }
#equipment-modal .btn-primary:hover { background: var(--primary-focus); border-color: var(--primary-focus); }
#equipment-modal .btn-secondary { background: var(--secondary); border-color: var(--secondary); color: var(--secondary-content); }
#equipment-modal .btn-secondary:hover { background: var(--secondary-focus); border-color: var(--secondary-focus); }

/* Dark theme adjustments */
:root[data-theme$='_dark'] #equipment-modal .modal-content { background: rgba(var(--base-100-rgb,15,23,42),0.78); border-color: var(--base-300); box-shadow: 0 12px 40px -6px rgba(0,0,0,0.55); }

:root[data-theme$='_dark'] #equipment-modal .btn-secondary { background: var(--secondary); }

/* Spots Admin Modals (Edit/Add Spot + Delete) */
#spot-modal.modal.fade, #delete-modal.modal.fade {
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  padding: 3.2rem 1rem 2.2rem;
}
#spot-modal .modal-dialog, #delete-modal .modal-dialog { max-width: 760px; }
#spot-modal .modal-content, #delete-modal .modal-content {
  background: rgba(var(--base-100-rgb,255,255,255),0.88);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--base-300);
  border-radius: 1rem;
  box-shadow: 0 10px 32px -6px rgba(0,0,0,0.25);
  animation: modalFade .25s ease;
}
#spot-modal .modal-header, #delete-modal .modal-header { border-bottom: 1px solid var(--base-300); padding: .9rem 1.1rem .6rem; }
#spot-modal .modal-title, #delete-modal .modal-title { font-size: 1.05rem; font-weight: 600; color: var(--secondary-focus); }
#spot-modal .modal-body, #delete-modal .modal-body { padding: .9rem 1.1rem 1.15rem; }
#spot-modal .modal-footer, #delete-modal .modal-footer { border-top: 1px solid var(--base-300); padding: .7rem 1.1rem .9rem; display:flex; gap:.6rem; }
#spot-modal .btn-close, #delete-modal .btn-close {
  background: linear-gradient(145deg, rgba(var(--base-100-rgb,255,255,255),0.25), rgba(var(--base-100-rgb,255,255,255),0.1));
  border: 1px solid var(--base-300);
  border-radius: .65rem;
  width: 34px; height: 34px; opacity: 1;
  transition: background .25s, border-color .25s, transform .18s;
}
#spot-modal .btn-close:hover, #delete-modal .btn-close:hover { background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.22), rgba(var(--secondary-rgb,252,111,96),0.22)); border-color: var(--primary); }
#spot-modal .btn-close:active, #delete-modal .btn-close:active { transform: scale(.9); }
#spot-modal label.select-label { font-size:.72rem; font-weight:600; color: var(--secondary-focus); letter-spacing:.35px; margin-bottom:.25rem; }
#spot-modal .form-control { font-size:.85rem; }
#spot-modal small.text-muted { font-size:.65rem; opacity:.8; }
#modal-map { background: rgba(var(--base-100-rgb,255,255,255),0.65); border: 1px solid var(--base-300) !important; border-radius: .85rem !important; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); overflow:hidden; }
#spot-modal h6 { font-size:.75rem; font-weight:600; letter-spacing:.4px; color: var(--primary); text-transform: uppercase; }
#spot-modal .btn-primary, #delete-modal .btn-primary { background: var(--primary); border-color: var(--primary); }
#spot-modal .btn-primary:hover, #delete-modal .btn-primary:hover { background: var(--primary-focus); border-color: var(--primary-focus); }
#spot-modal .btn-secondary, #delete-modal .btn-secondary { background: var(--secondary); border-color: var(--secondary); color: var(--secondary-content); }
#spot-modal .btn-secondary:hover, #delete-modal .btn-secondary:hover { background: var(--secondary-focus); border-color: var(--secondary-focus); }
#delete-modal .btn-danger { background: linear-gradient(135deg, #dc2626, #b91c1c); border-color:#dc2626; }
#delete-modal .btn-danger:hover { background: linear-gradient(135deg, #ef4444, #b91c1c); border-color:#b91c1c; }
:root[data-theme$='_dark'] #spot-modal .modal-content, :root[data-theme$='_dark'] #delete-modal .modal-content { background: rgba(var(--base-100-rgb,15,23,42),0.8); border-color: var(--base-300); box-shadow: 0 12px 40px -6px rgba(0,0,0,0.55); }
:root[data-theme$='_dark'] #spot-modal .btn-close, :root[data-theme$='_dark'] #delete-modal .btn-close { background: linear-gradient(145deg, rgba(var(--base-100-rgb,15,23,42),0.45), rgba(var(--base-100-rgb,15,23,42),0.18)); border-color: var(--base-300); }
:root[data-theme$='_dark'] #spot-modal .btn-close:hover, :root[data-theme$='_dark'] #delete-modal .btn-close:hover { background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.25), rgba(var(--secondary-rgb,252,111,96),0.25)); border-color: var(--primary); }
:root[data-theme$='_dark'] #spot-modal label.select-label { color: var(--gray-600); }
:root[data-theme$='_dark'] #modal-map { background: rgba(var(--base-100-rgb,15,23,42),0.55); border-color: var(--base-300) !important; }
:root[data-theme$='_dark'] #delete-modal .btn-danger { background: linear-gradient(135deg, #dc2626, #7f1d1d); }
:root[data-theme$='_dark'] #delete-modal .btn-danger:hover { background: linear-gradient(135deg, #f87171, #7f1d1d); }

/* Activity details themed delete panel */
#delete-theme-panel.modal { background: rgba(0,0,0,0.45); backdrop-filter: blur(6px); padding: 3.2rem 1rem 2.2rem; }
#delete-theme-panel .modal-dialog { max-width: 520px; }
#delete-theme-panel .modal-content {
  background: rgba(var(--base-100-rgb,255,255,255),0.88);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--base-300);
  border-radius: 1rem;
  box-shadow: 0 10px 32px -6px rgba(0,0,0,0.25);
  animation: modalFade .25s ease;
}
#delete-theme-panel .modal-header { border-bottom:1px solid var(--base-300); padding: .9rem 1.1rem .6rem; }
#delete-theme-panel .modal-title { font-size:1.05rem; font-weight:600; color: var(--secondary-focus); }
#delete-theme-panel .modal-body { padding: .9rem 1.1rem 1.15rem; }
#delete-theme-panel .modal-footer { border-top:1px solid var(--base-300); padding: .7rem 1.1rem .9rem; display:flex; gap:.6rem; justify-content:center; }
#delete-theme-panel .btn-danger { background: var(--danger, #dc2626); border-color: var(--danger, #dc2626); color: var(--danger-content, #fff); }
#delete-theme-panel .btn-danger:hover { background: var(--danger-focus, #b91c1c); border-color: var(--danger-focus, #b91c1c); }
:root[data-theme$='_dark'] #delete-theme-panel .modal-content { background: rgba(var(--base-100-rgb,15,23,42),0.8); border-color: var(--base-300); box-shadow: 0 12px 40px -6px rgba(0,0,0,0.55); }
:root[data-theme$='_dark'] #delete-theme-panel .btn-danger { background: var(--danger, #dc2626); border-color: var(--danger, #7f1d1d); }
:root[data-theme$='_dark'] #delete-theme-panel .btn-danger:hover { background: var(--danger-focus, #f87171); }

/* Delete panel utility classes (no inline styles) */
#delete-theme-panel[hidden] { display:none; }
.modal-dialog-delete { max-width:520px; }
.modal-content-delete { background: var(--card-bg, var(--base-100)); color: var(--text, var(--base-content)); border: 1px solid var(--muted-border, var(--base-300)); }
.modal-body-centered { text-align:center; background: transparent; }
.delete-panel-content { display:flex; flex-direction:column; align-items:center; gap:10px; padding:12px; }
.delete-icon-lg { font-size:48px; color: var(--primary); }
.delete-activity-name { margin:0 0 6px 0; color: var(--text, var(--base-content)); font-size:1.1rem; font-weight:600; }
.delete-activity-message { margin:0; color: var(--muted, var(--gray-600)); font-size:.8rem; line-height:1.3; }
.delete-footer { display:flex; justify-content:center; gap:8px; border-top:1px solid var(--muted-border, var(--base-300)); background:transparent; }
:root[data-theme$='_dark'] .modal-content-delete { background: rgba(var(--base-100-rgb,15,23,42),0.80); }
:root[data-theme$='_dark'] .delete-activity-message { color: var(--gray-500); }

/* Modalidades Admin Modals */
#modalidade-modal.modal.fade { background: rgba(0,0,0,0.45); backdrop-filter: blur(6px); padding: 3.2rem 1rem 2.2rem; }
#modalidade-modal .modal-dialog { max-width: 720px; }
#modalidade-modal .modal-content { background: rgba(var(--base-100-rgb,255,255,255),0.88); backdrop-filter: blur(14px) saturate(1.2); border:1px solid var(--base-300); border-radius:1rem; box-shadow:0 10px 32px -6px rgba(0,0,0,0.25); animation: modalFade .25s ease; }
#modalidade-modal .modal-header { border-bottom:1px solid var(--base-300); padding:.9rem 1.1rem .6rem; }
#modalidade-modal .modal-title { font-size:1.05rem; font-weight:600; color: var(--secondary-focus); }
#modalidade-modal .modal-body { padding:.9rem 1.1rem 1.15rem; }
#modalidade-modal .modal-footer { border-top:1px solid var(--base-300); padding:.7rem 1.1rem .9rem; display:flex; gap:.6rem; }
#modalidade-modal .btn-close { background: linear-gradient(145deg, rgba(var(--base-100-rgb,255,255,255),0.25), rgba(var(--base-100-rgb,255,255,255),0.1)); border:1px solid var(--base-300); border-radius:.65rem; width:34px; height:34px; opacity:1; transition: background .25s, border-color .25s, transform .18s; }
#modalidade-modal .btn-close:hover { background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.22), rgba(var(--secondary-rgb,252,111,96),0.22)); border-color: var(--primary); }
#modalidade-modal .btn-close:active { transform: scale(.9); }
#modalidade-modal label.select-label { font-size:.72rem; font-weight:600; letter-spacing:.35px; margin-bottom:.25rem; color: var(--secondary-focus); }
#modalidade-modal .form-control { font-size:.85rem; }
#modalidade-modal .icon-preview { background: linear-gradient(135deg, rgba(var(--primary-rgb,14,165,233),0.10), rgba(var(--secondary-rgb,252,111,96),0.10)); border:1px solid var(--base-300); border-radius:.75rem; padding:.75rem; }
#modalidade-modal .icon-option { border:1px solid var(--base-300); border-radius:.65rem; background: rgba(var(--base-100-rgb,255,255,255),0.65); transition: background .25s, border-color .25s, transform .18s; }
#modalidade-modal .icon-option:hover { background: linear-gradient(135deg, rgba(var(--primary-rgb,14,165,233),0.12), rgba(var(--secondary-rgb,252,111,96),0.12)); border-color: var(--primary); }
#modalidade-modal .icon-option.selected { background: linear-gradient(135deg, rgba(var(--primary-rgb,14,165,233),0.22), rgba(var(--secondary-rgb,252,111,96),0.22)); border-color: var(--primary); }
#modalidade-modal .btn-primary { background: var(--primary); border-color: var(--primary); }
#modalidade-modal .btn-primary:hover { background: var(--primary-focus); border-color: var(--primary-focus); }
#modalidade-modal .btn-secondary { background: var(--secondary); border-color: var(--secondary); color: var(--secondary-content); }
#modalidade-modal .btn-secondary:hover { background: var(--secondary-focus); border-color: var(--secondary-focus); }

/* Dark theme adjustments for modalidades */
:root[data-theme$='_dark'] #modalidade-modal .modal-content { background: rgba(var(--base-100-rgb,15,23,42),0.80); border-color: var(--base-300); box-shadow:0 12px 40px -6px rgba(0,0,0,0.55); }
:root[data-theme$='_dark'] #modalidade-modal .btn-close { background: linear-gradient(145deg, rgba(var(--base-100-rgb,15,23,42),0.45), rgba(var(--base-100-rgb,15,23,42),0.18)); border-color: var(--base-300); }
:root[data-theme$='_dark'] #modalidade-modal .btn-close:hover { background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.25), rgba(var(--secondary-rgb,252,111,96),0.25)); border-color: var(--primary); }
:root[data-theme$='_dark'] #modalidade-modal label.select-label { color: var(--gray-600); }
:root[data-theme$='_dark'] #modalidade-modal .icon-option { background: linear-gradient(135deg, rgba(var(--base-100-rgb,15,23,42),0.55), rgba(var(--base-100-rgb,15,23,42),0.35)); border-color: var(--base-300); }
:root[data-theme$='_dark'] #modalidade-modal .icon-option.selected { background: linear-gradient(135deg, rgba(var(--primary-rgb,14,165,233),0.30), rgba(var(--secondary-rgb,252,111,96),0.30)); border-color: var(--primary); }


/* Teams: Edit Team Modal (Bootstrap) themed */
#editTeamModal.modal.fade {
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  padding: 3.2rem 1rem 2.2rem;
}
#editTeamModal .modal-dialog { max-width: 640px; }
#editTeamModal .modal-content {
  background: rgba(var(--base-100-rgb,255,255,255),0.88);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--base-300);
  border-radius: 1rem;
  box-shadow: 0 10px 32px -6px rgba(0,0,0,0.25);
  animation: modalFade .25s ease;
  color: var(--base-content);
}
#editTeamModal .modal-header { border-bottom: 1px solid var(--base-300); padding: .9rem 1.1rem .6rem; }
#editTeamModal .modal-title { font-size: 1.05rem; font-weight: 600; color: var(--secondary-focus); }
#editTeamModal .modal-body { padding: .9rem 1.1rem 1.15rem; }
#editTeamModal .modal-footer { border-top: 1px solid var(--base-300); padding: .7rem 1.1rem .9rem; display:flex; gap:.6rem; }
#editTeamModal .btn-close {
  background: linear-gradient(145deg, rgba(var(--base-100-rgb,255,255,255),0.25), rgba(var(--base-100-rgb,255,255,255),0.1));
  border: 1px solid var(--base-300);
  border-radius: .65rem;
  width: 34px; height: 34px; opacity: 1;
  transition: background .25s, border-color .25s, transform .18s;
}
#editTeamModal .btn-close:hover { background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.22), rgba(var(--secondary-rgb,252,111,96),0.22)); border-color: var(--primary); }
#editTeamModal .btn-close:active { transform: scale(.9); }

/* Themed form controls inside modal */
#editTeamModal .form-label { font-size:.85rem; font-weight:600; color: var(--gray-700); }
#editTeamModal .form-control { background: var(--base-100); color: var(--base-content); border: 1px solid var(--base-300); }
#editTeamModal .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(var(--primary-rgb,14,165,233),0.35); }
#editTeamModal .form-select { background: var(--base-100); color: var(--base-content); border: 1px solid var(--base-300); }
#editTeamModal .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(var(--primary-rgb,14,165,233),0.35); }

/* Dark theme adjustments */
:root[data-theme$='_dark'] #editTeamModal .modal-content { background: rgba(var(--base-100-rgb,15,23,42),0.80); border-color: var(--base-300); box-shadow: 0 12px 40px -6px rgba(0,0,0,0.55); }
:root[data-theme$='_dark'] #editTeamModal .btn-close {
  background: linear-gradient(145deg, rgba(var(--base-100-rgb,15,23,42),0.45), rgba(var(--base-100-rgb,15,23,42),0.18));
  border-color: var(--base-300);
}
:root[data-theme$='_dark'] #editTeamModal .btn-close:hover { background: linear-gradient(145deg, rgba(var(--primary-rgb,14,165,233),0.25), rgba(var(--secondary-rgb,252,111,96),0.25)); }
:root[data-theme$='_dark'] #editTeamModal .form-label { color: var(--gray-600); }
:root[data-theme$='_dark'] #editTeamModal .form-control,
:root[data-theme$='_dark'] #editTeamModal .form-select { background: var(--base-200); border-color: var(--base-300); }
:root[data-theme$='_dark'] #editTeamModal .form-control:focus,
:root[data-theme$='_dark'] #editTeamModal .form-select:focus { border-color: var(--primary-focus); box-shadow: 0 0 0 2px rgba(var(--primary-rgb,14,165,233),0.45); }



/* Activity Map Styles */
#activity-map {
  width: 100%;
  height: 400px;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  overflow: hidden;
}

.leaflet-container {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Stat Boxes for Activity Details */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 1rem;
}

.stat-box {
  background-color: var(--gray-100);
  border-radius: var(--border-radius);
  padding: 15px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.stat-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-box h4 {
  margin-top: 0;
  color: var(--gray-700);
  font-size: 0.9rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.stat-box p {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary);
}

/* Equipment Section */
.equipment-selection {
  margin-bottom: 1.5rem;
}

.equipment-type h4 {
  margin-bottom: 0.5rem;
  color: var(--secondary);
}


@media (max-width: 576px) {
  .header-container,
  .main-container,
  .footer-container {
    padding: 0 1rem;
  }

  .brand-name {
    font-size: 1rem;
  }

  .tagline {
    display: none;
  }

  .nav-link {
    font-size: 0.95rem;
  }

  .card-body {
    padding: 1rem;
  }

  .card-header,
  .card-footer {
    padding: 0.75rem 1rem;
  }

  .page-title h1 {
    font-size: 1.4rem;
  }

  .stat-box h4 {
    font-size: 0.8rem;
  }

  .stat-box p {
    font-size: 1rem;
  }

  .btn {
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
  }

  .table th,
  .table td {
    font-size: 0.85rem;
    padding: 0.5rem;
  }

  .equipment-type h4 {
    font-size: 0.9rem;
  }
}

/* ================= Event View Enhancements ================ */
/* Header flex + CTA (moved from inline styles) */
.ev-header-flex{display:flex;align-items:flex-end;justify-content:space-between;flex-wrap:wrap;gap:1rem;}
.ev-header-left{flex:1 1 auto;min-width:200px;}
.ev-cta-register{background:linear-gradient(135deg,#ff9800,#ff5722);color:#111;font-weight:600;padding:.75rem 1.15rem;border-radius:999px;text-decoration:none;box-shadow:0 4px 14px -4px rgba(0,0,0,.6);font-size:.9rem;letter-spacing:.5px;position:relative;display:inline-flex;align-items:center;gap:.5rem;transition:filter .25s ease,transform .18s ease,box-shadow .28s ease;}
.ev-cta-register:hover{filter:brightness(1.1);} 
.dark-theme .ev-cta-register{color:#fff;}
.ev-cta-register:after{content:'→';font-weight:700;transition:transform .25s ease;}
.ev-cta-register:hover:after{transform:translateX(4px);} 
@media (max-width:640px){ .ev-header-flex{align-items:flex-start;} .ev-cta-register{width:100%;justify-content:center;} }

/* Event notice PDF themed button */
.ev-notice-link{display:inline-flex;align-items:center;gap:.55rem;font-weight:600;text-decoration:none;padding:.6rem 1.05rem;border:1px solid var(--base-300,#31363d);border-radius:12px;background:linear-gradient(135deg,var(--base-200,#24272d),var(--base-100,#1d1f24));box-shadow:0 4px 14px -6px rgba(0,0,0,.55);font-size:.8rem;letter-spacing:.35px;position:relative;line-height:1.1;color:var(--base-content,#fff);transition:background .28s ease,transform .2s ease,box-shadow .28s ease,filter .25s ease;}
.ev-notice-link i{color:#dc2626;font-size:1rem;line-height:1;}
.ev-notice-link:hover{filter:brightness(1.08);box-shadow:0 6px 18px -6px rgba(0,0,0,.65);} 
.ev-notice-link:active{transform:scale(.96);} 
:root[data-theme$='_dark'] .ev-notice-link{background:linear-gradient(135deg,var(--base-200,#24272d),var(--base-300,#31363d));}


  /* Themed form controls (global) */
  .form-control {
    background: var(--base-100);
    color: var(--base-content);
    border: 1px solid var(--base-300);
    box-shadow: 0 0 0 0 rgba(0,0,0,0);
    transition: border-color .2s ease, background-color .25s ease, box-shadow .25s ease;
  }
  .form-control::placeholder { color: var(--gray-500); opacity:.7; }
  .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb,14,165,233),0.35);
    background: var(--base-100);
  }
  :root[data-theme$='_dark'] .form-control {
    background: var(--base-200);
    color: var(--base-content);
    border-color: var(--base-300);
  }
  :root[data-theme$='_dark'] .form-control:focus {
    background: var(--base-200);
    border-color: var(--primary-focus);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb,14,165,233),0.45);
  }

  /* Upload modal specific control treatment */
  #upload-modal .form-control {
    background: rgba(var(--base-100-rgb,255,255,255),0.92);
    border: 1px solid var(--base-300);
    backdrop-filter: blur(2px);
  }
  #upload-modal .form-control:focus { background: rgba(var(--base-100-rgb,255,255,255),1); }
  :root[data-theme$='_dark'] #upload-modal .form-control {
    background: rgba(var(--base-100-rgb,15,23,42),0.65);
    border-color: var(--base-300);
  }
  :root[data-theme$='_dark'] #upload-modal .form-control:focus {
    background: rgba(var(--base-100-rgb,15,23,42),0.8);
  }

  /* Select (combobox) theming */
  select.form-control:not([multiple]) {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.25rem;
    background-image:
      linear-gradient(to bottom, var(--base-100), var(--base-100));
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.2rem 1.2rem;
    position: relative;
  }

  /* Custom caret via pseudo-element container wrapper (auto add if needed) */
  select.form-control:not([multiple])::-ms-expand { display: none; }

  /* Draw caret using layered gradients (CSS only) */
  select.form-control:not([multiple]) {
    background-image:
      linear-gradient(45deg, transparent 50%, var(--gray-600) 51%),
      linear-gradient(-45deg, transparent 50%, var(--gray-600) 51%),
      linear-gradient(to bottom, var(--base-100), var(--base-100));
    background-position:
      right 1rem center,
      right 0.65rem center,
      right 0.75rem center;
    background-size: 0.55rem 0.55rem, 0.55rem 0.55rem, 1.8rem 70%;
    background-repeat: no-repeat;
  }

  select.form-control:hover { border-color: var(--primary); }
  select.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb,14,165,233),0.35);
  }

  /* Option popup (limited browser support) */
  select.form-control option {
    background: var(--base-100);
    color: var(--base-content);
  }
  :root[data-theme$='_dark'] select.form-control option {
    background: var(--base-200);
    color: var(--base-content);
  }
  select.form-control option:checked, select.form-control option:focus {
    background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.25), rgba(var(--secondary-rgb,252,111,96),0.25));
    color: var(--base-content);
  }

  /* High contrast focus for accessibility */
  @media (prefers-contrast: more) {
    select.form-control:focus { box-shadow: 0 0 0 3px var(--primary); }
  }

  /* THEMED CUSTOM SELECT (popup replacement) */
    .themed-select { position: relative; display: block; margin-top:0; }
    /* Tighten vertical rhythm between label and custom select */
    /* Collapse gap: rely on adjacency (works even without :has() support) */
    .form-label + .themed-select { margin-top:-0.2rem; }
  /* Removido margin-top negativo que provocava cortes de dropdown */
   .form-label + .themed-select .ts-trigger { margin-top: -2rem; } 
    /* Slightly reduce label bottom margin only when next is themed-select */
    .form-label:has(+ .themed-select) { margin-bottom:.25rem; }
    /* Upload modal: force tight spacing between labels and custom selects */
    #upload-modal .form-group > .form-label { margin-bottom:.25rem; }
    #upload-modal .form-group > .form-label + .themed-select { margin-top:0 !important; }
    #upload-modal .themed-select .ts-trigger { padding:.44rem .85rem; line-height:1.15; }
  .themed-select select { position: absolute; inset:0; opacity:0; pointer-events:none; }
  .themed-select .ts-trigger {
    width:100%;
    background: var(--base-100);
    color: var(--base-content);
    border:1px solid var(--base-300);
    border-radius: .6rem;
    /* Slightly reduced vertical padding to align better with adjacent labels */
    padding:.5rem .9rem;
    font-size:.9rem;
    line-height:1.2;
    display:flex;
    justify-content:space-between;
    align-items:center;
    cursor:pointer;
    transition: border-color .2s ease, background-color .25s ease, box-shadow .25s ease;
  }
  .themed-select .ts-trigger:hover { border-color: var(--primary); }
  .themed-select.open .ts-trigger, .themed-select .ts-trigger:focus-visible {
    border-color: var(--primary);
    box-shadow:0 0 0 2px rgba(var(--primary-rgb,14,165,233),0.35);
    outline:none;
  }
  .themed-select .ts-trigger .ts-label { flex:1; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .themed-select .ts-trigger .ts-caret { margin-left:.75rem; width:.75rem; height:.75rem; position:relative; }
  .themed-select .ts-trigger .ts-caret::before, .themed-select .ts-trigger .ts-caret::after {
    content:""; position:absolute; inset:0; background: linear-gradient(45deg,var(--gray-600),var(--gray-600));
    clip-path: polygon(50% 65%, 0 0, 100% 0);
    transform-origin:center; transition: transform .25s ease;
  }
  .themed-select.open .ts-trigger .ts-caret::before { transform: rotate(180deg); }

  .ts-options {
    position:absolute; left:0; right:0; top:calc(100% + .35rem);
    background: rgba(var(--base-100-rgb,255,255,255),0.95);
    backdrop-filter: blur(14px) saturate(1.2);
    border:1px solid var(--base-300); border-radius:.8rem; padding:.35rem; margin:0; list-style:none;
    box-shadow:0 12px 32px -8px rgba(0,0,0,0.25);
    max-height: clamp(200px, 32vh, 340px); overflow-y:auto; z-index: 2000;
    display:none;
    animation: tsFade .18s ease;
  }
  .themed-select.open .ts-options { display:block; }
  .ts-options li { padding:.55rem .7rem; border-radius:.55rem; font-size:.85rem; cursor:pointer; display:flex; align-items:center; gap:.5rem; position:relative; }
  .ts-options li[data-selected="true"] { font-weight:600; color: var(--primary); }
  .ts-options li:hover, .ts-options li[aria-activedescendant], .ts-options li:focus { background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.18), rgba(var(--secondary-rgb,252,111,96),0.18)); }
  .ts-options li:active { background: linear-gradient(90deg, rgba(var(--primary-rgb,14,165,233),0.28), rgba(var(--secondary-rgb,252,111,96),0.28)); }

  /* Scrollbar styling */
  .ts-options::-webkit-scrollbar { width:10px; }
  .ts-options::-webkit-scrollbar-track { background: transparent; }
  .ts-options::-webkit-scrollbar-thumb { background: rgba(var(--primary-rgb,14,165,233),0.35); border-radius:6px; }
  .ts-options::-webkit-scrollbar-thumb:hover { background: rgba(var(--primary-rgb,14,165,233),0.55); }

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

  /* Dark theme adjustments */
  :root[data-theme$='_dark'] .themed-select .ts-trigger { background: rgba(var(--base-100-rgb,15,23,42),0.75); }
  /* Overrides finais para garantir nenhum margin-top inesperado */
  /* Remove negative margin - unified spacing */
  .form-label + .themed-select .ts-trigger, :root[data-theme$='_dark'] .form-label + .themed-select .ts-trigger { margin-top: 0 !important; }
  :root[data-theme='classic_dark'] .ts-options { background: rgba(var(--base-100-rgb,15,23,42),0.88); border-color: var(--base-300); }
  :root[data-theme='classic_dark'] .ts-options li[data-selected="true"] { color: var(--primary-focus); }




/* Spacing for buttons in 'Todas as Atividades' panel */
#toggle-filters-btn { margin-right: .6rem; }
.card-header .d-flex.align-items-center .btn + .btn { margin-left: .6rem; }

.darkmode-switch {
  display: inline-block;
  width: 60px;
  height: 34px;
  border-radius: 34px;
  position: relative;
  background-color: #2196F3;
  cursor: pointer;
  transition: background-color 0.4s;
  border: 2px solid #eee;
  background-image:
    radial-gradient(circle, #fefefe 20%, transparent 30%),
    radial-gradient(circle, #fefefe 20%, transparent 30%),
    radial-gradient(circle, #fefefe 20%, transparent 30%),
    radial-gradient(circle, #fefefe 20%, transparent 30%),
    radial-gradient(circle, #fefefe 20%, transparent 30%),
    radial-gradient(circle, #fefefe 20%, transparent 30%);
  background-size:
    50% 50%, 60% 60%, 40% 40%, 40% 40%, 50% 50%, 40% 40%;
  background-position:
    60% 82%, 80% 80%, 82% 80%, 110% 20%, 134% 12%, 130% 20%;
  background-repeat: no-repeat;
}

.darkmode-switch::before {
  content: "";
  position: absolute;
  bottom: 11.76%;
  left: 6.67%;
  width: 43.33%;
  height: 76.47%;
  background-color: #ffeb3b;
  background-image: radial-gradient(circle, #ffc107 15%, #ffeb3b 100%);
  border-radius: 50%;
  box-shadow: 0 0 20px 10px rgba(255, 235, 255, 0.4);
  transition: transform 0.2s ease-in, background-color 0.4s;
  background-repeat: no-repeat;
}

.darkmode .darkmode-switch {
  background-color: #023660;
  background-image:
    radial-gradient(circle, #fff 10%, transparent 30%),
    radial-gradient(circle, #fff 10%, transparent 30%),
    radial-gradient(circle, #fff 10%, transparent 30%),
    radial-gradient(circle, #fff 10%, transparent 30%),
    radial-gradient(circle, #fff 10%, transparent 30%),
    radial-gradient(circle, #fff 10%, transparent 30%),
    radial-gradient(circle, #fff 10%, transparent 30%),
    radial-gradient(circle, #fff 10%, transparent 30%),
    radial-gradient(circle, #fff 10%, transparent 30%);
  background-size:
    8% 8%, 7% 7%, 6% 6%, 8% 8%, 8% 8%, 6% 6%, 6% 6%, 8% 8%, 7% 7%;
  background-position:
    20% 20%, 45% 30%, 25% 55%, 20% 90%, 40% 60%, 5% 50%, 58% 10%, 58% 60%, 50% 80%;
  background-repeat: no-repeat;
}

.darkmode .darkmode-switch::before {
  transform: translateX(100%);
  background-color: #ddd;
  background-image:
    radial-gradient(circle, #c4c4c4 50%, transparent 50%),
    radial-gradient(circle, #c9c9c9 50%, transparent 50%),
    radial-gradient(circle, #c9c9c9 50%, transparent 50%),
    radial-gradient(circle, #c9c9c9 50%, transparent 50%);
  background-size:
    40% 40%, 25% 25%, 50% 50%, 30% 30%;
  background-position:
    20% 20%, 65% 30%, 120% 100%, 20% 80%;
  box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0.2);
}

/* Event Categories Modal Styles */
#category-modal {
  z-index: 1060;
}

#category-modal .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Requirements Modal Styles */
#requirements-modal {
  z-index: 1060;
}

#requirements-modal .modal-backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#requirements-modal .modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  z-index: 1070;
}

#requirements-modal .modal-content {
  background-color: var(--base-100);
  border: 1px solid var(--base-300);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  color: var(--base-content);
}

#requirements-modal .modal-header {
  background-color: var(--base-200);
  border-bottom: 1px solid var(--base-300);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#requirements-modal .modal-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--base-content);
}

#requirements-modal .btn-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--base-content);
  opacity: 0.6;
  transition: opacity 0.2s;
}

#requirements-modal .btn-close:hover { opacity: 1; }

#requirements-modal .modal-body { padding: 1.25rem 1.5rem; }

#requirements-modal .modal-footer {
  background-color: var(--base-200);
  border-top: 1px solid var(--base-300);
  padding: 1rem 1.5rem;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Checkbox styling in Requirements Modal */
#requirements-modal .form-check-label { color: var(--base-content); }
#requirements-modal .form-check-input {
  background-color: var(--base-100);
  border-color: var(--base-300);
}
#requirements-modal .form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

#category-modal .modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  z-index: 1070;
}

#category-modal .modal-content {
  background-color: var(--base-100);
  border: 1px solid var(--base-300);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  color: var(--base-content);
}

#category-modal .modal-header {
  background-color: var(--base-200);
  border-bottom: 1px solid var(--base-300);
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#category-modal .modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--base-content);
}

#category-modal .btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--base-content);
  opacity: 0.6;
  transition: opacity 0.2s;
}

#category-modal .btn-close:hover {
  opacity: 1;
}

#category-modal .modal-body {
  padding: 1.5rem;
}

#category-modal .modal-footer {
  background-color: var(--base-200);
  border-top: 1px solid var(--base-300);
  padding: 1rem 1.5rem;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Event Categories Table Styles */
#ee-categories .table {
  margin-bottom: 0;
  background-color: var(--base-100);
  color: var(--base-content);
  border-radius: var(--border-radius);
  overflow: hidden;
}

#ee-categories .table th {
  background-color: var(--base-200);
  border-bottom: 2px solid var(--base-300);
  font-weight: 600;
  color: var(--base-content);
  padding: 0.75rem;
  font-size: 0.875rem;
}

#ee-categories .table td {
  border-bottom: 1px solid var(--base-300);
  padding: 0.75rem;
  vertical-align: middle;
  font-size: 0.875rem;
}

#ee-categories .table tbody tr:hover {
  background-color: var(--base-200);
  transition: background-color 0.2s ease;
}

#ee-categories .table tbody tr:last-child td {
  border-bottom: none;
}

/* Mobile: render categories table as cards */
@media (max-width: 640px) {
  #ee-categories .table thead { display: none; }
  #ee-categories .table,
  #ee-categories .table tbody,
  #ee-categories .table tr,
  #ee-categories .table td { display: block; width: 100%; }
  #ee-categories .table tr { 
    background: var(--base-100);
    border: 1px solid var(--base-300);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    margin-bottom: 0.9rem;
    overflow: hidden;
  }
  #ee-categories .table td { 
    border: 0;
    border-bottom: 1px solid var(--base-300);
    padding: 0.65rem 0.85rem;
  }
  #ee-categories .table td:last-child { border-bottom: 0; }
  #ee-categories .table td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--secondary-focus);
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    opacity: 0.9;
  }
  #ee-categories .table td.actions-cell::before { content: ''; margin: 0; display: none; }
  #ee-categories .table td.actions-cell { display: flex; gap: .4rem; flex-wrap: wrap; padding-top: .5rem; }
}

/* Add category button styling */
#ee-add-category {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

#ee-add-category:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Category Action Buttons */
#ee-categories .btn-sm {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

#ee-categories .btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}

#ee-categories .btn-outline-primary:hover {
  background-color: var(--primary);
  color: var(--primary-content);
}

#ee-categories .btn-outline-danger {
  border-color: var(--error);
  color: var(--error);
}

#ee-categories .btn-outline-danger:hover {
  background-color: var(--error);
  color: var(--error-content);
}

/* Mobile: render registrations tables as cards */
@media (max-width: 640px) {
  #ee-registrations .table thead { display: none; }
  #ee-registrations .table,
  #ee-registrations .table tbody,
  #ee-registrations .table tr,
  #ee-registrations .table td { display: block; width: 100%; }
  #ee-registrations .table tr { 
    background: var(--base-100);
    border: 1px solid var(--base-300);
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
    margin-bottom: 0.9rem;
    overflow: hidden;
  }
  #ee-registrations .table td { 
    border: 0;
    border-bottom: 1px solid var(--base-300);
    padding: 0.65rem 0.85rem;
  }
  #ee-registrations .table td:last-child { border-bottom: 0; }
  #ee-registrations .table td::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    color: var(--secondary-focus);
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    opacity: 0.9;
  }
  #ee-registrations .table td.actions-cell::before { content: ''; margin: 0; display: none; }
  #ee-registrations .table td.actions-cell { display: flex; gap: .4rem; flex-wrap: wrap; padding-top: .5rem; }
}

/* Form Controls in Modal */
#category-modal .form-control {
  background-color: var(--base-100);
  border: 1px solid var(--base-300);
  color: var(--base-content);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.2s;
}

#category-modal .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
  outline: none;
}

#category-modal .form-label {
  font-weight: 500;
  color: var(--base-content);
  margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #category-modal .modal-dialog {
    width: 95%;
    margin: 1rem;
  }
  
  #category-modal .modal-header,
  #category-modal .modal-body,
  #category-modal .modal-footer {
    padding: 1rem;
  }
  
  #requirements-modal .modal-dialog {
    width: 95%;
    margin: 1rem;
  }
  #requirements-modal .modal-header,
  #requirements-modal .modal-body,
  #requirements-modal .modal-footer {
    padding: 1rem;
  }
  
  #ee-categories .table-responsive {
    font-size: 0.875rem;
  }
  
  #ee-categories .btn-sm {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }
}

/* Event register terms acceptance spacing */
#terms-accept-wrap.form-check { display:inline-flex; align-items:center; gap:.45rem; }
#terms-accept-wrap .form-check-input { margin:0; width:18px; height:18px; cursor:pointer; }
#terms-accept-wrap .form-check-label { cursor:pointer; font-weight:600; color:var(--accent); }
#terms-accept-wrap.terms-attention { outline:2px solid var(--accent); outline-offset:4px; border-radius:6px; }
@keyframes termsPulse { 0%,100% { box-shadow:0 0 0 0 rgba(var(--accent-rgb,0,179,137),0.45);} 50% { box-shadow:0 0 0 6px rgba(var(--accent-rgb,0,179,137),0); } }
#terms-accept-wrap.terms-attention { animation:termsPulse 1.2s ease-in-out 1; }
@keyframes termsShake { 0%,100% { transform:translateX(0); } 20%,60% { transform:translateX(-4px); } 40%,80% { transform:translateX(4px); } }
#terms-accept-wrap .form-check-label.terms-shake { animation:termsShake .6s ease; display:inline-block; }