/* ══════════════════════════════════════════════════════════════════
   GBCloud Design System — components.css
   Componentes oficiales. Requiere tokens.css cargado ANTES.
   Clases fgc-*  = shell de la plataforma (header, sidebar) — mismos
                   nombres que futuregbcloud.css.
   Clases gbc-*  = componentes de contenido (botones, tablas, tabs,
                   layouts, fichas). Ver equivalencias en la doc.
   ══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────── HEADER ─────────────────────────── */
.fgc-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--fgc-topbar-height);
  background: var(--fgc-topbar-bg-theme);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px 0 8px;
  z-index: 1000;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
  font-family: var(--fgc-font-family);
}
.fgc-topbar-left, .fgc-topbar-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fgc-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: none; border-radius: 6px;
  background: transparent; color: #fff; cursor: pointer; position: relative; flex-shrink: 0;
  transition: background var(--fgc-transition);
}
.fgc-icon-btn:hover { background: rgba(255,255,255,0.12); }
.fgc-icon-btn.is-active { background: rgba(255,255,255,0.16); }
.fgc-icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
.fgc-logo { display: flex; align-items: center; gap: 8px; margin: 0 6px 0 4px; flex-shrink: 0; text-decoration: none; }
.fgc-logo img { height: 26px; width: auto; display: block; }
.fgc-logo-text { font-weight: 800; font-size: 16.5px; letter-spacing: -0.2px; color: #fff; white-space: nowrap; }
.fgc-divider { width: 1px; height: 24px; background: rgba(255,255,255,0.22); margin: 0 8px; flex-shrink: 0; }

/* Selector de faena */
.fgc-dropdown-wrap { position: relative; }
.fgc-tenant {
  display: flex; align-items: center; gap: 8px;
  width: 176px; padding: 4px 10px 4px 6px; border-radius: 20px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
  color: #fff; cursor: pointer; text-align: left; font-family: inherit;
  transition: background var(--fgc-transition), border-color var(--fgc-transition);
}
.fgc-tenant:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.22); }
.fgc-tenant-logo {
  position: relative; overflow: hidden;
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 9px; font-weight: 700;
}
/* Logo de la empresa sobre las iniciales (si no carga, se quita y quedan las iniciales) */
.fgc-tenant-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 2px; background: #fff; }
.fgc-tenant-item .fgc-tenant-logo { width: 26px; height: 26px; }

/* Buscador de faenas dentro del selector */
.fgc-tenant-search { position: relative; margin: 2px 4px 6px; }
.fgc-tenant-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; color: rgba(255,255,255,.5); pointer-events: none; }
.fgc-tenant-search input {
  width: 100%; height: 32px; padding: 0 10px 0 30px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff;
  font: 500 13px var(--fgc-font-family); outline: none;
}
.fgc-tenant-search input::placeholder { color: rgba(255,255,255,.5); }
.fgc-tenant-search input:focus { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.12); }
.fgc-tenant-list { display: flex; flex-direction: column; gap: 1px; }
.fgc-tenant-item[hidden] { display: none; }
.fgc-tenant-empty { padding: 10px; font-size: 12.5px; color: rgba(255,255,255,.6); text-align: center; }
.fgc-tenant-empty[hidden] { display: none; }
.fgc-tenant-text { flex: 1 1 auto; min-width: 0; }
.fgc-tenant-name { display: block; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fgc-tenant-tag { display: block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,0.55); line-height: 1; }
.fgc-tenant-chevron { width: 10px; height: 10px; color: rgba(255,255,255,0.55); flex-shrink: 0; transition: transform var(--fgc-transition); }
.fgc-dropdown-wrap.is-open .fgc-tenant-chevron { transform: rotate(180deg); }

/* Botón Configuración (texto + ícono) */
.fgc-settings-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px;
  border: none; border-radius: 8px; background: transparent; color: #fff;
  font-family: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.fgc-settings-btn:hover { background: rgba(255,255,255,0.12); }
.fgc-settings-btn svg { width: 17px; height: 17px; fill: currentColor; }

/* Perfil */
.fgc-profile-btn {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px;
  border: none; border-radius: 20px; background: transparent; color: #fff; cursor: pointer; font-family: inherit;
}
.fgc-profile-btn:hover { background: rgba(255,255,255,0.12); }
.fgc-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--fgc-red); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.fgc-profile-name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dropdowns (faena / perfil) */
.fgc-dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--fgc-surface); border: 1px solid var(--fgc-border); border-radius: var(--fgc-radius);
  box-shadow: var(--fgc-shadow); padding: 8px; display: none; flex-direction: column; gap: 2px; z-index: 1100;
}
.fgc-dropdown-menu.is-open { display: flex; }
.fgc-dropdown-menu.is-left { left: 0; right: auto; }
.fgc-dropdown-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--fgc-muted); padding: 8px 10px 4px; }
.fgc-dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px;
  font-size: 13.5px; font-weight: 500; color: var(--fgc-ink); cursor: pointer; border: none; background: transparent;
  font-family: inherit; text-align: left; width: 100%;
}
.fgc-dropdown-item:hover { background: var(--fgc-surface-hover); }
.fgc-dropdown-item.is-active { background: var(--fgc-active-tint); }
.fgc-dropdown-item.danger { color: var(--fgc-red); }
.fgc-dropdown-sep { height: 1px; background: var(--fgc-border); margin: 6px 2px; }

/* ─────────────────────────── SIDEBAR (drawer) ─────────────────────────── */
.fgc-drawer {
  position: fixed; top: var(--fgc-topbar-height); left: 0; bottom: 0;
  width: var(--fgc-drawer-width);
  background: var(--fgc-surface-alt);
  border-right: 1px solid transparent;
  transform: translateX(-100%); opacity: 0;
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1), opacity 200ms ease;
  z-index: 950; display: flex; flex-direction: column; overflow-y: auto;
  font-family: var(--fgc-font-family);
}
/* .is-open = fijo (pinned, con click) · .is-preview = asomado con hover */
.fgc-drawer.is-open, .fgc-drawer.is-preview { transform: translateX(0); opacity: 1; border-right-color: var(--fgc-border); }
.fgc-drawer.is-preview { box-shadow: var(--fgc-shadow); }
/* Fijo: empuja el contenido (no lo tapa) */
body.fgc-drawer-pinned { padding-left: var(--fgc-drawer-width); transition: padding-left 240ms cubic-bezier(0.16, 1, 0.3, 1); }

