/* BIAXIS — hoja base. El color del cliente llega como --primario desde seg.parametro (empresa.color_primario). */
:root {
  --primario: #1f4e79;
  --texto: #1d2430;
  --suave: #5b6576;
  --borde: #d9dee6;
  --fondo: #f4f6f9;
  --blanco: #fff;
  --verde: #1e7d4f;
  --rojo: #b42318;
  --amarillo: #9a6700;
  --radio: 8px;
  --lateral: 232px;
  --alto-barra: 60px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); font-size: 15px; line-height: 1.45; }
a { color: var(--primario); }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.9em; }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 0.5rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }

/* Barra superior y menú lateral */
.barra { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.75rem; height: var(--alto-barra); padding: 0 1rem;
  background: var(--primario); color: var(--blanco); }
.barra a, .barra .enlace { color: var(--blanco); }
.logo { font-weight: 700; letter-spacing: 0.02em; text-decoration: none; font-size: 1.05rem; }
.empresa { opacity: 0.85; font-size: 0.9rem; }
.usuario { margin-left: auto; display: flex; align-items: center; gap: 0.9rem; font-size: 0.9rem; }
.usuario form { margin: 0; }
.menu-toggle { display: none; }
.btn-menu { display: none; cursor: pointer; font-size: 1.3rem; }
.lateral { position: fixed; top: var(--alto-barra); bottom: 0; left: 0; width: var(--lateral); overflow-y: auto; padding: 1rem 0.75rem;
  background: var(--blanco); border-right: 1px solid var(--borde); }
.lateral .modulo { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--suave); margin: 0.9rem 0.5rem 0.3rem; }
.lateral ul { list-style: none; margin: 0; padding: 0; }
.lateral a { display: block; padding: 0.4rem 0.6rem; border-radius: 6px; text-decoration: none; color: var(--texto); }
.lateral a:hover { background: var(--fondo); }
.lateral a.activo { background: color-mix(in srgb, var(--primario) 12%, white); color: var(--primario); font-weight: 600; }
.contenido { margin-left: var(--lateral); padding: 1.5rem; max-width: 1200px; }
.encabezado { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* Pantallas públicas (login, recuperación) */
.publica { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 1rem;
  background: linear-gradient(160deg, var(--primario), color-mix(in srgb, var(--primario) 60%, black)); }
.tarjeta-acceso { width: 100%; max-width: 400px; background: var(--blanco); border-radius: 12px; padding: 2rem;
  box-shadow: 0 12px 40px rgb(0 0 0 / 25%); }
.marca-acceso { display: flex; flex-direction: column; align-items: center; margin-bottom: 1.5rem; }
.marca-acceso .logo { color: var(--primario); font-size: 1.6rem; }
.marca-acceso .empresa { color: var(--suave); }
.pie-acceso { text-align: center; margin-top: 1rem; font-size: 0.9rem; }

/* Formularios */
.formulario { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.25rem; max-width: 720px; }
.formulario.angosto { max-width: 460px; }
.campo { margin-bottom: 0.9rem; display: flex; flex-direction: column; gap: 0.25rem; }
.campo label { font-weight: 600; font-size: 0.9rem; }
.campo-check label { font-weight: 400; display: flex; align-items: center; gap: 0.5rem; }
.campo ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
.campo ul label { font-weight: 400; display: flex; align-items: center; gap: 0.35rem; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
  width: 100%; padding: 0.55rem 0.65rem; border: 1px solid var(--borde); border-radius: 6px; font: inherit; background: var(--blanco); }
input[type=color] { width: 4rem; height: 2.2rem; padding: 0; border: 1px solid var(--borde); border-radius: 6px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primario) 45%, white); border-color: var(--primario); }
.con-error input, .con-error select, .con-error textarea { border-color: var(--rojo); }
.ayuda { color: var(--suave); font-size: 0.82rem; }
.error { color: var(--rojo); font-size: 0.85rem; }
.filtros { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.filtros input, .filtros select { width: auto; min-width: 180px; }

/* Botones */
.btn { display: inline-block; padding: 0.5rem 0.95rem; border: 1px solid var(--borde); border-radius: 6px; background: var(--blanco);
  color: var(--texto); font: inherit; font-size: 0.92rem; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--primario); }
