/* CTM · Arquitectura técnica (tema oscuro tipo documentación SaaS) */
body { background: #050912; color: #e2e8f0; overflow-x: hidden; }
.glow { position: fixed; z-index: 0; border-radius: 50%; filter: blur(110px); opacity: .35; pointer-events: none; }
.glow.g1 { width: 620px; height: 620px; background: #1d4ed8; top: -260px; left: -160px; }
.glow.g2 { width: 520px; height: 520px; background: #0f766e; top: 380px; right: -240px; opacity: .22; }
.wrap { position: relative; z-index: 1; max-width: 1260px; margin: 0 auto; padding: 0 28px; }
b { color: #fff; font-weight: 700; }

/* Encabezado */
.hero { padding: 104px 0 46px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; color: #93c5fd; background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.28); }
.hero h1 { font-size: clamp(36px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; color: #fff; margin: 20px 0 18px; max-width: 900px; }
.grad { background: linear-gradient(100deg, #60a5fa, #34d399 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(16px, 1.6vw, 19px); color: #94a3b8; max-width: 760px; line-height: 1.6; }
.principles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.principles span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); }
.principles i { color: #34d399; }
.hstats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; margin-top: 34px; border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.08); }
.hstats div { background: #0a1020; padding: 16px 18px; }
.hstats b { display: block; font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hstats span { font-size: 12.5px; color: #8391a7; font-weight: 600; }
.note { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; font-size: 13px; color: #7c8aa3; }
.note i { margin-top: 2px; }

/* Disposición con índice fijo */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding-bottom: 80px; }
.toc { position: sticky; top: 72px; align-self: start; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.toc > b { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; margin: 0 0 10px 12px; }
.toc > a { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; color: #94a3b8; font-weight: 600; border-left: 2px solid transparent; transition: all .2s; }
.toc > a span { font-family: var(--mono); font-size: 11.5px; color: #475569; }
.toc > a:hover { color: #fff; background: rgba(255,255,255,.04); }
.toc > a.on { color: #fff; background: rgba(59,130,246,.12); border-left-color: #3b82f6; border-radius: 4px 10px 10px 4px; }
.toc > a.on span { color: #60a5fa; }
.toc-cta { display: flex; flex-direction: column; gap: 6px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.07); }
.toc-cta a { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #94a3b8; padding: 6px 12px; font-weight: 600; }
.toc-cta a:hover { color: #fff; }

/* Secciones */
.sec { padding-top: 34px; margin-bottom: 52px; scroll-margin-top: 60px; }
.sh { max-width: 780px; margin-bottom: 22px; }
.kick { font-family: var(--mono); font-size: 12.5px; color: #60a5fa; font-weight: 600; letter-spacing: .02em; }
.sh h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; letter-spacing: -.028em; color: #fff; line-height: 1.12; margin: 8px 0 12px; }
.sh p { color: #94a3b8; font-size: 16px; line-height: 1.65; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.025)); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 22px; }
.card + .card, .grid2, .grid3, .card.callout { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid2 > .card, .grid3 > .card { margin-top: 0; }
.h4 { font-size: 16px; font-weight: 800; color: #fff; margin-bottom: 14px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.h4 small { font-size: 12px; color: #64748b; font-weight: 600; }
.muted { color: #94a3b8; font-size: 14.5px; line-height: 1.6; }
.fine { color: #64748b; font-size: 12.5px; margin-top: 14px; line-height: 1.5; }
.mini > i, .feat > i { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: rgba(59,130,246,.14); color: #60a5fa; margin-bottom: 14px; }
.mini h4, .feat h4 { color: #fff; font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.mini p, .feat p { color: #94a3b8; font-size: 14px; line-height: 1.6; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 700; background: #2563eb; color: #fff; transition: transform .2s, background .2s; }
.btn:hover { background: #1d4ed8; transform: translateY(-1px); }
.btn.ghost { background: rgba(255,255,255,.07); width: 40px; padding: 0; justify-content: center; }
.btn.ghost:hover { background: rgba(255,255,255,.14); }
.btn.sm { height: 36px; font-size: 13px; margin-top: 16px; }
.scroll-x { overflow-x: auto; scrollbar-width: thin; }
.checks { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.checks li { position: relative; padding-left: 28px; color: #a8b3c7; font-size: 14.5px; line-height: 1.55; }
.checks li::before { content: ''; position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 6px; background: rgba(52,211,153,.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat; }

/* Diagramas SVG */
.diag { padding: 18px; position: relative; overflow: hidden; }
.diag svg { width: 100%; height: auto; }
#seq { min-width: 760px; }
svg text { font-family: var(--font); }
.n rect { fill: #0d1528; stroke: rgba(255,255,255,.12); stroke-width: 1.2; transition: all .25s; }
.n text { fill: #e2e8f0; font-size: 14px; font-weight: 700; }
.n text.s { fill: #7c8aa3; font-size: 11.5px; font-weight: 600; }
.n.c rect { fill: #0f1d3a; stroke: rgba(96,165,250,.45); }
.n.svc rect { fill: #0c1a26; stroke: rgba(52,211,153,.35); }
.n.dat rect { fill: #161229; stroke: rgba(167,139,250,.4); }
.n.ext rect { fill: #1d1608; stroke: rgba(251,191,36,.38); stroke-dasharray: 5 4; }
.n.bar rect { fill: rgba(59,130,246,.1); stroke: rgba(96,165,250,.35); }
.n.bus rect { fill: rgba(52,211,153,.07); stroke: rgba(52,211,153,.3); }
.n[data-n] { cursor: pointer; }
.n[data-n]:hover rect, .n.sel rect { stroke: #fff; stroke-width: 2; }
.n .ico { color: #93c5fd; }
.n.svc .ico { color: #6ee7b7; } .n.dat .ico { color: #c4b5fd; } .n.ext .ico { color: #fcd34d; }
.lnk { stroke: rgba(148,163,184,.28); stroke-width: 1.5; fill: none; }
.flow { stroke: #60a5fa; stroke-width: 2; fill: none; stroke-dasharray: 4 10; animation: dash 1.4s linear infinite; opacity: .8; }
.flow.g { stroke: #34d399; } .flow.v { stroke: #a78bfa; } .flow.y { stroke: #fbbf24; }
.lbl { fill: #64748b; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
@keyframes dash { to { stroke-dashoffset: -28; } }
.node-info { position: absolute; right: 18px; top: 18px; width: min(340px, calc(100% - 36px)); background: rgba(6,10,20,.94); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.14); border-radius: 16px; padding: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.5); opacity: 0; transform: translateY(-6px); pointer-events: none; transition: all .25s var(--ease); }
.node-info.show { opacity: 1; transform: none; pointer-events: auto; }
.node-info h4 { color: #fff; font-size: 16px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 10px; }
.node-info h4 button { color: #64748b; width: 24px; height: 24px; }
.node-info p { color: #a8b3c7; font-size: 13.5px; line-height: 1.55; }
.node-info .tags { margin-top: 12px; }

/* Secuencia */
.seq-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.seq-cap { flex: 1; min-width: 220px; font-size: 14px; color: #cbd5e1; padding: 9px 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }
.seq-cap b { color: #60a5fa; font-family: var(--mono); margin-right: 6px; }
.actor rect { fill: #0f1d3a; stroke: rgba(96,165,250,.4); }
.actor text { fill: #fff; font-size: 13px; font-weight: 700; }
.life { stroke: rgba(148,163,184,.22); stroke-dasharray: 4 5; }
.msg line { stroke: #64748b; stroke-width: 1.6; transition: all .3s; }
.msg text { fill: #a8b3c7; font-size: 12.5px; font-weight: 600; transition: all .3s; }
.msg .no { fill: #475569; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.msg.ret line { stroke-dasharray: 5 4; }
.msg.on line { stroke: #60a5fa; stroke-width: 2.4; }
.msg.on text { fill: #fff; }
.msg.on .no { fill: #60a5fa; }
.msg.dim { opacity: .35; }
.msg.tx rect { fill: rgba(52,211,153,.06); stroke: rgba(52,211,153,.35); stroke-dasharray: 4 4; }
.msg.tx text { fill: #6ee7b7; font-size: 11px; font-weight: 800; letter-spacing: .06em; }

/* Modelo de datos */
.er { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ent { background: #0b1222; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; overflow: hidden; transition: all .25s; }
.ent header { display: flex; align-items: center; gap: 9px; padding: 12px 14px; background: rgba(255,255,255,.035); border-bottom: 1px solid rgba(255,255,255,.06); }
.ent header .ic-i { color: var(--c, #60a5fa); width: 18px; height: 18px; }
.ent header b { font-size: 14.5px; }
.ent header small { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: #475569; }
.ent ul { list-style: none; padding: 8px 14px 12px; font-family: var(--mono); font-size: 12px; }
.ent li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; color: #a8b3c7; }
.ent li em { font-style: normal; color: #475569; text-align: right; overflow-wrap: anywhere; }
.ent li span { flex: none; }
.ent li.pk span { color: #fbbf24; }
.ent li.fk span { color: #60a5fa; cursor: help; border-bottom: 1px dashed rgba(96,165,250,.4); }
.ent p { padding: 0 14px 13px; font-size: 12.5px; color: #64748b; line-height: 1.45; font-family: var(--font); }
.er.focus .ent { opacity: .3; }
.er.focus .ent.hl { opacity: 1; border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.er.focus .ent.src { opacity: 1; }

/* Flota */
.frow { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 13.5px; }
.frow:last-of-type { border-bottom: 0; }
.frow small { color: #64748b; display: block; font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(52,211,153,.12); color: #6ee7b7; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.off { background: rgba(251,191,36,.12); color: #fcd34d; }
.fsum { display: flex; gap: 18px; margin-bottom: 8px; font-size: 13px; color: #94a3b8; }
.fsum b { font-size: 20px; display: block; }

/* Seguridad */
.sec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.callout { display: flex; gap: 14px; align-items: flex-start; border-color: rgba(251,191,36,.3); background: rgba(251,191,36,.06); color: #e7d9b0; font-size: 14.5px; line-height: 1.6; }
.callout > i { color: #fbbf24; width: 22px; height: 22px; margin-top: 2px; }
.perm { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 760px; }
.perm th, .perm td { padding: 8px 6px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.06); }
.perm th { color: #64748b; font-weight: 700; font-size: 11.5px; }
.perm td:first-child, .perm th:first-child { text-align: left; color: #e2e8f0; font-weight: 700; white-space: nowrap; }
.perm .p2, .perm .p1, .perm .p0 { display: inline-block; width: 22px; height: 22px; border-radius: 7px; line-height: 22px; font-size: 11px; font-weight: 800; }
.perm .p2 { background: rgba(52,211,153,.18); color: #6ee7b7; }
.perm .p1 { background: rgba(96,165,250,.15); color: #93c5fd; }
.perm .p0 { background: rgba(255,255,255,.04); color: #334155; }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12.5px; color: #8391a7; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* Integraciones */
.integ { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ig { display: flex; flex-direction: column; gap: 10px; }
.ig .top { display: flex; align-items: center; gap: 12px; }
.ig .top .ic-i { width: 42px; height: 42px; padding: 10px; border-radius: 12px; background: rgba(251,191,36,.12); color: #fcd34d; }
.ig h4 { color: #fff; font-size: 15.5px; font-weight: 800; }
.ig .st { font-size: 11.5px; font-weight: 700; color: #fcd34d; }
.ig .st.ok { color: #6ee7b7; }
.ig p { color: #94a3b8; font-size: 13.5px; line-height: 1.55; }
.ig code { font-family: var(--mono); font-size: 11.5px; color: #93c5fd; background: rgba(59,130,246,.1); padding: 3px 7px; border-radius: 6px; align-self: flex-start; }

/* Infraestructura */
.rng { display: block; margin-bottom: 16px; }
.rng span { display: flex; justify-content: space-between; font-size: 13.5px; color: #a8b3c7; margin-bottom: 8px; font-weight: 600; }
.rng input { width: 100%; accent-color: #3b82f6; }
.est { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.est div { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06); }
.est b { font-size: 22px; display: block; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.est span { font-size: 12px; color: #7c8aa3; font-weight: 600; }
.stack { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.stack span { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px; background: rgba(255,255,255,.06); color: #cbd5e1; }

/* Pendientes */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filters button { height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 700; color: #94a3b8; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); transition: all .2s; }
.filters button:hover { color: #fff; }
.filters button.on { background: #fff; color: #0b1222; border-color: #fff; }
.pend { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.pd { display: flex; flex-direction: column; gap: 8px; padding: 18px; transition: opacity .25s, transform .25s; }
.pd.hide { display: none; }
.pd .row { display: flex; align-items: center; gap: 10px; }
.pd .no { font-family: var(--mono); font-size: 12px; font-weight: 700; color: #60a5fa; background: rgba(59,130,246,.12); border-radius: 8px; padding: 3px 8px; }
.pd .tag-st { margin-left: auto; font-size: 11px; font-weight: 800; color: #fcd34d; text-transform: uppercase; letter-spacing: .05em; }
.pd h4 { color: #fff; font-size: 15px; font-weight: 800; line-height: 1.35; }
.pd p { color: #94a3b8; font-size: 13.5px; line-height: 1.55; }
.pd .sup { font-size: 12.5px; color: #6ee7b7; }
.pd .sup::before { content: 'Supuesto de la demo: '; color: #64748b; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 7px; background: rgba(255,255,255,.06); color: #a8b3c7; }
.tags.no span { background: rgba(244,63,94,.1); color: #fda4af; text-decoration: line-through; text-decoration-color: rgba(253,164,175,.5); }
.card > .tags { margin-top: 14px; }

.foot { display: flex; align-items: center; gap: 14px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,.07); }
.foot img, .foot .logo-fallback { width: 44px; height: 44px; object-fit: contain; }
.foot div { flex: 1; display: flex; flex-direction: column; font-size: 13px; color: #64748b; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .hstats { grid-template-columns: repeat(3, 1fr); }
  .sec-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 70px; }
  .hstats { grid-template-columns: 1fr 1fr; }
  .grid2, .grid3, .sec-grid { grid-template-columns: 1fr; }
  .node-info { position: static; width: auto; margin-top: 12px; display: none; }
  .node-info.show { display: block; }
  .foot { flex-wrap: wrap; padding-bottom: 70px; }
}