.fgc-drawer-section { padding: 6px 8px; }
.fgc-drawer-section-title {
  display: flex; align-items: center; gap: 6px; padding: 12px 10px 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--fgc-muted);
}
.fgc-drawer-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--fgc-drawer-text); cursor: pointer; text-decoration: none;
  transition: background var(--fgc-transition), color var(--fgc-transition);
}
.fgc-drawer-item:hover { background: var(--fgc-surface-hover); color: var(--fgc-navy); }
.fgc-drawer-item.is-active { background: var(--fgc-active-tint); color: var(--fgc-navy); font-weight: 600; }
.fgc-drawer-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: inherit; }
.fgc-drawer-icon svg { width: 100%; height: 100%; }
.fgc-drawer-icon svg:not([fill="none"]) { fill: currentColor; } /* íconos de módulo traen fill="none" + paths en currentColor */
.fgc-drawer-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fgc-drawer-chevron { margin-left: auto; width: 12px; height: 12px; color: var(--fgc-muted); transition: transform var(--fgc-transition); flex-shrink: 0; }
.fgc-drawer-group.is-open .fgc-drawer-chevron { transform: rotate(180deg); }
.fgc-drawer-submenu { display: none; flex-direction: column; gap: 1px; margin-top: 2px; padding-left: 30px; }
.fgc-drawer-group.is-open .fgc-drawer-submenu { display: flex; }
.fgc-drawer-submenu .fgc-drawer-item { font-size: 13px; padding: 8px 10px; }
/* Desplegable abierto: el título del grupo queda con el mismo aspecto que en hover (el usuario sabe en qué servicio está) */
.fgc-drawer-group.is-open > .fgc-drawer-item,
.fgc-drawer-group > .fgc-drawer-item.is-active { background: var(--fgc-surface-hover); color: var(--fgc-navy); font-weight: 500; }
.fgc-drawer-group.is-open > .fgc-drawer-item .fgc-drawer-chevron { color: var(--fgc-navy); }
/* Ícono activo sin rojo: toma el color del texto. El rojo queda solo para alertas */
.fgc-drawer-item.is-active .fgc-drawer-icon { color: currentColor; }
/* Línea guía: una sola línea vertical gris bajo el centro del ícono del grupo (19px desde el borde; el submenú parte en 30px).
   Parte 4px bajo el título y termina 4px antes del último hijo. Sin conectores horizontales ni codos. */
.fgc-drawer-submenu .fgc-drawer-item { position: relative; }
.fgc-drawer-submenu .fgc-drawer-item::before {
  content: ''; position: absolute; left: -11px; top: -1px; bottom: 0;
  border-left: 1.5px solid var(--fgc-tree-line); pointer-events: none;
}
.fgc-drawer-submenu .fgc-drawer-item:first-child::before { top: 4px; }
.fgc-drawer-submenu .fgc-drawer-item:last-child::before { bottom: 4px; }

