/* =====================================================================
   TOTEM Ecosystem · sistema visual
   ---------------------------------------------------------------------
   Solo se aplica a páginas con <body class="totem">. Los paneles a medida
   (Bartolo, Macas, Zielo…) y el de Oñoro (bonos.css) NO llevan esa clase,
   así que no cambian. Se carga DESPUÉS de base.css/panel.css y redefine
   sus variables dentro de body.totem.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap');

body.totem {
  /* ---- marca TOTEM ---- */
  --tt-azul: #6C55E8;
  --tt-azul-claro: #8071E8;
  --tt-azul-hondo: #4E39C9;
  --tt-azul-suave: #EFECFD;
  --tt-azul-3d: linear-gradient(180deg, #8E7FF2 0%, #6C55E8 52%, #5640D0 100%);
  /* Personaje de TOTEM AI: violeta → cian (ver robot.css) */
  --tt-cian: #5DC1FD;
  --tt-lila: #AB7FFB;
  --tt-indigo: #1B1856;
  --tt-ai: linear-gradient(135deg, #AB7FFB 0%, #7B5CF0 45%, #5DC1FD 100%);
  --tt-noche: #16151D;
  --tt-noche-2: #201F2A;
  --tt-noche-3: #2E2C3C;
  --tt-crema: #F5F4F0;
  --tt-crema-2: #EAE8E2;
  --tt-blanco: #FFFFFF;
  --tt-sup: #FFFFFF;
  --tt-hueco: #F8F7F3;
  --tt-linea-2: #F0EEE9;
  --tt-apagado: #DAD7D0;
  --tt-clay: linear-gradient(160deg, #FFFFFF 0%, #EEEBFD 55%, #DED8FB 100%);
  --tt-texto: #16151D;
  --tt-gris: #6B6878;
  --tt-gris-2: #A09DAB;
  --tt-linea: #E6E3DC;
  --tt-ok: #17865A;   --tt-ok-bg: #E6F5EE;
  --tt-warn: #B5730E; --tt-warn-bg: #FCF1DE;
  --tt-err: #C2342E;  --tt-err-bg: #FCE9E8;
  --tt-r: 18px; --tt-r-s: 12px;
  --tt-sombra: 0 1px 2px rgba(22,21,29,.05), 0 10px 30px -12px rgba(22,21,29,.16);
  --tt-sombra-alta: 0 2px 4px rgba(22,21,29,.06), 0 24px 60px -18px rgba(22,21,29,.32);
  --tt-boton-3d: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 rgba(22,21,29,.08), 0 8px 18px -8px rgba(108,85,232,.65);
  --tt-side: 252px;

  /* ---- variables de base.css que TOTEM redefine ---- */
  --tinta: var(--tt-noche);
  --tinta-suave: var(--tt-noche-2);
  --tinta-borde: var(--tt-noche-3);
  --papel: var(--tt-crema);
  --papel-hueco: #F8F7F3;
  --superficie: var(--tt-sup);
  --grafito: var(--tt-gris);
  --grafito-claro: var(--tt-gris-2);
  --borde: var(--tt-linea);
  --borde-fuerte: #D3CFC6;
  --violeta: var(--tt-azul);
  --violeta-hondo: var(--tt-azul-hondo);
  --verde: var(--tt-ok);
  --ambar: var(--tt-warn);
  --display: 'Hanken Grotesk', system-ui, sans-serif;
  --ui: 'Hanken Grotesk', system-ui, sans-serif;
  --r-s: 10px; --r-m: 16px; --r-l: 20px;
  --sombra-baja: 0 1px 2px rgba(22,21,29,.05);
  --sombra-media: var(--tt-sombra);
  --sombra-alta: var(--tt-sombra-alta);

  font-family: var(--ui);
  background: var(--tt-crema);
  color: var(--tt-texto);
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
}
body.totem h1, body.totem h2, body.totem h3 { font-family: var(--display); letter-spacing: -.025em; font-weight: 700; }
body.totem :focus-visible { outline: 2px solid var(--tt-azul); outline-offset: 2px; }
body.totem a:not([class]) { color: var(--tt-azul); }

.tt-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tt-logo { display: block; flex: none; }
.tt-side .tt-logo, .tt-powered .tt-logo { color: #fff; }

/* ------------------------------------------------------------ marca */
.tt-marca { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.tt-marca-txt { display: flex; flex-direction: column; line-height: 1; }
.tt-marca-txt b { font-weight: 800; font-size: 25px; letter-spacing: -.055em; line-height: .9; }
.tt-marca-txt small { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .6; margin-top: 4px; font-weight: 600; }

/* =============================================================== LAYOUT */
.tt-app { display: grid; grid-template-columns: var(--tt-side) 1fr; min-height: 100vh; }
.tt-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: radial-gradient(120% 60% at 0% 0%, #1B2468 0%, var(--tt-noche) 55%);
  color: #D3D0DD; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 3px;
}
.tt-side .tt-marca { color: #fff; padding: 2px 10px 22px; }
.tt-side-cab { display: flex; align-items: center; gap: 11px; padding: 4px 8px 22px; }
.tt-negocio-logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--c, var(--tt-azul)); color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 14px -6px rgba(0,0,0,.6);
}
.tt-negocio-txt { min-width: 0; line-height: 1.2; }
.tt-negocio-txt b { display: block; color: #fff; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-negocio-txt small { color: #8E94BC; font-size: 12.5px; }
.tt-side-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #6E75A3; font-weight: 600; padding: 18px 12px 8px; }
.tt-side-item, .tt-side .menu button, .tt-side .nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border-radius: 11px; border: 0; background: none;
  color: #D3D0DD; font: inherit; font-size: 14.5px; font-weight: 500; text-align: left;
  text-decoration: none; cursor: pointer; transition: background .18s, color .18s;
  position: relative;
}
.tt-side-item:hover, .tt-side .menu button:hover, .tt-side .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.tt-side-item.on, .tt-side .menu button.activa, .tt-side .nav-item.activa {
  background: var(--tt-azul-3d); color: #fff; box-shadow: var(--tt-boton-3d);
}
.tt-side-item.pronto { opacity: .62; }
.tt-side-item em { margin-left: auto; font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; background: rgba(255,255,255,.1); padding: 2px 7px; border-radius: 999px; }
.tt-side .nav-item .contador { margin-left: auto; }
.tt-side .nav-ico { display: none; }
.tt-side-pie { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.tt-powered { display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; color: #7C83B0; letter-spacing: .02em; }
.tt-sub-nav { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 18px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.1); }
.tt-sub-nav .nav-item { padding: 8px 10px; font-size: 13.5px; }

.tt-cuerpo { min-width: 0; display: flex; flex-direction: column; }
.tt-top {
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 18px 34px; position: sticky; top: 0; z-index: 15;
  background: color-mix(in srgb, var(--tt-crema) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tt-linea);
}
.tt-miga { font-size: 13px; color: var(--tt-gris); display: flex; gap: 8px; align-items: center; }
.tt-miga b { color: var(--tt-texto); font-weight: 600; }
.tt-top-der { display: flex; gap: 10px; align-items: center; }
.tt-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--tt-azul-3d); color: #fff; font-weight: 700; font-size: 14px; box-shadow: var(--tt-boton-3d); }
.tt-chip { font-size: 12.5px; padding: 7px 12px; border-radius: 999px; background: var(--tt-sup); border: 1px solid var(--tt-linea); color: var(--tt-gris); white-space: nowrap; }
.tt-main { padding: 30px 34px 90px; max-width: 1320px; width: 100%; margin: 0 auto; }

/* ================================================================ TÍTULOS */
.tt-cabecera { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 26px; }
.tt-h1 { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.05; margin: 0; letter-spacing: -.035em !important; }
.tt-h1 .ola { display: inline-block; }
.tt-lead { color: var(--tt-gris); margin: 8px 0 0; font-size: 15.5px; }
.tt-h2 { font-size: 18px; margin: 0; }

/* ================================================================ BOTONES */
.tt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid var(--tt-linea);
  background: var(--tt-sup); color: var(--tt-texto); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: transform .12s, box-shadow .18s, background .18s, filter .18s;
}
.tt-btn:hover { border-color: #CDC9C0; box-shadow: var(--tt-sombra); }
.tt-btn:active { transform: translateY(1px); }
.tt-btn.azul { background: var(--tt-azul-3d); border-color: var(--tt-azul-hondo); color: #fff !important; box-shadow: var(--tt-boton-3d); }
.tt-btn.azul:hover { filter: brightness(1.06); }
.tt-btn.peq { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.tt-btn.fantasma { background: transparent; border-color: transparent; color: var(--tt-azul); }
.tt-btn.fantasma:hover { background: var(--tt-azul-suave); box-shadow: none; }
.tt-btn .tt-ico { width: 17px; height: 17px; }

/* =============================================================== TARJETAS */
.tt-card { background: var(--tt-sup); border-radius: var(--tt-r); box-shadow: var(--tt-sombra); border: 1px solid rgba(22,21,29,.04); padding: 22px; }
.tt-card-cab { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.tt-card-cab p { margin: 3px 0 0; color: var(--tt-gris); font-size: 13px; }

.tt-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.tt-kpi { background: var(--tt-sup); border-radius: var(--tt-r); box-shadow: var(--tt-sombra); padding: 18px 20px; display: flex; gap: 14px; align-items: center; border: 1px solid rgba(22,21,29,.04); }
.tt-kpi-ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--tt-clay); color: var(--tt-azul);
  box-shadow: inset 0 1px 0 #fff, 0 6px 14px -8px rgba(108,85,232,.55);
}
.tt-kpi-ico .tt-ico { width: 22px; height: 22px; }
.tt-kpi b { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.tt-kpi span { font-size: 13px; color: var(--tt-gris); }
.tt-kpi small { display: block; font-size: 12px; color: var(--tt-ok); font-weight: 600; margin-top: 2px; }
.tt-kpi.destaca { background: var(--tt-azul-3d); color: #fff; box-shadow: var(--tt-boton-3d), var(--tt-sombra); }
.tt-kpi.destaca span, .tt-kpi.destaca small { color: rgba(255,255,255,.82); }
.tt-kpi.destaca .tt-kpi-ico { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }

.tt-rejilla { display: grid; gap: 18px; }
.tt-r-21 { grid-template-columns: 1.65fr 1fr; }
.tt-r-2 { grid-template-columns: 1fr 1fr; }
.tt-r-3 { grid-template-columns: repeat(3, 1fr); }

/* ================================================================ ETIQUETAS */
.tt-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--tt-azul-suave); color: var(--tt-azul); white-space: nowrap; }
.tt-tag .tt-ico { width: 13px; height: 13px; stroke-width: 2; }
.tt-tag.ok { background: var(--tt-ok-bg); color: var(--tt-ok); }
.tt-tag.warn { background: var(--tt-warn-bg); color: var(--tt-warn); }
.tt-tag.err { background: var(--tt-err-bg); color: var(--tt-err); }
.tt-tag.gris { background: var(--tt-hueco); color: var(--tt-gris); }
.tt-punto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }

/* ================================================================== TABLAS */
.tt-tabla { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tt-tabla th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--tt-gris); font-weight: 600; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--tt-linea); background: none; }
.tt-tabla td { padding: 13px 12px; border-bottom: 1px solid var(--tt-linea-2); vertical-align: middle; }
.tt-tabla tr:last-child td { border-bottom: 0; }
.tt-tabla tbody tr { transition: background .15s; }
.tt-tabla tbody tr:hover td { background: var(--tt-hueco); }
.tt-neg { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tt-neg-logo { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 10px -6px rgba(0,0,0,.5); }
.tt-neg b { display: block; font-weight: 600; }
.tt-neg small { color: var(--tt-gris); font-size: 12.5px; }
.tt-mods { display: flex; gap: 5px; flex-wrap: wrap; }
.tt-acc { display: flex; gap: 6px; justify-content: flex-end; }

.tt-buscar { position: relative; }
.tt-buscar .tt-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tt-gris-2); width: 17px; height: 17px; }
.tt-buscar input { padding: 10px 12px 10px 38px !important; border-radius: 12px !important; min-width: 240px; background: var(--tt-sup); }

