﻿/* TestiGO Design System — light theme, cálido y moderno */
/* Tipografía Inter desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   Variables del design system
   ============================================================ */
:root {
  /* Fondos */
  --bg-base:       #F3F6FB;
  --bg-surface:    #FFFFFF;
  --bg-elevated:   #F0EEE8;
  --bg-input:      #FAFAF8;
  --bg-nav:        #1C1C28;

  /* Acento violeta */
  --accent:        #2563EB;
  --accent-light:  #EFF6FF;
  --accent-dark:   #1D4ED8;
  --accent-glow:   rgba(37, 99, 235, 0.25);

  /* Colores semánticos */
  --success:       #059669;
  --success-bg:    #ECFDF5;
  --warning:       #D97706;
  --warning-bg:    #FFFBEB;
  --danger:        #DC2626;
  --danger-bg:     #FEF2F2;
  --info:          #0284C7;
  --info-bg:       #F0F9FF;

  /* Texto */
  --text-primary:   #0F172A;
  --text-secondary: #64648A;
  --text-muted:     #A8A8C0;

  /* Bordes */
  --border:        rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);

  /* Sombras */
  --shadow-sm:     0 1px 2px rgba(15,23,42,0.06);
  --shadow-md:     0 1px 2px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.08);
  --shadow-lg:     0 2px 4px rgba(15,23,42,0.08), 0 16px 40px rgba(15,23,42,0.14);
  --shadow-accent: 0 8px 24px rgba(37, 99, 235,0.25);
  /* Elevación en dos capas: un contacto corto y nítido más una sombra ambiental difusa.
     Es lo que separa una tarjeta que parece apoyada de una con una mancha gris debajo. */
  --shadow-card:   0 1px 2px rgba(15,23,42,0.06), 0 4px 16px rgba(15,23,42,0.06), 0 0 0 1px rgba(15,23,42,0.04);
  --shadow-card-hover: 0 2px 4px rgba(15,23,42,0.08), 0 12px 32px rgba(15,23,42,0.12), 0 0 0 1px rgba(37,99,235,0.14);

  /* Radios */
  --radius-card:   20px;
  --radius-btn:    14px;
  --radius-input:  12px;
  --radius-pill:   999px;

  /* Transiciones */
  --ease-material: cubic-bezier(0.4, 0, 0.2, 1);
  --t-micro:       200ms;
  --t-normal:      250ms;
  --t-page:        300ms;
}

/* ============================================================
   Reset y base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--t-micro) var(--ease-material);
}

a:hover {
  color: var(--accent-dark);
}

/* ============================================================
   Animaciones de página y entrada
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

/* Clase de animación al entrar en viewport */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--t-page) var(--ease-material),
              transform var(--t-page) var(--ease-material);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Página — animación de entrada
   ============================================================ */
.page {
  animation: fadeInUp var(--t-page) var(--ease-material) both;
}

/* ============================================================
   Layout principal
   ============================================================ */
.tgo-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.tgo-sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg-nav);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 16px;
}

.tgo-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 32px;
}

.tgo-brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2s var(--ease-material) infinite;
}

/* Isotipo de la marca: sustituye al antiguo punto de color */
.tgo-isotipo {
  display: block;
  flex-shrink: 0;
  /* Sombra tenue en el tono del acento para que no se vea plano sobre la nav oscura */
  filter: drop-shadow(0 2px 6px rgba(37, 99, 235, 0.45));
}

.tgo-login-logo .tgo-isotipo {
  filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.28));
}

.tgo-brand-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.tgo-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tgo-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--t-micro) var(--ease-material);
  cursor: pointer;
}

.tgo-nav-item i {
  font-size: 16px;
  flex-shrink: 0;
  opacity: 0.8;
}

.tgo-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
}

.tgo-nav-item.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.tgo-nav-item.active i {
  opacity: 1;
}

/* Pie de sidebar */
.tgo-sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tgo-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  transition: background var(--t-micro) var(--ease-material);
  cursor: pointer;
}

.tgo-user-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.tgo-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.25);
  color: #93C5FD;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.tgo-user-info {
  flex: 1;
  min-width: 0;
}

.tgo-user-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tgo-user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}

/* Área de contenido */
.tgo-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Barra superior */
.tgo-topbar {
  height: 60px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  animation: fadeIn var(--t-normal) var(--ease-material);
}

.tgo-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.tgo-breadcrumb-sep {
  font-size: 11px;
  color: var(--text-muted);
}

.tgo-breadcrumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* Botón logout en topbar */
.tgo-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--t-micro) var(--ease-material);
  font-family: inherit;
}