/* ─────────────────────────── BOTONES DE MÓDULO ─────────────────────────── */
.fgc-drawer-item.fgc-module-item {
  min-height: 40px; padding: 8px 10px 8px 16px; gap: 19px; margin-bottom: 6px;
  border-radius: 8px; border: 1px solid var(--gbc-module-border);
  background: var(--gbc-module-bg); color: var(--gbc-module-text);
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease,
              transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 200ms ease;
}
.fgc-drawer-item.fgc-module-item:hover:not(.is-active):not(.is-locked),
.fgc-drawer-item.fgc-module-item.is-hover {
  background: var(--gbc-module-hover-bg); border-color: var(--gbc-module-hover-border);
  color: var(--gbc-module-hover-text); transform: translateX(3px); box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.fgc-drawer-item.fgc-module-item:active:not(.is-locked) { transform: translateX(1px) scale(0.97); }
.fgc-drawer-item.fgc-module-item.is-active {
  background: var(--gbc-module-active-bg); border-color: var(--gbc-module-active-border);
  color: var(--gbc-module-active-text); font-weight: 500;
}
.fgc-drawer-item.fgc-module-item.is-locked {
  background: var(--gbc-module-locked-bg); border-color: var(--gbc-module-locked-border);
  color: var(--gbc-module-locked-text); gap: 15px;
}
.fgc-drawer-item.fgc-module-item.is-locked:hover,
.fgc-drawer-item.fgc-module-item.is-locked.is-hover {
  background: var(--gbc-module-locked-hover-bg); border-color: var(--gbc-module-locked-hover-border);
  transform: translateX(3px);
}
.fgc-drawer-lock { margin-left: auto; width: 15px; height: 15px; flex-shrink: 0; display: inline-flex; color: currentColor; }
.fgc-drawer-lock svg { width: 100%; height: 100%; fill: currentColor; }
@media (prefers-reduced-motion: reduce) {
  .fgc-drawer-item.fgc-module-item { transition-duration: 0ms; }
}

/* ─────────────────────────── BOTONES ─────────────────────────── */
.gbc-btn {
  /* Alto FIJO + box-sizing:border-box = el borde se dibuja hacia ADENTRO.
     Así un botón con relleno, uno con borde y uno con degradado miden exactamente lo mismo. */
  --gbc-btn-h: var(--gbc-btn-h-md);
  box-sizing: border-box; height: var(--gbc-btn-h); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 16px; border: var(--gbc-btn-border) solid transparent; border-radius: var(--gbc-btn-radius);
  font-family: var(--fgc-font-family); font-size: 12.5px; font-weight: 700; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}
.gbc-btn i, .gbc-btn .gbc-ico { font-size: 14px; width: 14px; height: 14px; line-height: 14px; text-align: center; flex-shrink: 0; } /* íconos 14×14 */
/* Tamaños: en una misma fila, TODOS los botones usan el mismo */
.gbc-btn--sm { --gbc-btn-h: var(--gbc-btn-h-sm); padding: 0 12px; font-size: 12px; gap: 6px; }
.gbc-btn--lg { --gbc-btn-h: var(--gbc-btn-h-lg); padding: 0 18px; font-size: 13.5px; }
.gbc-btn:focus-visible { outline: 2px solid var(--gbc-info); outline-offset: 2px; }
.gbc-btn:disabled, .gbc-btn.is-disabled { opacity: .5; cursor: not-allowed; }

/* Primario — azul GBCloud. UNO por fila de acciones, siempre al final (derecha). */
.gbc-btn--primary,
.gbc-btn--primary:link, .gbc-btn--primary:visited {
  background: var(--gbc-btn-primary-bg); color: var(--gbc-btn-primary-text);
  border: 1.5px solid var(--gbc-btn-primary-bg);
}
.gbc-btn--primary:hover:not(:disabled) { background: var(--gbc-btn-primary-hover); border-color: var(--gbc-btn-primary-hover); }
.gbc-btn--primary:active:not(:disabled) { background: var(--gbc-btn-primary-active); border-color: var(--gbc-btn-primary-active); }

/* Secundario — blanco/outline. Todo lo que no es la acción principal (incluido "Eliminar": nunca rojo). */
.gbc-btn--secondary,
.gbc-btn--secondary:link, .gbc-btn--secondary:visited {
  background: var(--gbc-btn-secondary-bg); color: var(--gbc-btn-secondary-text);
  border: 1.5px solid var(--gbc-btn-secondary-border);
}
.gbc-btn--secondary:hover:not(:disabled) { background: var(--gbc-btn-secondary-hover); }

/* Solo ícono (volver, plegar, etc.) */
.gbc-btn--icon { width: var(--gbc-btn-h); padding: 0; } /* cuadrado: mismo alto que sus vecinos */

/* Acciones con IA — degradado Nex4Nova + ícono de destellos. Solo para funciones con IA. */
.gbc-btn--ia { background: var(--gbc-ia-gradient) border-box; border-color: transparent; color: #fff; font-weight: 800; } /* el degradado cubre también el borde transparente: mismo alto que los demás */
.gbc-btn--ia:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.gbc-btn--ia.is-done { background: rgba(34,197,94,.16); color: var(--gbc-badge-success-text); cursor: default; filter: none; transform: none; opacity: 1; }
.gbc-btn--ia-outline {
  border: 1.5px solid transparent; font-weight: 800;
  background: linear-gradient(var(--fgc-surface), var(--fgc-surface)) padding-box, var(--gbc-ia-gradient) border-box;
}
.gbc-btn--ia-outline i, .gbc-btn--ia-outline .gbc-ico { color: var(--gbc-ia-blue); }
html[data-fgc-theme="galaxy"] .gbc-btn--ia-outline i, html[data-fgc-theme="galaxy"] .gbc-btn--ia-outline .gbc-ico,
html[data-fgc-theme="blacktears"] .gbc-btn--ia-outline i, html[data-fgc-theme="blacktears"] .gbc-btn--ia-outline .gbc-ico { color: #6f9dff; }
.gbc-btn--ia-outline span { background: var(--gbc-ia-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
html[data-fgc-theme="galaxy"] .gbc-btn--ia-outline span, html[data-fgc-theme="blacktears"] .gbc-btn--ia-outline span { background-image: linear-gradient(135deg, #6f9dff, #ff6fc1); }
.gbc-btn--ia-outline:hover:not(:disabled) { filter: brightness(.96); transform: translateY(-1px); }
.gbc-btn--ia-outline.is-active { background: var(--gbc-ia-gradient); }
.gbc-btn--ia-outline.is-active i, .gbc-btn--ia-outline.is-active span { color: #fff; background: none; -webkit-background-clip: unset; background-clip: unset; }
.gbc-ico { width: 14px; height: 14px; flex-shrink: 0; }

/* Fila de acciones: secundarios primero, primario al final, alineada a la derecha */
.gbc-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ─────────────────────────── PÁGINA ─────────────────────────── */
.gbc-view { padding: 20px 28px 40px; min-width: 0; flex: 1 1 auto; } /* hijo directo de .page-wrapper (flex) */
.gbc-page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.gbc-page-title { font-size: 22px; font-weight: 700; color: var(--fgc-ink); margin: 0; }

/* ─────────────────────────── PESTAÑAS ─────────────────────────── */
/* Tipo A — Pestañas de VISTA (subrayado). Ej: Infraguards / Instrumentos */
.gbc-tabs-view { display: flex; gap: 4px; border-bottom: 1px solid var(--fgc-border); margin-bottom: 14px; }
.gbc-tab-view {
  display: flex; align-items: center; gap: 7px; padding: 9px 4px; margin-right: 20px;
  border: none; border-bottom: 2px solid transparent; background: transparent; cursor: pointer;
  font-family: var(--fgc-font-family); font-size: 13.5px; font-weight: 600; color: var(--gbc-tab-text);
  transition: color .15s ease, border-color .15s ease;
}
.gbc-tab-view:hover { color: var(--gbc-tab-active); }
.gbc-tab-view.is-active { color: var(--gbc-tab-active); border-bottom-color: var(--gbc-tab-active); }
.gbc-tab-view i { font-size: 12px; }

/* Tipo B — Pestañas de FICHA (barra gris + píldoras). Ej: Perfil de sondaje / Evento */
.gbc-tabs-ficha {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--gbc-tabbar-bg); border: 1px solid var(--gbc-tabbar-border); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px;
}
.gbc-tab-group { display: flex; gap: 6px; flex-wrap: wrap; }
.gbc-tab-pill {
  background: var(--gbc-tabpill-bg); border: 1.5px solid var(--gbc-tabpill-border); color: var(--gbc-tabpill-text);
  font-family: var(--fgc-font-family); font-weight: 700; font-size: 13px;
  padding: 7px 16px; border-radius: 8px; cursor: pointer; transition: all .15s ease;
}
.gbc-tab-pill:hover { border-color: var(--gbc-btn-primary-bg); }
.gbc-tab-pill.is-active { background: var(--gbc-btn-primary-bg); border-color: var(--gbc-btn-primary-bg); color: var(--gbc-btn-primary-text); }

/* Panel de contenido bajo las pestañas de ficha */
.gbc-panel { background: var(--gbc-panel-bg); border-radius: 12px; padding: 16px; }

/* ─────────────────────────── LAYOUTS ─────────────────────────── */
/* Doble columna pareja (ej. dos gráficos) */
.gbc-layout-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
/* Ficha + contenido (ficha fija a la izquierda, gráficos a la derecha) */
.gbc-layout-ficha { display: flex; gap: 16px; align-items: flex-start; }
.gbc-layout-ficha > .gbc-col-ficha { flex: 0 1 340px; min-width: 280px; }
.gbc-layout-ficha > .gbc-col-main { flex: 1 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) {
  .gbc-layout-2col { grid-template-columns: 1fr; }
  .gbc-layout-ficha { flex-direction: column; }
  .gbc-layout-ficha > .gbc-col-ficha { flex-basis: auto; width: 100%; min-width: 0; }
}

/* Tarjeta de gráfico / contenido */
.gbc-card { background: var(--fgc-surface); border: 1.5px solid var(--gbc-table-border); border-radius: 12px; padding: 14px 16px; }
.gbc-card-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--fgc-ink); margin-bottom: 10px; }

/* Contenido + Panel lateral DERECHO (patrón Acelerómetros / Análisis avanzado) */
.gbc-layout-sidepanel { display: flex; align-items: flex-start; gap: 18px; }
.gbc-layout-sidepanel > .gbc-col-main { flex: 1 1 auto; min-width: 0; order: 1; }
.gbc-layout-sidepanel > .gbc-col-side { flex: 0 0 340px; min-width: 0; order: 2; overflow: hidden; transition: flex-basis .26s cubic-bezier(.4,0,.2,1); }
.gbc-layout-sidepanel > .gbc-col-side.is-collapsed { flex-basis: 54px; }
.gbc-sidepanel { background: var(--fgc-surface); border: 1.5px solid var(--gbc-table-border); border-radius: 12px; position: sticky; top: 16px; }
.gbc-sidepanel-head {
  display: flex; align-items: center; gap: 9px; padding: 12px 16px;
  background: var(--gbc-sidepanel-head-bg); color: var(--gbc-sidepanel-head-text);
  border-radius: 10px 10px 0 0; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
}
.gbc-sidepanel-toggle {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: inherit;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px;
}
.gbc-sidepanel-toggle:hover { background: rgba(255,255,255,.26); }
.gbc-sidepanel-toggle i { transition: transform .22s ease; }
.gbc-sidepanel-toggle[aria-expanded="false"] i { transform: rotate(180deg); }
.gbc-sidepanel-body { padding: 14px 16px; }
.gbc-sidepanel-foot { padding: 14px 16px; border-top: 1px solid var(--gbc-info-divider); display: flex; gap: 8px; justify-content: flex-end; }
.gbc-col-side.is-collapsed .gbc-sidepanel-head { justify-content: center; border-radius: 10px; }
.gbc-col-side.is-collapsed .gbc-sidepanel-title,
.gbc-col-side.is-collapsed .gbc-sidepanel-body,
.gbc-col-side.is-collapsed .gbc-sidepanel-foot { display: none; }
@media (max-width: 900px) {
  .gbc-layout-sidepanel { flex-direction: column; }
  .gbc-layout-sidepanel > .gbc-col-side { flex-basis: auto; width: 100%; order: 0; }
}

/* ─────────────────────────── TABLAS ─────────────────────────── */
/* Fila de título + acciones: SIN tarjeta blanca alrededor */
.gbc-table-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.gbc-table-title { font-size: 16px; font-weight: 700; color: var(--fgc-ink); margin: 0; }
.gbc-table-header .gbc-actions { margin-left: auto; }
/* La tabla es la que lleva fondo, borde y radio */
.gbc-table-wrap {
  background: var(--gbc-table-bg); border: 1.5px solid var(--gbc-table-border); border-radius: 12px;
  overflow: auto; max-width: 100%; max-height: 55vh;
}
.gbc-table { width: 100%; border-collapse: collapse; font-family: var(--fgc-font-family); font-size: 12.5px; white-space: nowrap; }
.gbc-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--gbc-table-head-bg); color: var(--gbc-table-head-text);
  text-align: left; font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px;
  padding: 10px 12px;
}
.gbc-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--gbc-table-row-border); color: var(--gbc-table-text); font-weight: 600; }
.gbc-table tbody tr:last-child td { border-bottom: none; }
.gbc-table tbody tr:hover td { background: var(--gbc-table-row-hover); }
.gbc-table .gbc-col-actions { text-align: left; width: 1%; } /* título y botones alineados a la izquierda, como el resto de columnas */
.gbc-table .gbc-num { font-family: var(--fgc-font-family); font-variant-numeric: tabular-nums; } /* números y fechas en Outfit, nunca monoespaciada */
.gbc-row-actions { display: inline-flex; gap: 6px; }

/* Paginación: dentro del marco, bajo la tabla */
.gbc-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--gbc-table-row-border); font-family: var(--fgc-font-family); font-size: 12px; color: var(--fgc-muted); }
.gbc-pagination-info { font-variant-numeric: tabular-nums; }
.gbc-pagination-btns { display: flex; gap: 4px; }
.gbc-pagination-btns button { min-width: 32px; height: 30px; padding: 0 9px; border: 1px solid var(--gbc-table-border); border-radius: 6px; background: transparent; font-family: var(--fgc-font-family); font-size: 12px; font-weight: 500; color: var(--fgc-muted); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.gbc-pagination-btns button:hover:not(:disabled) { background: var(--gbc-table-row-hover); color: var(--fgc-ink); }
.gbc-pagination-btns button.is-active { background: var(--gbc-btn-primary-bg); border-color: var(--gbc-btn-primary-bg); color: var(--gbc-btn-primary-text); }
.gbc-pagination-btns button:disabled { opacity: .45; cursor: not-allowed; }
.gbc-pagination-btns button:focus-visible { outline: 2px solid var(--fgc-navy-light); outline-offset: 2px; }

/* ─────────────────────────── BADGES DE ESTADO ─────────────────────────── */
/* Patrón "soft": fondo translúcido del color + borde más saturado + texto oscuro del mismo tono.
   Siempre con palabra (y opcionalmente ícono): el color nunca va solo. */
.gbc-badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--fgc-font-family); font-size: 11px; font-weight: 700; line-height: 1.3;
}
.gbc-badge i { font-size: 10px; }
.gbc-badge--success { color: var(--gbc-badge-success-text); background: rgba(34,197,94,.12);  border-color: rgba(34,197,94,.40); }
.gbc-badge--info    { color: var(--gbc-badge-info-text);    background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.40); }
.gbc-badge--pending { color: var(--gbc-badge-pending-text); background: rgba(249,115,22,.12); border-color: rgba(249,115,22,.40); }
.gbc-badge--warning { color: var(--gbc-badge-warning-text); background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.45); }
.gbc-badge--danger  { color: var(--gbc-badge-danger-text);  background: rgba(239,68,68,.11);  border-color: rgba(239,68,68,.40); }
.gbc-badge--neutral { color: var(--gbc-badge-neutral-text); background: rgba(100,116,139,.10); border-color: rgba(100,116,139,.32); }
/* Riesgo: bajo / medio / alto (Zonas de Riesgo, Infraguards) */
.gbc-badge--risk-low    { color: var(--gbc-badge-teal-text);    background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.40); }
.gbc-badge--risk-medium { color: var(--gbc-badge-warning-text); background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.45); }
.gbc-badge--risk-high   { color: #ffffff; background: var(--gbc-danger-strong); border-color: var(--gbc-danger-strong); }
/* Advertencia IA: única variante sólida clara, para destacar un hallazgo de la IA */
.gbc-badge--ia-warning { color: #92400e; background: #fed7aa; border-color: #fdba74; font-weight: 800; }

/* Estado compacto: punto + texto (tablas densas, listas de sensores) */
.gbc-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--fgc-ink); }
.gbc-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.gbc-dot--success { background: var(--gbc-success); }
.gbc-dot--info    { background: var(--gbc-info); }
.gbc-dot--pending { background: var(--gbc-pending); }
.gbc-dot--warning { background: var(--gbc-warning); }
.gbc-dot--danger  { background: var(--gbc-danger-strong); }
.gbc-dot--neutral { background: var(--gbc-neutral); }

