/* =========================================================
 * QuantCortex — Design System base
 * =======================================================*/

/* ---------- Design tokens ---------- */
:root {
  --qc-bg: #0f1420;
  --qc-card: #141a2a;
  --qc-stroke: #26324d;
  --qc-text: #e8eef7;
  --qc-muted: #9fb0d1;
  --qc-accent: #7a2cff;

  --qc-radius-md: 10px;
  --qc-radius-lg: 14px;

  --qc-shadow-soft: 0 6px 30px rgba(0, 0, 0, .3);
  --qc-shadow-none: none;

  --qc-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --qc-font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --qc-input-bg: #0e1321;
  --qc-input-border: #2b3a5c;
  --qc-input-radius: 10px;

  --qc-danger: #ff5c5c;
  --qc-success: #76d368;
  --qc-warning: #f5b04d;
}

/* =========================================================
 *  Base global
 * =======================================================*/

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

body {
  font-family: var(--qc-font-sans);
  background: var(--qc-bg);
  color: var(--qc-text);
}

/* Layout genérico de la app (dashboard + admin) */
body.layout-app {
  background: var(--qc-bg);
  color: var(--qc-text);
}

/* Si aún no se define .layout-app, usamos el body normal igualmente */
body:not(.layout-app) {
  background: var(--qc-bg);
  color: var(--qc-text);
}

/* Textos */
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  color: var(--qc-text);
  
  margin: 1em 0;
}

p {
  margin: 0 0 10px;
}

/* Links */
a {
  color: var(--qc-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

hr {
	border-color: var(--qc-stroke);
}

/* Utilidades de texto */
.muted,
span.muted {
  color: var(--qc-muted);
  font-size: 13px;
}

/* =========================================================
 *  Layout: header, contenedores, tarjetas, shell+sidebar
 * =======================================================*/

/* Cabecera principal */
.qc-header,
header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 20px;
  background: var(--qc-card);
  border-bottom: 1px solid var(--qc-stroke);
  box-sizing: border-box;
  width: 100%;
  
  border: none;
  background: none;
}

/* Botón hamburguesa (se muestra sólo en móvil) */
.qc-nav-toggle {
  display: none;  /* se activará en el media query */
  background: transparent;
  border: 0;
  padding: 6px;
  margin-left: 8px;
  cursor: pointer;
  color: var(--qc-text);
  font-size: 20px;
}

.qc-nav-toggle:focus {
  outline: 2px solid var(--qc-accent);
  outline-offset: 2px;
}

.qc-nav-toggle i {
  pointer-events: none;
}



/* Logo */
.logo {
  display: block;
  width: 100%;
}

/* Contenedor principal de página (contenido dentro de main) */
.qc-wrap,
.wrap {
  /*max-width: 1100px;*/
  margin: 24px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* Tarjetas / bloques */
.qc-card,
.card {
  background: var(--qc-card);
  border: 1px solid var(--qc-stroke);
  border-radius: var(--qc-radius-lg);
  padding: 18px;
  margin-bottom: 18px;
  box-sizing: border-box;
}

/* Fila flexible genérica */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 10px;
}

/* ---------- Shell + Sidebar ---------- */

.qc-shell {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px;
  box-sizing: border-box;
  
  width: 100%;
  margin: 0;
  max-width: none;
  padding: 0;
  gap: 0;
  height: 100%;
}

/* Sidebar columna izquierda */
.qc-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--qc-card);
  border: 1px solid var(--qc-stroke);
  border-radius: var(--qc-radius-lg);
  padding: 16px;
  box-sizing: border-box;
  
  height: 100%;
  margin: 0;
  border-radius: 0;
  position: fixed;
}

.qc-sidebar-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--qc-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Lista de navegación lateral */
.qc-sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.qc-sidebar-item {
  margin-bottom: 4px;
}

