:root {
  --bg: #040a16;
  --bg-soft: #0a1730;
  --panel: rgba(10, 18, 34, 0.88);
  --panel-border: rgba(118, 159, 255, 0.16);
  --text: #eef4ff;
  --muted: #9eb1d0;
  --accent: #4dd7ff;
  --accent-2: #9db4ff;
  --warn: #ffb347;
  --danger: #ff6b81;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Trebuchet MS", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(77, 215, 255, 0.18), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(157, 180, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #02050d 0%, #07101e 42%, #0a1730 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 85%);
}

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

.page-shell {
  position: relative;
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 22px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  padding: 20px 28px;
  min-height: 110px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
}

.hero-copy::after {
  display: none !important;
  content: none !important;
}

.hero-logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.hero-text-block {
  position: relative;
  z-index: 2;
  min-width: 0;
  flex: 1 1 auto;
}

.login-brand-logo {
  height: 62px;
  width: auto;
  max-width: 480px;
  object-fit: contain;
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

.hero-copy > * {
  position: relative;
  z-index: 2;
}

.kicker {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(77, 215, 255, 0.12);
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.hero h1 {
  margin: 10px 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.hero p {
  color: var(--muted);
  max-width: 64ch;
  line-height: 1.65;
  font-size: 1rem;
}

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

.stat {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.06);
}

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

.stat .value {
  margin-top: 8px;
  font-size: 2rem;
  font-weight: 800;
}

.toolbar, .section {
  margin-top: 20px;
}

.main-nav {
  position: sticky;
  top: 14px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 14px;
  margin-top: 18px;
}

input.main-nav__checkbox,
.main-nav__checkbox {
  display: none !important;
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.main-nav__mobile-bar {
  display: none !important;
}

.main-nav__links {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  text-decoration: none;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.nav-link:hover {
  transform: translateY(-1px);
  background: rgba(77,215,255,0.12);
  border-color: rgba(77,215,255,0.35);
}

.nav-link-accent {
  background: rgba(77,215,255,0.16);
  border-color: rgba(77,215,255,0.3);
}

.main-nav .nav-link.nav-link-register,
.nav-link.nav-link-register,
.nav-link-register {
  background: #0284c7 !important;
  border: 1px solid #0284c7 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
  padding: 8px 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35) !important;
  text-decoration: none !important;
}

.main-nav .nav-link.nav-link-register:hover,
.nav-link.nav-link-register:hover,
.nav-link-register:hover {
  background: #0369a1 !important;
  border-color: #0369a1 !important;
  color: #ffffff !important;
}

.competition-title-link {
  color: var(--text);
  transition: color 0.15s ease-in-out;
}
.competition-title-link:hover {
  color: var(--accent);
}

.event-swimmer-link,
.record-swimmer-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  transition: color 0.15s ease-in-out;
}
.event-swimmer-link:hover,
.record-swimmer-link:hover {
  color: var(--accent-2);
}

.event-club-link,
.record-club-link {
  color: var(--text);
  font-weight: 500;
  transition: color 0.15s ease-in-out;
}
.event-club-link:hover,
.record-club-link:hover {
  color: var(--accent);
}

.event-pos-badge {
  color: #7df29c;
  font-weight: 700;
}

.event-time-val,
.record-time-val {
  color: #7df29c;
  font-weight: 700;
  font-size: 1.05rem;
  font-family: monospace;
}

.record-event-title {
  color: var(--accent);
  font-weight: 600;
}

.club-title {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}

.toolbar select, .toolbar input, .toolbar button, .form-field input, .form-field select, .form-field textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: rgba(4, 10, 20, 0.8);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
}

.toolbar button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 0;
  background: linear-gradient(135deg, #2c75ff, #58c7ff);
  color: #04111f;
  font-weight: 800;
}

.button-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
}

.athlete-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 10px;
}

.athlete-tabs .button.is-active,
.athlete-tabs .button[aria-pressed="true"] {
  background: linear-gradient(135deg, #58c7ff, #7df29c);
  color: #04111f;
  box-shadow: 0 12px 22px rgba(88, 199, 255, 0.18);
}

.athlete-panel.is-hidden {
  display: none;
}

.grid-2, .grid-3, .grid-4 {
  display: grid;
  gap: 18px;
}

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

.card {
  padding: 20px;
}

.card h2, .card h3, .section h2 {
  margin: 0 0 14px;
  letter-spacing: -0.03em;
}

.list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  text-decoration: none !important;
}

.list-item > div { min-width: 0; }
.list-item strong { display: block; line-height: 1.15; text-decoration: underline; }
.list-item span,
.list-item small,
.list-item .muted,
.list-item .badge { color: var(--muted); line-height: 1.2; text-decoration: none !important; }

.grid-athlete-stats .stat {
  padding: 14px;
}