/* ─────────────────────────── DROPDOWNS Y FILTROS ─────────────────────────── */
/* Barra de filtros: rótulo a la IZQUIERDA del control, centrado en vertical */
/* Fila sobre la tabla: filtros a la izquierda, botones a la derecha */
.gbc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.gbc-toolbar > .gbc-actions { margin-left: auto; }
.gbc-filters { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.gbc-filter { display: inline-flex; align-items: center; gap: 10px; }
.gbc-filter-label { font-family: var(--fgc-font-family); font-size: 11.5px; font-weight: 400; color: var(--fgc-muted); white-space: nowrap; }


/* Dropdown propio: botón secundario + menú flotante */
.gbc-dropdown { position: relative; display: inline-flex; }
.gbc-dropdown-toggle:focus:not(:focus-visible) { outline: none; } /* sin borde de foco al hacer click; solo con teclado */
.gbc-dropdown-caret { font-size: 10px !important; width: auto !important; color: var(--fgc-muted); margin-left: 2px; transition: transform .15s; }
.gbc-dropdown.is-open .gbc-dropdown-caret { transform: rotate(180deg); }
.gbc-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  box-sizing: border-box; min-width: 100%; width: max-content; max-width: 320px; max-height: 280px; overflow-y: auto;
  padding: 6px; background: var(--fgc-surface); border: 1px solid var(--fgc-border); border-radius: 10px; box-shadow: var(--fgc-shadow);
}
.gbc-dropdown--right .gbc-dropdown-menu { left: auto; right: 0; }
.gbc-dropdown.is-open .gbc-dropdown-menu { display: block; }
.gbc-dropdown-title { padding: 8px 10px 4px; font-family: var(--fgc-font-family); font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--fgc-muted); }
.gbc-dropdown-sep { height: 1px; margin: 6px 4px; background: var(--fgc-border); }
.gbc-dropdown-item {
  display: flex; align-items: center; gap: 9px; box-sizing: border-box; width: 100%; min-height: 34px; padding: 0 10px;
  border: 0; border-radius: 6px; background: transparent; color: var(--fgc-ink); text-align: left; cursor: pointer;
  font-family: var(--fgc-font-family); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.gbc-dropdown-item:hover, .gbc-dropdown-item:focus-visible { background: var(--fgc-surface-hover); outline: none; }
.gbc-dropdown-item > i { width: 14px; font-size: 13px; text-align: center; color: var(--fgc-muted); }
.gbc-dropdown-item .gbc-dropdown-check { margin-left: auto; padding-left: 12px; font-size: 11px; color: var(--gbc-btn-primary-bg); visibility: hidden; }
.gbc-dropdown-item.is-selected { font-weight: 700; }
.gbc-dropdown-item.is-selected .gbc-dropdown-check { visibility: visible; }
.gbc-filter .gbc-dropdown-toggle { font-weight: 600; }
/* Multi-selección: checkbox redondeado estilo Secundario (no el nativo) */
.gbc-option { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 0 10px; border-radius: 6px; font: 600 12.5px var(--fgc-font-family); color: var(--fgc-ink); cursor: pointer; }
.gbc-option:hover, .gbc-option:focus-within { background: var(--gbc-option-hover); }
.gbc-check {
  appearance: none; -webkit-appearance: none; position: relative; box-sizing: border-box;
  width: 18px; height: 18px; margin: 0; flex-shrink: 0; cursor: pointer;
  border: 1.5px solid var(--gbc-btn-secondary-border); border-radius: 6px;
  background: var(--gbc-btn-secondary-bg); color: var(--gbc-btn-secondary-text);
  transition: background 120ms ease, border-color 120ms ease;
}
.gbc-option:hover .gbc-check:not(:checked) { border-color: var(--gbc-check-border); }
.gbc-check:checked { background: var(--gbc-check-bg); border-color: var(--gbc-check-border); color: var(--gbc-check-mark); }
.gbc-check::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 10px; height: 10px;
  background: currentColor; opacity: 0; transform: scale(.6); transition: opacity 120ms ease, transform 120ms ease;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.gbc-check:checked::after { opacity: 1; transform: none; }
.gbc-check:focus-visible { outline: 2px solid var(--fgc-navy-light); outline-offset: 2px; }
.gbc-dropdown-item--danger, .gbc-dropdown-item--danger > i { color: var(--gbc-danger); }

/* ─────────────────────────── LECTURA DE INFORMACIÓN ─────────────────────────── */
/* Ficha vertical (ej. "Información del evento" en Acelerómetros) */
.gbc-info-card { background: var(--fgc-surface); border: 1.5px solid var(--gbc-table-border); border-radius: 12px; padding: 14px 16px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.gbc-info-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--fgc-ink); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.gbc-info-groups { display: flex; flex-direction: column; gap: 18px; }
.gbc-info-group-title { font-size: 10.5px; font-weight: 800; color: var(--gbc-info-group-title); text-transform: uppercase; letter-spacing: .5px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1.5px solid var(--gbc-info-divider); }
.gbc-info-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--gbc-info-row-border); font-size: 12.5px; }
.gbc-info-row:last-child { border-bottom: none; }
.gbc-info-label { color: var(--gbc-info-label); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.gbc-info-label i { font-size: 11px; color: var(--gbc-info-icon); width: 14px; text-align: center; }
.gbc-info-value { color: var(--gbc-info-value); font-weight: 600; text-align: right; }
.gbc-info-value--mono { font-size: 10.5px; font-weight: 700; word-break: break-all; }
.gbc-info-more { border-top: 1.5px solid var(--gbc-info-divider); padding-top: 12px; }
.gbc-info-toggle { display: flex; align-items: center; gap: 7px; background: none; border: none; padding: 0; font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--gbc-link); cursor: pointer; }
.gbc-info-toggle:hover { text-decoration: underline; }
.gbc-info-toggle i { font-size: 10px; transition: transform .15s ease; }
.gbc-info-toggle[aria-expanded="true"] i { transform: rotate(90deg); }
.gbc-info-detail { margin-top: 10px; }
.gbc-info-detail[hidden] { display: none; }