/* ================================================================ INTERRUPTOR */
.tt-switch { position: relative; width: 42px; height: 24px; border-radius: 999px; background: var(--tt-apagado); border: 0; cursor: pointer; transition: background .2s; flex: none; padding: 0; }
.tt-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .22s cubic-bezier(.3,.7,.4,1); }
.tt-switch.on { background: var(--tt-azul-3d); box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.tt-switch.on::after { transform: translateX(18px); }
.tt-switch:disabled { opacity: .45; cursor: default; }

/* ================================================================ GRÁFICO */
.tt-grafico { width: 100%; height: auto; aspect-ratio: 640 / 220; display: block; color: var(--tt-texto); }
.tt-barras { display: flex; flex-direction: column; gap: 12px; }
.tt-barra { display: grid; grid-template-columns: 34px 1fr auto; grid-template-areas: "i nom n" "i p p"; gap: 6px 10px; align-items: center; }
.tt-barra > .tt-ico { grid-area: i; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--tt-azul-suave); color: var(--tt-azul); }
.tt-barra .nom { grid-area: nom; font-size: 13.5px; font-weight: 600; }
.tt-barra .n { grid-area: n; font-weight: 800; font-size: 14px; }
.tt-barra .pista { grid-area: p; height: 8px; border-radius: 999px; background: var(--tt-hueco); overflow: hidden; }
.tt-barra .pista i { display: block; height: 100%; border-radius: 999px; background: var(--tt-azul-3d); }

