/*
 * Cuik Theme Core v4.9.0
 * Preferencia global claro/oscuro, transiciones controladas y contraste semántico.
 */
:root {
  --cuik-theme-duration: 220ms;
  --cuik-theme-ease: cubic-bezier(.2,.8,.2,1);
  --cuik-theme-tooltip-bg: #171522;
  --cuik-theme-tooltip-text: #ffffff;
  --cuik-theme-tooltip-line: rgba(255,255,255,.16);
}

html[data-theme="light"] {
  --cuik-ui-panel: var(--cuik-theme-tooltip-bg);
  --cuik-ui-text: var(--cuik-theme-tooltip-text);
  --cuik-ui-line: var(--cuik-theme-tooltip-line);
  --cuik-ui-shadow: 0 18px 48px rgba(28,24,43,.28);
}

.cuik-theme-icon {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

[data-cuik-theme-toggle] {
  color: inherit;
}

html.cuik-theme-changing body,
html.cuik-theme-changing body::before,
html.cuik-theme-changing header,
html.cuik-theme-changing aside,
html.cuik-theme-changing main,
html.cuik-theme-changing section,
html.cuik-theme-changing nav,
html.cuik-theme-changing article,
html.cuik-theme-changing .card,
html.cuik-theme-changing .panel,
html.cuik-theme-changing .topbar,
html.cuik-theme-changing .core-shell-topbar,
html.cuik-theme-changing .core-shell-sidebar,
html.cuik-theme-changing button,
html.cuik-theme-changing a,
html.cuik-theme-changing input,
html.cuik-theme-changing select,
html.cuik-theme-changing textarea,
html.cuik-theme-changing table,
html.cuik-theme-changing th,
html.cuik-theme-changing td,
html.cuik-theme-changing svg,
html.cuik-theme-changing svg text {
  transition-property: background, background-color, color, border-color, box-shadow, fill, stroke;
  transition-duration: var(--cuik-theme-duration);
  transition-timing-function: var(--cuik-theme-ease);
}

/* Dashboard principal: botones claros y descripciones visibles en modo claro. */
html[data-theme="light"] .core-shell-menu,
html[data-theme="light"] .core-shell-action {
  background: linear-gradient(145deg, #ffffff, #f1edfb);
  color: #2e2444;
  border-color: rgba(70,48,116,.22);
  box-shadow: 0 8px 22px rgba(46,34,75,.10);
}
html[data-theme="light"] .core-shell-menu:hover,
html[data-theme="light"] .core-shell-action:hover {
  background: linear-gradient(145deg, #ffffff, #e9e1fa);
  color: #241936;
  border-color: rgba(111,66,193,.42);
}
html[data-theme="light"] .core-shell-action.danger {
  background: linear-gradient(145deg, #fff8fa, #fbe9ef);
  color: #9b2c52;
  border-color: rgba(155,44,82,.24);
}
html[data-theme="light"] .core-shell-action.danger:hover {
  background: linear-gradient(145deg, #fff3f7, #f8dce6);
  color: #842243;
  border-color: rgba(155,44,82,.40);
}
html[data-theme="light"] .core-shell-primary-actions .core-shell-action::after {
  color: currentColor;
}
html[data-theme="light"] .core-shell-theme {
  background: #ffffff;
  color: #342255;
}

/* Tooltip compartido: siempre alto contraste, sin herencia accidental. */
#cuikGlobalTooltip {
  background: var(--cuik-theme-tooltip-bg) !important;
  color: var(--cuik-theme-tooltip-text) !important;
  border-color: var(--cuik-theme-tooltip-line) !important;
}

/* Botones de tema: icono únicamente y dimensiones consistentes. */
#themeToggle[data-cuik-theme-toggle],
#fichasThemeBtn[data-cuik-theme-toggle],
#geoThemeBtn[data-cuik-theme-toggle],
#btnTheme[data-cuik-theme-toggle],
#themeBtn[data-cuik-theme-toggle],
#pushThemeBtn[data-cuik-theme-toggle] {
  display: inline-grid;
  place-items: center;
}
#geoThemeBtn[data-cuik-theme-toggle] {
  width: 42px;
  min-width: 42px;
  justify-self: start;
  padding: 0;
  text-align: center;
}
#btnTheme[data-cuik-theme-toggle] {
  width: 42px;
  min-width: 42px;
  padding: 0;
}
#btnTheme[data-cuik-theme-toggle] .label,
#geoThemeBtn[data-cuik-theme-toggle] .geo-side-label {
  display: none !important;
}