/* ─────────────────────────── BARRA DE PROGRESO ─────────────────────────── */
/* Relleno con el degradado de marca Nex4Nova. Siempre con texto. Nunca spinner suelto. */
.gbc-progress-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.gbc-progress-label { font-size: 12.5px; font-weight: 600; color: var(--fgc-ink); display: inline-flex; align-items: center; gap: 6px; }
.gbc-progress-pct { font-family: var(--fgc-font-family); font-variant-numeric: tabular-nums; font-size: 11.5px; font-weight: 700; color: var(--gbc-info); }
.gbc-progress-track { width: 100%; height: 8px; background: var(--gbc-progress-track); border-radius: 99px; overflow: hidden; }
.gbc-progress-track--sm { height: 7px; }
.gbc-progress-fill { height: 100%; width: 0%; background: var(--gbc-ia-gradient); border-radius: 99px; transition: width .25s ease; }
.gbc-progress.is-done .gbc-progress-fill { background: var(--gbc-success); }
.gbc-progress.is-done .gbc-progress-label, .gbc-progress.is-done .gbc-progress-pct { color: var(--gbc-badge-success-text); }
.gbc-progress.is-error .gbc-progress-fill { background: var(--gbc-danger-strong); }
.gbc-progress.is-error .gbc-progress-label, .gbc-progress.is-error .gbc-progress-pct { color: var(--gbc-badge-danger-text); }

.gbc-progress-toast { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 8px; background: var(--gbc-progress-toast-bg); border: 1px solid var(--gbc-progress-toast-border); }
.gbc-progress-toast > i { color: var(--gbc-ia-blue); }
.gbc-progress-toast-msg { font-size: 12.5px; font-weight: 600; color: var(--fgc-ink); white-space: nowrap; }
.gbc-progress-toast-msg strong { font-weight: 800; color: var(--gbc-link); }
.gbc-progress-toast .gbc-progress-track { flex: 1; min-width: 60px; }
@media (max-width: 560px) { .gbc-progress-toast { flex-wrap: wrap; } .gbc-progress-toast-msg { white-space: normal; flex: 1 1 0; } .gbc-progress-toast .gbc-progress-track { flex-basis: 100%; } }

/* Modal de carga */
.gbc-loading-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(10,16,22,.55); display: none; align-items: center; justify-content: center; }
.gbc-loading-modal.is-open { display: flex; }
.gbc-loading-box { width: 380px; max-width: 92vw; background: var(--fgc-surface); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 30px 26px 24px; text-align: center; font-family: var(--fgc-font-family); }
.gbc-loading-icon { display: inline-block; font-size: 26px; margin-bottom: 12px; background: var(--gbc-ia-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; animation: gbcSpin 1.4s linear infinite; }
.gbc-loading-icon.is-done { animation: none; background: none; -webkit-text-fill-color: initial; color: var(--gbc-success); }
@keyframes gbcSpin { to { transform: rotate(360deg); } }
.gbc-loading-msg { font-size: 14px; font-weight: 800; color: var(--fgc-ink); margin-bottom: 4px; }
.gbc-loading-sub { font-size: 11.5px; color: var(--fgc-muted); margin-bottom: 14px; }
.gbc-loading-pct { font-size: 11px; font-weight: 700; color: var(--gbc-info); margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .gbc-loading-icon { animation: none; } }

/* ─────────────────────────── SKELETON UI ─────────────────────────── */
/* Un solo gris (--fgc-sk-base), sin brillo ni degradado; pulso de opacidad. */
@keyframes fgc-sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.fgc-sk-shell { display: flex; flex-direction: column; gap: 16px; padding: 24px; overflow: hidden; }
.fgc-sk-row { display: flex; gap: 16px; align-items: center; }
.fgc-sk-col { display: flex; flex-direction: column; gap: 16px; }
.fgc-sk-grow { flex: 1 1 0; min-width: 0; }
.fgc-sk-card { background: var(--fgc-surface); border: 1px solid var(--fgc-border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.fgc-sk-bone { background: var(--fgc-sk-base); border-radius: 8px; flex-shrink: 0; animation: fgc-sk-pulse 1.4s ease-in-out infinite; }
.fgc-sk-bone.is-text  { height: 10px; border-radius: 999px; }
.fgc-sk-bone.is-title { height: 14px; border-radius: 999px; }
.fgc-sk-bone.is-btn   { height: var(--gbc-btn-h-md); border-radius: var(--gbc-btn-radius); }
.fgc-sk-bone.is-block { border-radius: 12px; }
.fgc-sk-bone.is-thead { height: 32px; border-radius: 0; background: var(--fgc-sk-flat); animation: none; }
@media (prefers-reduced-motion: reduce) { .fgc-sk-bone { animation: none; } }

/* ─────────────────────────── FORMS ─────────────────────────── */
/* Rótulo ARRIBA del campo: solo en formularios y modales (en filtros el control dice qué filtra). */
.gbc-field { display: flex; flex-direction: column; min-width: 0; }
.gbc-field-label { display: block; font-family: var(--fgc-font-family); font-size: 11px; font-weight: 700; color: var(--fgc-muted); margin-bottom: 6px; }
.gbc-req { color: var(--gbc-danger); margin-left: 4px; }
.gbc-input {
  width: 100%; box-sizing: border-box; border: 1.5px solid var(--gbc-table-border); border-radius: 8px;
  padding: 9px 12px; font-family: var(--fgc-font-family); font-size: 13px; color: var(--fgc-ink); background: var(--fgc-surface-alt);
}
.gbc-input::placeholder { color: var(--fgc-muted); }
.gbc-input:focus { outline: none; border-color: var(--fgc-navy-light); background: var(--fgc-surface); }
.gbc-search { position: relative; }
.gbc-search > i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--fgc-muted); pointer-events: none; }
.gbc-search .gbc-input { padding-left: 32px; }
.gbc-field-error { display: none; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--gbc-badge-danger-text); }
.gbc-field.has-error .gbc-input { border-color: var(--gbc-danger); }
.gbc-field.has-error .gbc-field-error { display: block; }