.qc-sidebar-link {
  display: block;
  padding: 8px 10px;
  border-radius: var(--qc-radius-md);
  font-size: 14px;
  color: var(--qc-text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}

.qc-sidebar-link:hover {
  background: #181f33;
  border-color: var(--qc-stroke);
}

.qc-sidebar-link.is-active {
  background: #181f33;
  border-color: var(--qc-accent);
  color: #fff;
}

/* Submenú dentro del sidebar (por ejemplo: New License, New User) */
.qc-sidebar-subnav {
  list-style: none;
  padding-left: 14px;
  margin: 4px 0 2px;
}

.qc-sidebar-subitem {
  margin-bottom: 2px;
}

.qc-sidebar-sublink {
  display: block;
  padding: 4px 10px;
  border-radius: var(--qc-radius-md);
  font-size: 13px;
  color: var(--qc-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}

.qc-sidebar-sublink:hover {
  color: var(--qc-text);
  background: #181f33;
  border-color: var(--qc-stroke);
}

.qc-sidebar-sublink.is-active {
  color: #fff;
  background: #181f33;
  border-color: var(--qc-accent);
}

/* Contenido principal a la derecha */
.qc-main {
  flex: 1;
  min-width: 0; /* para que funcione bien el ellipsis en tablas */
  
  margin-left: 280px;
  width: 100%;
}





/* =========================================================
 *  Botones
 * =======================================================*/

button,
.btn {
  display: inline-block;
  padding: 8px 10px;
  border-radius: var(--qc-radius-md);
  border: 0;
  background: var(--qc-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  text-decoration: none;
}

button:hover,
.btn:hover {
  filter: brightness(1.05);
}

/* Variante contorno */
.btn-outline {
  background: transparent;
  border: 1px solid var(--qc-input-border);
  color: var(--qc-text);
}

/* Botón pequeño */
.btn-sm {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 999px;
}

/* Botón tipo link (sin caja) */
.btn-link {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--qc-muted) !important;
  padding: 0;
}

/* Estados deshabilitados */
button[disabled],
.btn[disabled] {
  opacity: .6;
  cursor: default;
}

/* Botones de solo icono (header) */
.btn-icon {
  padding: 6px 8px;
  min-width: auto;
}

.btn-icon i {
  font-size: 14px;
}


/* =========================================================
 *  Tablas, badges, monospace
 * =======================================================*/

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid var(--qc-stroke);
  text-align: left;
}

th {
  font-weight: 600;
  color: var(--qc-muted);
}

/* Tabla con celdas "fijas" y truncamiento (logs) */
.table-fixed {
  width: 100%;
  border-collapse: collapse;
}

.table-fixed th,
.table-fixed td {
  padding: 8px;
  border-bottom: 1px solid var(--qc-stroke);
}

/* Celda truncable (para logs, licencias) */
.cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Texto monoespaciado (licencias, tokens…) */
.mono {
  font-family: var(--qc-font-mono);
  font-size: 12px;
}

/* Badges de estado (compatibles con dashboard/admin originales) */
.qc-badge,
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--qc-input-border); /* #2b3a5c */
}

/* Variantes "de sistema" posibles a futuro */
.qc-badge--ok {
  background: rgba(46, 204, 113, .18);
  color: var(--qc-success);
}

.qc-badge--warn {
  background: rgba(243, 156, 18, .18);
  color: var(--qc-warning);
}

.qc-badge--error {
  background: rgba(231, 76, 60, .18);
  color: #ff8976;
}

/* Compatibilidad exacta con .ok/.warn/.err originales */
.ok {
  color: #9ff59f;
  border-color: #2f6f2f;
  background: #0e1a0e;
}

.warn {
  color: #ffd27a;
  border-color: #6f5f2f;
  background: #1a160e;
}

.err {
  color: #ff9f9f;
  border-color: #6f2f2f;
  background: #1a0e0e;
}

/* Badges específicos para logs (admin/seat) */
.admin {
  color: #b3d3ff;
  border-color: #2b4a7a;
  background: #0e1524;
}

.seat {
  color: #d3b3ff;
  border-color: #4a2b7a;
  background: #140e24;
}

/* Flash messages (de dashboard.php original) */
.flash {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
}

.flash.ok {
  background: #102417;
  border: 1px solid #214a34;
  color: #bfe9c9;
}

.flash.err {
  background: #2a1414;
  border: 1px solid #5a2a2a;
  color: #ffc9c9;
}

/* Paginación */
.pager {
  margin-top: 12px;
}

.pager a,
.pager span {
  margin-right: 8px;
  font-size: 13px;
}

.pager a {
  color: var(--qc-muted);
  text-decoration: none;
}

.pager a:hover {
  text-decoration: underline;
}

.pager span.current {
  font-weight: 700;
}

/* =========================================================
 *  Formularios
 * =======================================================*/

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 13px;
}