.grid-athlete-stats .value {
  font-size: 1.55rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-admin { background: rgba(255,107,129,0.16); color: #ffb1be; border: 1px solid rgba(255,107,129,0.3); }
.badge-manager { background: rgba(77,215,255,0.16); color: #a8e9ff; border: 1px solid rgba(77,215,255,0.3); }
.badge-trainer { background: rgba(125,242,156,0.16); color: #bff5cd; border: 1px solid rgba(125,242,156,0.3); }
.badge-member { background: rgba(255,179,71,0.16); color: #ffd8a3; border: 1px solid rgba(255,179,71,0.3); }
.badge-user { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.badge-guest { background: rgba(148, 163, 184, 0.14); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.25); }

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.flash {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.flash.success { border-color: rgba(125,242,156,0.35); }
.flash.error { border-color: rgba(255,107,129,0.35); }
.flash.info { border-color: rgba(77,215,255,0.35); }

.floating-import {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(440px, calc(100vw - 36px));
  z-index: 40;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.floating-import.is-collapsed {
  width: 280px;
}

.floating-import.is-collapsed .floating-import__body {
  display: none;
}

.floating-import__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
}

.floating-import__header h2 {
  margin: 0 0 8px;
}

.floating-import__header p {
  margin: 0;
}

.floating-import__body {
  padding: 18px;
}

.floating-import .table {
  display: block;
  max-height: 220px;
  overflow: auto;
}

.floating-import .table thead,
.floating-import .table tbody,
.floating-import .table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.floating-import .table tbody {
  max-height: 160px;
}

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  overflow: hidden;
}

.auth-side {
  padding: 34px;
  background: linear-gradient(145deg, rgba(77,215,255,0.18), rgba(125,242,156,0.08));
}

.auth-form {
  padding: 34px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-field label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.split-box {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}

.progress-wrap {
  display: grid;
  gap: 10px;
}

.progress-track {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}

.progress-track-mini {
  height: 6px;
  opacity: 0.9;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 200ms ease;
}

.progress-bar-file {
  background: linear-gradient(90deg, #7df29c, #58c7ff);
}

small, .muted {
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* ==========================================================================
   Tablet Landscape (992px - 1199px)
   ========================================================================== */
@media (min-width: 992px) and (max-width: 1199px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 14px;
  }
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .toolbar {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
}

/* ==========================================================================
   Tablet Portrait & iPads (768px - 991px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 991px) {
  .page-shell {
    width: min(100% - 20px, 980px);
    padding-top: 12px;
  }
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .toolbar {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
  }
  .card, .panel {
    padding: 18px;
    border-radius: 16px;
  }
  .main-nav__links {
    display: none !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .main-nav__checkbox:checked ~ .main-nav__links {
    display: grid !important;
  }
  .hero-copy {
    padding: 16px 20px;
  }
}

/* ==========================================================================
   Móvil (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 992px) {
  .page-shell { width: min(100% - 14px, 1400px); padding-top: 12px; }
  .hero-stats, .card, .auth-side, .auth-form, .toolbar { padding: 14px; }
  .hero-copy { padding: 14px 18px; min-height: 80px; gap: 14px; align-items: center; }
  .hero-logo-icon { width: 48px; height: 48px; border-radius: 12px; }
  .hero-text-block { min-width: 0; flex: 1 1 auto; }
  .login-brand-logo {
    height: 44px;
    max-width: 320px;
    margin-left: auto;
    width: auto;
  }
  .toolbar { grid-template-columns: 1fr; gap: 10px; }

  /* Minimizable Mobile Header Navigation */
  .main-nav {
    top: 8px;
    padding: 10px 14px;
    margin-top: 8px;
    z-index: 100;
  }

  .main-nav__mobile-bar {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
  }

  .main-nav__mobile-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .main-nav__mobile-logo {
    color: var(--accent);
  }

  .main-nav__mobile-sep {
    color: var(--muted);
    opacity: 0.6;
  }

  .main-nav__mobile-current {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .main-nav__toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(77, 215, 255, 0.16);
    color: var(--accent);
    border: 1px solid rgba(77, 215, 255, 0.35);
    flex-shrink: 0;
    pointer-events: none;
  }

  .main-nav__links {
    display: none !important;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .main-nav__checkbox:checked ~ .main-nav__links {
    display: flex !important;
  }

  .main-nav__checkbox:checked ~ .main-nav__mobile-bar .main-nav__toggle {
    background: rgba(77, 215, 255, 0.3);
    border-color: var(--accent);
    color: #fff;
  }

  .main-nav .nav-link {
    display: flex;
    width: 100%;
    text-align: center;
    justify-content: center;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 12px;
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--panel-border);
  }

  .main-nav .nav-link:active,
  .main-nav .nav-link:hover {
    background: rgba(77, 215, 255, 0.22);
    border-color: var(--accent);
  }

  .main-nav .nav-user {
    width: 100%;
  }

  .main-nav .nav-user-btn {
    width: 100%;
    justify-content: center;
    padding: 8px 14px;
  }

  /* Compact Buttons & Horizontal Scroll Containers */
  .button, .button-ghost {
    padding: 7px 14px;
    font-size: 0.85rem;
  }

  .athlete-tabs,
  .btn-group-scroll,
  .button-row-scroll,
  .nav-tabs-scroll,
  .horizontal-scroll-row,
  [data-horizontal-scroll] {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 6px;
    margin-bottom: 8px;
    gap: 8px !important;
    align-items: center;
    max-width: 100%;
  }

  .athlete-tabs > *,
  .btn-group-scroll > *,
  .button-row-scroll > *,
  .nav-tabs-scroll > *,
  .horizontal-scroll-row > *,
  [data-horizontal-scroll] > * {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }

  .athlete-tabs::-webkit-scrollbar,
  .btn-group-scroll::-webkit-scrollbar,
  .button-row-scroll::-webkit-scrollbar,
  .horizontal-scroll-row::-webkit-scrollbar,
  [data-horizontal-scroll]::-webkit-scrollbar {
    height: 4px;
  }

  .athlete-tabs::-webkit-scrollbar-thumb,
  .btn-group-scroll::-webkit-scrollbar-thumb,
  .button-row-scroll::-webkit-scrollbar-thumb,
  .horizontal-scroll-row::-webkit-scrollbar-thumb,
  [data-horizontal-scroll]::-webkit-scrollbar-thumb {
    background: rgba(77, 215, 255, 0.3);
    border-radius: 4px;
  }
}

/* ==========================================================================
   Mobile Responsive Rules (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  /* Cabecera Movil - Pantalla de Login */
  .login-hero .hero-copy {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 24px 16px 20px !important;
    gap: 12px !important;
    min-height: auto !important;
  }

  .login-hero .login-brand-logo {
    order: -1 !important;
    display: block !important;
    max-width: min(280px, 86vw) !important;
    height: auto !important;
    max-height: 52px !important;
    margin: 0 auto 4px !important;
    object-fit: contain !important;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3)) !important;
  }

  .login-hero .hero-logo-icon {
    display: none !important;
  }

  .login-hero .hero-text-block {
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .login-hero .hero-text-block .kicker {
    margin: 0 auto 6px !important;
    font-size: 0.78rem !important;
    padding: 4px 12px !important;
  }

  .login-hero .hero-text-block h1 {
    font-size: 1.55rem !important;
    line-height: 1.25 !important;
    margin: 4px 0 !important;
    white-space: normal !important;
  }

  .login-hero .hero-text-block p {
    font-size: 0.92rem !important;
    line-height: 1.4 !important;
    margin: 4px 0 0 !important;
    color: var(--muted) !important;
  }

  /* Cabecera Movil - Vistas internas de la aplicacion */
  .hero:not(.login-hero) .hero-copy {
    padding: 12px 14px !important;
    min-height: auto !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    flex-wrap: nowrap !important;
  }

  .hero:not(.login-hero) .hero-logo-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
  }

  .hero:not(.login-hero) .hero-text-block {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  .hero:not(.login-hero) .hero-text-block h1 {
    font-size: 1.25rem !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    white-space: normal !important;
  }

  .hero:not(.login-hero) .login-brand-logo {
    display: none !important;
  }
}

/* ==========================================================================
   Móvil Horizontal / Landscape (max-height <= 520px)
   ========================================================================== */
@media (max-height: 520px) and (orientation: landscape) {
  .page-shell {
    padding-top: 6px !important;
  }
  .hero-copy {
    padding: 8px 12px !important;
    min-height: 48px !important;
    gap: 10px !important;
  }
  .hero-logo-icon {
    width: 36px !important;
    height: 36px !important;
  }
  .hero-text-block h1 {
    font-size: 1.15rem !important;
  }
  .hero-text-block .kicker {
    font-size: 0.72rem !important;
    padding: 2px 8px !important;
  }
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .card, .panel {
    padding: 12px 14px !important;
  }
}

/* =========================================================================
   SISTEMA INTEGRAL DE TEMAS MULTICONTRASTE DE NADANDOVOY
   1. Cálido (Light / Sepia Suave) - Por Defecto
   2. Azul Piscina (Ocean / Acuático)
   3. Oscuro (Dark / Original)
   4. Piscina Sol (Contrast / Alto Contraste para sol directo)
   ========================================================================= */

/* -------------------------------------------------------------------------
   TEMA 1: CÁLIDO (LIGHT)
   ------------------------------------------------------------------------- */
html[data-theme="light"],
body.theme-light {
  --bg: #f8f4e8;
  --bg-soft: #f1ead8;
  --panel: rgba(253, 250, 242, 0.96);
  --panel-border: rgba(180, 155, 110, 0.28);
  --text: #0f172a;
  --muted: #475569;
  --accent: #0284c7;
  --accent-2: #0369a1;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 12px 32px rgba(68, 55, 34, 0.08);
}

html[data-theme="light"] body,
body.theme-light {
  color: #0f172a !important;
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.10), transparent 36%),
    radial-gradient(circle at 85% 10%, rgba(56, 189, 248, 0.10), transparent 30%),
    linear-gradient(180deg, #fbf8ef 0%, #f6f0df 52%, #efe6cf 100%) !important;
}

html[data-theme="light"] body::before {
  background-image: linear-gradient(rgba(120, 100, 70, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 100, 70, 0.04) 1px, transparent 1px) !important;
}

html[data-theme="light"] .panel,
html[data-theme="light"] .card,
html[data-theme="light"] .portal-kpi-card,
html[data-theme="light"] .portal-table-wrap,
html[data-theme="light"] .portal-nav-bar,
html[data-theme="light"] .stat,
html[data-theme="light"] .list-item,
html[data-theme="light"] .split-box {
  background: rgba(253, 250, 242, 0.96) !important;
  border-color: rgba(180, 155, 110, 0.28) !important;
  color: #0f172a !important;
  box-shadow: 0 8px 24px rgba(68, 55, 34, 0.07) !important;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] strong:not(.badge):not(.button) {
  color: #0f172a;
}

html[data-theme="light"] .muted,
html[data-theme="light"] small.muted {
  color: #475569 !important;
}

html[data-theme="light"] .nav-link:not(.nav-link-register):not(.nav-link-kofi),
html[data-theme="light"] .main-nav .nav-link:not(.nav-link-register):not(.nav-link-kofi) {
  background: #f4efe2 !important;
  border-color: #d6cbb5 !important;
  color: #1e293b !important;
}

html[data-theme="light"] .nav-link:not(.nav-link-register):not(.nav-link-kofi):hover,
html[data-theme="light"] .nav-link-accent,
html[data-theme="light"] .main-nav .nav-link:not(.nav-link-register):not(.nav-link-kofi):hover,
html[data-theme="light"] .main-nav .nav-link.nav-link-accent {
  background: rgba(2, 132, 199, 0.14) !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
}

html[data-theme="light"] .competition-title-link,
html[data-theme="light"] .event-club-link,
html[data-theme="light"] .record-club-link,
html[data-theme="light"] .club-title {
  color: #0f172a !important;
}
html[data-theme="light"] .competition-title-link:hover,
html[data-theme="light"] .event-club-link:hover,
html[data-theme="light"] .record-club-link:hover {
  color: #0284c7 !important;
}

html[data-theme="light"] .event-swimmer-link,
html[data-theme="light"] .record-swimmer-link,
html[data-theme="light"] .record-event-title,
html[data-theme="light"] .table a:not(.button):not(.badge),
html[data-theme="light"] .list a:not(.button):not(.badge),
html[data-theme="light"] table a:not(.button):not(.badge) {
  color: #0284c7 !important;
}
html[data-theme="light"] .event-swimmer-link:hover,
html[data-theme="light"] .record-swimmer-link:hover,
html[data-theme="light"] .table a:not(.button):not(.badge):hover,
html[data-theme="light"] .list a:not(.button):not(.badge):hover {
  color: #0369a1 !important;
  text-decoration: underline !important;
}

html[data-theme="light"] .event-pos-badge {
  color: #047857 !important;
}
html[data-theme="light"] .event-time-val,
html[data-theme="light"] .record-time-val {
  color: #047857 !important;
}

html[data-theme="light"] .list-item,
html[data-theme="light"] a.list-item {
  background: rgba(253, 250, 242, 0.95) !important;
  border-color: rgba(180, 155, 110, 0.3) !important;
  color: #0f172a !important;
}
html[data-theme="light"] .list-item strong {
  color: #0f172a !important;
  text-decoration: none !important;
}
html[data-theme="light"] .list-item:hover,
html[data-theme="light"] a.list-item:hover {
  background: #f5eedc !important;
  border-color: #0284c7 !important;
}

html[data-theme="light"] .toolbar select,
html[data-theme="light"] .toolbar input,
html[data-theme="light"] .form-field input,
html[data-theme="light"] .form-field select,
html[data-theme="light"] .form-field textarea,
html[data-theme="light"] select,
html[data-theme="light"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="light"] textarea {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #d6cbb5 !important;
}
html[data-theme="light"] select option {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #94a3b8 !important;
}
html[data-theme="light"] .button-ghost {
  background: #f4efe2 !important;
  color: #0f172a !important;
  border: 1px solid #d6cbb5 !important;
}

html[data-theme="light"] .table th,
html[data-theme="light"] table th {
  background: #efe8d5 !important;
  color: #0369a1 !important;
  border-bottom: 2px solid #d6cbb5 !important;
  font-weight: 700 !important;
}
html[data-theme="light"] .table td,
html[data-theme="light"] table td {
  color: #0f172a !important;
  border-bottom: 1px solid #e6dec8 !important;
}

/* Modals en Tema Claro */
html[data-theme="light"] #calendar-modal > div,
html[data-theme="light"] #day-events-modal > div,
html[data-theme="light"] #fan-preview-modal > div,
html[data-theme="light"] #pwa-install-modal > div {
  background: #fdfaf2 !important;
  color: #0f172a !important;
  border: 1px solid #d6cbb5 !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25) !important;
}

/* -------------------------------------------------------------------------
   TEMA 2: AZUL PISCINA (OCEAN / ACUÁTICO)
   ------------------------------------------------------------------------- */
html[data-theme="ocean"],
body.theme-ocean {
  --bg: #e0f2fe;
  --bg-soft: #f0f9ff;
  --panel: #ffffff;
  --panel-border: #bae6fd;
  --text: #0c4a6e;
  --muted: #0369a1;
  --accent: #0284c7;
  --accent-2: #075985;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow: 0 12px 32px rgba(2, 132, 199, 0.10);
}

html[data-theme="ocean"] body,
body.theme-ocean {
  color: #0c4a6e !important;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 36%),
    radial-gradient(circle at 85% 10%, rgba(2, 132, 199, 0.14), transparent 32%),
    linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 48%, #e0f2fe 100%) !important;
}

html[data-theme="ocean"] body::before {
  background-image: linear-gradient(rgba(2, 132, 199, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(2, 132, 199, 0.04) 1px, transparent 1px) !important;
}

html[data-theme="ocean"] .panel,
html[data-theme="ocean"] .card,
html[data-theme="ocean"] .portal-kpi-card,
html[data-theme="ocean"] .portal-table-wrap,
html[data-theme="ocean"] .portal-nav-bar,
html[data-theme="ocean"] .stat,
html[data-theme="ocean"] .list-item,
html[data-theme="ocean"] .split-box {
  background: #ffffff !important;
  border-color: #bae6fd !important;
  color: #0c4a6e !important;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.08) !important;
}

html[data-theme="ocean"] h1,
html[data-theme="ocean"] h2,
html[data-theme="ocean"] h3,
html[data-theme="ocean"] h4,
html[data-theme="ocean"] h5,
html[data-theme="ocean"] strong:not(.badge):not(.button) {
  color: #0c4a6e;
}

html[data-theme="ocean"] .muted,
html[data-theme="ocean"] small.muted {
  color: #0369a1 !important;
}

html[data-theme="ocean"] .nav-link:not(.nav-link-register):not(.nav-link-kofi),
html[data-theme="ocean"] .main-nav .nav-link:not(.nav-link-register):not(.nav-link-kofi) {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
  color: #0c4a6e !important;
}

html[data-theme="ocean"] .nav-link:not(.nav-link-register):not(.nav-link-kofi):hover,
html[data-theme="ocean"] .nav-link-accent,
html[data-theme="ocean"] .main-nav .nav-link:not(.nav-link-register):not(.nav-link-kofi):hover,
html[data-theme="ocean"] .main-nav .nav-link.nav-link-accent {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
  font-weight: 700 !important;
}

html[data-theme="ocean"] .competition-title-link,
html[data-theme="ocean"] .event-club-link,
html[data-theme="ocean"] .record-club-link,
html[data-theme="ocean"] .club-title {
  color: #0c4a6e !important;
}
html[data-theme="ocean"] .competition-title-link:hover,
html[data-theme="ocean"] .event-club-link:hover,
html[data-theme="ocean"] .record-club-link:hover {
  color: #0284c7 !important;
}

html[data-theme="ocean"] .event-swimmer-link,
html[data-theme="ocean"] .record-swimmer-link,
html[data-theme="ocean"] .record-event-title,
html[data-theme="ocean"] .table a:not(.button):not(.badge),
html[data-theme="ocean"] .list a:not(.button):not(.badge),
html[data-theme="ocean"] table a:not(.button):not(.badge) {
  color: #0284c7 !important;
}
html[data-theme="ocean"] .event-swimmer-link:hover,
html[data-theme="ocean"] .record-swimmer-link:hover,
html[data-theme="ocean"] .table a:not(.button):not(.badge):hover,
html[data-theme="ocean"] .list a:not(.button):not(.badge):hover {
  color: #075985 !important;
  text-decoration: underline !important;
}

html[data-theme="ocean"] .event-pos-badge {
  color: #047857 !important;
}
html[data-theme="ocean"] .event-time-val,
html[data-theme="ocean"] .record-time-val {
  color: #047857 !important;
}

html[data-theme="ocean"] .list-item,
html[data-theme="ocean"] a.list-item {
  background: #ffffff !important;
  border-color: #bae6fd !important;
  color: #0c4a6e !important;
}
html[data-theme="ocean"] .list-item strong {
  color: #0c4a6e !important;
  text-decoration: none !important;
}
html[data-theme="ocean"] .list-item:hover,
html[data-theme="ocean"] a.list-item:hover {
  background: #f0f9ff !important;
  border-color: #0284c7 !important;
}

html[data-theme="ocean"] .toolbar select,
html[data-theme="ocean"] .toolbar input,
html[data-theme="ocean"] .form-field input,
html[data-theme="ocean"] .form-field select,
html[data-theme="ocean"] .form-field textarea,
html[data-theme="ocean"] select,
html[data-theme="ocean"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="ocean"] textarea {
  background: #ffffff !important;
  color: #0c4a6e !important;
  border: 1px solid #bae6fd !important;
}
html[data-theme="ocean"] select option {
  background: #ffffff !important;
  color: #0c4a6e !important;
}
html[data-theme="ocean"] input::placeholder,
html[data-theme="ocean"] textarea::placeholder {
  color: #64748b !important;
}
html[data-theme="ocean"] .button-ghost {
  background: #f0f9ff !important;
  color: #0c4a6e !important;
  border: 1px solid #bae6fd !important;
}

html[data-theme="ocean"] .table th,
html[data-theme="ocean"] table th {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border-bottom: 2px solid #bae6fd !important;
  font-weight: 700 !important;
}
html[data-theme="ocean"] .table td,
html[data-theme="ocean"] table td {
  color: #0c4a6e !important;
  border-bottom: 1px solid #e0f2fe !important;
}

/* Modals en Tema Ocean */
html[data-theme="ocean"] #calendar-modal > div,
html[data-theme="ocean"] #day-events-modal > div,
html[data-theme="ocean"] #fan-preview-modal > div,
html[data-theme="ocean"] #pwa-install-modal > div {
  background: #ffffff !important;
  color: #0c4a6e !important;
  border: 1px solid #bae6fd !important;
  box-shadow: 0 20px 50px rgba(2, 132, 199, 0.20) !important;
}

/* -------------------------------------------------------------------------
   TEMA 3: OSCURO (DARK / ORIGINAL)
   ------------------------------------------------------------------------- */
html[data-theme="dark"] {
  --bg: #040a16;
  --bg-soft: #0a1730;
  --panel: rgba(10, 18, 34, 0.88);
  --panel-border: rgba(118, 159, 255, 0.16);
  --text: #eef4ff;
  --muted: #9eb1d0;
  --accent: #38bdf8;
  --accent-2: #0284c7;
  --warn: #ffd166;
  --danger: #ff6b81;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] body {
  color: #eef4ff !important;
  background:
    radial-gradient(circle at top left, rgba(77, 215, 255, 0.18), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(157, 180, 255, 0.12), transparent 26%),
    linear-gradient(180deg, #02050d 0%, #07101e 42%, #0a1730 100%) !important;
}

html[data-theme="dark"] .competition-title-link {
  color: #eef4ff !important;
}
html[data-theme="dark"] .competition-title-link:hover {
  color: #38bdf8 !important;
}
html[data-theme="dark"] .event-swimmer-link,
html[data-theme="dark"] .record-swimmer-link {
  color: #38bdf8 !important;
}
html[data-theme="dark"] .event-club-link,
html[data-theme="dark"] .record-club-link {
  color: #9eb1d0 !important;
}

/* -------------------------------------------------------------------------
   TEMA 4: PISCINA SOL (CONTRAST / ALTO CONTRASTE)
   ------------------------------------------------------------------------- */
html[data-theme="contrast"],
body.poolside-contrast {
  --bg: #000000;
  --bg-soft: #050505;
  --panel: #050505;
  --panel-border: #ffffff;
  --text: #ffffff;
  --muted: #fde047;
  --accent: #facc15;
  --accent-2: #38bdf8;
  --warn: #facc15;
  --danger: #ef4444;
  --shadow: 0 0 0 2px #ffffff;
}

html[data-theme="contrast"] body,
body.poolside-contrast {
  background: #000000 !important;
  color: #ffffff !important;
}

html[data-theme="contrast"] body::before {
  display: none !important;
}

html[data-theme="contrast"] .panel,
html[data-theme="contrast"] .card,
html[data-theme="contrast"] .portal-kpi-card,
html[data-theme="contrast"] .portal-table-wrap,
html[data-theme="contrast"] .portal-nav-bar,
html[data-theme="contrast"] .stat,
html[data-theme="contrast"] .list-item,
html[data-theme="contrast"] .split-box {
  background: #050505 !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
}

html[data-theme="contrast"] h1,
html[data-theme="contrast"] h2,
html[data-theme="contrast"] h3,
html[data-theme="contrast"] h4,
html[data-theme="contrast"] h5,
html[data-theme="contrast"] strong {
  color: #ffffff !important;
}

html[data-theme="contrast"] .muted,
html[data-theme="contrast"] small.muted {
  color: #fde047 !important;
}

html[data-theme="contrast"] .nav-link:not(.nav-link-register),
html[data-theme="contrast"] .main-nav .nav-link:not(.nav-link-register) {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
  color: #ffffff !important;
}
html[data-theme="contrast"] .nav-link:not(.nav-link-register):hover,
html[data-theme="contrast"] .nav-link-accent,
html[data-theme="contrast"] .main-nav .nav-link.nav-link-accent {
  background: #facc15 !important;
  border-color: #facc15 !important;
  color: #000000 !important;
  font-weight: 800 !important;
}

html[data-theme="contrast"] .competition-title-link,
html[data-theme="contrast"] .event-swimmer-link,
html[data-theme="contrast"] .record-swimmer-link,
html[data-theme="contrast"] .table a:not(.button):not(.badge),
html[data-theme="contrast"] .list a:not(.button):not(.badge) {
  color: #38bdf8 !important;
  text-decoration: underline !important;
  font-weight: 700 !important;
}
html[data-theme="contrast"] .competition-title-link:hover,
html[data-theme="contrast"] .event-swimmer-link:hover,
html[data-theme="contrast"] .table a:not(.button):not(.badge):hover {
  color: #fde047 !important;
}

html[data-theme="contrast"] .event-pos-badge,
html[data-theme="contrast"] .event-time-val,
html[data-theme="contrast"] .record-time-val {
  color: #4ade80 !important;
}

html[data-theme="contrast"] .table th,
html[data-theme="contrast"] table th {
  background: #1a1a1a !important;
  color: #fde047 !important;
  border-bottom: 2px solid #ffffff !important;
  font-size: 1rem !important;
}
html[data-theme="contrast"] .table td,
html[data-theme="contrast"] table td {
  color: #ffffff !important;
  border-bottom: 1px solid #333333 !important;
}

html[data-theme="contrast"] select,
html[data-theme="contrast"] input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
html[data-theme="contrast"] textarea {
  background: #000000 !important;
  color: #ffffff !important;
  border: 2px solid #ffffff !important;
}

/* =========================================================================
   REGLAS UNIVERSALES DE CONTRASTE PARA ESTILOS INLINE (LIGHT Y OCEAN)
   ========================================================================= */
/* 1. Elementos con textos claros inline -> Oscurecer en temas claros */
html[data-theme="light"] [style*="#eef4ff" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="light"] [style*="#f8fafc" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="light"] [style*="#e2e8f0" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="light"] [style*="#f1f5f9" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="light"] [style*="#e0e7ff" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="light"] [style*="color: #fff" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not(.nav-link-register):not([type="submit"]):not([type="button"]),
html[data-theme="light"] [style*="color: white" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not(.nav-link-register):not([type="submit"]):not([type="button"]) {
  color: #0f172a !important;
}

html[data-theme="ocean"] [style*="#eef4ff" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="ocean"] [style*="#f8fafc" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="ocean"] [style*="#e2e8f0" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="ocean"] [style*="#f1f5f9" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="ocean"] [style*="#e0e7ff" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not([type="submit"]),
html[data-theme="ocean"] [style*="color: #fff" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not(.nav-link-register):not([type="submit"]):not([type="button"]),
html[data-theme="ocean"] [style*="color: white" i]:not(.button):not(.badge):not(.pwa-bottom-nav__icon):not(.pwa-theme-btn):not(.nav-link-register):not([type="submit"]):not([type="button"]) {
  color: #0c4a6e !important;
}

/* 2. Enlaces con colores claros o cian inline -> Convertir a azul natación contrastado */
html[data-theme="light"] a[style*="#eef4ff" i],
html[data-theme="light"] a[style*="#f8fafc" i],
html[data-theme="light"] a[style*="#e2e8f0" i],
html[data-theme="light"] a[style*="#38bdf8" i],
html[data-theme="light"] a[style*="#4dd7ff" i],
html[data-theme="light"] a[style*="#58c7ff" i],
html[data-theme="light"] a[style*="#7dd3fc" i],
html[data-theme="light"] a[style*="#9eb1d0" i],
html[data-theme="light"] a[style*="#cbd5e1" i],
html[data-theme="light"] a[style*="#94a3b8" i],
html[data-theme="ocean"] a[style*="#eef4ff" i],
html[data-theme="ocean"] a[style*="#f8fafc" i],
html[data-theme="ocean"] a[style*="#e2e8f0" i],
html[data-theme="ocean"] a[style*="#38bdf8" i],
html[data-theme="ocean"] a[style*="#4dd7ff" i],
html[data-theme="ocean"] a[style*="#58c7ff" i],
html[data-theme="ocean"] a[style*="#7dd3fc" i],
html[data-theme="ocean"] a[style*="#9eb1d0" i],
html[data-theme="ocean"] a[style*="#cbd5e1" i],
html[data-theme="ocean"] a[style*="#94a3b8" i] {
  color: #0284c7 !important;
}
html[data-theme="light"] a[style*="#eef4ff" i]:hover,
html[data-theme="light"] a[style*="#38bdf8" i]:hover,
html[data-theme="ocean"] a[style*="#eef4ff" i]:hover,
html[data-theme="ocean"] a[style*="#38bdf8" i]:hover {
  color: #0369a1 !important;
  text-decoration: underline !important;
}

/* 3. Textos muted / secundarios inline */
html[data-theme="light"] [style*="#9eb1d0" i]:not(a):not(.button):not(.badge),
html[data-theme="light"] [style*="#cbd5e1" i]:not(a):not(.button):not(.badge),
html[data-theme="light"] [style*="#94a3b8" i]:not(a):not(.button):not(.badge) {
  color: #475569 !important;
}
html[data-theme="ocean"] [style*="#9eb1d0" i]:not(a):not(.button):not(.badge),
html[data-theme="ocean"] [style*="#cbd5e1" i]:not(a):not(.button):not(.badge),
html[data-theme="ocean"] [style*="#94a3b8" i]:not(a):not(.button):not(.badge) {
  color: #334155 !important;
}

/* 4. Colores semánticos (Tiempos, Posiciones, Avisos, Errores) */
html[data-theme="light"] [style*="#7df29c" i]:not(input):not(select),
html[data-theme="light"] [style*="#86efac" i]:not(input):not(select),
html[data-theme="light"] [style*="#4ade80" i]:not(input):not(select),
html[data-theme="ocean"] [style*="#7df29c" i]:not(input):not(select),
html[data-theme="ocean"] [style*="#86efac" i]:not(input):not(select),
html[data-theme="ocean"] [style*="#4ade80" i]:not(input):not(select) {
  color: #047857 !important;
}

html[data-theme="light"] [style*="#ffd166" i],
html[data-theme="light"] [style*="#fbbf24" i],
html[data-theme="light"] [style*="#fde047" i],
html[data-theme="light"] [style*="#facc15" i],
html[data-theme="ocean"] [style*="#ffd166" i],
html[data-theme="ocean"] [style*="#fbbf24" i],
html[data-theme="ocean"] [style*="#fde047" i],
html[data-theme="ocean"] [style*="#facc15" i] {
  color: #b45309 !important;
}

html[data-theme="light"] [style*="#ffb86c" i],
html[data-theme="light"] [style*="#ffb347" i],
html[data-theme="ocean"] [style*="#ffb86c" i],
html[data-theme="ocean"] [style*="#ffb347" i] {
  color: #c2410c !important;
}

html[data-theme="light"] [style*="#ff7b72" i],
html[data-theme="light"] [style*="#f87171" i],
html[data-theme="light"] [style*="#fca5a5" i],
html[data-theme="ocean"] [style*="#ff7b72" i],
html[data-theme="ocean"] [style*="#f87171" i],
html[data-theme="ocean"] [style*="#fca5a5" i] {
  color: #b91c1c !important;
}

html[data-theme="light"] [style*="#38bdf8" i]:not(a):not(.badge):not(.button),
html[data-theme="light"] [style*="#58c7ff" i]:not(a):not(.badge):not(.button),
html[data-theme="ocean"] [style*="#38bdf8" i]:not(a):not(.badge):not(.button),
html[data-theme="ocean"] [style*="#58c7ff" i]:not(a):not(.badge):not(.button) {
  color: #0284c7 !important;
}

html[data-theme="light"] [style*="#d2a8ff" i],
html[data-theme="ocean"] [style*="#d2a8ff" i] {
  color: #7c3aed !important;
}
html[data-theme="light"] [style*="#f472b6" i],
html[data-theme="ocean"] [style*="#f472b6" i] {
  color: #be185d !important;
}

/* 5. Fondos oscuros inline convertidos a fondo claro */
html[data-theme="light"] [style*="background: #0e1726" i],
html[data-theme="light"] [style*="background: #0f172a" i],
html[data-theme="light"] [style*="background: #1e293b" i],
html[data-theme="light"] [style*="background: #090e17" i],
html[data-theme="light"] [style*="background: #090d16" i],
html[data-theme="light"] [style*="background: #111827" i],
html[data-theme="light"] [style*="background: #131b2e" i],
html[data-theme="light"] [style*="background: #0b111e" i],
html[data-theme="light"] [style*="background: #020617" i],
html[data-theme="light"] [style*="background: rgba(15, 23, 42" i],
html[data-theme="light"] [style*="background: rgba(15,23,42" i],
html[data-theme="light"] [style*="background: rgba(9, 14, 23" i],
html[data-theme="light"] [style*="background: rgba(9,14,23" i] {
  background: #fbf7ee !important;
  border-color: #d6cbb5 !important;
  color: #0f172a !important;
}

html[data-theme="ocean"] [style*="background: #0e1726" i],
html[data-theme="ocean"] [style*="background: #0f172a" i],
html[data-theme="ocean"] [style*="background: #1e293b" i],
html[data-theme="ocean"] [style*="background: #090e17" i],
html[data-theme="ocean"] [style*="background: #090d16" i],
html[data-theme="ocean"] [style*="background: #111827" i],
html[data-theme="ocean"] [style*="background: #131b2e" i],
html[data-theme="ocean"] [style*="background: #0b111e" i],
html[data-theme="ocean"] [style*="background: #020617" i],
html[data-theme="ocean"] [style*="background: rgba(15, 23, 42" i],
html[data-theme="ocean"] [style*="background: rgba(15,23,42" i],
html[data-theme="ocean"] [style*="background: rgba(9, 14, 23" i],
html[data-theme="ocean"] [style*="background: rgba(9,14,23" i] {
  background: #ffffff !important;
  border-color: #bae6fd !important;
  color: #0c4a6e !important;
}

/* Botones que siempre deben mantener texto blanco */
html[data-theme="light"] .button:not(.button-ghost):not(.button-secondary),
html[data-theme="ocean"] .button:not(.button-ghost):not(.button-secondary),
html[data-theme="light"] .button-primary,
html[data-theme="ocean"] .button-primary,
html[data-theme="light"] .button-accent,
html[data-theme="ocean"] .button-accent,
html[data-theme="light"] button[type="submit"],
html[data-theme="ocean"] button[type="submit"],
html[data-theme="light"] .nav-link-register,
html[data-theme="ocean"] .nav-link-register,
html[data-theme="light"] [style*="background: #0284c7" i],
html[data-theme="ocean"] [style*="background: #0284c7" i],
html[data-theme="light"] [style*="background: #dc2626" i],
html[data-theme="ocean"] [style*="background: #dc2626" i],
html[data-theme="light"] [style*="background: #10b981" i],
html[data-theme="ocean"] [style*="background: #10b981" i] {
  color: #ffffff !important;
}

/* Badges en temas claros */
html[data-theme="light"] .badge-admin { background: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fca5a5 !important; }
html[data-theme="light"] .badge-manager { background: #e0f2fe !important; color: #0369a1 !important; border: 1px solid #7dd3fc !important; }
html[data-theme="light"] .badge-trainer { background: #dcfce7 !important; color: #166534 !important; border: 1px solid #86efac !important; }
html[data-theme="light"] .badge-member { background: #fef3c7 !important; color: #92400e !important; border: 1px solid #fcd34d !important; }
html[data-theme="light"] .badge-user { background: #e2e8f0 !important; color: #1e293b !important; border: 1px solid #cbd5e1 !important; }
html[data-theme="light"] .badge-guest { background: #e2e8f0 !important; color: #334155 !important; border: 1px solid #94a3b8 !important; }
html[data-theme="light"] .badge:not([class*="badge-"]) { background: #e2e8f0 !important; color: #1e293b !important; border: 1px solid #cbd5e1 !important; }

html[data-theme="ocean"] .badge-admin { background: #fee2e2 !important; color: #991b1b !important; border: 1px solid #fca5a5 !important; }
html[data-theme="ocean"] .badge-manager { background: #e0f2fe !important; color: #0369a1 !important; border: 1px solid #7dd3fc !important; }
html[data-theme="ocean"] .badge-trainer { background: #dcfce7 !important; color: #166534 !important; border: 1px solid #86efac !important; }
html[data-theme="ocean"] .badge-member { background: #fef3c7 !important; color: #92400e !important; border: 1px solid #fcd34d !important; }
html[data-theme="ocean"] .badge-user { background: #f0f9ff !important; color: #0c4a6e !important; border: 1px solid #bae6fd !important; }
html[data-theme="ocean"] .badge-guest { background: #f0f9ff !important; color: #0369a1 !important; border: 1px solid #bae6fd !important; }
html[data-theme="ocean"] .badge:not([class*="badge-"]) { background: #f0f9ff !important; color: #0c4a6e !important; border: 1px solid #bae6fd !important; }

html[data-theme="contrast"] .badge-admin { background: #b91c1c !important; color: #ffffff !important; border: 2px solid #ffffff !important; }
html[data-theme="contrast"] .badge-manager { background: #0284c7 !important; color: #ffffff !important; border: 2px solid #ffffff !important; }
html[data-theme="contrast"] .badge-trainer { background: #15803d !important; color: #ffffff !important; border: 2px solid #ffffff !important; }
html[data-theme="contrast"] .badge-member { background: #b45309 !important; color: #ffffff !important; border: 2px solid #ffffff !important; }
html[data-theme="contrast"] .badge-user { background: #334155 !important; color: #ffffff !important; border: 2px solid #ffffff !important; }
html[data-theme="contrast"] .badge-guest { background: #475569 !important; color: #ffffff !important; border: 2px solid #ffffff !important; }
html[data-theme="contrast"] .badge:not([class*="badge-"]) { background: #000000 !important; color: #ffffff !important; border: 2px solid #ffffff !important; }


