/* Variante visual de Core · 06/11/2026. Referencia Antigravity, identidad CargaPLUS.
   Capa local: no modifica los recursos comunes ni los estilos de otros módulos. */
@font-face {
  font-family: "Inter";
  src: url("fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  font-family: "Inter", "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  --bg: #e9edf2;
  --surface: #ffffff;
  --ink: #25262b;
  --muted: #63646d;
  --line: #dcdde2;
  --field: #f6f6f8;
  --field-line: #c7c8d0;
  --soft: #ededf1;
  --sidebar: #f5f6f8;
  --sidebar-card: #ffffff;
  --sidebar-line: #d3d8df;
  --sidebar-ink: #25262b;
  --sidebar-muted: #606671;
  --sidebar-hover: #e9edf2;
  --sidebar-selected: #ffffff;
  --sidebar-selected-line: #c8cfd9;
  --accent: #b7440b;
  --accent-text: #ffffff;
  --action-link: #a13c08;
  --action-line: #e9c7b5;
  --action-bg: #fff1e9;
  --action-hover: #fff7f2;
  --focus: #b7440b;
  --quiet-bg: #e8ecf1;
  --quiet-ink: #5e5f68;
  --card-top-light: #ffffff;
  --deck: #f2f4f7;
  --beam-edge: #dc773d91;
  --beam-glow: #f65c0812;
  --card-hover: #fdfdfd;
  --card-shadow: 0 4px 12px -5px #23334a24, inset 0 1px 0 #ffffff;
}

:root[data-theme="dark"] {
  --bg: #080a0e;
  --surface: #181d26;
  --ink: #f2f2f4;
  --muted: #b0b1bb;
  --line: #343c49;
  --field: #131416;
  --field-line: #4b4d56;
  --soft: #222a35;
  --sidebar: #0d0e10;
  --sidebar-card: #17181b;
  --sidebar-line: #2c2d33;
  --sidebar-ink: #eeeef2;
  --sidebar-muted: #aaaab4;
  --sidebar-hover: #ffffff0e;
  --sidebar-selected: #ffffff09;
  --sidebar-selected-line: #ffffff26;
  --accent: #fb954c;
  --accent-text: #24150e;
  --action-link: #ffb17f;
  --action-line: #62402e;
  --action-bg: #302219;
  --action-hover: #201c19;
  --focus: #ff9c62;
  --quiet-bg: #17181b;
  --quiet-ink: #b0b1bb;
  --card-top-light: #ffffff0b;
  --deck: #0e1219;
  --beam-edge: #f58b48a6;
  --beam-glow: #f65c0830;
  --card-hover: #1d2430;
  --card-shadow: inset 0 1px 0 #ffffff0b;
}

body { font-family: "Inter", "Segoe UI", sans-serif; line-height: 1.5; }
h1, h2, h3 { text-wrap: balance; }
p { font-size: 13px; line-height: 1.7; }
.workspace { grid-template-columns: 248px minmax(0, 1fr); }
.workspace-main { min-width: 0; }
.sidebar { padding: 28px 20px; border-right: 1px solid var(--sidebar-line); }
.sidebar .brand { color: var(--sidebar-ink); font-size: 22px; gap: 10px; margin-bottom: 32px; }
.brand small { letter-spacing: 1.4px; font-size: 8px; color: var(--sidebar-muted); }
.sidebar-context { border-radius: 11px; padding: 12px; color: var(--sidebar-ink); font-size: 12px; }
.sidebar-context small { color: var(--sidebar-muted); }
.context-icon { border: 1px solid var(--sidebar-line); background: var(--sidebar-hover); color: var(--sidebar-ink); border-radius: 8px; }
.sidebar-label { color: var(--sidebar-muted); font-size: 10px; letter-spacing: 1.2px; margin: 0 12px 10px; }
.nav-link { color: var(--sidebar-muted); border: 1px solid transparent; border-radius: 9px; padding: 12px; font-size: 12px; }
.nav-link.selected { color: var(--sidebar-ink); background: var(--sidebar-selected); border-color: var(--sidebar-selected-line); box-shadow: inset 2px 0 var(--sidebar-muted); }
.nav-link:hover { color: var(--sidebar-ink); background: var(--sidebar-hover); }
.sidebar-next { border-radius: 11px; padding: 16px; margin-top: 24px; }
.sidebar-next .tiny-label { font-size: 9px; color: var(--sidebar-muted); }
.sidebar-next strong { font-size: 13px; color: var(--sidebar-ink); margin: 10px 0 8px; }
.sidebar-next p { font-size: 12px; color: var(--sidebar-muted); line-height: 1.7; }
.sidebar-bottom { padding: 18px 5px 0; }
.local-label { color: var(--sidebar-muted); font-size: 11px; }
.topbar { height: 64px; padding: 0 40px; background: var(--bg); }
.breadcrumb { font-size: 12px; gap: 10px; }
.breadcrumb b { font-weight: 550; }
.topbar-user { gap: 14px; }
.topbar-user>a { font-size: 12px; color: var(--muted); }
.topbar-user>a:hover { color: var(--ink); }
.theme-toggle { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); }
.theme-toggle:hover { background: var(--action-bg); border-color: var(--action-line); }
.dashboard { max-width: 1440px; padding: 38px 40px 28px; }
.page-heading { margin-bottom: 32px; }
.page-heading .section-label { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; letter-spacing: 1.35px; color: var(--muted); }
.page-heading .section-label::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--muted); }
.page-heading h1 { font-size: clamp(27px, 2.5vw, 34px); font-weight: 650; letter-spacing: -1.15px; line-height: 1.25; margin: 13px 0 10px; }
.page-heading p { font-size: 14px; }
.section-heading { margin-bottom: 16px; }
.section-heading h2 { font-size: 14px; font-weight: 600; }
.section-heading>span { font-size: 11px; }
.systems-section {
  padding: 24px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: linear-gradient(var(--deck), var(--deck)) padding-box,
              linear-gradient(115deg, var(--beam-edge), var(--line) 32%, var(--line) 72%, var(--beam-edge)) border-box;
  box-shadow: -8px 0 26px -12px var(--beam-glow), 8px 8px 28px -14px var(--beam-glow);
}
.system-grid { gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.system-card { border: 1px solid var(--line); border-radius: 14px; padding: 22px 22px 0; min-height: 270px; box-shadow: var(--card-shadow); }
.system-card .product-top { gap: 12px; margin-bottom: 22px; align-items: flex-start; }
.system-card .product-mark { width: 44px; height: 44px; border-radius: 11px; background: var(--soft); color: var(--ink); border: 1px solid var(--line); font-size: 12px; letter-spacing: -.3px; flex-shrink: 0; }
.system-card .card-tag { color: var(--muted); font-size: 10px; line-height: 1.6; padding-top: 4px; max-width: 135px; }
.system-card h3 { font-size: 20px; letter-spacing: -.6px; font-weight: 600; margin-bottom: 9px; }
.system-card>p { min-height: 44px; font-size: 13px; }
.system-card .system-note { font-size: 12px; min-height: 38px; margin: 18px 0 18px; line-height: 1.65; }
.system-card .product-bottom { padding: 16px 0; }
.system-card .product-action { font-size: 12px; font-weight: 650; text-decoration: none; background: var(--accent); color: var(--accent-text); border: 1px solid transparent; border-radius: 8px; padding: 9px 12px; min-height: 40px; }
.system-card .product-action>span { display: grid; place-items: center; width: 20px; height: 20px; font-size: 16px; }
.system-card .pending-action { font-size: 12px; font-weight: 450; }
.system-link { transition: border-color .16s ease, background-color .16s ease; }
.system-link:hover { border-color: var(--muted); background: var(--card-hover); }
.system-link:hover h3, .system-link:focus-visible h3 { color: var(--ink); }
.system-link:hover .product-action { filter: brightness(1.06); }
.system-card .product-action:hover { background: var(--accent); }
.system-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.portal-note { margin-top: 24px; border-radius: 11px; padding: 16px 18px; font-size: 12px; border-color: var(--line); }
.portal-note strong { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.dashboard-footer { font-size: 10px; line-height: 1.6; margin-top: 32px; padding-top: 20px; }
.button { border-radius: 9px; font-weight: 600; min-height: 40px; }
.button:hover:not(:disabled) { filter: none; }
.button.primary:hover:not(:disabled) { background: var(--action-link); }
.button.secondary:hover:not(:disabled) { background: var(--action-hover); }
input, select, textarea { border-radius: 9px; }
.notice, .card, dialog { border-radius: 12px; }
.access-story { background: var(--sidebar); color: var(--sidebar-ink); border-right: 1px solid var(--sidebar-line); }
.access-story .brand { color: var(--sidebar-ink); }
.access-story .story-copy h1 { letter-spacing: -1.6px; font-weight: 650; }
.access-story .story-copy>p, .access-story .story-footer { color: var(--sidebar-muted); }
.access-story .eyebrow { color: var(--sidebar-muted); }
.product-orbit>span { border-color: var(--sidebar-line); background: var(--sidebar-card); color: var(--sidebar-muted); border-radius: 9px; }
.product-orbit b { color: var(--sidebar-ink); }
.product-orbit .orbit-main { border-color: var(--sidebar-selected-line); }
.access-card h2 { font-weight: 650; letter-spacing: -.85px; }
.access-card label { font-size: 12px; }
.access-card input:not([type=hidden]) { height: 44px; }
.access-note { line-height: 1.8; }
.message-page h1 { font-weight: 650; }

@media (min-width: 1550px) {
  .dashboard { padding: 48px 56px 32px; }
  .topbar { padding: 0 56px; }
}
@media (min-width: 851px) and (max-width: 1150px) {
  .workspace { grid-template-columns: 216px minmax(0, 1fr); }
  .sidebar { padding: 24px 14px; }
  .topbar { padding: 0 24px; }
  .dashboard { padding: 30px 24px; }
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .sidebar { padding: 16px 22px; gap: 12px; border-right: 0; border-bottom: 1px solid var(--sidebar-line); }
  .sidebar .brand { margin: 0; font-size: 21px; }
  .sidebar nav { margin-left: auto; }
  .nav-link { font-size: 11px; padding: 10px; }
  .topbar { height: auto; min-height: 60px; padding: 12px 22px; gap: 10px; }
  .dashboard { padding: 30px 22px 24px; }
  .page-heading { margin-bottom: 28px; }
  .system-card { min-height: 255px; }
  .access-story { border-right: 0; }
}
@media (min-width: 601px) and (max-width: 850px) {
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .systems-section { padding: 16px; border-radius: 14px; }
  .system-grid { grid-template-columns: minmax(0, 1fr); }
  .system-card { padding: 20px 20px 0; min-height: 0; }
  .system-card .product-top { margin-bottom: 18px; }
  .system-card>p { min-height: 0; }
  .system-card .system-note { min-height: 0; margin: 14px 0 18px; }
  .system-card .product-bottom { margin-top: auto; }
  .page-heading p { font-size: 13px; }
  .portal-note { padding: 15px; }
  .topbar-user { gap: 10px; }
  .dashboard-footer { gap: 8px; }
}
@media (max-width: 370px) {
  .sidebar { padding: 15px 18px; }
  .sidebar .brand { font-size: 19px; }
  .sidebar nav { margin-left: 0; }
  .dashboard { padding: 26px 18px 22px; }
  .topbar { padding: 12px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .system-link, .button { transition: none; transform: none !important; }
}

/* Navegación: el menú minimizado conserva iconos y control de retorno. */
.topbar-leading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sidebar-toggle { display: inline-grid; place-items: center; flex-shrink: 0; width: 38px; height: 38px; padding: 8px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; }
.sidebar-toggle:hover { background: var(--soft); border-color: var(--muted); }
.sidebar-toggle svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[data-sidebar-collapsed="true"] .sidebar-toggle-arrow { transform: rotate(180deg); transform-origin: 14px 12px; }
.sidebar .nav-link { position: relative; }
.sidebar .nav-link .nav-icon { display: inline-grid; place-items: center; width: 20px; font-size: 20px; line-height: 1; flex-shrink: 0; }
.sidebar .nav-link .nav-label { display: inline; width: auto; font-size: 12px; line-height: 1.4; }
.sidebar .nav-link .nav-tooltip { display: none; position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%); width: max-content; max-width: 180px; padding: 8px 10px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; font-size: 12px; line-height: 1.4; z-index: 40; pointer-events: none; }
[data-sidebar-collapsed="true"] .sidebar .brand>span,
[data-sidebar-collapsed="true"] .sidebar-context,
[data-sidebar-collapsed="true"] .sidebar-label,
[data-sidebar-collapsed="true"] .sidebar-next,
[data-sidebar-collapsed="true"] .sidebar-bottom,
[data-sidebar-collapsed="true"] .sidebar .nav-link .nav-label { display: none; }
[data-sidebar-collapsed="true"] .sidebar .nav-link { justify-content: center; gap: 0; width: 44px; height: 44px; padding: 10px; }
[data-sidebar-collapsed="true"] .sidebar .nav-link:is(:hover,:focus-visible) .nav-tooltip { display: block; }
@media (min-width: 851px) {
  [data-sidebar-collapsed="true"] .workspace { grid-template-columns: 72px minmax(0,1fr); }
  [data-sidebar-collapsed="true"] .sidebar { padding: 26px 12px; align-items: center; }
  [data-sidebar-collapsed="true"] .sidebar .brand { margin: 0 0 28px; }
  [data-sidebar-collapsed="true"] .sidebar .brand-logo { width: 36px; height: 36px; }
}
@media (max-width: 850px) {
  .sidebar .nav-link .nav-label { font-size: 11px; }
  [data-sidebar-collapsed="true"] .sidebar { padding: 12px 18px; }
  [data-sidebar-collapsed="true"] .sidebar .nav-link .nav-tooltip { left: auto; right: 0; top: calc(100% + 8px); transform: none; }
}

/* Menú común08/11: control dentro del lateral, nunca sobre su borde. */
#core-sidebar .cp-menu-heading { display:flex; justify-content:flex-end; width:100%; flex-shrink:0; position:sticky; top:0; z-index:3; padding-bottom:12px; background:var(--sidebar); }
#core-sidebar .sidebar-toggle { display:grid; place-items:center; position:static; flex:0 0 44px; width:44px; height:44px; min-height:44px; padding:10px; }
#core-sidebar .sidebar-toggle svg > rect, #core-sidebar .sidebar-toggle svg > path:not(.sidebar-toggle-arrow) { display:none; }
#core-sidebar .sidebar-toggle-arrow { transform-origin:12px 12px; }
[data-sidebar-collapsed="true"] #core-sidebar .sidebar-toggle-arrow { transform:rotate(180deg); }
[data-sidebar-collapsed="true"] #core-sidebar .cp-menu-heading { justify-content:center; }
@media(min-width:851px) {
  .workspace { grid-template-columns:240px minmax(0,1fr); }
  #core-sidebar { padding:16px 12px; overflow-y:auto; }
  #core-sidebar .brand { margin-bottom:20px; }
  [data-sidebar-collapsed="true"] #core-sidebar { padding:16px 12px; }
  [data-sidebar-collapsed="true"] #core-sidebar .brand { margin-bottom:20px; }
}
@media(max-width:850px) {
  #core-sidebar .cp-menu-heading { width:auto; padding:0; position:static; margin-left:auto; order:-1; }
  [data-sidebar-collapsed="true"] #core-sidebar { padding:12px; }
}

/* Ayuda dentro del carril: no se corta por el scroll del lateral compacto. */
[data-sidebar-collapsed="true"] #core-sidebar .nav-link:is(:hover,:focus-visible) { height:auto; min-height:44px; flex-direction:column; gap:4px; }
[data-sidebar-collapsed="true"] #core-sidebar .nav-link:is(:hover,:focus-visible) .nav-label { display:block; max-width:100%; font-size:10px; line-height:1.3; text-align:center; white-space:normal; overflow-wrap:anywhere; }
[data-sidebar-collapsed="true"] #core-sidebar .nav-tooltip { display:none; }
