/* GLIVOK · U7-B (ADR-079) — Studio empotrado en /consola (zona Por-empresa).
 * Todo el CSS de Studio va SCOPED bajo #studioEmbed para NO pisar el tema oscuro de /consola
 * (las vars de Studio —tema claro— viven sólo dentro del contenedor). Cero iframe, cero 2º login:
 * es un MERGE real (comparte sesión + selector de empresa de /consola). */
#studioEmbed{
  --obsidian:#111317;--white:#F8F9FA;--oxford:#1F3A52;--active:#2E5A82;--active-d:#24486A;--soft:#EAF0F6;
  --steel:#7A828A;--ink:#1A1D22;--body:#363B43;--line:#E5E7EB;--line-s:#CDD2D8;
  --bg:#FFFFFF;--bg-alt:#F4F5F7;--ok:#3F9C63;--gold:#B8862B;--red:#C25450;
  --f-d:"Helvetica Neue","Inter",sans-serif;--f-b:"Inter",sans-serif;--f-m:"JetBrains Mono",monospace;
  background:var(--bg-alt);color:var(--body);font-family:var(--f-b);font-size:14.5px;line-height:1.5;
  padding:18px;border-radius:12px;border:1px solid var(--line);
}
#studioEmbed .fld{margin-bottom:16px}
#studioEmbed .fld label{display:block;font-family:var(--f-m);font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--steel);margin-bottom:6px}
#studioEmbed .fld input,#studioEmbed .fld select,#studioEmbed .fld textarea{width:100%;border:1px solid var(--line-s);padding:11px 12px;font-family:var(--f-b);font-size:15px;outline:none;background:#fff;color:var(--body)}
#studioEmbed .fld textarea{min-height:80px;resize:vertical}
#studioEmbed .btn{background:var(--active);color:#fff;border:0;padding:12px 16px;font-family:var(--f-d);font-weight:700;text-transform:uppercase;letter-spacing:.05em;font-size:13px;cursor:pointer}
#studioEmbed .btn:hover{background:var(--active-d)}
#studioEmbed .btn:disabled{opacity:.5;cursor:not-allowed}
#studioEmbed .btn.ghost{background:#fff;color:var(--active);border:1px solid var(--active)}
#studioEmbed .btn.sm{padding:7px 12px;font-size:11px}
#studioEmbed .err{color:var(--red);font-size:12.5px;margin-top:8px;display:none}
#studioEmbed .err.show{display:block}
#studioEmbed .view{display:none}
#studioEmbed .view.on{display:block}
#studioEmbed .kpis{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:22px}
#studioEmbed .kpi{background:#fff;border:1px solid var(--line);padding:14px 16px}
#studioEmbed .kpi .l{font-family:var(--f-m);font-size:10.5px;letter-spacing:.07em;text-transform:uppercase;color:var(--steel)}
#studioEmbed .kpi .v{font-family:var(--f-m);font-weight:700;font-size:1.8rem;color:var(--obsidian);margin-top:6px;line-height:1}
#studioEmbed .card{background:#fff;border:1px solid var(--line);margin-bottom:20px}
#studioEmbed .card .hd{padding:14px 18px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px}
#studioEmbed .card .hd h3{font-family:var(--f-d);font-weight:900;text-transform:uppercase;letter-spacing:.04em;font-size:.9rem;color:var(--obsidian)}
#studioEmbed .card .bd{padding:16px 18px}
#studioEmbed .grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
#studioEmbed .mod{border:1px solid var(--line);padding:13px 14px;display:flex;flex-direction:column;gap:7px;background:#fff}
#studioEmbed .mod .t{font-size:13px;font-weight:600;color:var(--obsidian);line-height:1.3}
#studioEmbed .mod .meta{font-family:var(--f-m);font-size:10.5px;color:var(--steel)}
#studioEmbed .mod .row{display:flex;align-items:center;gap:8px;margin-top:2px}
#studioEmbed .dot{width:9px;height:9px;border-radius:50%;display:inline-block;flex:none}
#studioEmbed .st-on .dot{background:var(--ok)}
#studioEmbed .st-ready .dot{background:var(--gold)}
#studioEmbed .st-blocked_credentials .dot,#studioEmbed .st-blocked_dependencies .dot{background:var(--red)}
#studioEmbed .stt{font-family:var(--f-m);font-size:10px;text-transform:uppercase;letter-spacing:.05em}
#studioEmbed .st-on .stt{color:var(--ok)}
#studioEmbed .st-ready .stt{color:var(--gold)}
#studioEmbed .st-blocked_credentials .stt,#studioEmbed .st-blocked_dependencies .stt{color:var(--red)}
#studioEmbed .sw{margin-left:auto;width:38px;height:21px;background:var(--line-s);border-radius:11px;position:relative;cursor:pointer;flex:none;transition:.15s}
#studioEmbed .sw.on{background:var(--ok)}
#studioEmbed .sw::after{content:"";position:absolute;top:2px;left:2px;width:17px;height:17px;background:#fff;border-radius:50%;transition:.15s}
#studioEmbed .sw.on::after{left:19px}
#studioEmbed .sw.lock{opacity:.4;cursor:not-allowed}
#studioEmbed .hint{font-size:11px;color:var(--red);margin-top:2px}
#studioEmbed .tag{display:inline-block;font-family:var(--f-m);font-size:9.5px;padding:1px 6px;background:var(--soft);color:var(--active-d);text-transform:uppercase;letter-spacing:.04em}
#studioEmbed .tag.ai{background:#F3ECDD;color:var(--gold)}
#studioEmbed .row2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
#studioEmbed .sp{flex:1}
#studioEmbed pre.out{background:var(--ink);color:#cfe;font-family:var(--f-m);font-size:11.5px;padding:12px;overflow:auto;white-space:pre-wrap;max-height:260px}
#studioEmbed .muted{color:var(--steel);font-size:12.5px}
#studioEmbed .violations{margin-top:8px}
#studioEmbed .violations li{color:var(--red);font-size:12px;margin-left:16px}
/* el toast de Studio es fixed; lo dejamos global pero originado en el embed */
#studioToast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#111317;color:#fff;padding:12px 20px;font-size:13px;opacity:0;pointer-events:none;transition:.2s;z-index:50;font-family:"Inter",sans-serif}
#studioToast.show{opacity:1}
#studioToast.err{background:#C25450}
@media(max-width:760px){#studioEmbed .kpis{grid-template-columns:repeat(2,1fr)}#studioEmbed .row2{grid-template-columns:1fr}}