/* Campos de texto base (sin ancho todavía) */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="date"],
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--qc-text);
  background: var(--qc-input-bg);
  border-radius: var(--qc-input-radius);
  border: 1px solid var(--qc-input-border);
  padding: 8px 10px;
  outline: none;
}

/* Ejemplo para filtros de admin (anchos más contenidos) */
input[type="text"],
input[type="search"] {
  max-width: 280px;
}

/* Enfoque */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--qc-accent);
}

/* Textareas */
textarea {
  resize: vertical;
  min-height: 80px;
}

/* [ANCLA-CSS-FORM-WIDTHS]
 * Evita desbordes en WebKit y asegura que los campos respetan el contenedor
 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: -webkit-fill-available;
  width: 100%;
  box-sizing: border-box;
}

/* =========================================================
 *  Footer
 * =======================================================*/

footer.qc-footer {
  margin-top: 24px;
  padding: 16px;
  text-align: center;
  color: var(--qc-muted);
  border-top: 1px solid var(--qc-stroke);
  box-sizing: border-box;
  
  position: absolute;
  bottom: 4px;
  width: 100%;
  left: 0;
  padding: 8px;
}

footer.qc-footer a {
  color: var(--qc-text);
  text-decoration: none;
}

footer.qc-footer a:hover {
  text-decoration: underline;
}

/* =========================================================
 *  Login / páginas especiales
 * =======================================================*/

body#login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body#login main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

body#login h1 {
	text-align: center;
}

.login-card {
  background: var(--qc-card);
  border: 1px solid var(--qc-stroke);
  border-radius: var(--qc-radius-lg);
  padding: 28px;
  max-width: 420px;
  width: 92%;
  box-shadow: var(--qc-shadow-soft);
  box-sizing: border-box;
}

/* =========================================================
 *  Utilidades varias
 * =======================================================*/

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* Espaciados horizontales rápidos */
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }

/* Anchos de contenedor habituales */
.wrap-sm    { max-width: 720px; margin: 24px auto; padding: 0 16px; box-sizing:border-box; }
.wrap-md    { max-width: 960px; margin: 24px auto; padding: 0 16px; box-sizing:border-box; }

/* Layouts flex genéricos */
.flex        { display:flex; }
.inline      { display:inline; }
.flex-end    { align-items:flex-end; }
.flex-center { align-items:center; }
.flex-row    { flex-direction:row; }
.flex-wrap   { flex-wrap:wrap; }
.gap-1       { gap: 8px; }
.gap-2       { gap: 14px; }

/* Utilidad para el texto pequeñito tipo toast */
.text-xs   { font-size: 12px; }
.opacity-0 { opacity: 0; }









/* =======================
 * Help layout (help.php)
 * =======================*/

