*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#0b1020;color:#e8edf7}body{min-height:100vh}.app-shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh}.sidebar{background:#0a0f1b;border-right:1px solid #1c2740;padding:24px;display:flex;flex-direction:column;gap:28px}.brand{display:flex;gap:12px;align-items:center}.logo{width:44px;height:44px;border:1px solid #2c3957;border-radius:12px;display:grid;place-items:center;background:#111a2d;font-weight:800;color:#7dd3fc}.brand h1{font-size:18px;margin:0}.brand p{margin:4px 0 0;color:#7f8aa3;font-size:12px}.nav{display:flex;flex-direction:column;gap:8px}.nav-item{border:0;background:transparent;color:#8e9ab4;padding:11px 12px;text-align:left;border-radius:10px;cursor:pointer;font-weight:600}.nav-item:hover,.nav-item.active{background:#121b30;color:#fff}.sidebar-note{margin-top:auto;padding:14px;background:#101827;border:1px solid #1d2a45;border-radius:12px;display:flex;flex-direction:column;gap:6px}.sidebar-note strong{color:#9fe8c0}.sidebar-note span{color:#8390aa;font-size:12px;line-height:1.45}.main{padding:30px;overflow:auto}.section{display:none}.section.active{display:block}.topbar{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;margin-bottom:24px}.topbar h2{font-size:30px;margin:4px 0 6px}.topbar p{margin:0;color:#8c98b2}.eyebrow{font-size:11px;letter-spacing:.12em;color:#60a5fa;font-weight:800}.badge{padding:9px 12px;border:1px solid #29456e;border-radius:999px;background:#0d1830;color:#98c6ff;font-size:12px;font-weight:700}.grid{display:grid;grid-template-columns:minmax(330px,430px) minmax(500px,1fr);gap:20px}.panel{background:#101726;border:1px solid #1f2b46;border-radius:16px;padding:20px;box-shadow:0 16px 40px rgba(0,0,0,.18)}.panel-title{display:flex;justify-content:space-between;gap:20px;margin-bottom:18px}.panel-title h3{margin:0 0 4px}.panel-title p{margin:0;color:#7f8aa4;font-size:13px}.field{display:flex;flex-direction:column;gap:7px;margin:14px 0}.field label,h4{font-size:13px;font-weight:700;color:#d6def0}.field select,.field input{width:100%;background:#0c1322;color:#eef3fb;border:1px solid #273653;border-radius:10px;padding:11px 12px;outline:none}.field select:focus,.field input:focus{border-color:#4f8cff}.helper{font-size:11px;color:#6f7d99;margin-top:4px}.divider{height:1px;background:#1e2940;margin:20px 0}.check-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.check{background:#0d1422;border:1px solid #202d47;border-radius:10px;padding:10px;display:flex;gap:8px;align-items:center;font-size:12px;color:#bcc7dc}.check input{accent-color:#60a5fa}.action-row{display:flex;gap:10px;margin-top:20px}.primary,.secondary,.ghost{border:0;border-radius:10px;padding:10px 14px;font-weight:700;cursor:pointer}.primary{background:#2563eb;color:white}.primary:hover{background:#1d4ed8}.secondary,.ghost{background:#162136;color:#d6e0f5;border:1px solid #2a3a5b}.secondary:hover,.ghost:hover{background:#1b2942}.output-title{align-items:center}.output-actions{display:flex;gap:8px;flex-wrap:wrap}.code-wrap{background:#080d18;border:1px solid #1c2942;border-radius:12px;overflow:auto;min-height:560px;max-height:68vh}.code-wrap pre{margin:0;padding:18px;font:13px/1.6 "Cascadia Code","SFMono-Regular",Consolas,monospace;white-space:pre;tab-size:2}.code-wrap code{color:#c7d2fe}.notice{margin-top:14px;padding:12px;border-radius:10px;background:#171726;border:1px solid #3b315d;color:#b9b3d0;font-size:12px}.stats-strip{display:grid;grid-template-columns:repeat(4,1fr);margin-top:20px;background:#0f1625;border:1px solid #1f2a42;border-radius:14px;overflow:hidden}.stats-strip>div{padding:18px;border-right:1px solid #1f2a42;display:flex;flex-direction:column;gap:3px}.stats-strip>div:last-child{border-right:0}.stats-strip strong{font-size:20px}.stats-strip span{font-size:11px;color:#73819e}.cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.card,.about-card{background:#101726;border:1px solid #1f2b46;border-radius:14px;padding:18px}.card h3,.about-card h3{margin-top:0}.card p,.about-card p{color:#8e9ab4;line-height:1.55}.tag{display:inline-block;margin-top:8px;padding:5px 8px;border:1px solid #2b3b5d;border-radius:999px;font-size:10px;color:#9eb3d5}.toast{position:fixed;right:24px;bottom:24px;background:#ecfdf5;color:#064e3b;padding:10px 14px;border-radius:10px;font-weight:700;opacity:0;transform:translateY(8px);transition:.2s;pointer-events:none}.toast.show{opacity:1;transform:translateY(0)}@media(max-width:980px){.app-shell{grid-template-columns:1fr}.sidebar{position:static;border-right:0;border-bottom:1px solid #1c2740;padding:14px 18px}.nav{flex-direction:row}.sidebar-note{display:none}.main{padding:18px}.grid{grid-template-columns:1fr}.cards{grid-template-columns:1fr 1fr}.stats-strip{grid-template-columns:1fr 1fr}.code-wrap{min-height:430px}}@media(max-width:620px){.topbar{flex-direction:column}.cards{grid-template-columns:1fr}.check-grid{grid-template-columns:1fr}.stats-strip{grid-template-columns:1fr 1fr}.output-title{align-items:flex-start;flex-direction:column}.action-row{flex-direction:column}}