.tgo-logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}

/* Main content area */
.tgo-main {
  flex: 1;
  padding: 32px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  animation: fadeInUp var(--t-page) var(--ease-material) both;
}

/* ============================================================
   Headers de página
   ============================================================ */
.tgo-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.tgo-page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tgo-page-title i {
  color: var(--accent);
}

.tgo-page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================================
   Tarjetas
   ============================================================ */
.card-tgo {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform var(--t-micro) var(--ease-material),
              box-shadow var(--t-micro) var(--ease-material);
}

.card-tgo:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}

/* Tarjeta de captura */
.card-captura {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-micro) var(--ease-material),
              box-shadow var(--t-micro) var(--ease-material);
  box-shadow: var(--shadow-card);
  position: relative;
  height: 100%;
  cursor: pointer;
}

.card-captura:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-captura-thumb {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.card-captura-thumb-placeholder {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.card-captura-thumb-placeholder i {
  font-size: 28px;
  color: var(--accent);
  opacity: 0.6;
}

.card-captura-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-captura-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.card-captura-title:hover {
  color: var(--accent);
}

/* Stretched link para toda la tarjeta */
.card-captura-title.stretched-link::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  content: "";
}

.card-captura-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.card-captura-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================================================
   Botones
   ============================================================ */
.btn-tgo-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  /* Degradado corto y sombra en dos capas: da volumen sin parecer un botón de los 2000. */
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 12px 22px;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t-micro) var(--ease-material);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10),
              0 6px 18px rgba(37, 99, 235, 0.28);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-tgo-primary:hover {
  background: linear-gradient(180deg, var(--accent-dark) 0%, #1E40AF 100%);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.12),
              0 10px 26px rgba(37, 99, 235, 0.34);
  transform: translateY(-1px);
  color: #fff;
}

.btn-tgo-primary:active {
  transform: scale(0.98);
}

.btn-tgo-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #F0EEF8;
  color: var(--accent);
  border: none;
  border-radius: var(--radius-btn);
  padding: 12px 22px;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t-micro) var(--ease-material);
  text-decoration: none;
  white-space: nowrap;
}

.btn-tgo-secondary:hover {
  background: #E5E1F8;
  color: var(--accent);
}

.btn-tgo-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-btn);
  padding: 12px 22px;
  font-weight: 500;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t-micro) var(--ease-material);
  text-decoration: none;
  white-space: nowrap;
}

.btn-tgo-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.btn-tgo-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--danger-bg);
  color: var(--danger);
  border: none;
  border-radius: var(--radius-btn);
  padding: 12px 22px;
  font-weight: 600;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--t-micro) var(--ease-material);
  text-decoration: none;
  white-space: nowrap;
}

.btn-tgo-danger:hover {
  background: #FFE0DF;
  color: var(--danger);
}

/* ============================================================
   Inputs
   ============================================================ */
.input-tgo {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  color: var(--text-primary);
  padding: 13px 16px;
  font-family: inherit;
  font-size: 15px;
  width: 100%;
  transition: border-color var(--t-micro) var(--ease-material),
              box-shadow var(--t-micro) var(--ease-material),
              background var(--t-micro) var(--ease-material);
  outline: none;
}

.input-tgo::placeholder {
  color: #C0BDD8;
}

.input-tgo:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #fff;
}

.input-tgo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-tgo-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

.input-tgo.has-icon {
  padding-left: 38px;
}

.input-tgo-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-tgo-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

/* ============================================================
   Badges de estado
   ============================================================ */
.badge-tgo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}

.badge-tgo-success {
  background: var(--success-bg);
  color: var(--success);
}

.badge-tgo-warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-tgo-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-tgo-info {
  background: var(--info-bg);
  color: var(--info);
}

.badge-tgo-muted {
  background: #F3F4F6;
  color: #6B7280;
}

/* ============================================================
   Skeleton loading
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    #F0EEE8 25%,
    #E8E6E0 50%,
    #F0EEE8 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

.skeleton-card {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  height: 220px;
  box-shadow: var(--shadow-card);
}

/* ============================================================
   Filtros / chips
   ============================================================ */
.tgo-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tgo-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  transition: all var(--t-micro) var(--ease-material);
  white-space: nowrap;
  font-family: inherit;
}

.tgo-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.tgo-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ============================================================
   Grid de capturas
   ============================================================ */
.tgo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ============================================================
   Estado vacío
   ============================================================ */
.tgo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
  gap: 16px;
}