/* ================================================================ DIÁLOGO */
.tt-dialogo { border: 0; padding: 0; border-radius: 22px; width: min(560px, calc(100vw - 32px)); box-shadow: var(--tt-sombra-alta); color: var(--tt-texto); }
.tt-dialogo::backdrop { background: rgba(22,21,29,.42); backdrop-filter: blur(3px); }
.tt-dialogo form { padding: 26px; }
.tt-dialogo h2 { font-size: 22px; margin: 0 0 4px; }
.tt-dialogo .tt-lead { margin: 0 0 18px; font-size: 14px; }
.tt-dialogo-pie { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.tt-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tt-campos .ancho { grid-column: 1 / -1; }
body.totem label { font-size: 12.5px; font-weight: 600; color: var(--tt-texto); }
body.totem input, body.totem select, body.totem textarea { border-radius: 12px; border-color: var(--tt-linea); font-family: var(--ui); }
body.totem input:focus, body.totem select:focus, body.totem textarea:focus { border-color: var(--tt-azul); box-shadow: 0 0 0 4px rgba(108,85,232,.12); }
.tt-mod-lista { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.tt-mod-op { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--tt-linea); border-radius: 13px; cursor: pointer; transition: border-color .15s, background .15s; user-select: none; }
.tt-mod-op:hover { border-color: #CDC9C0; }
.tt-mod-op.on { border-color: var(--tt-azul); background: var(--tt-azul-suave); }
.tt-mod-op .tt-ico { color: var(--tt-azul); }
.tt-mod-op span { font-size: 13.5px; font-weight: 600; line-height: 1.15; }
.tt-mod-op small { display: block; font-weight: 400; color: var(--tt-gris); font-size: 11.5px; }
.tt-mod-op .marca-ok { margin-left: auto; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #D3CFC6; display: grid; place-items: center; flex: none; }
.tt-mod-op.on .marca-ok { background: var(--tt-azul); border-color: var(--tt-azul); color: #fff; }
.tt-mod-op .marca-ok .tt-ico { width: 14px; height: 14px; color: #fff; stroke-width: 2.6; opacity: 0; }
.tt-mod-op.on .marca-ok .tt-ico { opacity: 1; }
.tt-resultado { margin-top: 16px; padding: 16px; border-radius: 14px; background: var(--tt-ok-bg); color: #0E5A3C; font-size: 14px; }
.tt-resultado code { background: var(--tt-sup); padding: 2px 7px; border-radius: 6px; font-size: 13px; }
.tt-error { color: var(--tt-err); font-size: 13.5px; margin: 10px 0 0; min-height: 1em; }

/* ============================================================ MATRIZ MÓDULOS */
.tt-matriz th.m { text-align: center; font-size: 10.5px; letter-spacing: .04em; min-width: 92px; }
.tt-matriz th.m .tt-ico { display: block; margin: 0 auto 5px; color: var(--tt-azul); width: 19px; height: 19px; }
.tt-matriz td.m { text-align: center; }
.tt-matriz .pronto { display: block; font-size: 9.5px; color: var(--tt-gris-2); font-weight: 600; margin-top: 2px; }

/* ===================================================== TOAST */
.tt-toasts { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.tt-toast { background: var(--tt-noche); color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 13.5px; box-shadow: var(--tt-sombra-alta); display: flex; gap: 10px; align-items: center; animation: tt-in .3s cubic-bezier(.2,.8,.3,1); }
.tt-toast .tt-ico { color: #AFA4F7; }
@keyframes tt-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.tt-aparece { animation: tt-in .45s cubic-bezier(.2,.8,.3,1) both; }

/* ============================================================== RESPONSIVE */
@media (max-width: 1100px) {
  .tt-kpis { grid-template-columns: repeat(2, 1fr); }
  .tt-r-21, .tt-r-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .tt-app { grid-template-columns: 1fr; }
  .tt-side {
    position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; align-items: center;
    padding: 10px 12px; gap: 6px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .tt-side::-webkit-scrollbar { display: none; }
  .tt-side .tt-marca, .tt-side-cab { padding: 0 8px 0 2px; flex: none; }
  .tt-side .tt-marca-txt small, .tt-negocio-txt small, .tt-side-sec, .tt-powered { display: none; }
  .tt-side-item, .tt-side .menu button { flex: none; width: auto; padding: 8px 12px; font-size: 13.5px; }
  .tt-side .menu { display: flex; gap: 4px; }
  .tt-side-pie { margin: 0 0 0 auto; padding: 0; flex-direction: row; }
  .tt-side-pie .tt-side-item span { display: none; }
  .tt-top { display: none; }
  .tt-main { padding: 20px 16px 110px; }
  .tt-r-2, .tt-campos, .tt-mod-lista { grid-template-columns: 1fr; }
  .tt-buscar input { min-width: 0; width: 100%; }
}
@media (max-width: 520px) {
  .tt-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tt-kpi { padding: 14px; gap: 10px; flex-direction: column; align-items: flex-start; }
  .tt-kpi b { font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) { .tt-aparece, .tt-toast { animation: none; } }

/* retoques */
.tt-side-item > span:not(.contador), .tt-side .menu button > span, .tt-side .nav-item > span:not(.contador) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tt-side-item em { flex: none; }
.tt-matriz td:first-child, .tt-matriz th:first-child { min-width: 230px; position: sticky; left: 0; background: var(--tt-sup); z-index: 1; }
.tt-matriz tbody tr:hover td:first-child { background: var(--tt-hueco); }
.tt-matriz .tt-neg b { white-space: nowrap; }


/* =====================================================================
   TOTEM · volumen, 3D y movimiento
   ===================================================================== */

/* ---------------------------------------------------------- iconos «clay» */
.tt-kpi-ico, .tt-servicio.pronto .tt-servicio-ico, .tt-barra > .tt-ico {
  background: var(--tt-clay);
  box-shadow: inset 0 2px 1px rgba(255,255,255,.95), inset 0 -3px 5px rgba(108,85,232,.16), 0 8px 16px -8px rgba(108,85,232,.55), 0 2px 3px rgba(22,21,29,.08);
}
.tt-servicio-ico, .tt-pronto-ico, .tt-avatar, .tt-negocio-logo, .tt-neg-logo {
  box-shadow: inset 0 2px 1px rgba(255,255,255,.4), inset 0 -4px 7px rgba(0,0,0,.2), 0 10px 20px -10px rgba(108,85,232,.8), 0 2px 3px rgba(22,21,29,.15);
}
.tt-btn.azul, .tt-side-item.on, .tt-side .menu button.activa, .tt-side .nav-item.activa, .tt-kpi.destaca, body.panel-totem .btn.primario {
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(22,21,29,.22), 0 10px 22px -10px rgba(108,85,232,.85), 0 2px 3px rgba(22,21,29,.16);
}
.tt-btn.azul:active, body.panel-totem .btn.primario:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(22,21,29,.22), 0 4px 10px -6px rgba(108,85,232,.8); }
.tt-btn.cristal { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; backdrop-filter: blur(8px); }
.tt-btn.cristal:hover { background: rgba(255,255,255,.18); box-shadow: none; }

/* tarjetas que se elevan e inclinan con el puntero (totem.js pone --rx/--ry) */
.tt-kpi, .tt-servicio, .tt-card[data-tilt] { transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.8,.3,1), box-shadow .35s; will-change: transform; }
[data-tilt] { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0); }
[data-tilt].activo { transition: transform .08s linear, box-shadow .3s; }
.tt-kpi[data-tilt]:hover, .tt-servicio[data-tilt]:hover { box-shadow: var(--tt-sombra-alta); }

/* ------------------------------------------------------------ escena 3D */
.tt-escena { position: relative; overflow: visible; }
.tt-escena-lienzo { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; opacity: 0; transition: opacity .8s ease; }
.tt-escena.lista .tt-escena-lienzo { opacity: 1; }
.tt-escena-img {
  position: absolute; left: 50%; top: 50%; width: min(52%, 300px); aspect-ratio: 1; object-fit: contain;
  translate: -50% -50%; filter: drop-shadow(0 30px 34px rgba(18,16,28,.55));
  animation: tt-flota 6.5s ease-in-out infinite; transition: opacity .6s;
}
.tt-escena[data-escena="logo"] .tt-escena-img { width: min(78%, 260px); }
.tt-escena.lista .tt-escena-img, .tt-escena.lista .tt-chip3d { opacity: 0; pointer-events: none; }
@keyframes tt-flota { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2.5deg); } }
.tt-chip3d {
  position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px 8px 8px; border-radius: 15px;
  background: rgba(255,255,255,.96); color: #16151D; font-weight: 700; font-size: 13px; white-space: nowrap;
  box-shadow: 0 18px 30px -14px rgba(18,16,28,.7), inset 0 1px 0 #fff; animation: tt-flota 7s ease-in-out infinite; transition: opacity .6s;
}
.tt-chip3d i { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--tt-azul-3d); color: #fff; box-shadow: inset 0 1.5px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(22,21,29,.22); }
.tt-chip3d .tt-ico { width: 16px; height: 16px; }
.tt-chip3d.c1 { left: 6%; top: 16%; } .tt-chip3d.c2 { right: 6%; top: 22%; animation-delay: -1.7s; }
.tt-chip3d.c3 { right: 9%; bottom: 16%; animation-delay: -3.4s; } .tt-chip3d.c4 { left: 9%; bottom: 20%; animation-delay: -5s; }

/* ----------------------------------------------------------------- hero */
.tt-hero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: 28px; color: #fff;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; min-height: 330px; margin-bottom: 22px;
  background:
    radial-gradient(60% 90% at 78% 40%, rgba(142,127,242,.55) 0%, transparent 62%),
    radial-gradient(50% 70% at 0% 100%, rgba(108,85,232,.5) 0%, transparent 60%),
    linear-gradient(150deg, #251D52 0%, #16151D 55%, #0E0C1A 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 30px 60px -30px rgba(22,21,29,.75);
}
.tt-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgba(255,255,255,.14) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent 20%, #000 70%); -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 70%); }
.tt-hero-txt { padding: 38px 0 38px 40px; position: relative; z-index: 2; }
.tt-hero .tt-h1 { color: #fff; font-size: clamp(30px, 3.4vw, 46px); }
.tt-hero .tt-lead { color: #CAC5E0; max-width: 40ch; }
.tt-hero-tag { display: inline-block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: #C6BDF9; padding: 6px 11px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); margin-bottom: 16px; }
.tt-hero-acc { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.tt-hero .tt-escena { align-self: stretch; min-height: 330px; }
.tt-hero.compacto { min-height: 220px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.tt-hero.compacto .tt-escena { min-height: 220px; }

/* ----------------------------------------------- tarjeta Wallet en un móvil */
.tt-movil-escena { display: grid; place-items: center; padding: 10px 0 22px; perspective: 1100px; }
.tt-movil {
  position: relative; width: min(230px, 78%); aspect-ratio: 9 / 18.2; border-radius: 38px; padding: 9px;
  background: linear-gradient(145deg, #2A3170, #0B1038 45%, #1B2360);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18), inset 0 2px 3px rgba(255,255,255,.3), 0 40px 50px -26px rgba(22,21,29,.75), 0 12px 18px -8px rgba(22,21,29,.4);
  --rx: 6deg; --ry: -14deg; transition: transform .6s cubic-bezier(.2,.8,.3,1);
}
.tt-movil-pantalla { position: relative; height: 100%; border-radius: 30px; overflow: hidden; background: linear-gradient(180deg, #F5F4F0, #E4DDCF); padding: 34px 9px 10px; }
.tt-movil-isla { position: absolute; top: 9px; left: 50%; translate: -50% 0; width: 62px; height: 17px; border-radius: 999px; background: #070A24; }
.tt-brillo { position: absolute; inset: 0; border-radius: 38px; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(60% 45% at var(--bx, 30%) var(--by, 12%), rgba(255,255,255,.4), transparent 70%); }
.tt-pase3d { background: var(--c, #6C55E8); color: var(--t, #fff); border-radius: 14px; overflow: hidden; box-shadow: 0 14px 22px -12px rgba(0,0,0,.6); font-size: 9px; animation: tt-pase-entra .9s .2s cubic-bezier(.2,.8,.3,1) both; }
@keyframes tt-pase-entra { from { transform: translateY(60%); opacity: 0; } }
.tt-pase3d .p-cab { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 10px 10px 8px; }
.tt-pase3d .p-cab b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-pase3d .p-cab span { text-align: right; font-size: 6.5px; letter-spacing: .08em; opacity: .9; flex: none; }
.tt-pase3d .p-cab strong, .tt-pase3d .p-campos strong { display: block; font-size: 11px; letter-spacing: 0; }
.tt-pase3d .p-strip { width: 100%; display: block; }
.tt-pase3d .p-campos { display: flex; justify-content: space-between; padding: 8px 10px; font-size: 6.5px; letter-spacing: .08em; text-transform: uppercase; }
.tt-pase3d .p-campos span:last-child { text-align: right; }
.tt-pase3d .p-campos strong { font-size: 9.5px; text-transform: none; }
.tt-pase3d .p-qr { display: grid; place-items: center; padding: 4px 0 12px; }
.tt-pase3d .p-qr img { width: 56%; border-radius: 7px; background: #fff; padding: 4px; }
body.superadmin.totem .lienzo { perspective: 1100px; }
body.superadmin.totem .lienzo .pase { transition: transform .5s cubic-bezier(.2,.8,.3,1); box-shadow: 0 40px 50px -26px rgba(22,21,29,.6); }

/* ------------------------------------------------------ movimiento general */
body.totem .vista:not(.oculta) { animation: tt-vista .5s cubic-bezier(.2,.8,.3,1) both; }
@keyframes tt-vista { from { opacity: 0; transform: translateY(14px) scale(.992); } }
.tt-kpis > *, .tt-rejilla > *, body.panel-totem .metricas > *, body.panel-totem .vista > .tarjeta, body.panel-totem .tt-r-inicio > * { animation: tt-in .6s cubic-bezier(.2,.8,.3,1) both; }
.tt-kpis > :nth-child(2), body.panel-totem .metricas > :nth-child(2), .tt-rejilla > :nth-child(2), body.panel-totem .tt-r-inicio > :nth-child(2) { animation-delay: .06s; }
.tt-kpis > :nth-child(3), body.panel-totem .metricas > :nth-child(3), body.panel-totem .tt-r-inicio > :nth-child(3) { animation-delay: .12s; }
.tt-kpis > :nth-child(4), body.panel-totem .metricas > :nth-child(4) { animation-delay: .18s; }
body.panel-totem .metricas > :nth-child(n+5) { animation-delay: .24s; }
.tt-tabla tbody tr { animation: tt-in .45s cubic-bezier(.2,.8,.3,1) both; }
.tt-tabla tbody tr:nth-child(2) { animation-delay: .04s; } .tt-tabla tbody tr:nth-child(3) { animation-delay: .08s; }
.tt-tabla tbody tr:nth-child(4) { animation-delay: .12s; } .tt-tabla tbody tr:nth-child(n+5) { animation-delay: .16s; }
.tt-grafico .linea { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tt-traza 1.6s .2s cubic-bezier(.3,.7,.2,1) forwards; }
.tt-grafico .area { opacity: 0; animation: tt-aparece-op 1s 1s forwards; }
.tt-grafico .punto { opacity: 0; animation: tt-aparece-op .4s 1.6s forwards; }
@keyframes tt-traza { to { stroke-dashoffset: 0; } }
@keyframes tt-aparece-op { to { opacity: 1; } }
.tt-barra .pista i { transform-origin: left; animation: tt-crece 1s .25s cubic-bezier(.2,.8,.3,1) both; }
@keyframes tt-crece { from { transform: scaleX(0); } }
.tt-dialogo[open] { animation: tt-dlg .35s cubic-bezier(.2,.9,.3,1.15); }
.tt-dialogo[open]::backdrop { animation: tt-aparece-op .3s both; }
@keyframes tt-dlg { from { opacity: 0; transform: translateY(24px) scale(.94) perspective(800px) rotateX(8deg); } }
.tt-side-item, .tt-side .menu button, .tt-side .nav-item { transition: background .25s, color .2s, transform .25s cubic-bezier(.2,.8,.3,1), box-shadow .25s; }
.tt-side-item:hover, .tt-side .menu button:hover, .tt-side .nav-item:hover { transform: translateX(3px); }
.tt-side-item .tt-ico, .tt-side .menu button .tt-ico, .tt-side .nav-item .tt-ico { transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.tt-side-item:hover .tt-ico, .tt-side .menu button:hover .tt-ico, .tt-side .nav-item:hover .tt-ico { transform: scale(1.15) rotate(-6deg); }
.tt-side .tt-marca .tt-logo, .tt-powered .tt-logo { animation: tt-flota 7s ease-in-out infinite; }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .22s ease both tt-vt-sale; }
::view-transition-new(root) { animation: .34s cubic-bezier(.2,.8,.3,1) both tt-vt-entra; }
@keyframes tt-vt-sale { to { opacity: 0; transform: scale(.985); } }
@keyframes tt-vt-entra { from { opacity: 0; transform: translateY(10px); } }

/* ------------------------------------------------------------ modo oscuro */
.tt-tema { width: 34px; height: 34px; border-radius: 11px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: #D3D0DD; display: grid; place-items: center; cursor: pointer; margin-left: auto; flex: none; transition: background .2s, transform .3s; }
.tt-tema:hover { background: rgba(255,255,255,.14); transform: rotate(18deg); }
.tt-tema .tt-ico { width: 17px; height: 17px; }
.tt-tema .luna { display: none; }
html[data-tema="oscuro"] .tt-tema .sol { display: none; } html[data-tema="oscuro"] .tt-tema .luna { display: block; }
.tt-tema.flotante { position: absolute; top: 20px; right: 20px; }
body.totem > .w .tt-tema, .tt-tema.flotante { border-color: var(--tt-linea); background: var(--tt-sup); color: var(--tt-texto); }

html[data-tema="oscuro"] { color-scheme: dark; background: #0C0B11; }
html[data-tema="oscuro"] body.totem {
  --tt-crema: #0C0B11; --tt-crema-2: #111017; --tt-sup: #14131B; --tt-hueco: #111017; --tt-linea: #2C2A3B; --tt-linea-2: #1F1D29; --tt-apagado: #34314A;
  --tt-texto: #EFECFD; --tt-gris: #ADA8C2; --tt-gris-2: #7C7891; --tt-azul-suave: #1A2362;
  --tt-clay: linear-gradient(160deg, #3A2F7A 0%, #241E45 60%, #141B52 100%);
  --tt-ok: #4BD39B; --tt-ok-bg: #0E3528; --tt-warn: #F2B552; --tt-warn-bg: #3A2B0D; --tt-err: #FF8A82; --tt-err-bg: #41191B;
  --tt-sombra: 0 1px 2px rgba(0,0,0,.4), 0 14px 34px -14px rgba(0,0,0,.75);
  --tt-sombra-alta: 0 2px 4px rgba(0,0,0,.4), 0 30px 70px -20px rgba(0,0,0,.9);
  --tinta: #EFECFD; --papel-hueco: #111017; --borde-fuerte: #3B3560; --grafito: #ADA8C2; --grafito-claro: #7C7891;
  --bone: #0C0B11; --linen: #14131B; --parchment: #111017; --ash: #1F1D29; --stone: #2C2A3B; --carbon: #EFECFD; --ink: #fff;
}
html[data-tema="oscuro"] body.totem .tt-side { background: radial-gradient(120% 60% at 0% 0%, #221E36 0%, #060920 60%); border-right: 1px solid #1F1D29; }
html[data-tema="oscuro"] body.totem a:not([class]) { color: #AFA4F7; }
html[data-tema="oscuro"] body.totem .tt-card, html[data-tema="oscuro"] body.totem .tt-kpi:not(.destaca), html[data-tema="oscuro"] body.totem .tarjeta, html[data-tema="oscuro"] body.totem .metrica:not(.destaca), html[data-tema="oscuro"] body.totem .tt-servicio { border-color: rgba(175,164,247,.12); background-image: linear-gradient(180deg, rgba(175,164,247,.06), transparent 40%); }
html[data-tema="oscuro"] body.totem .tt-kpi-ico, html[data-tema="oscuro"] body.totem .tt-barra > .tt-ico { color: #C6BDF9; box-shadow: inset 0 1.5px 1px rgba(255,255,255,.18), inset 0 -3px 5px rgba(0,0,0,.3), 0 8px 16px -8px rgba(0,0,0,.8); }
html[data-tema="oscuro"] body.totem .tt-tag:not(.ok):not(.warn):not(.err):not(.gris) { color: #C6BDF9; }
html[data-tema="oscuro"] body.totem .tt-toast { background: #241E45; }
html[data-tema="oscuro"] body.totem input, html[data-tema="oscuro"] body.totem select, html[data-tema="oscuro"] body.totem textarea { background: #111017; color: var(--tt-texto); }
html[data-tema="oscuro"] body.totem .tt-btn:not(.azul):not(.cristal):not(.fantasma), html[data-tema="oscuro"] body.totem .btn:not(.primario):not(.violeta) { background: #1F1D29; color: var(--tt-texto); border-color: #34314A; }
html[data-tema="oscuro"] body.totem .premio-fila, html[data-tema="oscuro"] body.totem .resultado-cliente { background: #111017; border-color: #2C2A3B; color: var(--tt-texto); }
html[data-tema="oscuro"] body.totem .badge.premio { background: #3A2B0D; color: #F2B552; } html[data-tema="oscuro"] body.totem .badge.activo { background: #0E3528; color: #4BD39B; } html[data-tema="oscuro"] body.totem .badge.dormido { background: #41191B; color: #FF8A82; }
html[data-tema="oscuro"] body.totem .tt-movil-pantalla { background: linear-gradient(180deg, #151C52, #0A0F33); }
html[data-tema="oscuro"] body.totem .tt-mod-op .marca-ok { border-color: #3B3560; }
html[data-tema="oscuro"] body.totem .teclado button:not(.sutil) { background: #1F1D29; color: #fff; border-color: #34314A; }
html[data-tema="oscuro"] body.totem code, html[data-tema="oscuro"] body.totem .enlace { background: #111017; color: #D3D0DD; }
html[data-tema="oscuro"] body.totem .tt-resultado { background: var(--tt-ok-bg); color: #BDF0DA; } html[data-tema="oscuro"] body.totem .tt-resultado code { background: #111017; }

html[data-tema="oscuro"] body.totem .jjm-hueco, html[data-tema="oscuro"] body.totem .jjm-vacio { background: rgba(175,164,247,.05); border-color: #34314A; color: var(--tt-gris); }
html[data-tema="oscuro"] body.totem [class*="jjm-chip"], html[data-tema="oscuro"] body.totem .jjm-servicio, html[data-tema="oscuro"] body.totem .jjm-cuenta { background: #1F1D29; color: var(--tt-texto); border-color: #34314A; }
html[data-tema="oscuro"] body.totem .rejilla-iconos, html[data-tema="oscuro"] body.totem .zona-subida { background: #111017; border-color: #2C2A3B; }
html[data-tema="oscuro"] body.totem .pestanas { background: #111017; } html[data-tema="oscuro"] body.totem .pestanas button.on { background: #1F1D29; }

@media (max-width: 860px) {
  .tt-hero { grid-template-columns: 1fr; min-height: 0; border-radius: 22px; }
  .tt-hero-txt { padding: 26px 22px 0; }
  .tt-hero .tt-escena, .tt-hero.compacto .tt-escena { min-height: 190px; }
  .tt-hero.compacto { grid-template-columns: 1fr 120px; } .tt-hero.compacto .tt-hero-txt { padding-bottom: 24px; } .tt-hero.compacto .tt-escena { min-height: 0; }
  .tt-chip3d { font-size: 11.5px; padding: 6px 10px 6px 6px; } .tt-chip3d i { width: 24px; height: 24px; }
  .tt-side .tt-powered { display: flex; border: 0; padding: 0; } .tt-side .tt-powered > :not(.tt-tema) { display: none; }
  .tt-tema.flotante { top: auto; bottom: 14px; right: 14px; position: fixed; z-index: 5; }
}
@media (prefers-reduced-motion: reduce) {
  body.totem *, body.totem *::before, body.totem *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .tt-grafico .linea { stroke-dashoffset: 0; }
  @view-transition { navigation: none; }
}