.btn-primario { background: var(--primario); border-color: var(--primario); color: var(--blanco); font-weight: 600; }
.btn-primario:hover { filter: brightness(1.1); }
.btn-peligro { color: var(--rojo); border-color: color-mix(in srgb, var(--rojo) 40%, white); margin-top: 1rem; }
.ancho { width: 100%; text-align: center; padding: 0.65rem; }
.enlace { background: none; border: 0; padding: 0; font: inherit; color: var(--primario); cursor: pointer; text-decoration: underline; }
.botonera { display: flex; flex-direction: column; gap: 0.5rem; }
.botonera form { margin: 0; }

/* Mensajes */
.mensajes { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.msg { padding: 0.65rem 0.9rem; border-radius: 6px; border: 1px solid var(--borde); background: var(--blanco); margin-bottom: 0.75rem; }
.mensajes .msg { margin: 0; }
.msg-success { border-color: #a6d8bd; background: #ecf8f1; }
.msg-error { border-color: #f1b4ae; background: #fdf0ef; color: var(--rojo); }
.msg-warning { border-color: #f0d28a; background: #fff8e6; }
.msg-info { border-color: #b7cbe6; background: #eef4fb; }

/* Tablas y paneles */
.tabla-scroll { overflow-x: auto; background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); }
.tabla { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tabla th, .tabla td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: top; }
.tabla th { background: var(--fondo); font-weight: 600; font-size: 0.82rem; color: var(--suave); white-space: nowrap; }
.tabla tr:last-child td { border-bottom: 0; }
.matriz td:not(:first-child), .matriz th:not(:first-child) { text-align: center; }
.paginacion { display: flex; gap: 1rem; justify-content: center; align-items: center; margin-top: 1rem; font-size: 0.9rem; }
.columnas { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1.25rem; align-items: start; }
.panel { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1.1rem; }
.panel h3:first-child { margin-top: 0; }
.datos { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.datos li { padding: 0.3rem 0; border-bottom: 1px dashed var(--borde); }
.fila-accion { display: flex; justify-content: space-between; gap: 0.5rem; }
.fila-accion form { margin: 0; }
.etiqueta { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600;
  background: color-mix(in srgb, var(--primario) 12%, white); color: var(--primario); }
.etiqueta.verde { background: #e3f4ea; color: var(--verde); }
.etiqueta.roja { background: #fde8e6; color: var(--rojo); }
.etiqueta.amarilla { background: #fff3d6; color: var(--amarillo); }
.etiqueta.gris { background: #eceff3; color: var(--suave); }
.estado-dato { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; padding: 0.7rem 0.9rem; margin-bottom: 1rem;
  background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); font-size: 0.9rem; }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.9rem; }
.tarjeta { display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem; background: var(--blanco); border: 1px solid var(--borde);
  border-radius: var(--radio); text-decoration: none; color: var(--texto); }
.tarjeta:hover { border-color: var(--primario); }
.tarjeta .modulo { font-size: 0.72rem; text-transform: uppercase; color: var(--suave); letter-spacing: 0.05em; }

/* Celular (RF7) */
@media (max-width: 860px) {
  .btn-menu { display: block; }
  .usuario .nombre { display: none; }
  .lateral { transform: translateX(-100%); transition: transform 0.2s; z-index: 15; box-shadow: 4px 0 20px rgb(0 0 0 / 15%); }
  .menu-toggle:checked ~ .lateral { transform: none; }
  .contenido { margin-left: 0; padding: 1rem; }
  .columnas { grid-template-columns: 1fr; }
  .empresa { display: none; }
}

/* Paleta de gráficos (Parámetros) */
.paleta { list-style: none; margin: 0 0 0.5rem; padding: 0; font-size: 0.88rem; }
.paleta li { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
.muestra { display: inline-block; width: 1.6rem; height: 0.9rem; border-radius: 4px; box-shadow: inset 0 0 0 1px rgb(11 11 11 / 10%); }

/* Portal: sin menú lateral */
.contenido.sin-lateral { margin: 0 auto; }
.lista-empresas { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; max-width: 460px; }

/* Logo BIAxis (plataforma) en las apps de cliente: blanco en la barra del color del cliente, a color en el ingreso */
.barra .logo { display: flex; align-items: center; }
.barra .logo-svg { height: 50px; width: auto; display: block; }
.marca-acceso .logo-img { width: 200px; height: auto; display: block; }
.marca-acceso .empresa { margin-top: 0.35rem; font-weight: 600; color: var(--primario); }