.tgo-empty-icon {
  font-size: 56px;
  opacity: 0.4;
  margin-bottom: 8px;
}

.tgo-empty-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.tgo-empty-desc {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 320px;
}

/* ============================================================
   Paginación
   ============================================================ */
.tgo-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.tgo-pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.tgo-pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tgo-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-micro) var(--ease-material);
}

.tgo-page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.tgo-page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.tgo-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tgo-page-btn:disabled:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
  background: var(--bg-surface);
}

/* ============================================================
   Detalle de captura
   ============================================================ */
.tgo-hero {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}

.tgo-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tgo-hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(transparent, rgba(246, 244, 239, 0.6));
}

.tgo-hero-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tgo-hero-placeholder i {
  font-size: 48px;
  color: var(--accent);
  opacity: 0.5;
}

.tgo-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .tgo-detail-grid {
    grid-template-columns: 1fr;
  }
}

.tgo-meta-item {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.tgo-meta-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 16px;
  flex-shrink: 0;
}

.tgo-meta-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tgo-meta-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Galería adjuntos */
.tgo-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.tgo-gallery::-webkit-scrollbar {
  height: 4px;
}

.tgo-gallery::-webkit-scrollbar-track {
  background: transparent;
}

.tgo-gallery::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.tgo-gallery-item {
  width: 100px;
  height: 80px;
  /* Es un <button> que abre el visor, no un enlace: hay que neutralizar los estilos del agente. */
  padding: 0;
  background: none;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  cursor: zoom-in;
  transition: transform var(--t-micro) var(--ease-material),
              box-shadow var(--t-micro) var(--ease-material);
}

.tgo-gallery-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.tgo-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tgo-gallery-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Audio player */
.tgo-audio {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.tgo-audio-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-light);
  border: 1.5px solid rgba(37, 99, 235, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 18px;
  flex-shrink: 0;
}

.tgo-audio audio {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  background: transparent;
}

/* ============================================================
   Sección heading dentro de páginas
   ============================================================ */
.tgo-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tgo-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   Layout de login
   ============================================================ */
.tgo-login-bg {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}

/* Panel izquierdo — decorativo */
.tgo-login-left {
  flex: 1;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.tgo-login-left-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

/* Marca del panel decorativo: aro con el icono del producto. */
.tgo-login-illu-mark {
  width: 88px;
  height: 88px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--accent);
  font-size: 38px;
  line-height: 1;
}

.tgo-login-illu-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-top: 24px;
  margin-bottom: 12px;
}

.tgo-login-illu-text {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 340px;
  margin: 0 auto;
  line-height: 1.65;
}

.tgo-login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.tgo-login-orb-1 {
  width: 400px; height: 400px;
  background: rgba(37, 99, 235, 0.10);
  top: -100px; left: -100px;
}

.tgo-login-orb-2 {
  width: 300px; height: 300px;
  background: rgba(37, 99, 235, 0.07);
  bottom: -60px; right: -60px;
}

/* Panel derecho — formulario */
.tgo-login-right {
  width: 480px;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.06);
}

.tgo-login-card {
  width: 100%;
  max-width: 360px;
  animation: scaleIn var(--t-page) var(--ease-material) both;
}

.tgo-login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tgo-login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.tgo-login-tagline {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

/* ============================================================
   Foco accesible — un único anillo para todo lo interactivo.
   Solo con :focus-visible, para que no salte al hacer clic con ratón.
   ============================================================ */
.btn-tgo-primary:focus-visible,
.btn-tgo-secondary:focus-visible,
.btn-tgo-ghost:focus-visible,
.btn-tgo-danger:focus-visible,
.input-tgo:focus-visible,
.tgo-chip:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-btn);
}

/* Selección de texto en el color de la marca */
::selection {
  background: var(--accent-light);
  color: var(--text-primary);
}

/* Barras de desplazamiento discretas en navegadores de escritorio */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.18) transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.16);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: rgba(15, 23, 42, 0.28); background-clip: content-box; }

/* Respeta a quien pide menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Alertas
   ============================================================ */
.alert-tgo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
}

.alert-tgo-danger {
  background: var(--danger-bg);
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: var(--danger);
}

.alert-tgo-info {
  background: var(--info-bg);
  border: 1px solid rgba(2, 132, 199, 0.2);
  color: var(--info);
}

/* ============================================================
   Tabla de usuarios
   ============================================================ */
.tgo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tgo-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  text-align: left;
  background: transparent;
}

.tgo-table td {
  padding: 16px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  vertical-align: middle;
}

.tgo-table tr:last-child td {
  border-bottom: none;
}