.integroia-wordmark{font-weight:900;letter-spacing:-.04em;font-size:21px;line-height:1}
.integroia-wordmark .integro{color:#f8fafc}
.integroia-wordmark .ia{color:#60a5fa}
.integroia-wordmark.large{font-size:34px}
.integroia-wordmark.small{font-size:16px}
.brand-copy p{margin-top:5px}
.commercial-about{max-width:900px}
.about-brand{display:flex;align-items:flex-end;gap:14px;margin-bottom:28px;padding-bottom:20px;border-bottom:1px solid #1f2b46}
.product-label{font-size:12px;color:#8997b3;padding-bottom:3px}
.legal-box{margin-top:28px;padding:16px;border:1px solid #29456e;background:#0d1830;border-radius:12px;display:flex;flex-direction:column;gap:5px}
.legal-box strong{color:#dbeafe}
.legal-box span{font-size:12px;color:#90a4c4}
.app-footer{margin-top:26px;padding:18px 4px 4px;border-top:1px solid #1f2a42;display:flex;align-items:center;justify-content:space-between;gap:20px;color:#7f8aa3;font-size:11px}
.footer-brand{display:flex;align-items:center;gap:10px}
@media(max-width:620px){.app-footer{flex-direction:column;align-items:flex-start}}

.brand-logo{width:48px;height:48px;display:block;border-radius:50%;flex:0 0 auto}
.about-logo{width:74px;height:74px;border-radius:50%;flex:0 0 auto}
.footer-logo{width:28px;height:28px;border-radius:50%}
.analyzer-grid{display:grid;grid-template-columns:minmax(420px,1.05fr) minmax(380px,.95fr);gap:20px}
.analyzer-status{padding:9px 12px;border-radius:999px;border:1px solid #2b3b5d;background:#101827;color:#9eb3d5;font-size:12px;font-weight:700}
.script-editor{width:100%;min-height:560px;resize:vertical;background:#080d18;color:#dbeafe;border:1px solid #1c2942;border-radius:12px;padding:16px;font:13px/1.6 "Cascadia Code","SFMono-Regular",Consolas,monospace;outline:none;tab-size:4}
.script-editor:focus{border-color:#4f8cff;box-shadow:0 0 0 3px rgba(79,140,255,.08)}
.file-button{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.file-button input{display:none}
.analysis-disclaimer{margin-top:14px;color:#7f8aa4;font-size:11px;line-height:1.55}
.score-card{display:flex;align-items:center;gap:14px;padding:16px;border:1px solid #273653;border-radius:12px;margin-bottom:14px;background:#0c1322}
.score-card .score-value{width:58px;height:58px;border-radius:50%;display:grid;place-items:center;font-size:22px;font-weight:900;background:#151f34;border:1px solid #2b3c60}
.score-card>div:last-child{display:flex;flex-direction:column;gap:4px}
.score-card span{font-size:12px;color:#8390aa}
.score-card.good{border-color:#1f5b49;background:#0d211d}.score-card.good .score-value{color:#86efac;border-color:#277a5f}
.score-card.warn{border-color:#66552d;background:#241f11}.score-card.warn .score-value{color:#fde68a;border-color:#8b742f}
.score-card.bad{border-color:#6b3038;background:#271316}.score-card.bad .score-value{color:#fda4af;border-color:#8b3945}
.analysis-counters{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}
.counter{padding:12px;border-radius:10px;background:#0c1322;border:1px solid #202d47;display:flex;flex-direction:column;gap:3px}
.counter strong{font-size:20px}.counter span{font-size:11px;color:#7f8aa4}
.counter.error strong{color:#fda4af}.counter.warning strong{color:#fde68a}.counter.info strong{color:#93c5fd}
.issues-list{display:flex;flex-direction:column;gap:10px;max-height:535px;overflow:auto;padding-right:3px}
.issue{border:1px solid #23314d;background:#0c1322;border-radius:12px;padding:13px}
.issue-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:7px}
.issue-type{font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;padding:4px 7px;border-radius:999px}
.issue-type.error{color:#fecdd3;background:#3a171d}.issue-type.warning{color:#fde68a;background:#382f14}.issue-type.info{color:#bfdbfe;background:#152946}
.issue-line{font:11px "Cascadia Code",Consolas,monospace;color:#73819e}
.issue-title{font-weight:800;font-size:13px;margin-bottom:5px}
.issue-message{font-size:12px;line-height:1.5;color:#9ca9c2}
.issue-snippet{margin-top:9px;padding:9px;border-radius:8px;background:#070c15;color:#cbd5e1;font:11px/1.45 "Cascadia Code",Consolas,monospace;white-space:pre-wrap;word-break:break-word}
.empty-state{min-height:190px;border:1px dashed #2a3856;border-radius:12px;display:grid;place-items:center;text-align:center;align-content:center;gap:6px;padding:20px;color:#7f8aa4}
.empty-state strong{color:#c3cee2}
.analyzer-capabilities{margin-top:20px}.analyzer-capabilities h3{margin-top:0}
.capability-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.capability-grid span{padding:10px 12px;border:1px solid #202d47;background:#0d1422;border-radius:9px;color:#aebbd2;font-size:12px}
@media(max-width:1050px){.analyzer-grid{grid-template-columns:1fr}.script-editor{min-height:430px}}
@media(max-width:620px){.capability-grid{grid-template-columns:1fr}.analysis-counters{grid-template-columns:1fr 1fr 1fr}}

/* ===== Licenciamiento IntegroIA ===== */
.app-shell.license-locked{filter:blur(7px);pointer-events:none;user-select:none}
.license-gate{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px;background:rgba(4,8,17,.92);backdrop-filter:blur(7px)}
.license-gate.hidden{display:none}
.license-card{width:min(440px,100%);background:#101726;border:1px solid #263755;border-radius:20px;padding:30px;box-shadow:0 28px 80px rgba(0,0,0,.5)}
.license-logo{width:70px;height:70px;border-radius:50%;display:block;margin-bottom:18px}
.license-card h1{font-size:27px;margin:5px 0 8px}.license-card>p{color:#8d9bb5;line-height:1.55;margin:0 0 20px}
.license-activate{width:100%;margin-top:8px;padding:12px 14px}
.license-message{min-height:20px;margin-top:12px;font-size:12px}.license-message.error{color:#fda4af}.license-message.success{color:#86efac}
.license-help{border-top:1px solid #1f2b46;margin-top:18px;padding-top:14px;color:#6f7e99;font-size:11px;line-height:1.5}
.license-panel{margin-top:10px;padding:12px;border:1px solid #1f2b46;border-radius:11px;background:#0d1422;display:flex;flex-direction:column;gap:8px}
.license-panel>div{display:flex;flex-direction:column;gap:3px}.license-panel strong{font-size:12px;color:#dbeafe}.license-panel span{font-size:10px;color:#7987a3}
.license-link{padding:0;border:0;background:none;color:#7eb5ff;text-align:left;font-size:10px;cursor:pointer}.license-link:hover{text-decoration:underline}


/* ============================================================
   IntegroIA Suite UX
   Tema compartido + barra superior
   ============================================================ */

.product-toolbar{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:-8px 0 22px;
  padding:8px 10px;
  border:1px solid #1f2b46;
  border-radius:13px;
  background:#0d1422;
}

.apps-selector-mount{
  min-width:0;
  display:flex;
  align-items:center;
}

.product-toolbar-actions{
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}

.toolbar-control{
  display:flex;
  align-items:center;
  gap:7px;
  color:#7f8aa4;
  font-size:10px;
  font-weight:700;
}

.toolbar-control select{
  appearance:auto;
  min-width:74px;
  padding:7px 9px;
  border:1px solid #2a3a5b;
  border-radius:9px;
  background:#111a2b;
  color:#dce6f7;
  font:600 11px Inter,ui-sans-serif,system-ui,sans-serif;
  outline:none;
}

.toolbar-control select:focus{
  border-color:#4f8cff;
}

.toolbar-button,
.toolbar-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:7px 10px;
  border:1px solid #2a3a5b;
  border-radius:9px;
  background:#111a2b;
  color:#dce6f7;
  font:700 11px Inter,ui-sans-serif,system-ui,sans-serif;
  text-decoration:none;
  cursor:pointer;
}

.toolbar-button:hover,
.toolbar-link:hover{
  background:#18243a;
  border-color:#385078;
}

#logoutBtn{
  color:#fecaca;
  border-color:#5b3038;
  background:#211317;
}

#logoutBtn:hover{
  background:#321a20;
}

.about-web-link{
  width:max-content;
  margin-top:8px;
  color:#8fc0ff;
  font-size:11px;
  text-decoration:none;
}

.about-web-link:hover{
  text-decoration:underline;
}

/* El selector de apps se integra en la nueva barra sin márgenes extra. */
.apps-selector-mount .integroia-apps-selector{
  margin-left:0;
}

/* ===== Tema claro ===== */

html[data-theme="light"],
html[data-theme="light"] body{
  background:#f4f7fb;
  color:#172033;
}

html[data-theme="light"] .sidebar{
  background:#ffffff;
  border-color:#dce4ef;
}

html[data-theme="light"] .main{
  background:#f4f7fb;
}

html[data-theme="light"] .integroia-wordmark .integro{
  color:#172033;
}

html[data-theme="light"] .brand p,
html[data-theme="light"] .topbar p,
html[data-theme="light"] .panel-title p,
html[data-theme="light"] .card p,
html[data-theme="light"] .about-card p,
html[data-theme="light"] .product-label,
html[data-theme="light"] .analysis-disclaimer,
html[data-theme="light"] .issue-message,
html[data-theme="light"] .score-card span,
html[data-theme="light"] .counter span,
html[data-theme="light"] .stats-strip span{
  color:#65738a;
}

html[data-theme="light"] .nav-item{
  color:#59667d;
}

html[data-theme="light"] .nav-item:hover,
html[data-theme="light"] .nav-item.active{
  background:#edf3fb;
  color:#18243a;
}

html[data-theme="light"] .sidebar-note,
html[data-theme="light"] .license-panel,
html[data-theme="light"] .product-toolbar,
html[data-theme="light"] .panel,
html[data-theme="light"] .card,
html[data-theme="light"] .about-card,
html[data-theme="light"] .stats-strip,
html[data-theme="light"] .legal-box,
html[data-theme="light"] .score-card,
html[data-theme="light"] .counter,
html[data-theme="light"] .issue,
html[data-theme="light"] .capability-grid span{
  background:#ffffff;
  border-color:#dce4ef;
}

html[data-theme="light"] .sidebar-note strong{
  color:#17824f;
}

html[data-theme="light"] .field label,
html[data-theme="light"] h4{
  color:#27354b;
}

html[data-theme="light"] .field select,
html[data-theme="light"] .field input,
html[data-theme="light"] .toolbar-control select{
  background:#ffffff;
  color:#18243a;
  border-color:#cdd8e7;
}

html[data-theme="light"] .check{
  background:#f8fafc;
  color:#42516a;
  border-color:#dbe3ee;
}

html[data-theme="light"] .secondary,
html[data-theme="light"] .ghost,
html[data-theme="light"] .toolbar-button,
html[data-theme="light"] .toolbar-link{
  background:#ffffff;
  color:#324158;
  border-color:#ccd7e6;
}

html[data-theme="light"] .secondary:hover,
html[data-theme="light"] .ghost:hover,
html[data-theme="light"] .toolbar-button:hover,
html[data-theme="light"] .toolbar-link:hover{
  background:#eef3f9;
}

html[data-theme="light"] #logoutBtn{
  background:#fff6f6;
  color:#a12f3c;
  border-color:#e7bec3;
}

html[data-theme="light"] #logoutBtn:hover{
  background:#fcebed;
}

html[data-theme="light"] .code-wrap,
html[data-theme="light"] .script-editor,
html[data-theme="light"] .issue-snippet{
  background:#f7f9fc;
  color:#24324a;
  border-color:#d7e0ec;
}

html[data-theme="light"] .code-wrap code{
  color:#243b78;
}

html[data-theme="light"] .divider,
html[data-theme="light"] .about-brand,
html[data-theme="light"] .app-footer,
html[data-theme="light"] .stats-strip>div{
  border-color:#dce4ef;
}

html[data-theme="light"] .notice{
  background:#f6f2fb;
  color:#655d7d;
  border-color:#ddd2ee;
}

html[data-theme="light"] .analyzer-status,
html[data-theme="light"] .tag{
  background:#f4f7fb;
  color:#50617d;
  border-color:#d4deeb;
}

html[data-theme="light"] .empty-state{
  border-color:#cdd8e7;
  color:#65738a;
}

html[data-theme="light"] .empty-state strong{
  color:#26354d;
}

html[data-theme="light"] .score-card.good{
  background:#eefaf5;
  border-color:#b8dfcf;
}

html[data-theme="light"] .score-card.warn{
  background:#fff9e9;
  border-color:#ead99d;
}

html[data-theme="light"] .score-card.bad{
  background:#fff2f3;
  border-color:#e8bec4;
}

html[data-theme="light"] .license-gate{
  background:rgba(236,241,247,.94);
}

html[data-theme="light"] .license-card{
  background:#ffffff;
  border-color:#d7e0eb;
  box-shadow:0 28px 80px rgba(50,70,100,.18);
}

html[data-theme="light"] .license-card>p,
html[data-theme="light"] .license-help,
html[data-theme="light"] .license-panel span{
  color:#68768d;
}

html[data-theme="light"] .license-panel strong{
  color:#27354b;
}

@media(max-width:820px){
  .product-toolbar{
    align-items:flex-start;
    flex-direction:column;
  }

  .product-toolbar-actions{
    width:100%;
    margin-left:0;
    justify-content:flex-start;
  }
}

@media(max-width:620px){
  .product-toolbar-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  .toolbar-control{
    justify-content:space-between;
  }

  .toolbar-link,
  .toolbar-button{
    width:100%;
  }
}