/* Mensajes Push: paleta clara nativa del módulo. */
html[data-theme="light"] .push-shell {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface2: #f7f8fc;
  --surface3: #eceaf5;
  --line: rgba(42,35,67,.12);
  --text: #171526;
  --muted: #666a7c;
  --shadow: 0 18px 48px rgba(39,31,68,.12);
}
html[data-theme="light"] body.push-page {
  background: radial-gradient(circle at 80% 0, rgba(124,58,237,.12), transparent 31%), #f3f5fa;
  color: #171526;
}
html[data-theme="light"] .push-shell .push-sidebar {
  background: rgba(255,255,255,.96);
}
html[data-theme="light"] .push-shell .push-sidebar nav button:hover,
html[data-theme="light"] .push-shell .push-sidebar nav button.active {
  color: #2a2140;
}
html[data-theme="light"] .push-shell .push-topbar {
  background: rgba(247,248,252,.92);
}
html[data-theme="light"] .push-shell .icon-btn,
html[data-theme="light"] .push-shell .button.secondary,
html[data-theme="light"] .push-shell .table-action {
  background: #ffffff;
  color: #2a2140;
}
html[data-theme="light"] .push-shell .kpi,
html[data-theme="light"] .push-shell .panel,
html[data-theme="light"] .push-shell .device-card,
html[data-theme="light"] .push-shell .modal-card {
  background: linear-gradient(145deg, #ffffff, #f8f8fc);
  color: #171526;
}
html[data-theme="light"] .push-shell .chart-grid { stroke: rgba(40,33,64,.10); }
html[data-theme="light"] .push-shell .chart-dot { stroke: #ffffff; }
html[data-theme="light"] .push-shell .chart-label { fill: #666a7c; }
html[data-theme="light"] .push-shell .donut::before { background: #ffffff; }
html[data-theme="light"] .push-shell input,
html[data-theme="light"] .push-shell textarea,
html[data-theme="light"] .push-shell select {
  background: #ffffff;
  color: #171526;
}
html[data-theme="light"] .push-shell legend,
html[data-theme="light"] .push-shell .check-card span,
html[data-theme="light"] .push-shell .scope-row label,
html[data-theme="light"] .push-shell .user-option span,
html[data-theme="light"] .push-shell .confirm-check {
  color: #272238;
}
html[data-theme="light"] .push-shell .check-card,
html[data-theme="light"] .push-shell .user-option,
html[data-theme="light"] .push-shell .confirm-summary,
html[data-theme="light"] .push-shell th {
  background: rgba(111,66,193,.045);
}
html[data-theme="light"] .push-shell .chip:has(input:checked) {
  color: #362261;
}
html[data-theme="light"] .push-shell .audience-summary {
  color: #245466;
}
html[data-theme="light"] .push-shell .modal-backdrop {
  background: rgba(26,22,37,.48);
}
html[data-theme="light"] .push-shell .modal-close {
  color: #2a2140;
}
html[data-theme="light"] .push-shell .toast {
  background: #ffffff;
  color: #171526;
}

@media (prefers-reduced-motion: reduce) {
  html.cuik-theme-changing *,
  html.cuik-theme-changing *::before,
  html.cuik-theme-changing *::after {
    transition: none !important;
  }
}
