/* ==========================================================================
   IDEASSYS POS — sistema de diseño
   Bootstrap 5 aporta rejilla, formularios y componentes; aquí van los tokens,
   la identidad visual y el movimiento. Todo el color pasa por variables, así
   el color de cada empresa (--brand) y el modo oscuro se aplican en un solo lugar.
   ========================================================================== */

@font-face { font-family: "Inter"; src: url("../vendor/fonts/inter.8e433c0592f7.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Jakarta"; src: url("../vendor/fonts/jakarta.13d1b429e990.woff2") format("woff2");
  font-weight: 200 800; font-display: swap; }

:root {
  --brand: #4f46e5;
  --brand-rgb: 79, 70, 229;
  --brand-ink: #ffffff;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --brand-strong: color-mix(in srgb, var(--brand) 82%, #000);

  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #eef0f7;
  --border: #e4e7f0;
  --border-strong: #d3d8e6;
  --text: #141827;
  --text-2: #3d4560;
  --muted: #6b7390;

  --side-bg: #0e1121;
  --side-bg-2: #151a33;
  --side-text: #c4c9e0;
  --side-muted: #7e86a8;
  --side-active: rgba(255, 255, 255, .08);

  --ok: #0f9f6e;   --ok-soft: #e3f6ee;
  --warn: #c27803; --warn-soft: #fdf3dc;
  --bad: #dc3545;  --bad-soft: #fde8ea;
  --info: #2563eb; --info-soft: #e5eefe;

  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --sombra-1: 0 1px 2px rgba(16, 24, 40, .05);
  --sombra-2: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --sombra-3: 0 12px 40px rgba(16, 24, 40, .14);

  /* Curvas: las de CSS por defecto se sienten débiles. */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  --side: 264px;
  --top: 64px;

  --fuente: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fuente-display: "Jakarta", "Inter", system-ui, sans-serif;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d18; --surface: #12152a; --surface-2: #161a31; --surface-3: #1d2240;
    --border: #252b4a; --border-strong: #323a60; --text: #eceefa; --text-2: #c3c8e2; --muted: #8b93b6;
    --side-bg: #080a14; --side-bg-2: #0e1121;
    --ok-soft: rgba(15, 159, 110, .16); --warn-soft: rgba(194, 120, 3, .18); --bad-soft: rgba(220, 53, 69, .16);
    --info-soft: rgba(37, 99, 235, .18);
    --sombra-2: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --sombra-3: 0 16px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d18; --surface: #12152a; --surface-2: #161a31; --surface-3: #1d2240;
  --border: #252b4a; --border-strong: #323a60; --text: #eceefa; --text-2: #c3c8e2; --muted: #8b93b6;
  --side-bg: #080a14; --side-bg-2: #0e1121;
  --ok-soft: rgba(15, 159, 110, .16); --warn-soft: rgba(194, 120, 3, .18); --bad-soft: rgba(220, 53, 69, .16);
  --info-soft: rgba(37, 99, 235, .18);
  --sombra-2: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --sombra-3: 0 16px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* --- Base ---------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--fuente); background: var(--bg); color: var(--text); font-size: .9375rem;
  line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
h1, h2, h3, h4, h5, .display { font-family: var(--fuente-display); letter-spacing: -0.02em; color: var(--text); }
h1 { font-weight: 750; } h2, h3 { font-weight: 700; } h4, h5 { font-weight: 650; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
.text-muted, .muted { color: var(--muted) !important; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .85em; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
hr { border-color: var(--border); opacity: 1; }

/* --- Shell: barra lateral + contenido ------------------------------------ */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.lateral {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(120% 60% at 0% 0%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
              linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
  color: var(--side-text); padding: 18px 14px 24px; scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent; z-index: 1030;
}
.marca { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; color: #fff; }
.marca:hover { color: #fff; }
.marca-logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #22d3ee));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 45%, transparent), inset 0 1px 0 rgba(255,255,255,.25);
  overflow: hidden;
}
.marca-logo img { width: 100%; height: 100%; object-fit: cover; }
.marca-texto { line-height: 1.15; min-width: 0; }
.marca-texto strong { font-family: var(--fuente-display); font-size: 1.02rem; display: block; letter-spacing: -.01em; }
.marca-texto small { color: var(--side-muted); font-size: .75rem; display: block; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.menu-seccion { margin-top: 14px; }
.menu-titulo { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--side-muted);
  padding: 0 12px 6px; font-weight: 600; }
.menu-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 10px; color: var(--side-text);
  font-size: .9rem; font-weight: 500; position: relative;
  transition: background-color 160ms ease, color 160ms ease;
}
.menu-item i { font-size: 1.05rem; width: 20px; text-align: center; opacity: .85; }
.menu-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.menu-item.activo { background: var(--side-active); color: #fff; }
.menu-item.activo::before {
  content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--brand); box-shadow: 0 0 12px var(--brand);
}
.menu-item.activo i { opacity: 1; color: color-mix(in srgb, var(--brand) 35%, #fff); }

.principal { min-width: 0; display: flex; flex-direction: column; }
/* Velo del menú móvil: fuera de la cuadrícula siempre (si no, ocupa una columna y empuja el contenido). */
.velo { position: fixed; inset: 0; background: rgba(8, 10, 20, .45); z-index: 1025; opacity: 0; pointer-events: none;
  transition: opacity 260ms ease; }
.superior {
  position: sticky; top: 0; z-index: 1020; height: var(--top); display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.contenido { padding: 26px 28px 56px; max-width: 1480px; width: 100%; margin: 0 auto; }
.boton-icono.btn-menu { display: none; }
.busqueda-global { position: relative; flex: 1; max-width: 420px; }
.busqueda-global input { padding-left: 38px; background: var(--surface); border-radius: 999px; height: 38px; }
.busqueda-global i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  font-size: .78rem; color: var(--brand-ink); background: linear-gradient(135deg, var(--brand), #22d3ee);
}
.boton-icono {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.boton-icono:hover { background: var(--surface-3); color: var(--text); }
.boton-icono:active { transform: scale(.94); }

.aviso-banda {
  display: flex; align-items: center; gap: 10px; padding: 10px 28px; font-size: .88rem; font-weight: 500;
  border-bottom: 1px solid var(--border);
}
.aviso-banda.warn { background: var(--warn-soft); color: var(--warn); }
.aviso-banda.bad { background: var(--bad-soft); color: var(--bad); }
.aviso-banda.info { background: var(--info-soft); color: var(--info); }

@media (max-width: 991.98px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .lateral {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); transform: translateX(-104%);
    transition: transform 380ms var(--ease-drawer); box-shadow: var(--sombra-3);
  }
  body.menu-abierto .lateral { transform: none; }
  body.menu-abierto .velo { opacity: 1; pointer-events: auto; }
  .boton-icono.btn-menu { display: grid; }
  .superior { padding: 0 16px; }
  .contenido { padding: 18px 16px 48px; }
  .aviso-banda { padding: 10px 16px; }
}

/* --- Encabezado de página ------------------------------------------------- */
.encabezado { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px;
  margin-bottom: 22px; }
.encabezado h1 { font-size: 1.6rem; margin: 0; }
.encabezado .sub { color: var(--muted); margin: 4px 0 0; font-size: .92rem; }
.encabezado .acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.migas { font-size: .8rem; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.migas a { color: var(--muted); }
.migas a:hover { color: var(--brand); }

/* --- Tarjetas ------------------------------------------------------------- */
.tarjeta {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sombra-1);
}
.tarjeta-cuerpo { padding: 20px 22px; }
.tarjeta-titulo { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 22px; border-bottom: 1px solid var(--border); }
.tarjeta-titulo h2, .tarjeta-titulo h3 { font-size: 1rem; margin: 0; }
.tarjeta-titulo .sub { color: var(--muted); font-size: .82rem; }
.tarjeta.elevada { box-shadow: var(--sombra-2); }
a.tarjeta { color: inherit; display: block; transition: transform 220ms var(--ease-out), box-shadow 220ms ease,
  border-color 160ms ease; }
@media (hover: hover) and (pointer: fine) {
  a.tarjeta:hover { transform: translateY(-2px); box-shadow: var(--sombra-2); border-color: var(--border-strong); }
}
a.tarjeta:active { transform: scale(.985); }

/* KPI */
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .etiqueta { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; display: flex; align-items: center; gap: 8px; }
.kpi .valor { font-family: var(--fuente-display); font-size: 1.75rem; font-weight: 750; letter-spacing: -.03em;
  margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .detalle { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.kpi .icono {
  position: absolute; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 12px; display: grid;
  place-items: center; font-size: 1.15rem; background: var(--brand-soft); color: var(--brand);
}
.kpi .icono.ok { background: var(--ok-soft); color: var(--ok); }
.kpi .icono.warn { background: var(--warn-soft); color: var(--warn); }
.kpi .icono.bad { background: var(--bad-soft); color: var(--bad); }
.kpi .icono.info { background: var(--info-soft); color: var(--info); }
.tendencia { font-size: .78rem; font-weight: 650; padding: 2px 8px; border-radius: 999px; }
.tendencia.sube { background: var(--ok-soft); color: var(--ok); }
.tendencia.baja { background: var(--bad-soft); color: var(--bad); }

.destacado {
  background: radial-gradient(140% 120% at 100% 0%, color-mix(in srgb, #22d3ee 35%, transparent), transparent 55%),
              linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #0e1121));
  color: #fff; border: 0;
}
.destacado .etiqueta, .destacado .detalle { color: rgba(255,255,255,.78); }
.destacado .icono { background: rgba(255,255,255,.16); color: #fff; }

/* --- Chips de estado ------------------------------------------------------ */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem;
  font-weight: 650; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-muted { background: var(--surface-3); color: var(--muted); }
.chip-brand { background: var(--brand-soft); color: var(--brand); }
.chip.sin-punto::before { display: none; }

/* --- Tablas --------------------------------------------------------------- */
.tabla-envoltura { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.tabla thead th {
  position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: .74rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em; padding: 11px 16px; border-bottom: 1px solid var(--border);
  white-space: nowrap; text-align: left;
}
.tabla tbody td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background-color 120ms ease; }
.tabla tbody tr:hover { background: var(--surface-2); }
.tabla tfoot td { padding: 12px 16px; font-weight: 700; border-top: 1px solid var(--border-strong); }
.tabla .der, .tabla th.der { text-align: right; }
.tabla .cen { text-align: center; }
.tabla .acciones-fila { white-space: nowrap; text-align: right; }
.tabla a.fila-link { color: var(--text); font-weight: 600; }
.tabla a.fila-link:hover { color: var(--brand); }
.tabla.compacta tbody td { padding: 8px 12px; }

.vacio { text-align: center; padding: 56px 20px; color: var(--muted); }
.vacio i { font-size: 2.4rem; display: block; margin-bottom: 10px; color: var(--border-strong); }
.vacio h3 { font-size: 1.05rem; color: var(--text-2); margin-bottom: 4px; }

/* --- Filtros -------------------------------------------------------------- */
.filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 16px;
  border-bottom: 1px solid var(--border); }
.filtros .form-control, .filtros .form-select { height: 38px; font-size: .88rem; }
.filtros .buscar { flex: 1 1 240px; position: relative; }
.filtros .buscar i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.filtros .buscar input { padding-left: 36px; }

/* --- Botones -------------------------------------------------------------- */
.btn { font-weight: 600; border-radius: 10px; padding: .5rem 1rem; font-size: .9rem;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease,
              transform 160ms var(--ease-out); }
.btn:active { transform: scale(.97); }
.btn-sm { padding: .32rem .7rem; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: .75rem 1.3rem; font-size: 1rem; border-radius: 12px; }
.btn i { margin-right: 4px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-strong);
  --bs-btn-hover-border-color: var(--brand-strong); --bs-btn-active-bg: var(--brand-strong);
  --bs-btn-active-border-color: var(--brand-strong); --bs-btn-disabled-bg: var(--brand);
  --bs-btn-disabled-border-color: var(--brand); color: var(--brand-ink);
  box-shadow: 0 1px 2px rgba(16,24,40,.08), 0 4px 12px color-mix(in srgb, var(--brand) 28%, transparent); }
.btn-light, .btn-outline-secondary { --bs-btn-bg: var(--surface); --bs-btn-color: var(--text-2);
  --bs-btn-border-color: var(--border-strong); --bs-btn-hover-bg: var(--surface-3); --bs-btn-hover-color: var(--text);
  --bs-btn-hover-border-color: var(--border-strong); --bs-btn-active-bg: var(--surface-3);
  --bs-btn-active-color: var(--text); --bs-btn-active-border-color: var(--border-strong); }
.btn-suave { background: var(--brand-soft); color: var(--brand); border: 0; }
.btn-suave:hover { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand-strong); }
.btn-fantasma { background: transparent; border: 0; color: var(--text-2); }
.btn-fantasma:hover { background: var(--surface-3); color: var(--text); }

/* --- Formularios ---------------------------------------------------------- */
.form-control, .form-select {
  border-radius: 10px; border-color: var(--border-strong); background-color: var(--surface); color: var(--text);
  font-size: .92rem; padding: .55rem .8rem; transition: border-color 160ms ease, box-shadow 160ms ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
  background-color: var(--surface); color: var(--text);
}
.form-control::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.form-label { font-weight: 600; font-size: .84rem; color: var(--text-2); margin-bottom: .35rem; }
.form-text { color: var(--muted); font-size: .78rem; }
.form-check-input { border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
  border-color: var(--brand); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.invalid-feedback { display: block; font-size: .8rem; }
.campo-error .form-control, .campo-error .form-select { border-color: var(--bad); }
.form-seccion { padding: 22px; border-bottom: 1px solid var(--border); }
.form-seccion:last-of-type { border-bottom: 0; }
.form-seccion h3 { font-size: .95rem; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.form-seccion h3::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--brand); }
.barra-guardar {
  position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px;
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.input-group-text { background: var(--surface-3); border-color: var(--border-strong); color: var(--muted);
  border-radius: 10px; }
.opciones-check { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.opciones-check > div { display: flex; align-items: center; gap: 6px; }
.opciones-check ul, ul.opciones-check { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap;
  gap: 6px 16px; }
.opciones-check label { display: flex; align-items: center; gap: 6px; font-weight: 500; font-size: .88rem; }

/* --- Pestañas tipo segmento ----------------------------------------------- */
.segmento { display: inline-flex; padding: 4px; background: var(--surface-3); border-radius: 12px; gap: 2px;
  flex-wrap: wrap; }
.segmento a, .segmento button { padding: 6px 14px; border-radius: 9px; font-size: .85rem; font-weight: 600;
  color: var(--muted); border: 0; background: transparent; transition: background-color 160ms ease, color 160ms ease; }
.segmento a:hover, .segmento button:hover { color: var(--text); }
.segmento .activo { background: var(--surface); color: var(--text); box-shadow: var(--sombra-1); }

/* --- Paginación ----------------------------------------------------------- */
.paginacion { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
  border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); flex-wrap: wrap; }
.paginacion .pasos { display: flex; gap: 4px; }
.paginacion a, .paginacion span.actual { min-width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 9px; padding: 0 10px; border: 1px solid var(--border); color: var(--text-2); font-weight: 600; }
.paginacion a:hover { background: var(--surface-3); }
.paginacion span.actual { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* --- Mensajes (toasts) ---------------------------------------------------- */
.avisos { position: fixed; right: 20px; bottom: 20px; z-index: 1090; display: flex; flex-direction: column; gap: 10px;
  width: min(420px, calc(100vw - 40px)); pointer-events: none; }
.aviso {
  pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--sombra-3); font-size: .9rem;
  animation: aviso-entra 420ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms);
}
.aviso.sale { animation: aviso-sale 220ms ease-in forwards; }
.aviso i.ico { font-size: 1.15rem; margin-top: 1px; }
.aviso.success i.ico { color: var(--ok); } .aviso.error i.ico { color: var(--bad); }
.aviso.warning i.ico { color: var(--warn); } .aviso.info i.ico { color: var(--info); }
.aviso .cerrar { margin-left: auto; background: none; border: 0; color: var(--muted); padding: 0 2px; }
@keyframes aviso-entra { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes aviso-sale { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* --- Entrada de contenido (una vez por página, escalonada) ---------------- */
.entra { animation: entra 520ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* --- Modales y menús desplegables ----------------------------------------- */
.modal-content { border-radius: var(--r-xl); border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--sombra-3); color: var(--text); }
.modal-header, .modal-footer { border-color: var(--border); padding: 16px 22px; }
.modal-body { padding: 20px 22px; }
.modal-title { font-family: var(--fuente-display); font-weight: 700; }
.modal.fade .modal-dialog { transform: scale(.96) translateY(6px); opacity: 0;
  transition: transform 260ms var(--ease-out), opacity 200ms ease; }
.modal.show .modal-dialog { transform: none; opacity: 1; }
.modal-backdrop.show { opacity: .4; }
.dropdown-menu { border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--sombra-3);
  background: var(--surface); padding: 6px; font-size: .9rem; --bs-dropdown-link-color: var(--text-2);
  --bs-dropdown-link-hover-bg: var(--surface-3); --bs-dropdown-link-hover-color: var(--text);
  --bs-dropdown-link-active-bg: var(--brand); transform-origin: top right; }
.dropdown-menu.show { animation: menu-entra 180ms var(--ease-out); }
@keyframes menu-entra { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-item { border-radius: 9px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; }
.dropdown-header { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }

/* --- Utilidades ----------------------------------------------------------- */
.rejilla { display: grid; gap: 16px; }
.rejilla-kpi { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.lista-limpia { list-style: none; margin: 0; padding: 0; }
.fila-dato { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.fila-dato:last-child { border-bottom: 0; }
.fila-dato span:first-child { color: var(--muted); }
.fila-dato strong, .fila-dato span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.total-grande { font-family: var(--fuente-display); font-size: 2rem; font-weight: 800; letter-spacing: -.03em; }
.pildora-icono { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.25rem;
  background: var(--brand-soft); color: var(--brand); flex: none; }
.barra-progreso { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.barra-progreso > span { display: block; height: 100%; border-radius: inherit; background: var(--brand);
  transition: width 600ms var(--ease-out); }
.miniatura { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--surface-3);
  display: grid; place-items: center; color: var(--muted); flex: none; }
.cuadricula-acceso { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.acceso { padding: 18px; display: flex; gap: 14px; align-items: flex-start; }
.acceso h3 { font-size: .98rem; margin: 0 0 2px; }
.acceso p { margin: 0; color: var(--muted); font-size: .84rem; }
.grafica { position: relative; height: 280px; }
.grafica.baja { height: 220px; }
.separador-texto { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; }
.separador-texto::before, .separador-texto::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.paso { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.paso:last-child { border-bottom: 0; }
.paso .marca-paso { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 2px solid var(--border-strong); font-weight: 700; font-size: .85rem; color: var(--muted); }
.paso.hecho .marca-paso { background: var(--ok); border-color: var(--ok); color: #fff; }
.linea-tiempo { list-style: none; padding: 0; margin: 0; position: relative; }
.linea-tiempo li { position: relative; padding: 0 0 16px 26px; }
.linea-tiempo li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.linea-tiempo li::after { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.linea-tiempo li:last-child::after { display: none; }
.cod-barras { max-width: 100%; height: auto; }
kbd { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 6px; font-size: .74rem; padding: 1px 6px; font-family: var(--fuente); font-weight: 600; }

/* --- Páginas públicas (acceso, registro, precios) ------------------------- */
.publico { min-height: 100dvh; background:
  radial-gradient(60% 50% at 10% 0%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%),
  radial-gradient(50% 40% at 100% 10%, color-mix(in srgb, #22d3ee 16%, transparent), transparent 70%), var(--bg); }
.acceso-caja { width: min(440px, 100%); }
.acceso-panel { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100dvh; }
.acceso-arte {
  position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column;
  justify-content: space-between;
  background: radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, #22d3ee 45%, transparent), transparent 60%),
              radial-gradient(80% 60% at 0% 100%, color-mix(in srgb, #a855f7 40%, transparent), transparent 60%),
              linear-gradient(160deg, var(--brand), #0e1121 85%);
}
.acceso-arte h2 { color: #fff; font-size: 2.3rem; line-height: 1.1; max-width: 520px; }
.acceso-arte p { color: rgba(255,255,255,.78); max-width: 460px; }
.orbe { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.5), rgba(255,255,255,0) 60%); }
.flotante { animation: flotar 9s var(--ease-in-out) infinite alternate; }
@keyframes flotar { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -18px, 0); } }
.tarjeta-vidrio { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); border-radius: 18px;
  padding: 16px 18px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@media (max-width: 991.98px) { .acceso-panel { grid-template-columns: 1fr; } .acceso-arte { display: none; } }

.hero { padding: 88px 0 56px; text-align: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -.035em; max-width: 860px;
  margin: 0 auto 18px; }
.hero p.lead { color: var(--text-2); max-width: 640px; margin: 0 auto 28px; font-size: 1.12rem; }
.texto-degradado { background: linear-gradient(90deg, var(--brand), #22d3ee 60%, #a855f7);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan { padding: 26px; height: 100%; display: flex; flex-direction: column; }
.plan.destacado-plan { border: 2px solid var(--brand); box-shadow: 0 20px 50px color-mix(in srgb, var(--brand) 22%, transparent); }
.plan .precio { font-family: var(--fuente-display); font-size: 2.4rem; font-weight: 800; letter-spacing: -.04em; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; flex: 1; }
.plan li { padding: 6px 0; display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.plan li i { color: var(--ok); }
.caracteristica { padding: 22px; }
.caracteristica .pildora-icono { margin-bottom: 14px; }
.nav-publica { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }

/* --- Movimiento reducido -------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .entra, .aviso { animation: desvanece 200ms ease both !important; }
  @keyframes desvanece { from { opacity: 0; } to { opacity: 1; } }
}

/* --- Impresión ------------------------------------------------------------ */
@media print {
  .lateral, .superior, .avisos, .no-imprimir, .aviso-banda, .barra-guardar { display: none !important; }
  .app { display: block; } .contenido { padding: 0; max-width: none; }
  body { background: #fff; color: #000; } .tarjeta { border: 0; box-shadow: none; }
}