/* Formulario de respuesta: secciones → preguntas como tarjeta */
.gbc-form-sections { display: flex; flex-direction: column; gap: 14px; }
.gbc-form-section { border: 1px solid var(--gbc-table-border); border-radius: 12px; overflow: hidden; background: var(--fgc-surface); }
.gbc-form-section-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 18px; border: 0; background: var(--gbc-table-border); font-family: var(--fgc-font-family); text-align: left; cursor: pointer; }
.gbc-form-section-head strong { display: block; font-size: 16px; font-weight: 700; color: var(--fgc-navy); }
.gbc-form-section-head span { display: block; font-size: 11.5px; font-weight: 500; color: var(--fgc-muted); }
.gbc-form-section-head > i { margin-left: auto; color: var(--fgc-navy); font-size: 12px; transition: transform .18s ease; }
.gbc-form-section-head[aria-expanded="false"] > i { transform: rotate(-90deg); }
.gbc-form-section-head:focus:not(:focus-visible) { outline: none; }
.gbc-form-section-body { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--gbc-panel-bg); border-top: 1px solid var(--gbc-table-border); }
.gbc-form-section-head[aria-expanded="false"] + .gbc-form-section-body { display: none; }
.gbc-question { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; background: var(--fgc-surface); border: 1px solid var(--gbc-table-border); border-radius: 10px; transition: border-color .15s; }
.gbc-question:focus-within { border-color: var(--fgc-navy-light); }
.gbc-question.has-error { border-color: var(--gbc-danger); }
.gbc-question-title { font-family: var(--fgc-font-family); font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--fgc-ink); }
.gbc-question-help { font-size: 12px; font-weight: 500; color: var(--fgc-muted); margin-top: -6px; }
.gbc-question-error { display: none; font-size: 12px; font-weight: 600; color: var(--gbc-badge-danger-text); }
.gbc-question.has-error .gbc-question-error { display: block; }
.gbc-opt-list { display: flex; flex-direction: column; gap: 10px; }
.gbc-opt { display: inline-flex; align-items: center; gap: 10px; width: fit-content; font-size: 13.5px; font-weight: 500; color: var(--fgc-ink); cursor: pointer; }
.gbc-opt input { margin: 0; width: 16px; height: 16px; accent-color: var(--gbc-btn-primary-bg); cursor: pointer; }
.gbc-opt-detail { max-width: 520px; }
.gbc-opt-detail[hidden] { display: none; }

/* Texto largo con formato (reemplaza al textarea) */
.gbc-rte { border: 1.5px solid var(--gbc-table-border); border-radius: 8px; background: var(--fgc-surface-alt); }
.gbc-rte:focus-within { border-color: var(--fgc-navy-light); background: var(--fgc-surface); }
.gbc-question.has-error .gbc-rte { border-color: var(--gbc-danger); }
.gbc-rte-bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--gbc-table-border); }
.gbc-rte-btn { width: 30px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--fgc-muted); font-family: var(--fgc-font-family); font-size: 13px; cursor: pointer; }
.gbc-rte-btn:hover { background: var(--fgc-surface-hover); color: var(--fgc-ink); }
.gbc-rte-btn[aria-pressed="true"] { background: var(--fgc-active-tint); color: var(--fgc-navy); }
.gbc-rte-btn:focus:not(:focus-visible) { outline: none; }
.gbc-rte-btn:focus-visible { outline: 2px solid var(--fgc-navy-light); outline-offset: 1px; }
.gbc-rte-btn i { font-size: 12px; }
.gbc-rte-sep { width: 1px; height: 16px; margin: 0 6px; background: var(--gbc-table-border); }
.gbc-rte-area { min-height: 84px; max-height: 320px; overflow-y: auto; padding: 10px 12px; font-family: var(--fgc-font-family); font-size: 13.5px; line-height: 1.55; color: var(--fgc-ink); outline: none; }
.gbc-rte-area ul, .gbc-rte-area ol { margin: 4px 0; padding-left: 22px; }

/* Perfil: ítem "Idioma: Español" + chevron pegado al texto */
.fgc-lang-menu-item > i { font-size: 11px; color: var(--fgc-muted); }

/* Layout de formularios: cuerpo a 6/8 del ancho, centrado (1/8 | 6/8 | 1/8). El encabezado de la página no cambia. */
.gbc-form-body { width: 75%; min-width: 520px; max-width: 100%; margin-left: auto; margin-right: auto; }
@media (max-width: 600px) { .gbc-form-body { width: 100%; min-width: 0; } }
/* Encabezado de sección del constructor: nombre a la izquierda; a la derecha cantidad, "Agregar pregunta" y flechas / eliminar */
.gbc-form-section-head.is-row { cursor: default; }
.gbc-form-section-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.gbc-form-section-tools .gbc-form-count { font-size: 11.5px; font-weight: 500; color: var(--fgc-muted); }
/* Botón de resalte del constructor: el único con este color, sin ícono */
.gbc-btn--highlight { background: #4D82FF; border-color: #4D82FF; color: #fff; }
.gbc-btn--highlight:hover { background: #3F72EE; border-color: #3F72EE; }

/* ─────────────────────────── MODALES ─────────────────────────── */
.gbc-modal-overlay { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 16, 24, .5); }
.gbc-modal-overlay.is-open { display: flex; }
.gbc-modal-overlay--contained { position: absolute; display: flex; z-index: 2; border-radius: 10px; } /* solo para las demos de este manual */
.gbc-modal { display: flex; flex-direction: column; width: 520px; max-width: 100%; max-height: 90vh; background: var(--fgc-surface); color: var(--fgc-ink); border-radius: 14px; border: 1.5px solid rgba(127, 138, 153, .55); overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); outline: none; }
.gbc-modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--fgc-modal-head-bg); color: #fff; border-radius: 12px 12px 0 0; }
.gbc-modal-title { margin: 0; font-family: var(--fgc-font-family); font-size: 16px; font-weight: 700; color: #fff; }
.gbc-modal-close { margin-left: auto; width: 28px; height: 28px; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: #fff; cursor: pointer; }
.gbc-modal-close:hover { background: rgba(255, 255, 255, .16); }
.gbc-modal-close:focus:not(:focus-visible) { outline: none; }
.gbc-modal-close:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.gbc-modal-body { display: flex; flex-direction: column; gap: 14px; padding: 18px; overflow-y: auto; }
.gbc-modal-text { margin: 0; font-family: var(--fgc-font-family); font-size: 13.5px; font-weight: 400; line-height: 1.55; color: var(--fgc-ink); }
.gbc-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--fgc-border); }