.help-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* Columna izquierda fija y scrollable */
.help-aside {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 16px;
  align-self: flex-start;

  max-height: calc(100vh - 32px); /* espacio disponible en la ventana */
  overflow-y: auto;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-aside li a {
	display: block;
    padding: 4px 10px;
    border-radius: var(--qc-radius-md);
    font-size: 13px;
    color: var(--qc-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background .15s, border-color .15s, color .15s;
}


/* Bloque admin (botones + estado) */
.help-admin {
  border-bottom: 1px solid #26324d;
  padding-bottom: 8px;
}

/* Título del índice */
.help-sections-title {
  font-size: 15px;
  margin: 0 0 4px;
}

/* Contenedor del índice dentro del aside */
.help-toc {
  /* ya no hace falta overflow aquí, el scroll lo tiene el aside */
}

/* Estilo básico de la lista de índice que generamos en JS */
.help-toc ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.help-toc li {
  margin-bottom: 4px;
}

.help-toc a {
  color: inherit;
  text-decoration: none;
}

.help-toc a:hover {
  text-decoration: underline;
}

/* Columna derecha (contenido de ayuda) */
.help-main {
  flex: 1;
  min-width: 0;
}

.help-main p {
	color: #9fb0d1;
}

/* En pantallas pequeñas la columna ya no queda sticky ni con scroll propio */
@media (max-width: 880px) {
  .help-aside {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

/* Scrollbar elegante solo en el aside de help */
.help-aside {
  scrollbar-width: thin;                 /* Firefox */
  scrollbar-color: #3a4564 transparent;  /* Firefox */
  border-right: 1px solid #3a4564;
}

.help-aside::-webkit-scrollbar {
  width: 6px;                            /* ancho de la barra */
}

.help-aside::-webkit-scrollbar-track {
  background: transparent;
}

.help-aside::-webkit-scrollbar-thumb {
  background: #3a4564;
  border-radius: 999px;
}

.help-aside::-webkit-scrollbar-thumb:hover {
  background: #5a6590;
}


/* Help page a ancho completo dentro del shell */
.page-help .wrap {
  max-width: 100%;
  /*
  padding-left: 0;
  padding-right: 0;
  */
}



/* =======================
 * FAQ accordion (faq.php)
 * =======================*/

/* Ancho más amplio para la página de FAQ */
.page-faq .wrap {
  max-width: 960px;
}

/* Contenedor general de categorías */
.faq-section {
  margin-bottom: 18px;
}

/* Título de cada bloque de categoría */
.faq-section-title {
  font-size: 17px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Lista tipo acordeón */
.faq-accordion {
  margin-top: 4px;
}

/* Cada item de FAQ */
.faq-item {
  border-bottom: 1px solid var(--qc-stroke);
  padding: 4px 0;
}

/* Botón de pregunta (ocupa todo el ancho) */
.faq-question {
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--qc-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

/* Contenido principal de la pregunta (icono + texto) */
.faq-q-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  text-align: left;
}

.faq-q-icon {
  width: 18px;
  text-align: center;
  color: var(--qc-muted);
}

.faq-q-text {
  flex: 1;
}

/* Chevron de apertura/cierre */
.faq-q-chevron {
  margin-left: 8px;
  color: var(--qc-muted);
  transition: transform .15s ease, color .15s ease;
}

.faq-item.is-open .faq-q-chevron {
  transform: rotate(180deg);
  color: var(--qc-text);
}

/* Respuesta colapsable */
.faq-answer {
  display: none;
  margin: 4px 0 6px 26px; /* un poco a la derecha respecto al icono */
  font-size: 14px;
  color: var(--qc-muted);
}

.faq-item.is-open .faq-answer {
  display: block;
}


.page-user-guide .wrap {
  max-width: 100%;
}

/* =======================
 * User Guide styling
 * =======================*/

.page-user-guide .card {
  /*padding: 20px 24px;*/
}

/* Contenedor general del texto de la guía */
.ug-body {
  line-height: 1.5;
}

/* Secciones (01. Time, 02. Days...) */
.ug-body h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--qc-muted);
  border-bottom: 1px solid var(--qc-stroke);
  padding-bottom: 4px;
}

/* Primer h2 de la página un poco más pegado arriba */
.ug-body h2:first-child {
  margin-top: 0;
}

/* Nombre de parámetro */
.ug-body h3 {
  margin-top: 14px;
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Pequeña “píldora” delante del nombre del parámetro */
.ug-body h3::before {
  content: '●';
  font-size: 9px;
  line-height: 1;
  color: #9f7aea; /* puedes cambiar el color si quieres */
}

/* Bloque de descripción del parámetro */
.ug-body h3 + p {
  margin-top: 0;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(9, 18, 40, 0.8);
  border: 1px solid var(--qc-stroke);
  color: var(--qc-muted);
}

/* Párrafos extra del mismo parámetro (si los hubiera) */
.ug-body h3 + p + p {
  margin-top: 4px;
}

/* Un poco de sangrado para que los parámetros queden “debajo” del grupo */
.ug-body h3,
.ug-body h3 + p {
  margin-left: 10px;
}

























/* Responsive: sidebar off-canvas + ajustes en móvil */
@media (max-width: 880px) {

  .qc-shell {
    position: relative;
    flex-direction: column;
    overflow-x: hidden;
  }

  /* Sidebar off-canvas: oculto a la izquierda por defecto */
  .qc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    border-radius: 0;
    transform: translateX(-100%);
    transition: transform .25s ease-out, box-shadow .25s ease-out;
    z-index: 1000;
  }

  /* Sidebar visible cuando el body marca que está abierto */
  body.has-sidebar-open .qc-sidebar {
    transform: translateX(0);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); /* overlay oscuro clicable */
  }

  /* El contenido ya no “reserva” espacio para el sidebar en móvil */
  .qc-main {
    margin-left: 0;
  }

  /* Botón hamburguesa visible en móvil */
  .qc-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Ocultar layout de ayuda completo en móvil */
  .help-layout .help-aside {
    display: none;
  }
  /*
  .help-layout help-main {
    display: none;
  }*/
}




.metrics-chart {
  width: 50%;
  min-height: 220px;
}

