/* ==========================================================================
   BADGES CONTRAST FIX — aplica a TODO el panel (Ola E·5 2026-04-29)
   Problema: el patrón legacy "bg-{color}-500/20 text-{color}-300" era
   color sobre color en dark mode → ilegible (rojo sobre rojo, etc.).
   Fix: subir el texto a -100 y agregar ring sutil del color base.
   Esta regla aplica AUTOMATICAMENTE a cualquier elemento con esos
   patrones de Tailwind sin tocar HTML/JS de los 272 lugares afectados.
   ========================================================================== */

/* Texto pastel claro para todos los .text-{color}-{300|400} en dark mode */
[class*="text-red-300"]    { color: #fecaca !important; }
[class*="text-red-400"]    { color: #fca5a5 !important; }
[class*="text-yellow-300"] { color: #fef9c3 !important; }
[class*="text-yellow-400"] { color: #fde047 !important; }
[class*="text-amber-300"]  { color: #fef3c7 !important; }
[class*="text-amber-400"]  { color: #fcd34d !important; }
[class*="text-green-300"]  { color: #dcfce7 !important; }
[class*="text-green-400"]  { color: #86efac !important; }
[class*="text-emerald-300"]{ color: #d1fae5 !important; }
[class*="text-emerald-400"]{ color: #6ee7b7 !important; }
[class*="text-blue-300"]   { color: #dbeafe !important; }
[class*="text-blue-400"]   { color: #93c5fd !important; }
[class*="text-cyan-300"]   { color: #cffafe !important; }
[class*="text-cyan-400"]   { color: #67e8f9 !important; }
[class*="text-orange-300"] { color: #ffedd5 !important; }
[class*="text-orange-400"] { color: #fdba74 !important; }
[class*="text-violet-300"] { color: #ede9fe !important; }
[class*="text-violet-400"] { color: #c4b5fd !important; }
[class*="text-pink-300"]   { color: #fce7f3 !important; }
[class*="text-pink-400"]   { color: #f9a8d4 !important; }
[class*="text-rose-300"]   { color: #ffe4e6 !important; }
[class*="text-rose-400"]   { color: #fda4af !important; }
[class*="text-lime-300"]   { color: #ecfccb !important; }
[class*="text-lime-400"]   { color: #bef264 !important; }
[class*="text-sky-300"]    { color: #e0f2fe !important; }
[class*="text-sky-400"]    { color: #7dd3fc !important; }

/* Modo claro: el texto necesita color OSCURO para legibilidad sobre bg pastel */
html.light [class*="text-red-300"],    html.light [class*="text-red-400"]    { color: #b91c1c !important; }
html.light [class*="text-yellow-300"], html.light [class*="text-yellow-400"] { color: #a16207 !important; }
html.light [class*="text-amber-300"],  html.light [class*="text-amber-400"]  { color: #b45309 !important; }
html.light [class*="text-green-300"],  html.light [class*="text-green-400"]  { color: #166534 !important; }
html.light [class*="text-emerald-300"],html.light [class*="text-emerald-400"]{ color: #047857 !important; }
html.light [class*="text-blue-300"],   html.light [class*="text-blue-400"]   { color: #1e40af !important; }
html.light [class*="text-cyan-300"],   html.light [class*="text-cyan-400"]   { color: #0e7490 !important; }
html.light [class*="text-orange-300"], html.light [class*="text-orange-400"] { color: #c2410c !important; }
html.light [class*="text-violet-300"], html.light [class*="text-violet-400"] { color: #6d28d9 !important; }
html.light [class*="text-pink-300"],   html.light [class*="text-pink-400"]   { color: #be185d !important; }
html.light [class*="text-rose-300"],   html.light [class*="text-rose-400"]   { color: #be123c !important; }
html.light [class*="text-lime-300"],   html.light [class*="text-lime-400"]   { color: #4d7c0f !important; }
html.light [class*="text-sky-300"],    html.light [class*="text-sky-400"]    { color: #0369a1 !important; }

/* ==========================================================================
   Guiadeo Panel — Polish Layer v1.0
   Mejoras UX encima del design-system.css:
   - Búsqueda omnipresente
   - Density toggle
   - Dark/light toggle
   - Breadcrumbs
   - Keyboard shortcuts hint
   - Sidebar footer Harold
   - Activo nav más claro
   Autor: design-creative agent — 2026-04-25
   ========================================================================== */

/* ==========================================================================
   BÚSQUEDA OMNIPRESENTE — barra inline en el header de cada sección
   ========================================================================== */
.g-search-bar {
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  background: var(--g-surface-2);
  border: 1px solid var(--g-border);
  border-radius: var(--g-radius-md);
  padding: 0 var(--g-space-3);
  transition: border-color var(--g-transition-fast),
              box-shadow var(--g-transition-fast);
  min-width: 200px;
  max-width: 320px;
}

.g-search-bar:focus-within {
  border-color: var(--g-blue-500);
  box-shadow: 0 0 0 3px rgba(51, 141, 255, 0.14);
}

.g-search-bar svg {
  flex-shrink: 0;
  color: var(--g-text-disabled);
  transition: color var(--g-transition-fast);
}

.g-search-bar:focus-within svg {
  color: var(--g-blue-400);
}

.g-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.8125rem;
  font-family: var(--g-font-body);
  color: var(--g-text-primary);
  padding: 0.4rem 0;
}

.g-search-input::placeholder {
  color: var(--g-text-disabled);
}

.g-search-kbd {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-family: var(--g-font-mono);
  background: var(--g-surface-3);
  border: 1px solid var(--g-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--g-text-muted);
  pointer-events: none;
}

/* Mobile: sin kbd hint */
@media (max-width: 640px) {
  .g-search-kbd { display: none; }
  .g-search-bar { min-width: 140px; }
}

/* ==========================================================================
   KEYBOARD SHORTCUTS HINT — strip debajo del header en páginas de lista
   ========================================================================== */
.g-shortcuts-hint {
  display: flex;
  align-items: center;
  gap: var(--g-space-4);
  padding: 0.125rem var(--g-space-4);
  font-size: 0.6875rem;
  color: var(--g-text-disabled);
  border-bottom: 1px solid var(--g-border);
  background: var(--g-surface-1);
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-height: 22px;
}

.g-shortcuts-hint::-webkit-scrollbar { display: none; }

.g-shortcut {
  display: flex;
  align-items: center;
  gap: 4px;
}

.g-kbd {
  font-family: var(--g-font-mono);
  font-size: 0.625rem;
  background: var(--g-surface-3);
  border: 1px solid var(--g-border);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--g-text-secondary);
  line-height: 1.4;
}

/* Ocultar en pantallas chicas (laptop 13" y mobile) — A10 reducir chrome */
@media (max-width: 1024px) {
  .g-shortcuts-hint { display: none; }
}

/* A10 — compactar nav-groups (4px menos por barra, 8px total con 2 niveles) */
.nav-group {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* ==========================================================================
   DENSITY TOGGLE — compact / comfortable
   ========================================================================== */
.g-density-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--g-radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--g-text-muted);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color var(--g-transition-fast),
              background var(--g-transition-fast),
              border-color var(--g-transition-fast);
}

.g-density-btn:hover {
  background: var(--g-surface-2);
  color: var(--g-text-primary);
}

.g-density-btn.active {
  background: var(--g-surface-3);
  border-color: var(--g-border);
  color: var(--g-text-primary);
}

/* Modo compact: filas más pequeñas */
body.density-compact .g-table tbody td,
body.density-compact .g-table thead th {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

body.density-compact table tbody td,
body.density-compact table thead th {
  padding-top: 0.375rem !important;
  padding-bottom: 0.375rem !important;
}

/* ==========================================================================
   DARK / LIGHT TOGGLE — botón en el header
   ========================================================================== */
.g-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--g-radius-md);
  background: var(--g-surface-2);
  border: 1px solid var(--g-border);
  cursor: pointer;
  color: var(--g-text-muted);
  transition: color var(--g-transition-fast),
              background var(--g-transition-fast),
              border-color var(--g-transition-fast);
}

.g-theme-toggle:hover {
  background: var(--g-surface-3);
  color: var(--g-text-primary);
  border-color: var(--g-border-hover);
}

/* El ícono visible se alterna via JS */
.g-theme-toggle .icon-sun  { display: none; }
.g-theme-toggle .icon-moon { display: block; }
html.light .g-theme-toggle .icon-sun  { display: block; }
html.light .g-theme-toggle .icon-moon { display: none; }

/* ==========================================================================
   BREADCRUMBS — páginas de detalle
   ========================================================================== */
.g-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  font-size: 0.75rem;
  color: var(--g-text-muted);
  margin-bottom: var(--g-space-4);
}

.g-breadcrumb a {
  color: var(--g-text-muted);
  text-decoration: none;
  transition: color var(--g-transition-fast);
}

.g-breadcrumb a:hover { color: var(--g-blue-400); }

.g-breadcrumb-sep {
  color: var(--g-text-disabled);
  font-size: 0.625rem;
  line-height: 1;
}

.g-breadcrumb-current {
  color: var(--g-text-secondary);
  font-weight: 500;
}

/* ==========================================================================
   SIDEBAR FOOTER — Harold avatar + logout
   ========================================================================== */
.g-sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--g-border);
  padding: var(--g-space-3) var(--g-space-4);
  display: flex;
  align-items: center;
  gap: var(--g-space-3);
}

.g-sidebar-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--g-radius-full);
  background: var(--g-blue-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.g-sidebar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.g-sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--g-text-primary);
  line-height: 1.2;
}

.g-sidebar-user-role {
  font-size: 0.6875rem;
  color: var(--g-text-muted);
}

.g-sidebar-logout {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--g-radius-sm);
  color: var(--g-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--g-transition-fast),
              background var(--g-transition-fast);
}

.g-sidebar-logout:hover {
  color: var(--g-accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

/* ==========================================================================
   NAV ACTIVE — más visible que el borde inferior delgado actual
   ========================================================================== */

/* Nivel 1: fondo + borde inferior 3px */
.nav-group.active,
.nav-group[data-active="true"] {
  color: #ffffff !important;
  border-bottom-color: var(--g-blue-400) !important;
  background: rgba(51, 141, 255, 0.08);
  border-bottom-width: 3px !important;
}

/* Subtabs */
.sub-tab.active,
.sub-tab[data-active="true"] {
  color: var(--g-blue-400) !important;
  border-bottom-color: var(--g-blue-400) !important;
  border-bottom-width: 2px !important;
  font-weight: 600 !important;
}

/* ==========================================================================
   SECCIÓN HEADER — layout consistente con search integrado
   ========================================================================== */
.g-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--g-space-3);
  margin-bottom: var(--g-space-4);
}

.g-section-head-left {
  display: flex;
  align-items: center;
  gap: var(--g-space-3);
}

.g-section-head-right {
  display: flex;
  align-items: center;
  gap: var(--g-space-2);
  flex-wrap: wrap;
}

/* ==========================================================================
   TABLA DE ACCIONES — botones edit/delete consistentes
   ========================================================================== */

/* Asegura que la última columna (acciones) tenga ancho mínimo */
.g-table th:last-child,
table thead th:last-child {
  text-align: center;
  min-width: 100px;
}

/* Row action buttons — visible siempre en mobile, fade-in en desktop */
.g-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* En desktop, los botones de acción aparecen en hover de la fila */
@media (min-width: 768px) {
  .g-table tbody tr .g-row-actions .g-btn,
  table tbody tr .row-actions .action-btn {
    opacity: 0.5;
    transition: opacity var(--g-transition-fast);
  }

  .g-table tbody tr:hover .g-row-actions .g-btn,
  table tbody tr:hover .row-actions .action-btn {
    opacity: 1;
  }
}

/* ==========================================================================
   OFFICE PAGE — mejoras específicas
   ========================================================================== */

/* Agent desk card mejorada */
.agent-desk {
  background: var(--g-surface-1);
  border: 1px solid var(--g-border);
  border-radius: var(--g-radius-lg);
  padding: var(--g-space-5);
  transition: border-color var(--g-transition-fast),
              box-shadow var(--g-transition-fast);
}

.agent-desk:hover {
  border-color: var(--g-border-hover);
  box-shadow: var(--g-shadow-sm);
}

.agent-desk.desk-active {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1),
              var(--g-shadow-sm);
}

/* ==========================================================================
   ROADMAP — consistencia con design system
   ========================================================================== */
.g-roadmap-phase {
  background: var(--g-surface-1);
  border: 1px solid var(--g-border);
  border-radius: var(--g-radius-lg);
  padding: var(--g-space-5);
  transition: border-color var(--g-transition-fast),
              box-shadow var(--g-transition-fast);
}

.g-roadmap-phase:hover {
  border-color: var(--g-border-hover);
}

.g-roadmap-phase.phase-done {
  border-left: 3px solid var(--g-accent-green);
}

.g-roadmap-phase.phase-active {
  border-left: 3px solid var(--g-blue-400);
}

.g-roadmap-phase.phase-pending {
  border-left: 3px solid var(--g-text-disabled);
}

/* ==========================================================================
   CONTRATO PAGE — light mode consistente
   ========================================================================== */
.g-contract-header {
  background: var(--g-surface-1);
  border-bottom: 1px solid var(--g-border);
}

/* ==========================================================================
   ADMIN COPILOT — reemplaza estilos hardcoded inline
   ========================================================================== */
.g-copilot-confirm-card {
  background: var(--g-surface-2);
  border: 2px solid var(--g-accent-lime);
  border-radius: var(--g-radius-md);
  padding: var(--g-space-4);
  max-width: 95%;
}

.g-copilot-confirm-title {
  font-size: 0.75rem;
  color: var(--g-accent-lime);
  font-weight: 700;
  margin-bottom: var(--g-space-2);
  font-family: var(--g-font-mono);
}

/* ==========================================================================
   SECTION SEARCH FILTER — highlight en filas filtradas
   ========================================================================== */
tr.search-match td {
  background: rgba(51, 141, 255, 0.04) !important;
}

tr.search-no-match {
  display: none !important;
}

/* ==========================================================================
   EMPTY STATE MEJORADO — en lugar de texto plano en skeleton
   ========================================================================== */
.g-table-empty {
  padding: var(--g-space-12) var(--g-space-8);
  text-align: center;
}

.g-table-empty-icon {
  font-size: 2rem;
  opacity: 0.3;
  margin-bottom: var(--g-space-3);
}

.g-table-empty-text {
  font-size: 0.875rem;
  color: var(--g-text-muted);
}

/* ==========================================================================
   LOADING PULSE — mejora del .skeleton legacy
   ========================================================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--g-surface-2) 25%,
    var(--g-surface-3) 50%,
    var(--g-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: g-shimmer 1.6s ease-in-out infinite;
  border-radius: var(--g-radius-sm);
  color: transparent !important;
}

/* ==========================================================================
   SCORE PAGE — reemplaza el tema claro standalone por tokens del sistema
   ========================================================================== */
.score-page-body {
  font-family: var(--g-font-body);
}

/* ==========================================================================
   KANBAN BOARD — usa tokens en vez de valores hardcoded
   ========================================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--g-space-4);
}

@media (max-width: 768px) {
  .kanban-board { grid-template-columns: 1fr; }
}

.kanban-column {
  background: var(--g-surface-1);
  border: 1px solid var(--g-border);
  border-radius: var(--g-radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.kanban-column-header {
  padding: 0.75rem var(--g-space-4);
  font-size: 0.875rem;
  font-weight: 600;
  border-bottom: 1px solid var(--g-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--g-text-primary);
}

.kanban-cards {
  padding: var(--g-space-2);
  display: flex;
  flex-direction: column;
  gap: var(--g-space-2);
  flex: 1;
}

.kanban-card {
  background: var(--g-surface-2);
  border: 1px solid var(--g-border);
  border-radius: var(--g-radius-md);
  padding: 0.625rem 0.75rem;
  border-left: 3px solid transparent;
  transition: border-color var(--g-transition-fast),
              box-shadow var(--g-transition-fast);
}

.kanban-card:hover { box-shadow: var(--g-shadow-sm); }
.kanban-card-hecho { border-left-color: var(--g-accent-green); }
.kanban-card-progreso { border-left-color: var(--g-accent-amber); }
.kanban-card-alta { border-left-color: var(--g-accent-rose); }
.kanban-card-media { border-left-color: var(--g-text-disabled); }

.kanban-card-title {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--g-text-primary);
  margin-bottom: 0.25rem;
}

.kanban-card-desc {
  font-size: 0.6875rem;
  color: var(--g-text-muted);
  line-height: 1.3;
}

/* ==========================================================================
   AUTOCOMPLETE — usa tokens (reemplaza hardcoded bg #1e2130)
   ========================================================================== */
.autocomplete-dropdown {
  background: var(--g-surface-2);
  border: 1px solid var(--g-border);
  border-radius: var(--g-radius-md);
  box-shadow: var(--g-shadow-md);
}

.autocomplete-item {
  border-bottom: 1px solid var(--g-border);
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background: var(--g-surface-3);
}

.autocomplete-item-name {
  color: var(--g-text-primary);
}

.autocomplete-item-detail {
  color: var(--g-text-muted);
}

/* ==========================================================================
   SEO COMPARISON GRID — usa tokens
   ========================================================================== */
.seo-comparison-grid {
  border: 1px solid var(--g-border);
}

.seo-comparison-grid > div {
  border-right: 1px solid var(--g-border);
}

/* ==========================================================================
   HEADER WORDMARK — display font en el logo del panel
   ========================================================================== */
.panel-wordmark {
  font-family: var(--g-font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--g-blue-400);
}

/* ==========================================================================
   RESPONSIVE — mejoras mobile del panel admin
   ========================================================================== */
@media (max-width: 640px) {
  .g-section-head { flex-direction: column; align-items: flex-start; }
  .g-search-bar { max-width: 100%; width: 100%; }
}

/* ==========================================================================
   MODAL CLOSE BUTTONS — touch target mínimo 44px (WCAG 2.5.5)
   Aplica a todos los botones &times; de modales del panel.
   ========================================================================== */
button.text-2xl.leading-none,
button.text-xl.leading-none,
button.text-lg.leading-none {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--g-radius-md);
  border: none;
  cursor: pointer;
  background: none;
  transition: background var(--g-transition-fast), color var(--g-transition-fast);
}

button.text-2xl.leading-none:hover,
button.text-xl.leading-none:hover,
button.text-lg.leading-none:hover {
  background: var(--g-surface-3);
}

/* ==========================================================================
   SECTION TITLES — consistencia tipográfica h2 dentro de tab-content
   ========================================================================== */
.tab-content h2:not([class*="g-title"]) {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--g-text-primary);
  letter-spacing: -0.01em;
}

/* ==========================================================================
   HEALTH BAR — más compacto y legible
   ========================================================================== */
#health-bar {
  font-size: 0.75rem;
}

#health-bar .flex.items-center.gap-1\.5 > span:first-child {
  color: var(--g-text-disabled);
}

/* ==========================================================================
   TABLA HEADERS — consistencia (reemplaza text-xs uppercase legacy)
   ========================================================================== */
table thead th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--g-text-muted);
}

/* ==========================================================================
   TABLA HOVER ROW — feedback visual en filas
   ========================================================================== */
table tbody tr {
  transition: background var(--g-transition-fast);
}

table tbody tr:hover {
  background: var(--g-surface-3);
}

/* ==========================================================================
   SELECT INPUTS — estilos consistentes
   ========================================================================== */
select.bg-surface-700,
input.bg-surface-700 {
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--g-transition-fast), box-shadow var(--g-transition-fast);
}

select.bg-surface-700:focus,
input.bg-surface-700:focus {
  border-color: var(--g-blue-500);
  box-shadow: 0 0 0 3px rgba(51, 141, 255, 0.14);
  outline: none;
}

/* ==========================================================================
   SUMMARY / KPI CARDS — alineación vertical consistente
   ========================================================================== */
.bg-surface-800.border.border-surface-600.rounded-xl.p-5,
.bg-surface-800.border.border-surface-600.rounded-xl.px-4.py-3 {
  transition: border-color var(--g-transition-fast), box-shadow var(--g-transition-fast);
}

.bg-surface-800.border.border-surface-600.rounded-xl.p-5:hover,
.bg-surface-800.border.border-surface-600.rounded-xl.px-4.py-3:hover {
  border-color: var(--g-border-hover);
}

/* ==========================================================================
   MOBILE NAV GRUPO — mejor touch target
   ========================================================================== */
@media (max-width: 1024px) {
  nav#nav-groups button.nav-group {
    min-height: 44px;
  }
}

/* ==========================================================================
   SCROLL NAV — ocultar scrollbar visualmente en nav grupos
   ========================================================================== */
#nav-groups > div::-webkit-scrollbar,
#nav-subtabs > div::-webkit-scrollbar {
  display: none;
}

/* ==========================================================================
   HEALTH BAR — compacto, indicadores con color semántico
   ========================================================================== */
#health-bar > div {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

/* ==========================================================================
   MAIN CONTENT — padding top reducido en mobile
   ========================================================================== */
@media (max-width: 640px) {
  main.max-w-7xl {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }
}

/* ==========================================================================
   FOCUS VISIBLE — WCAG AA en toda la app
   ========================================================================== */
*:focus-visible {
  outline: 2px solid var(--g-blue-400);
  outline-offset: 2px;
  border-radius: var(--g-radius-sm);
}

/* Excepciones: no mostrar outline en elementos con estilos propios de foco */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
}

/* ==========================================================================
   BOTONES PRIMARIOS LEGACY — consistencia con design system
   ========================================================================== */
.bg-guiadeo-500,
.bg-guiadeo-600 {
  transition: background var(--g-transition-fast), box-shadow var(--g-transition-fast);
}

/* ==========================================================================
   TABLA — sticky header visual
   ========================================================================== */
.bg-surface-800.border.border-surface-600.rounded-xl.overflow-hidden thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

/* ==========================================================================
   SECCIÓN HEADER — padding consistente en todas las secciones tab
   ========================================================================== */
.tab-content.section-fade {
  padding-bottom: 3rem;
}

/* ==========================================================================
   METRIC VALUE — mejorar contraste con fondo en dark mode
   ========================================================================== */
.text-2xl.font-bold.mt-1.skeleton {
  min-height: 2rem;
  min-width: 4rem;
  display: block;
  border-radius: var(--g-radius-sm);
}

/* V7 — skeleton metric values con dimensión mínima visible (shimmer pre-load) */
.skeleton-metric-value,
.skeleton-metric,
.metric-value.skeleton {
  min-height: 1.5rem;
  min-width: 4rem;
  display: inline-block;
  border-radius: var(--g-radius-sm);
}

/* ==========================================================================
   V2 — HEALTH STATUS DOT (consistencia visual junto al label)
   ========================================================================== */
.health-status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(156, 163, 175, 0.6);
  margin-right: 0.125rem;
  flex-shrink: 0;
  transition: background var(--g-transition-fast);
}
.health-status-dot.is-ok    { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.45); }
.health-status-dot.is-warn  { background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, 0.45); }
.health-status-dot.is-error { background: #f87171; box-shadow: 0 0 6px rgba(248, 113, 113, 0.45); }

/* ==========================================================================
   V3 — BOTÓN SALIR (touch target 44px + ícono logout)
   ========================================================================== */
.g-btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 0.875rem;
  border-radius: var(--g-radius-md, 8px);
  border: 1px solid var(--g-border-v2, rgba(255,255,255,0.12));
  background: rgba(255,255,255,0.04);
  color: var(--g-text-v2-primary, #F4F4F8);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--g-transition-fast), color var(--g-transition-fast), border-color var(--g-transition-fast);
}
.g-btn-logout:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}
.g-btn-logout:focus-visible {
  outline: 2px solid var(--g-blue-400);
  outline-offset: 2px;
}

/* ==========================================================================
   V5 — MOBILE NAV SCROLLABLE (9+ grupos no entran en grid 3x2)
   ========================================================================== */
.nav-mobile-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-mobile-scroll::-webkit-scrollbar {
  display: none;
}
.nav-mobile-scroll > .nav-group,
.nav-mobile-scroll > a {
  flex: 0 0 auto;
  padding-left: 0.875rem;
  padding-right: 0.875rem;
  white-space: nowrap;
  min-height: 44px;
}

/* ==========================================================================
   V8 — SELECT inputs con chevron consistente (appearance:none + svg)
   ========================================================================== */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A8A8C0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  background-size: 12px 12px;
  padding-right: 2rem;
}
select::-ms-expand {
  display: none;
}