.tgo-table tbody tr {
  transition: background var(--t-micro) var(--ease-material);
}

.tgo-table tbody tr:hover td {
  background: #FAFAF8;
}

.tgo-table-wrapper {
  background: var(--bg-surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* Avatar con iniciales */
.tgo-initial-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ============================================================
   Spinner personalizado
   ============================================================ */
.tgo-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.tgo-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 32px;
  justify-content: center;
}

/* ============================================================
   Mapa
   ============================================================ */
.tgo-mapa-container {
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

/* ============================================================
   Overrides de Bootstrap para light theme
   ============================================================ */
.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-muted);
  content: "/";
}

.breadcrumb-item a {
  color: var(--text-secondary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 600;
}

/* Modal de error de Blazor */
#blazor-error-ui {
  background: var(--bg-surface);
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 10px;
  color: var(--text-primary);
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  padding: 12px 20px;
  position: fixed;
  z-index: 10000;
  display: none;
  box-shadow: var(--shadow-lg);
}

#blazor-error-ui a {
  color: var(--accent);
}

#blazor-error-ui button.dismiss {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  margin-left: 12px;
}

/* ============================================================
   Responsive — mobile (< 768px): sidebar → bottom nav
   ============================================================ */
@media (max-width: 767px) {
  .tgo-layout {
    flex-direction: column;
  }

  .tgo-sidebar {
    width: 100%;
    min-height: auto;
    height: auto;
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    z-index: 200;
    flex-direction: row;
    padding: 8px;
    overflow: visible;
  }

  .tgo-sidebar-brand,
  .tgo-sidebar-footer {
    display: none;
  }

  .tgo-nav {
    flex-direction: row;
    gap: 4px;
    justify-content: space-around;
    width: 100%;
  }

  .tgo-nav-item {
    flex-direction: column;
    padding: 8px 12px;
    font-size: 10px;
    gap: 4px;
    flex: 1;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
  }

  .tgo-nav-item i {
    font-size: 20px;
  }

  .tgo-content {
    padding-bottom: 70px;
  }

  .tgo-main {
    padding: 16px;
  }

  .tgo-topbar {
    padding: 0 16px;
  }

  .tgo-login-left {
    display: none;
  }

  .tgo-login-right {
    width: 100%;
    padding: 32px 24px;
  }

  .tgo-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Visor de fotos superpuesto (lightbox)
   ============================================================ */
.tgo-visor {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 12, 20, 0.92);
  backdrop-filter: blur(4px);
  padding: 72px 24px 132px;
  animation: fadeInUp var(--t-normal) var(--ease-material) both;
}

.tgo-visor:focus { outline: none; }

.tgo-visor-imagen {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.tgo-visor-barra {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  color: #fff;
}

.tgo-visor-contador {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}

.tgo-visor-boton,
.tgo-visor-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  cursor: pointer;
  transition: background var(--t-micro) var(--ease-material),
              transform var(--t-micro) var(--ease-material);
}

.tgo-visor-boton {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
}

.tgo-visor-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
}

.tgo-visor-anterior { left: 20px; }
.tgo-visor-siguiente { right: 20px; }

.tgo-visor-boton:hover,
.tgo-visor-nav:hover { background: rgba(255, 255, 255, 0.22); }
.tgo-visor-nav:hover { transform: translateY(-50%) scale(1.06); }

.tgo-visor-boton:focus-visible,
.tgo-visor-nav:focus-visible,
.tgo-visor-tira:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Tira de miniaturas inferior */
.tgo-visor-tiras {
  position: absolute;
  bottom: 44px;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 20px;
}

.tgo-visor-tira {
  width: 64px;
  height: 48px;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.55;
  background: none;
  transition: opacity var(--t-micro) var(--ease-material),
              border-color var(--t-micro) var(--ease-material);
}

.tgo-visor-tira img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tgo-visor-tira:hover { opacity: 0.85; }
.tgo-visor-tira.activa { opacity: 1; border-color: var(--accent); }

.tgo-visor-ayuda {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* El hero pasa a ser pulsable para abrir el visor. */
.tgo-hero-boton {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
}

@media (max-width: 768px) {
  .tgo-visor { padding: 64px 12px 120px; }
  .tgo-visor-nav { width: 40px; height: 40px; font-size: 18px; }
  .tgo-visor-anterior { left: 8px; }
  .tgo-visor-siguiente { right: 8px; }
  .tgo-visor-ayuda { display: none; }
}

/* ============================================================
   Accesibilidad — skip link
   ============================================================ */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden-focusable:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 14px;
}