/* ══════════════ LANDING DE MÓDULO: hero, accesos directos, card de servicio, paginación ══════════════ */
.gbc-hero { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 360px; padding: 0 40px; border-radius: 0; color: #fff; font-family: var(--fgc-font-family);
  background: linear-gradient(90deg, rgba(8,14,22,.84) 0%, rgba(8,14,22,.58) 46%, rgba(8,14,22,.06) 100%), var(--gbc-hero-img, #1d3747) center 38% / cover no-repeat; }
.gbc-hero-over { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.gbc-hero-title { margin: 0; font-size: 34px; font-weight: 700; line-height: 1.15; color: #fff; }
.gbc-hero-sub { margin: 0; max-width: 520px; font-size: 14px; font-weight: 400; color: #fff; }
@media (max-width: 640px) { .gbc-hero { height: 200px; padding: 0 20px; } .gbc-hero-title { font-size: 24px; } .gbc-hero-sub { font-size: 12.5px; } }

.gbc-lp-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 0 0 14px; }
.gbc-lp-title { margin: 0; font-size: 20px; font-weight: 800; color: var(--fgc-ink); }
.gbc-lp-count { font-size: 12.5px; font-weight: 600; color: var(--fgc-ink); }

.gbc-sc-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.gbc-shortcut { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; border: 1px solid var(--fgc-border); border-radius: 10px; background: var(--fgc-surface); color: var(--fgc-ink); font: 600 13px var(--fgc-font-family); text-decoration: none; transition: border-color .15s ease, background-color .15s ease; }
.gbc-shortcut > i:first-child { width: 20px; text-align: center; font-size: 15px; color: var(--fgc-navy); }
.gbc-shortcut > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbc-shortcut-arrow { flex: none; width: 11px; height: 11px; color: var(--gbc-svc-arrow); }
.gbc-shortcut:hover, .gbc-shortcut:focus-visible { border-color: var(--gbc-svc-arrow); background: var(--fgc-surface-hover); }
.gbc-shortcut:focus-visible { outline: 2px solid var(--fgc-navy-light); outline-offset: 2px; }
.gbc-shortcut--add { justify-content: center; border: 1.5px dashed var(--gbc-btn-secondary-text); background: transparent; cursor: pointer; }
.gbc-shortcut--add > i:first-child { color: var(--gbc-btn-secondary-text); }

.gbc-svc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .gbc-svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .gbc-svc-grid { grid-template-columns: minmax(0, 1fr); } }
.gbc-svc-card { position: relative; display: flex; align-items: center; gap: 14px; box-sizing: border-box; height: 114px; padding: 14px 40px 14px 16px; overflow: hidden; background: var(--fgc-surface); border: 1px solid var(--fgc-border); border-radius: 12px; color: var(--fgc-ink); text-decoration: none; font-family: var(--fgc-font-family);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease; }
.gbc-svc-ico { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--fgc-surface-hover); border: 1px solid var(--fgc-border); color: var(--fgc-navy); font-size: 16px; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.gbc-svc-text { min-width: 0; }
.gbc-svc-name { margin: 0 0 3px; font-size: 14.5px; font-weight: 700; line-height: 1.25; color: inherit; }
.gbc-svc-desc { margin: 0; font-size: 12.5px; font-weight: 400; line-height: 1.4; color: inherit; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gbc-svc-arrow { position: absolute; top: 12px; right: 14px; width: 13px; height: 13px; color: var(--gbc-svc-arrow); transition: color .18s ease; }
.gbc-svc-card:hover, .gbc-svc-card:focus-visible, .gbc-svc-card.is-demo-hover { background: var(--gbc-svc-hover-bg); border-color: var(--gbc-svc-hover-accent); color: #fff; box-shadow: 0 10px 24px rgba(0,0,0,.18); transform: translateY(-3px) scale(1.02); }
.gbc-svc-card:hover .gbc-svc-ico, .gbc-svc-card:focus-visible .gbc-svc-ico, .gbc-svc-card.is-demo-hover .gbc-svc-ico { background: #fff; border-color: #fff; color: var(--gbc-svc-hover-accent); }
.gbc-svc-card:hover .gbc-svc-arrow, .gbc-svc-card:focus-visible .gbc-svc-arrow, .gbc-svc-card.is-demo-hover .gbc-svc-arrow { color: #fff; }
.gbc-svc-card:focus-visible { outline: 2px solid var(--fgc-navy-light); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .gbc-svc-card { transition: none; } .gbc-svc-card:hover, .gbc-svc-card.is-demo-hover { transform: none; } }

/* Paginación de listados de cards/filas (la de las tablas es .gbc-pagination, más compacta) */
.gbc-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-family: var(--fgc-font-family); }
.gbc-pager[hidden] { display: none; }
.gbc-pager-info { font-size: 12.5px; font-weight: 600; color: var(--fgc-ink); font-variant-numeric: tabular-nums; }
.gbc-pager-btns { display: flex; gap: 6px; }
.gbc-pager-btn { min-width: 32px; height: 32px; padding: 0 9px; box-sizing: border-box; border: 1.5px solid var(--gbc-btn-secondary-border); border-radius: 8px; background: var(--gbc-btn-secondary-bg); color: var(--gbc-btn-secondary-text); font: 600 12.5px var(--fgc-font-family); cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.gbc-pager-btn:hover:not(:disabled):not(.is-active) { background: var(--gbc-btn-secondary-hover); }
.gbc-pager-btn.is-active { background: var(--gbc-page-active); border-color: var(--gbc-page-active); color: #fff; font-weight: 800; }
.gbc-pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.gbc-pager-btn:focus-visible { outline: 2px solid var(--fgc-navy-light); outline-offset: 2px; }

/* Modal "Añadir / Editar acceso directo": caja de alto fijo + lista reordenable por arrastre */
.gbc-modal--shortcuts { width: 480px; height: 520px; }
.gbc-modal--shortcuts .gbc-modal-body { flex: 1; min-height: 0; overflow: hidden; }
.gbc-order-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 700; color: var(--fgc-ink); }
.gbc-order-head small { font-size: 12px; font-weight: 600; }
.gbc-order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; overflow-y: auto; }
.gbc-order-item { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 8px 0 4px; border: 1px solid var(--fgc-border); border-radius: 8px; background: var(--fgc-surface); color: var(--fgc-ink); font: 600 13px var(--fgc-font-family); }
.gbc-order-item.is-dragging { opacity: .45; }
.gbc-order-item.is-over { border-color: var(--gbc-page-active); box-shadow: 0 0 0 1px var(--gbc-page-active); }
.gbc-order-handle { display: grid; place-items: center; width: 26px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--fgc-ink); cursor: grab; }
.gbc-order-handle:hover { background: var(--fgc-surface-hover); }
.gbc-order-handle:focus-visible { outline: 2px solid var(--fgc-navy-light); outline-offset: 1px; }
.gbc-order-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbc-order-remove { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--fgc-ink); cursor: pointer; }
.gbc-order-remove:hover { background: var(--fgc-surface-hover); }
.gbc-order-empty { padding: 14px; border: 1.5px dashed var(--gbc-btn-secondary-border); border-radius: 8px; font-size: 12.5px; font-weight: 400; color: var(--fgc-ink); text-align: center; }

.gbc-lp-content { display: flex; flex-direction: column; gap: 28px; padding: 26px 40px 40px; }
@media (max-width: 640px) { .gbc-lp-content { padding: 20px 16px 28px; } }
.gbc-dropdown-menu--scroll { max-height: 240px; overflow-y: auto; }
.gbc-svc-grid.is-enter .gbc-svc-card { animation: gbcFadeIn .18s ease; }
@keyframes gbcFadeIn { from { opacity: 0; } to { opacity: 1; } }
.gbc-btn[hidden] { display: none; }
.gbc-svc-grid { align-content: start; }

/* ══════════════ MIS ACCESOS DIRECTOS (sidebar, máx. 5 por usuario) ══════════════ */
.fgc-drawer-section-title .fgc-shortcuts-add {
  margin-left: auto; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px; background: transparent; color: var(--fgc-muted); cursor: pointer;
  transition: color var(--fgc-transition), background var(--fgc-transition);
}
.fgc-shortcuts-add svg { width: 18px; height: 18px; }
.fgc-shortcuts-add:hover, .fgc-shortcuts-add.is-active { color: var(--fgc-navy); background: var(--fgc-surface-hover); }
.fgc-shortcuts-add:disabled { opacity: .4; cursor: not-allowed; background: transparent; }
.fgc-drawer-shortcuts { display: flex; flex-direction: column; gap: 1px; }
.fgc-drawer-item.fgc-shortcut-item { position: relative; padding-right: 30px; }
.fgc-shortcut-remove {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; border: none; border-radius: 6px;
  background: transparent; color: var(--fgc-muted); cursor: pointer; opacity: 0;
  transition: opacity var(--fgc-transition), background var(--fgc-transition), color var(--fgc-transition);
}
.fgc-shortcut-item:hover .fgc-shortcut-remove, .fgc-shortcut-remove:focus-visible { opacity: 1; }
.fgc-shortcut-remove:hover { background: var(--fgc-surface-hover); color: var(--fgc-red); }
.fgc-shortcut-remove svg { width: 10px; height: 10px; }
.fgc-drawer-shortcuts-empty { padding: 4px 10px 8px; font-size: 12.5px; line-height: 1.4; color: var(--fgc-muted); }
.fgc-drawer-shortcuts-empty[hidden] { display: none; }
.fgc-shortcuts-picker {
  display: none; flex-direction: column; gap: 1px; margin: 2px 0 6px; padding: 6px; max-height: 320px; overflow-y: auto;
  background: var(--fgc-surface); border: 1px solid var(--fgc-border); border-radius: 10px;
}
.fgc-shortcuts-picker.is-open { display: flex; }
.fgc-shortcuts-picker-hint { padding: 2px 6px 6px; font-size: 11px; color: var(--fgc-muted); }
.fgc-shortcuts-picker-group { padding: 8px 8px 2px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--fgc-muted); }
.fgc-shortcuts-picker-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px;
  font-size: 13px; font-weight: 600; color: var(--fgc-ink); cursor: pointer; transition: background var(--fgc-transition);
}
.fgc-shortcuts-picker-item:hover { background: var(--fgc-surface-hover); }
.fgc-shortcuts-picker-item input { accent-color: var(--fgc-navy); }
.fgc-shortcuts-picker-item.is-disabled { opacity: .45; cursor: not-allowed; }

/* ══════════════ MENÚ LATERAL EN MÓVIL (<= 900 px) ══════════════ */
.fgc-scrim {
  position: fixed; inset: 0; top: var(--fgc-topbar-height); z-index: 940;
  background: rgba(10, 18, 24, .35); opacity: 0; pointer-events: none;
  transition: opacity var(--fgc-transition);
}
.fgc-scrim.is-open { opacity: 1; pointer-events: auto; }
@media (max-width: 900px) {
  body.fgc-drawer-pinned { padding-left: 0; }                      /* no empuja: se abre encima */
  .fgc-drawer { width: min(86vw, var(--fgc-drawer-width)); }
  .fgc-drawer.is-open { box-shadow: var(--fgc-shadow); }
}
@media (min-width: 901px) { .fgc-scrim { display: none; } }
@media (max-width: 640px) {                                         /* barra superior compacta */
  .fgc-profile-name { display: none; }
  .fgc-settings-btn { font-size: 0; gap: 0; }                      /* solo el ícono, sin el texto */
  .fgc-tenant-name { max-width: 96px; }
}

/* Botón Soporte de la barra superior (enlace con el aspecto de Configuración) */
a.fgc-settings-btn { text-decoration: none; }

/* Iconos de módulo y de sección del drawer (mockup de Catalina) */
.fgc-section-icon {width: 12px; height: 12px; flex-shrink: 0; fill: #b3bcc1;}
.fgc-drawer-label.fgc-drawer-label-stacked {display: flex; flex-direction: column; justify-content: center; gap: 1px; white-space: normal; overflow: visible;}
.fgc-drawer-icon--mod svg {fill: none;}
.fgc-drawer-icon--mod svg [fill]:not([fill="none"]) {fill: currentColor !important;}
.fgc-drawer-icon--mod svg [stroke] {stroke: currentColor !important;}
.fgc-drawer-icon--mod svg [stroke]:not([fill]) {stroke-width: 1.5;}
.fgc-drawer-icon--mod {width: 22px; height: 22px;}

/* Loader de transición entre páginas (partials/design/page-loader.hbs, js/design/fgc-page-transition.js) */
.fgc-page-loader {
  position: fixed; top: var(--fgc-topbar-height); left: 0; right: 0; bottom: 0; z-index: 900;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: var(--fgc-bg); color: var(--fgc-muted); font-size: 13.5px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 150ms ease, left 240ms cubic-bezier(0.16, 1, 0.3, 1);
}
body.fgc-drawer-pinned .fgc-page-loader { left: var(--fgc-drawer-width); }
.fgc-page-loader.is-visible { opacity: 1; pointer-events: all; }
.fgc-page-loader-logo { width: 64px; height: auto; animation: fgc-loader-pulse 1.6s ease-in-out infinite; }
.fgc-page-loader-logo--dark { display: none; }
html[data-fgc-theme="galaxy"] .fgc-page-loader-logo--light,
html[data-fgc-theme="blacktears"] .fgc-page-loader-logo--light { display: none; }
html[data-fgc-theme="galaxy"] .fgc-page-loader-logo--dark,
html[data-fgc-theme="blacktears"] .fgc-page-loader-logo--dark { display: block; }
@keyframes fgc-loader-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: .7; } }

/* Entrada suave del contenido al cargar cada página */
@keyframes fgc-page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-wrapper { animation: fgc-page-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both; }
@media (prefers-reduced-motion: reduce) {
  .page-wrapper { animation: none; }
  .fgc-page-loader-logo { animation: none; }
}
