/* CELDA ERP · UI BLOQUE 4.6
   Capa final cargada DESPUÉS de app.js para dominar estilos heredados inyectados
   por la baseline sin tocar su lógica. */

/* --------------------------------------------------------------------------
   Chrome superior: separación real entre avisos y cuenta
   -------------------------------------------------------------------------- */
@media (min-width:761px){
  html[data-celda-design="sgi"] body #celda-context-hub{
    top:16px!important;
    right:258px!important;
    z-index:10024!important;
  }
  html[data-celda-design="sgi"] body #celda-context-hub .celda-context-actions{
    display:flex!important;
    align-items:center!important;
    gap:7px!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-celda-design="sgi"] body #celda-context-hub .cch-button{
    min-width:38px!important;
    width:38px!important;
    height:38px!important;
    padding:0!important;
    border:1px solid transparent!important;
    border-radius:11px!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-button{
    width:auto!important;
    min-width:72px!important;
    padding:0 10px!important;
    gap:6px!important;
  }
  html[data-celda-design="sgi"] body #celda-context-hub .cch-button:hover,
  html[data-celda-design="sgi"] body #celda-context-hub .cch-button:focus-visible,
  html[data-celda-design="sgi"] body #celda-context-hub .cch-button[aria-expanded="true"]{
    background:#fff!important;
    border-color:#d8e5f2!important;
    box-shadow:0 6px 18px rgba(33,72,112,.10)!important;
  }
  html[data-celda-design="sgi"] body #celda-system-bar{
    top:12px!important;
    right:16px!important;
    z-index:10025!important;
  }
  html[data-celda-design="sgi"] body #celda-system-toggle{
    min-width:218px!important;
    max-width:232px!important;
    min-height:46px!important;
    padding:5px 10px 5px 6px!important;
    border:1px solid #dce7f1!important;
    border-radius:14px!important;
    background:rgba(255,255,255,.97)!important;
    box-shadow:0 5px 18px rgba(35,69,107,.08)!important;
  }
  html[data-celda-design="sgi"] body #celda-system-toggle .cs-user-compact{max-width:130px!important;}
  html[data-celda-design="sgi"] body #celda-system-toggle .cs-badge{
    position:static!important;
    margin-left:2px!important;
    flex:0 0 auto!important;
  }
}
@media (max-width:1180px) and (min-width:761px){
  html[data-celda-design="sgi"] body #celda-context-hub{right:218px!important;}
  html[data-celda-design="sgi"] body #celda-system-toggle{min-width:180px!important;max-width:194px!important;}
  html[data-celda-design="sgi"] body #celda-system-toggle .cs-user-compact{max-width:92px!important;}
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-label{display:none!important;}
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-button{min-width:38px!important;width:38px!important;padding:0!important;}
}

/* --------------------------------------------------------------------------
   Menú de cuenta: es la interfaz principal. Las opciones NO abren el panel viejo
   -------------------------------------------------------------------------- */
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu{
  top:56px!important;
  right:0!important;
  width:318px!important;
  max-height:min(72vh,610px)!important;
  overflow:auto!important;
  padding:13px!important;
  border:1px solid #dbe6f1!important;
  border-radius:20px!important;
  background:#fff!important;
  box-shadow:0 30px 72px rgba(26,56,91,.22)!important;
  color:#203f61!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-head{
  grid-template-columns:62px minmax(0,1fr)!important;
  gap:13px!important;
  padding:10px 9px 13px!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-avatar{
  width:62px!important;height:62px!important;
  border:3px solid #f7fbff!important;
  box-shadow:0 9px 20px rgba(31,69,111,.17)!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-head b{font-size:15px!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-head small{font-size:10.8px!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-separator{margin:6px 4px!important;background:#e7edf4!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-menu>button{
  min-height:60px!important;
  border-radius:14px!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-menu>button:hover,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-menu>button:focus-visible{
  background:#f5f9fe!important;
  border-color:#d8e5f3!important;
}

html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-route-head{
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  gap:10px;
  align-items:center;
  padding:2px 2px 12px;
  border-bottom:1px solid #e8eef5;
  margin-bottom:11px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-route-head>button{
  width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;
  display:grid!important;place-items:center!important;
  grid-template-columns:1fr!important;
  padding:0!important;
  border-radius:11px!important;
  background:#f2f6fb!important;
  color:#476c91!important;
  font-size:17px!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-route-head>div b{
  display:block;color:#18395d;font-size:14px;line-height:1.2;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-route-head>div small{
  display:block;margin-top:3px;color:#788ca0;font-size:10.5px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-card{
  display:grid;grid-template-columns:70px minmax(0,1fr);gap:13px;align-items:center;
  padding:13px;border:1px solid #dfe9f3;border-radius:16px;background:linear-gradient(180deg,#f8fbff,#f2f7fc);
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-card.compact{grid-template-columns:52px minmax(0,1fr);}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-avatar.large{width:70px!important;height:70px!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-card.compact .cs-quick-avatar{width:52px!important;height:52px!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-card>div b{display:block;color:#18395d;font-size:13px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-card>div small{display:block;margin-top:4px;color:#58728c;font-size:10.5px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-card>div em{
  display:inline-flex;align-items:center;gap:5px;margin-top:7px;padding:4px 8px;border:1px solid #dce7f2;border-radius:999px;background:#fff;color:#698096;font-size:9.5px;font-style:normal;font-weight:750;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-card>div em i{width:6px;height:6px;border-radius:50%;background:#18a678;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-metrics{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-metrics>div{
  padding:10px 11px;border:1px solid #e2eaf3;border-radius:13px;background:#fff;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-metrics span{display:block;color:#8394a6;font-size:9px;text-transform:uppercase;letter-spacing:.05em;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-metrics b{display:block;margin-top:4px;color:#18395d;font-size:13px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-status-card,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-card{
  display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:10px;align-items:center;
  margin-top:9px;padding:11px;border:1px solid #e0e9f2;border-radius:14px;background:#fff;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-status-card>div b,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-card>div b{display:block;color:#18395d;font-size:11.8px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-status-card>div small,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-card>div small{display:block;margin-top:3px;color:#7d90a3;font-size:9.8px;line-height:1.35;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-status-card>em,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-card>em{
  padding:4px 7px;border-radius:999px;font-size:9px;font-style:normal;font-weight:800;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-status-card>em.good,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-card>em.good{background:#e8f8f1;color:#13815e;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-status-card>em.warn{background:#fff5df;color:#a36d0d;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-status-card>em.bad{background:#fff0f2;color:#c84b5c;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-icon{
  width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:#eef5fc;color:#4e7399;font-weight:800;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-card.compact>button{
  min-height:34px!important;width:auto!important;grid-template-columns:1fr!important;padding:6px 9px!important;border:1px solid #d5e3f0!important;border-radius:10px!important;background:#f7fbff!important;color:#2d6cab!important;font-size:10px!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-wide{
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:100%!important;min-height:42px!important;margin-top:9px!important;
  grid-template-columns:1fr!important;
  border:1px solid #d7e5f2!important;border-radius:12px!important;
  background:#f7fbff!important;color:#256ab4!important;font-size:11px!important;font-weight:800!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-wide.danger{background:#fff6f7!important;border-color:#f1d4d9!important;color:#cb4658!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-field{
  display:grid;grid-template-columns:minmax(0,1fr) 108px;gap:10px;align-items:center;
  margin-top:9px;padding:11px;border:1px solid #e0e9f2;border-radius:14px;background:#fff;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-field b{display:block;color:#18395d;font-size:11.8px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-field small{display:block;margin-top:3px;color:#7c90a4;font-size:9.6px;line-height:1.35;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-field select{min-height:35px;border:1px solid #d8e5f1;border-radius:10px;background:#fff;color:#315674;font-size:10.5px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-section-label{margin:12px 4px 6px;color:#8194a7;font-size:8.5px;font-weight:850;letter-spacing:.12em;text-transform:uppercase;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-action-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-action-grid>button{
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
  gap:5px!important;min-height:70px!important;padding:8px!important;grid-template-columns:1fr!important;
  border:1px solid #e0e9f2!important;border-radius:13px!important;background:#fff!important;color:#315675!important;text-align:center!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-action-grid>button span{width:30px;height:30px;display:grid;place-items:center;border-radius:10px;background:#eef5fc;color:#557899;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-action-grid>button b{font-size:10.5px!important;color:#294e70!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-action{
  margin-top:9px!important;border:1px solid #e0e9f2!important;background:#fff!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-info{
  display:grid;grid-template-columns:1fr auto;gap:8px 12px;margin-top:9px;padding:12px;border:1px solid #e1eaf3;border-radius:14px;background:#f8fbfe;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-info span{color:#7d90a3;font-size:10px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-info b{color:#203f61;font-size:10.5px;}

/* El panel heredado permanece en DOM solo como compatibilidad interna y ya no es
   una ruta visible del menú autenticado. */
html[data-celda-design="sgi"] body #celda-system-bar:not(.open) #celda-system-panel{display:none!important;}

/* --------------------------------------------------------------------------
   Aviso colaborativo/concurrencia: tarjeta bajo el chrome, nunca encima
   -------------------------------------------------------------------------- */
@media (min-width:761px){
  html[data-celda-design="sgi"] body #celda-action-banner{
    left:auto!important;
    right:18px!important;
    top:74px!important;
    transform:none!important;
    width:min(430px,calc(100vw - 290px))!important;
    max-width:430px!important;
    padding:16px!important;
    border:1px solid #efd39b!important;
    border-left:4px solid #dfa128!important;
    border-radius:18px!important;
    background:linear-gradient(145deg,#fffdfa,#f7fbff)!important;
    box-shadow:0 24px 56px rgba(29,60,94,.16)!important;
    backdrop-filter:blur(12px)!important;
    z-index:10018!important;
  }
  html[data-celda-design="sgi"] body #celda-action-banner.collapsed{
    left:auto!important;right:18px!important;top:74px!important;transform:none!important;
    width:min(340px,calc(100vw - 290px))!important;max-width:340px!important;
    border-radius:16px!important;padding:10px 12px!important;
  }
}
html[data-celda-design="sgi"] body #celda-action-banner .cab-row{align-items:flex-start!important;gap:12px!important;}
html[data-celda-design="sgi"] body #celda-action-banner .cab-icon{
  width:42px!important;height:42px!important;flex:0 0 42px!important;border-radius:14px!important;
  background:#fff4df!important;color:#b97809!important;box-shadow:inset 0 0 0 1px #efd8a9!important;
}
html[data-celda-design="sgi"] body #celda-action-banner .cab-kicker{color:#ad7413!important;font-size:9px!important;letter-spacing:.14em!important;}
html[data-celda-design="sgi"] body #celda-action-banner .cab-title{color:#173958!important;font-size:15px!important;line-height:1.25!important;}
html[data-celda-design="sgi"] body #celda-action-banner .cab-text{color:#667d90!important;font-size:11.5px!important;line-height:1.55!important;}
html[data-celda-design="sgi"] body #celda-action-banner .cab-safe{display:block;margin-top:4px;color:#18845f!important;font-weight:850!important;}
html[data-celda-design="sgi"] body #celda-action-banner .cab-meta{color:#8a99a9!important;font-size:9.5px!important;}
html[data-celda-design="sgi"] body #celda-action-banner .cab-chip{background:#edf6fb!important;border-color:#d7e7f0!important;color:#466c82!important;}
html[data-celda-design="sgi"] body #celda-action-banner .cab-actions{gap:8px!important;margin-top:12px!important;}
html[data-celda-design="sgi"] body #celda-action-banner .cab-actions button{
  min-height:38px!important;padding:8px 12px!important;border-radius:11px!important;border:1px solid #d6e3ed!important;background:#fff!important;color:#31536e!important;font-size:10.5px!important;box-shadow:none!important;
}
html[data-celda-design="sgi"] body #celda-action-banner .cab-actions button.primary{
  background:linear-gradient(180deg,#328bc6,#287dad)!important;border-color:#287dad!important;color:#fff!important;
}

/* --------------------------------------------------------------------------
   Conflicto de edición: fidelidad al mockup + comparación funcional intacta
   -------------------------------------------------------------------------- */
html[data-celda-design="sgi"] body #celda-conflict-overlay{
  background:rgba(24,42,63,.50)!important;
  backdrop-filter:blur(7px)!important;
  z-index:11000!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog{
  width:min(760px,calc(100vw - 30px))!important;
  max-height:min(86vh,780px)!important;
  border:1px solid #dbe6f1!important;
  border-radius:24px!important;
  background:#fff!important;
  box-shadow:0 34px 100px rgba(9,29,51,.30)!important;
  overflow:hidden!important;
  color:#203f5d!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-head{
  display:grid!important;
  grid-template-columns:58px minmax(0,1fr) auto!important;
  gap:14px!important;
  align-items:center!important;
  padding:22px 24px!important;
  background:linear-gradient(180deg,#f8fbff,#eef5fb)!important;
  border-bottom:1px solid #dfe9f3!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-head-icon{
  width:54px!important;height:54px!important;border-radius:18px!important;
  background:#fff3dc!important;color:#b9790c!important;
  box-shadow:inset 0 0 0 1px #efd7a4!important;
  font-size:22px!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-eyebrow{color:#ad7413!important;font-size:9px!important;letter-spacing:.15em!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog h2{margin-top:2px!important;color:#163858!important;font-size:21px!important;line-height:1.2!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-head p{margin-top:5px!important;color:#70859a!important;font-size:11.5px!important;line-height:1.5!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-status{
  align-self:start!important;margin-top:0!important;padding:6px 10px!important;border-radius:999px!important;
  border:1px solid #efd39c!important;background:#fff7e8!important;color:#93620d!important;font-size:9.5px!important;font-weight:850!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-scroll-body{padding:18px 22px 2px!important;background:#fff!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-summary{
  display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important;margin:0 0 10px!important;padding:0!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-summary b{color:#17395a!important;font-size:11.5px!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-summary span{color:#8293a5!important;font-size:10.5px!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-compare-head{
  display:grid!important;grid-template-columns:190px 1fr 1fr!important;
  border:1px solid #dfe8f1!important;border-radius:13px 13px 0 0!important;
  background:#f4f8fc!important;color:#687f95!important;overflow:hidden!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-diff-list{
  border:1px solid #dfe8f1!important;border-top:0!important;border-radius:0 0 13px 13px!important;overflow:hidden!important;background:#fff!important;box-shadow:none!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-diff-row{grid-template-columns:190px 1fr 1fr!important;background:#fff!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-diff-label{background:#f8fafc!important;color:#577087!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-diff-value span{border-radius:9px!important;padding:8px 10px!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-diff-value.local span{background:#eaf5ff!important;color:#246fb2!important;border-left:3px solid #2d86d9!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-diff-value.server span{background:#fff4e5!important;color:#9f6812!important;border-left:3px solid #d99a26!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-version-meta{
  display:grid!important;grid-template-columns:auto 1fr 1fr!important;gap:0!important;margin:12px 0!important;border:1px solid #e0e9f2!important;border-radius:13px!important;background:#f9fbfd!important;overflow:hidden!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-version-meta>*{padding:10px 12px!important;border-right:1px solid #e5edf4!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-version-meta>*:last-child{border-right:0!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-decision-note{
  margin:0 0 16px!important;padding:12px 13px!important;border:1px solid #e5edf4!important;border-radius:13px!important;background:#fbfcfe!important;color:#71869a!important;font-size:10.5px!important;line-height:1.5!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-actions{
  display:flex!important;justify-content:flex-end!important;gap:9px!important;flex-wrap:wrap!important;
  padding:14px 22px 20px!important;border-top:1px solid #e2eaf3!important;background:#f8fafc!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-actions button{
  min-height:42px!important;padding:9px 14px!important;border-radius:12px!important;border:1px solid #d4e1ec!important;background:#fff!important;color:#31536e!important;font-size:10.5px!important;font-weight:780!important;box-shadow:none!important;transform:none!important;
}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-actions button.primary{background:linear-gradient(180deg,#348ce2,#287dd3)!important;border-color:#287dd3!important;color:#fff!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-actions button.danger{background:#fff6f7!important;border-color:#f0cfd4!important;color:#c74a5a!important;}

/* Toasts / estados transitorios */
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note{
  border-radius:16px!important;border:1px solid #dce7f1!important;background:#fff!important;box-shadow:0 20px 48px rgba(26,57,91,.16)!important;
}

@media (max-width:760px){
  html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu{top:58px!important;right:8px!important;left:8px!important;width:auto!important;max-height:calc(100dvh - 72px)!important;}
  html[data-celda-design="sgi"] body #celda-action-banner,
  html[data-celda-design="sgi"] body #celda-action-banner.collapsed{left:8px!important;right:8px!important;top:62px!important;width:auto!important;max-width:none!important;transform:none!important;}
  html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-head{grid-template-columns:48px 1fr!important;padding:16px!important;}
  html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-status{grid-column:1/-1!important;justify-self:start!important;}
  html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-compare-head{display:none!important;}
  html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-diff-row{display:block!important;}
  html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-version-meta{grid-template-columns:1fr!important;}
  html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-version-meta>*{border-right:0!important;border-bottom:1px solid #e5edf4!important;}
  html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-actions{flex-direction:column!important;}
  html[data-celda-design="sgi"] body #celda-conflict-overlay #celda-conflict-dialog .ccd-actions button{width:100%!important;}
}

/* ========================================================================== 
   BLOQUE 4.7 · coherencia funcional del menú + conflicto visual definitivo
   ========================================================================== */

/* Topbar: el botón de concurrencia debe ser visible incluso sobre fondo blanco. */
@media (min-width:761px){
  html[data-celda-design="sgi"] body #celda-context-hub{right:278px!important;}
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-button{
    background:#f4f9ff!important;
    border-color:#cfe1f3!important;
    color:#236cba!important;
    box-shadow:0 3px 12px rgba(37,104,174,.07)!important;
  }
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-button:hover,
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-button:focus-visible,
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-button[aria-expanded="true"]{
    background:#eaf4ff!important;
    border-color:#9fc6eb!important;
    color:#145ba6!important;
  }
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-glyph{
    color:#236cba!important;
    font-size:17px!important;
    font-weight:900!important;
    text-shadow:none!important;
  }
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-label{
    color:#236cba!important;
    font-weight:850!important;
  }
  html[data-celda-design="sgi"] body #celda-context-hub .cch-collaboration-button .cch-badge{
    background:#ed9f12!important;
    color:#fff!important;
    border:2px solid #fff!important;
    box-shadow:0 2px 7px rgba(176,111,0,.18)!important;
  }
}
@media (max-width:1180px) and (min-width:761px){
  html[data-celda-design="sgi"] body #celda-context-hub{right:232px!important;}
}

/* Acciones principales antiguas en cobre pasan al azul canónico del sistema. */
html[data-celda-design="sgi"] #erp-root .btn.copper,
html[data-celda-design="sgi"] #erp-root button.btn.copper{
  background:linear-gradient(180deg,#3188ee 0%,#2477df 100%)!important;
  border-color:#2477df!important;
  color:#fff!important;
  box-shadow:0 5px 13px rgba(36,119,223,.18)!important;
}
html[data-celda-design="sgi"] #erp-root .btn.copper:hover,
html[data-celda-design="sgi"] #erp-root button.btn.copper:hover{
  background:linear-gradient(180deg,#2b80e7 0%,#1f69cb 100%)!important;
  border-color:#1f69cb!important;
  color:#fff!important;
}

/* Iconografía consistente y no repetida para la cuenta. */
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-icon,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-mini-icon,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-icon{
  --cs-mask:none;
  position:relative;
  color:transparent!important;
  font-size:0!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-icon::before,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-mini-icon::before,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-icon::before{
  content:"";
  width:17px;height:17px;display:block;
  background:currentColor;
  -webkit-mask:var(--cs-mask) center/contain no-repeat;
  mask:var(--cs-mask) center/contain no-repeat;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-icon::before{color:#587a9c;background:#587a9c;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-mini-icon::before{color:#52779d;background:#52779d;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-icon::before{color:#52779d;background:#52779d;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-profile{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4' fill='black'/%3E%3Cpath d='M4.5 21a7.5 7.5 0 0 1 15 0' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-preferences{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 7h10M18 7h2M4 17h4M12 17h8M14 4v6M8 14v6'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-security{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 20 6v5c0 5-3.3 8.1-8 10-4.7-1.9-8-5-8-10V6z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-password{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='15' r='4'/%3E%3Cpath d='m11 12 8-8M15 4h4v4M5 18l-2 2'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-logout{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 5H5v14h5M14 8l4 4-4 4M18 12H9'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-camera{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M4 7h4l1.5-2h5L16 7h4v12H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-image{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Ccircle cx='8.5' cy='9' r='1.5' fill='black' stroke='none'/%3E%3Cpath d='m5 17 4.5-4.5 3 3L15 13l4 4'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-edit{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20h4l11-11-4-4L4 16zM13.5 6.5l4 4'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-interface{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='14' rx='2'/%3E%3Cpath d='M8 22h8M12 18v4'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-sound{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M5 9v6h4l5 4V5L9 9zM18 9a4 4 0 0 1 0 6M20.5 6.5a8 8 0 0 1 0 11'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-timer{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M9 2h6M12 13l3-2'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-lock{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-role{--cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3'/%3E%3Cpath d='M3 20a6 6 0 0 1 12 0M16 11l2 2 4-4'/%3E%3C/svg%3E");}

html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-menu>button .cs-quick-icon{
  width:36px!important;height:36px!important;border-radius:12px!important;
  background:#eef4fb!important;display:grid!important;place-items:center!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-menu>button.danger .cs-quick-icon{
  background:#ffedf0!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-menu>button.danger .cs-quick-icon::before{
  background:#d94d60!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-menu>button:hover .cs-quick-icon::before,
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-menu>button:focus-visible .cs-quick-icon::before{
  background:#236bb8!important;
}

html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-note{
  display:grid;grid-template-columns:38px minmax(0,1fr);gap:10px;align-items:center;
  margin-top:10px;padding:11px 12px;border:1px solid #e1eaf3;border-radius:14px;background:#f8fbfd;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-note .cs-quick-icon{
  width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:#edf4fb;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-note b{display:block;color:#18395d;font-size:11.8px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-profile-note small{display:block;margin-top:3px;color:#758a9e;font-size:10px;line-height:1.4;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-hint{
  margin-top:11px;padding:10px 11px;border-radius:12px;background:#f5f8fb;border:1px solid #e5edf5;color:#71869b;font-size:9.7px;line-height:1.5;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-action-grid>button .cs-mini-icon{
  width:32px;height:32px!important;display:grid;place-items:center;border-radius:10px;background:#eef5fc!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-action-grid>button .cs-mini-icon::before{background:#52779d!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-icon{
  width:36px!important;height:36px!important;display:grid!important;place-items:center!important;border-radius:11px!important;background:#eef5fc!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-setting-icon::before{background:#52779d!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-status{
  display:grid;gap:8px;margin-top:10px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-status>div{
  display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:10px;align-items:center;
  padding:10px 11px;border:1px solid #e1eaf3;border-radius:14px;background:#fff;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-status .cs-quick-icon{
  width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:#eef5fc;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-status>div>span:nth-child(2) b{display:block;color:#18395d;font-size:11.4px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-status>div>span:nth-child(2) small{display:block;margin-top:2px;color:#7b8ea2;font-size:9.3px;line-height:1.35;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-security-status>div>em{max-width:92px;text-align:right;color:#315b7e;font-size:10.3px;font-style:normal;font-weight:800;}

/* Conflicto: composición claramente distinta y más cercana al mockup aprobado. */
html[data-celda-design="sgi"] body #celda-conflict-overlay{
  display:grid!important;place-items:center!important;padding:26px!important;
  background:rgba(28,43,60,.48)!important;
  backdrop-filter:blur(7px)!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog{
  width:min(650px,calc(100vw - 40px))!important;
  max-height:min(88vh,760px)!important;
  border:1px solid #dce6f0!important;
  border-radius:22px!important;
  background:#fff!important;
  box-shadow:0 34px 90px rgba(14,31,49,.28)!important;
  overflow:hidden!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-hero{
  position:relative;display:flex;flex-direction:column;align-items:center;text-align:center;
  padding:28px 34px 22px!important;
  border-bottom:1px solid #e8eef5;
  background:linear-gradient(180deg,#fbfdff 0%,#f5f9fd 100%)!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-hero-icon{
  width:58px;height:58px;display:grid;place-items:center;border-radius:50%;
  background:#fff4df;color:#c88412;font-size:25px;font-weight:900;
  border:1px solid #f0d397;box-shadow:0 8px 18px rgba(190,127,16,.10);
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-eyebrow{
  margin-top:12px;color:#b2750d!important;font-size:9px!important;font-weight:900!important;letter-spacing:.15em!important;text-transform:uppercase;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-hero h2{
  max-width:520px;margin:6px auto 0!important;color:#17395d!important;font-size:21px!important;line-height:1.22!important;font-weight:800!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-hero p{
  max-width:510px;margin:7px auto 0!important;color:#71869a!important;font-size:11.2px!important;line-height:1.5!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-status{
  position:absolute;right:18px;top:18px;padding:6px 10px!important;border-radius:999px!important;
  background:#fff7e8!important;border:1px solid #efcf8b!important;color:#9b680d!important;font-size:9px!important;font-weight:850!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-scroll-body{
  padding:16px 20px 0!important;overflow:auto!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-card{
  display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:11px;align-items:center;
  padding:11px 12px;margin-bottom:12px;border:1px solid #e1eaf3;border-radius:14px;background:#f8fbfd;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-avatar{
  width:44px;height:44px;display:grid;place-items:center;border-radius:50%;background:#58779d;color:#fff;font-size:13px;font-weight:850;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-copy b{display:block;color:#18395d;font-size:11.8px;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-copy small{display:block;margin-top:2px;color:#72879b;font-size:9.6px;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-copy em{display:block;margin-top:2px;color:#98a6b4;font-size:8.8px;font-style:normal;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-version{
  padding:5px 8px;border-radius:999px;background:#eef4fb;color:#58738e;font-size:9px;font-weight:850;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-question{
  display:flex;align-items:baseline;gap:8px;margin:0 0 9px;padding:0 2px;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-question b{color:#18395d;font-size:11.5px;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-question span{color:#7b8fa3;font-size:9.8px;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-compare-head{
  grid-template-columns:145px 1fr 1fr!important;border-radius:12px 12px 0 0!important;background:#f1f6fb!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-list{
  border-radius:0 0 14px 14px!important;border-top:0!important;box-shadow:none!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-row{
  grid-template-columns:145px 1fr 1fr!important;min-height:58px!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-label{
  display:flex;align-items:center;background:#fbfcfe!important;color:#526b83!important;font-size:10.5px!important;font-weight:800!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-value{
  display:flex;align-items:center;padding:9px!important;background:#fff!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-value small{display:none!important;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-value span{
  width:100%;padding:8px 9px!important;border-radius:9px!important;font-size:11px!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-value.local span{
  background:#eaf4ff!important;color:#1e6cb8!important;border:0!important;box-shadow:inset 3px 0 0 #2f87d9!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-value.server span{
  background:#fff4e4!important;color:#a16b12!important;border:0!important;box-shadow:inset 3px 0 0 #d79a2b!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-decision-note{
  margin:12px 0 15px!important;padding:10px 12px!important;border:1px solid #e5edf5!important;border-radius:12px!important;background:#f8fbfd!important;color:#71869b!important;font-size:9.6px!important;line-height:1.45!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-decision-note b{color:#234b70!important;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actions{
  display:grid!important;grid-template-columns:1fr 1.25fr 1fr!important;gap:9px!important;padding:14px 20px 20px!important;border-top:1px solid #e8eef4!important;background:#fff!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actions button{
  min-height:42px!important;border-radius:12px!important;font-size:10px!important;font-weight:800!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actions button.danger{
  background:#fff5f6!important;border-color:#efccd1!important;color:#c84657!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actions button.primary{
  background:linear-gradient(180deg,#318aec,#2478dc)!important;border-color:#2478dc!important;color:#fff!important;box-shadow:0 5px 13px rgba(36,120,220,.18)!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-state-note{
  margin-bottom:12px!important;border-radius:13px!important;
}

@media (max-width:700px){
  html[data-celda-design="sgi"] body #celda-conflict-overlay{padding:10px!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog{width:100%!important;max-height:calc(100dvh - 20px)!important;border-radius:18px!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-hero{padding:24px 18px 18px!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-status{position:static;margin-top:10px;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-card{grid-template-columns:40px 1fr!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-version{grid-column:2;justify-self:start;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-compare-head{display:none!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-row{display:block!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-label{padding:8px 9px!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-value{border-top:1px solid #edf2f6!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actions{grid-template-columns:1fr!important;}
}
html[data-celda-design="sgi"] body #celda-action-banner .cab-actions button.primary{
  background:linear-gradient(180deg,#3189ea,#2478dc)!important;
  border-color:#2478dc!important;
  color:#fff!important;
  box-shadow:0 5px 14px rgba(36,120,220,.16)!important;
}

/* ========================================================================== 
   UI BLOQUE 4.8 · Ventanas y estados globales
   ========================================================================== */

/* Confirmaciones visuales CELDA (reemplazo progresivo de window.confirm). */
html[data-celda-design="sgi"] body .celda-global-overlay{
  position:fixed;inset:0;z-index:100080;display:grid;place-items:center;padding:20px;
  background:rgba(20,34,50,.44);backdrop-filter:blur(8px);
  opacity:0;transition:opacity .16s ease;
}
html[data-celda-design="sgi"] body .celda-global-overlay.visible{opacity:1;}
html[data-celda-design="sgi"] body .celda-global-overlay.leaving{opacity:0;}
html[data-celda-design="sgi"] body .celda-global-dialog{
  position:relative;width:min(440px,calc(100vw - 36px));padding:28px 28px 24px;
  border:1px solid #dce7f2;border-radius:22px;background:#fff;
  box-shadow:0 34px 90px rgba(11,31,53,.26);text-align:center;
  transform:translateY(6px) scale(.985);transition:transform .16s ease;
}
html[data-celda-design="sgi"] body .celda-global-overlay.visible .celda-global-dialog{transform:none;}
html[data-celda-design="sgi"] body .celda-global-close{
  position:absolute;right:14px;top:12px;width:30px;height:30px;border:0;border-radius:50%;
  background:transparent;color:#7890a5;font-size:20px;cursor:pointer;
}
html[data-celda-design="sgi"] body .celda-global-close:hover{background:#f1f5f9;color:#244c75;}
html[data-celda-design="sgi"] body .celda-global-icon{
  width:58px;height:58px;display:grid;place-items:center;margin:0 auto 13px;border-radius:50%;
  background:#fff5df;border:1px solid #efd59b;color:#bd7b0d;font-size:24px;font-weight:900;
}
html[data-celda-design="sgi"] body .celda-global-overlay.tone-danger .celda-global-icon{
  background:#fff0f2;border-color:#f5ccd3;color:#da4e5f;
}
html[data-celda-design="sgi"] body .celda-global-overlay.tone-info .celda-global-icon{
  background:#eef6ff;border-color:#d6e6f7;color:#2878d6;
}
html[data-celda-design="sgi"] body .celda-global-kicker{
  display:block;color:#8b9caf;font-size:9px;font-weight:900;letter-spacing:.13em;text-transform:uppercase;
}
html[data-celda-design="sgi"] body .celda-global-dialog h2{
  margin:6px 0 0;color:#17395d;font-size:21px;line-height:1.2;font-weight:800;
}
html[data-celda-design="sgi"] body .celda-global-dialog p{
  margin:9px auto 0;max-width:350px;color:#6f8499;font-size:12px;line-height:1.55;
}
html[data-celda-design="sgi"] body .celda-global-detail{
  margin-top:15px;padding:11px 12px;border:1px solid #e5edf5;border-radius:13px;
  background:#f7fafc;color:#637b92;font-size:11px;line-height:1.5;text-align:left;
}
html[data-celda-design="sgi"] body .celda-global-actions{
  display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:20px;
}
html[data-celda-design="sgi"] body .celda-global-actions button{
  min-height:44px;border:1px solid #d6e2ee;border-radius:12px;background:#fff;color:#284d72;
  font-size:11px;font-weight:800;cursor:pointer;
}
html[data-celda-design="sgi"] body .celda-global-actions button:hover{background:#f6faff;border-color:#bed3e7;}
html[data-celda-design="sgi"] body .celda-global-actions button.primary{
  background:linear-gradient(180deg,#3289ee,#2577dc);border-color:#2577dc;color:#fff;
  box-shadow:0 6px 14px rgba(37,119,220,.17);
}
html[data-celda-design="sgi"] body .celda-global-actions button.primary.danger{
  background:linear-gradient(180deg,#ee5e6d,#db4658);border-color:#db4658;
  box-shadow:0 6px 14px rgba(219,70,88,.16);
}

/* Conflicto real de versión: acercado al lenguaje del mockup sin ocultar datos útiles. */
html[data-celda-design="sgi"] body #celda-conflict-dialog{
  width:min(560px,calc(100vw - 40px))!important;
  max-height:min(88vh,720px)!important;
  border-radius:24px!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-close{
  position:absolute;z-index:5;right:15px;top:14px;width:32px;height:32px;border:0!important;border-radius:50%!important;
  background:transparent!important;color:#71889f!important;font-size:20px!important;box-shadow:none!important;cursor:pointer;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-close:hover{background:#eef4fa!important;color:#245f9d!important;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-hero{
  padding:28px 28px 18px!important;background:#fff!important;border-bottom:0!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-hero-icon{
  width:56px;height:56px;margin-bottom:3px!important;border-radius:50%!important;
  background:#fff4df!important;border:1px solid #efd398!important;color:#c98411!important;
  box-shadow:0 6px 16px rgba(197,132,17,.08)!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-eyebrow{
  margin-top:10px!important;color:#b4750c!important;font-size:9px!important;letter-spacing:.14em!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-hero h2{
  margin-top:6px!important;max-width:430px!important;font-size:20px!important;line-height:1.23!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-hero p{
  max-width:430px!important;margin-top:7px!important;font-size:11px!important;line-height:1.5!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-scroll-body{padding:0 22px 0!important;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-card{
  grid-template-columns:46px minmax(0,1fr) auto!important;margin:2px 0 12px!important;padding:11px 12px!important;
  border-radius:15px!important;background:#f7faff!important;border-color:#dfe9f3!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actor-avatar{
  width:46px!important;height:46px!important;background:linear-gradient(135deg,#587ba8,#3d6699)!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-change-details{
  margin:0 0 12px;border:1px solid #e0e9f2;border-radius:15px;background:#fff;overflow:hidden;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-change-details>summary{
  display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 13px;cursor:pointer;
  list-style:none;background:#f8fbfd;color:#244866;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-change-details>summary::-webkit-details-marker{display:none;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-change-details>summary b{display:block;font-size:11px;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-change-details>summary small{display:block;margin-top:2px;color:#8192a3;font-size:9.5px;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-summary-chevron{color:#6d8499;font-size:16px;transition:transform .15s ease;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-change-details[open] .ccd-summary-chevron{transform:rotate(180deg);}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-change-content{padding:0 10px 10px;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-compare-head{
  grid-template-columns:120px 1fr 1fr!important;border-radius:10px 10px 0 0!important;font-size:9px!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-row{grid-template-columns:120px 1fr 1fr!important;min-height:52px!important;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-label{font-size:9.8px!important;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-value span{padding:7px 8px!important;font-size:10px!important;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-decision-note{
  display:block!important;margin:0 0 14px!important;padding:11px 12px!important;border-radius:13px!important;
  background:#f7fafc!important;border-color:#e2ebf3!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-decision-note b{display:block;font-size:10.7px!important;color:#244967!important;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-decision-note span{display:block;margin-top:3px;color:#788da1;font-size:9.6px;line-height:1.45;}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actions{
  grid-template-columns:1fr 1.18fr 1fr!important;padding:14px 22px 20px!important;background:#fbfdff!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actions button{min-height:42px!important;border-radius:12px!important;font-size:9.8px!important;}

/* Toasts / éxito / error: más cercanos a las tarjetas de estado del mockup. */
html[data-celda-design="sgi"] body #celda-notification-stack{width:min(370px,calc(100vw - 24px))!important;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note{
  grid-template-columns:34px minmax(0,1fr) 24px!important;gap:10px!important;align-items:center!important;
  padding:11px 11px!important;border-radius:16px!important;background:#fff!important;
  border:1px solid #dfe8f1!important;box-shadow:0 18px 44px rgba(18,49,82,.14)!important;
}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note-icon{
  width:34px!important;height:34px!important;margin:0!important;display:grid!important;place-items:center!important;
  border-radius:50%!important;background:#eef4fb!important;position:relative;
}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note-icon::after{
  content:'i';color:#4272a2;font-size:14px;font-weight:900;
}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note.success .celda-note-icon{background:#e8f8f0!important;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note.success .celda-note-icon::after{content:'✓';color:#159367;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note.warning .celda-note-icon{background:#fff5df!important;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note.warning .celda-note-icon::after{content:'!';color:#c98513;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note.error .celda-note-icon{background:#ffedf0!important;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note.error .celda-note-icon::after{content:'!';color:#d64b5c;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note-body b{
  display:block;color:#17395d;font-size:11.5px;line-height:1.25;
}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note-body span{
  display:block;margin-top:3px;color:#71869a;font-size:10px;line-height:1.45;
}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note.success{border-color:#cfeade!important;background:#fbfffd!important;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note.warning{border-color:#efd9a7!important;background:#fffdf8!important;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note.error{border-color:#f0cbd1!important;background:#fffafb!important;}
html[data-celda-design="sgi"] body #celda-notification-stack .celda-note-close{align-self:start!important;margin-top:-1px!important;color:#8193a6!important;}

/* Empty states: menos texto perdido y más señal visual. */
html[data-celda-design="sgi"] body #erp-root .empty{
  position:relative;min-height:92px;display:flex;align-items:center;justify-content:center;text-align:center;
  padding:48px 18px 18px!important;color:#8192a5!important;background:linear-gradient(180deg,#fbfdff,#f8fafc)!important;
  border:1px dashed #dfe8f1!important;border-radius:14px!important;
}
html[data-celda-design="sgi"] body #erp-root .empty::before{
  content:'';position:absolute;top:15px;left:50%;width:24px;height:28px;transform:translateX(-50%);
  border:2px solid #7ca1cc;border-radius:5px;background:#eef5fd;
  box-shadow:8px 7px 0 -5px #eef5fd;
}
html[data-celda-design="sgi"] body #erp-root .empty::after{
  content:'';position:absolute;top:23px;left:50%;width:11px;height:2px;transform:translateX(-50%);
  background:#7ca1cc;box-shadow:0 5px 0 #7ca1cc;
}

/* Loading / sincronización. */
html[data-celda-design="sgi"] body .cs-context-loading,
html[data-celda-design="sgi"] body .celda-login-spinner{
  color:#55738f!important;
}
html[data-celda-design="sgi"] body .cs-context-loading{
  position:relative;padding:15px 14px 15px 46px!important;border:1px solid #e0e9f2;border-radius:14px;background:#f8fbfd;
}
html[data-celda-design="sgi"] body .cs-context-loading::before{
  content:'';position:absolute;left:15px;top:50%;width:19px;height:19px;margin-top:-10px;border-radius:50%;
  border:3px solid #dce9f6;border-top-color:#2f83df;animation:celdaSgiSpin .8s linear infinite;
}
@keyframes celdaSgiSpin{to{transform:rotate(360deg)}}

/* Sesión expirada / cuenta bloqueada: modal de reingreso más próximo al mockup. */
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="expired"] .celda-login-shell,
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-shell{
  width:min(460px,calc(100vw - 32px))!important;grid-template-columns:1fr!important;border-radius:24px!important;overflow:hidden!important;
  box-shadow:0 36px 96px rgba(7,24,42,.30)!important;
}
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="expired"] .celda-login-brand,
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-brand{display:none!important;}
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="expired"] .celda-login-form-panel,
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-form-panel{
  padding:30px 30px 26px!important;background:#fff!important;
}
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state] .celda-login-heading{text-align:center;}
html[data-celda-design="sgi"] body .celda-login-state-icon{
  width:62px;height:62px;margin:0 auto 12px;border-radius:50%;position:relative;
  background:#fff4df;border:1px solid #efd8a8;
}
html[data-celda-design="sgi"] body .celda-login-state-icon::before{
  content:'';position:absolute;left:21px;top:26px;width:19px;height:16px;border:2px solid #c78413;border-radius:4px;
}
html[data-celda-design="sgi"] body .celda-login-state-icon::after{
  content:'';position:absolute;left:25px;top:17px;width:11px;height:11px;border:2px solid #c78413;border-bottom:0;border-radius:8px 8px 0 0;
}
html[data-celda-design="sgi"] body .celda-login-state-icon.locked{background:#ffedf0;border-color:#f2cbd1;}
html[data-celda-design="sgi"] body .celda-login-state-icon.locked::before,
html[data-celda-design="sgi"] body .celda-login-state-icon.locked::after{border-color:#d64b5c;}
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="expired"] .celda-login-heading h2,
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-heading h2{
  color:#17395d!important;font-size:23px!important;
}
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="expired"] .celda-login-heading p,
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-heading p{
  max-width:350px;margin-inline:auto;color:#71869a!important;
}
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="expired"] .celda-login-notice,
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-notice{
  border-radius:13px!important;margin-top:14px!important;
}

@media (max-width:700px){
  html[data-celda-design="sgi"] body .celda-global-actions{grid-template-columns:1fr!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog{width:100%!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-compare-head{display:none!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-diff-row{display:block!important;}
  html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-actions{grid-template-columns:1fr!important;}
}

/* ========================================================================== 
   UI BLOQUE 4.9 · Coherencia del panel personal + sonidos por evento
   ========================================================================== */
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-sounds{
  --cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 13v-2M8 16V8M12 19V5M16 16V8M20 13v-2'/%3E%3C/svg%3E");
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-sound-external{
  --cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h12M12 6l6 6-6 6'/%3E%3Cpath d='M4 5v14'/%3E%3C/svg%3E");
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-sound-conflict{
  --cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h7a4 4 0 0 1 4 4v1'/%3E%3Cpath d='m15 9 3 3 3-3'/%3E%3Cpath d='M17 17H10a4 4 0 0 1-4-4v-1'/%3E%3Cpath d='m9 15-3-3-3 3'/%3E%3C/svg%3E");
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .icon-sound-system{
  --cs-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9'/%3E%3Cpath d='M10 21h4'/%3E%3C/svg%3E");
}

html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-sounds{
  width:352px!important;
  max-height:min(78vh,700px)!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:11px 12px;margin-bottom:9px;
  border:1px solid #dfe8f2;border-radius:14px;background:#fff;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master>div{
  display:grid;grid-template-columns:36px minmax(0,1fr);gap:10px;align-items:center;min-width:0;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master>div>span:nth-child(2) b{
  display:block;color:#18395d;font-size:11.8px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master>div>span:nth-child(2) small{
  display:block;margin-top:2px;color:#7d90a3;font-size:9.5px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master>button{
  min-height:34px!important;width:auto!important;padding:6px 10px!important;
  border:1px solid #d5e3f0!important;border-radius:10px!important;
  background:#f7fbff!important;color:#2d6cab!important;font-size:10px!important;font-weight:800!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-field.sound-profile{
  margin-bottom:9px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-volume{
  display:block;padding:11px 12px;margin-bottom:10px;
  border:1px solid #e0e9f2;border-radius:14px;background:#fff;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-volume>span{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-volume b{color:#18395d;font-size:11.8px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-volume output{color:#2d6cab;font-size:10.5px;font-weight:800;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-volume input[type="range"]{width:100%;margin-top:9px;accent-color:#2d7fe0;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-events{display:grid;gap:9px;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event{
  padding:11px;border:1px solid #e0e9f2;border-radius:15px;background:#fff;
  box-shadow:0 4px 14px rgba(33,69,105,.035);
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event-head{
  display:grid;grid-template-columns:36px minmax(0,1fr) 32px;gap:9px;align-items:start;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event-icon{
  width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:#eef5fc;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event-icon::before{
  content:"";width:17px;height:17px;display:block;background:#52779d;
  -webkit-mask:var(--cs-mask) center/contain no-repeat;mask:var(--cs-mask) center/contain no-repeat;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event-head>div b{
  display:block;color:#18395d;font-size:11.4px;line-height:1.25;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event-head>div small{
  display:block;margin-top:3px;color:#7b8fa2;font-size:9.1px;line-height:1.35;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event-head>button{
  width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important;padding:0!important;
  display:grid!important;place-items:center!important;grid-template-columns:1fr!important;
  border:1px solid #d6e4f1!important;border-radius:10px!important;background:#f7fbff!important;color:#286eb7!important;font-size:11px!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event-head>button:disabled{opacity:.42!important;cursor:not-allowed!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-source{
  display:grid;grid-template-columns:auto minmax(0,1fr);gap:9px;align-items:center;margin-top:9px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-source>span{color:#8092a5;font-size:9.4px;font-weight:750;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-source select{
  min-height:34px;border:1px solid #d9e5f1;border-radius:10px;background:#fff;color:#315674;font-size:10px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-file{
  display:flex;gap:6px;margin-top:8px;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-file>button{
  min-height:34px!important;padding:6px 9px!important;border-radius:10px!important;
  border:1px solid #d9e5f1!important;background:#f8fbfe!important;color:#476b8e!important;
  font-size:9.7px!important;font-weight:750!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-file>button:first-child{flex:1 1 auto!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-file>button.remove{
  width:34px!important;min-width:34px!important;padding:0!important;flex:0 0 34px!important;
  color:#c94c5d!important;background:#fff5f6!important;border-color:#f0d2d7!important;font-size:15px!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-status{
  display:block;margin-top:7px;color:#6c8196;font-size:9px;line-height:1.35;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-status.error{color:#c34c5c;}

/* Concurrencia repetida: aviso compacto, no una segunda tarjeta dominante. */
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-state-note.compact{
  display:grid!important;grid-template-columns:30px minmax(0,1fr)!important;gap:9px!important;align-items:center!important;
  margin:0 0 10px!important;padding:8px 10px!important;
  border:1px solid #f0d8a3!important;border-radius:12px!important;background:#fffaf0!important;
  color:#8c6218!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-state-note.compact .ccd-state-icon{
  width:28px!important;height:28px!important;display:grid!important;place-items:center!important;
  border-radius:9px!important;background:#fff3d8!important;color:#bd7b0c!important;font-size:13px!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-state-note.compact b{
  display:inline!important;color:#80560f!important;font-size:10.5px!important;
}
html[data-celda-design="sgi"] body #celda-conflict-dialog .ccd-state-note.compact span:not(.ccd-state-icon){
  margin-left:5px!important;color:#9b742e!important;font-size:9.4px!important;line-height:1.35!important;
}

@media (max-width:760px){
  html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-account-menu.view-sounds{width:auto!important;max-height:calc(100dvh - 72px)!important;}
  html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event-head{grid-template-columns:34px minmax(0,1fr) 32px;}
}

/* ========================================================================== 
   UI BLOQUE 4.10 · Sesión, sonidos sin parpadeo y limpieza transversal
   ========================================================================== */

/* Sesión expirada / bloqueada: icono de candado real y flujo en dos pasos. */
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="expired"] .celda-login-state-icon,
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-state-icon{
  width:64px!important;height:64px!important;margin:0 auto 12px!important;
  display:grid!important;place-items:center!important;border-radius:50%!important;
  background:#fff7e8!important;border:1px solid #f1d39b!important;
  color:#c27d08!important;box-shadow:0 8px 24px rgba(160,105,8,.08)!important;
}
html[data-celda-design="sgi"] body #celda-login-gate .celda-login-state-icon::before{
  content:""!important;width:30px!important;height:30px!important;display:block!important;
  border:0!important;border-radius:0!important;position:static!important;transform:none!important;
  background:currentColor!important;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='10' width='16' height='11' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat!important;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='10' width='16' height='11' rx='2' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat!important;
}
html[data-celda-design="sgi"] body #celda-login-gate .celda-login-state-icon::after{display:none!important;content:none!important;}
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-state-icon{
  background:#fff0f2!important;border-color:#f2cbd1!important;color:#d64b5c!important;
}
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="expired"] .celda-login-shell,
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-shell{
  width:min(520px,calc(100vw - 28px))!important;border-radius:24px!important;
}
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="expired"] .celda-login-form-panel,
html[data-celda-design="sgi"] body #celda-login-gate[data-auth-state="locked"] .celda-login-form-panel{
  padding:30px!important;
}
html[data-celda-design="sgi"] body .celda-session-expired-actions,
html[data-celda-design="sgi"] body .celda-login-form-actions{
  display:grid;grid-template-columns:1fr 1.2fr;gap:10px;margin-top:16px;
}
html[data-celda-design="sgi"] body .celda-session-expired-actions button,
html[data-celda-design="sgi"] body .celda-login-form-actions button{
  min-height:44px!important;border-radius:12px!important;border:1px solid #cddff0!important;
  background:#fff!important;color:#2a68ad!important;font-weight:800!important;box-shadow:none!important;
}
html[data-celda-design="sgi"] body .celda-session-expired-actions button.primary,
html[data-celda-design="sgi"] body .celda-login-form-actions .celda-login-submit{
  background:linear-gradient(180deg,#338cf2,#2879df)!important;border-color:#2879df!important;color:#fff!important;
  box-shadow:0 7px 18px rgba(40,121,223,.17)!important;
}
html[data-celda-design="sgi"] body .celda-login-form-actions .celda-login-submit{width:100%!important;margin:0!important;}
html[data-celda-design="sgi"] body .celda-login-form-actions button.secondary{color:#56718d!important;background:#f8fbfe!important;}

/* Avatar: iniciales centradas de forma explícita para cualquier usuario sin foto. */
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-avatar{
  display:grid!important;place-items:center!important;overflow:hidden!important;
  background:linear-gradient(145deg,#557bad,#3f689d)!important;color:#fff!important;
  font-family:var(--font-body)!important;font-size:16px!important;font-weight:850!important;line-height:1!important;
  text-align:center!important;letter-spacing:0!important;text-indent:0!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-avatar.large{font-size:18px!important;}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-avatar img{
  display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;border-radius:inherit!important;
}

/* Sonidos: estado maestro inequívoco y controles estables sin reconstruir el panel. */
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master{
  display:grid!important;grid-template-columns:minmax(0,1fr) auto auto!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master.is-on{
  border-color:#bfe5d8!important;background:linear-gradient(180deg,#f4fcf8,#eff9f5)!important;
  box-shadow:inset 4px 0 0 #20a77b!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master.is-off{
  border-color:#dfe7ef!important;background:#f7f9fb!important;box-shadow:inset 4px 0 0 #a5b2c0!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-state{
  display:inline-flex;align-items:center;justify-content:center;align-self:center;
  min-height:24px;padding:4px 8px;border-radius:999px;background:#e8f8f1;color:#16845f;
  font-size:9px;font-weight:850;white-space:nowrap;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master.is-off .cs-quick-sound-state{
  background:#edf1f5;color:#718294;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-master>button.is-on{
  color:#fff!important;background:#2f87e8!important;border-color:#2f87e8!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-event.is-muted{
  opacity:.63;background:#f8fafc!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-file{
  display:grid!important;grid-template-columns:minmax(0,1fr) 34px!important;gap:7px!important;align-items:center!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-file>button:first-child{
  width:100%!important;min-width:0!important;text-align:left!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-file>button.remove{
  width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;padding:0!important;margin:0!important;
  display:grid!important;place-items:center!important;border-radius:10px!important;line-height:1!important;
}
html[data-celda-design="sgi"] body :is(#celda-system-bar,#tp-profile-configuration) .cs-quick-sound-file>input[hidden]{display:none!important;}

/* Cierres X coherentes: dentro de su superficie y siempre centrados. */
html[data-celda-design="sgi"] body :is(#celda-system-panel .cs-close,.celda-global-modal .celda-global-close,#celda-conflict-dialog .ccd-close){
  width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;padding:0!important;
  display:grid!important;place-items:center!important;border-radius:50%!important;line-height:1!important;
}

/* --------------------------------------------------------------------------
   Auditoría transversal de módulos heredados — Línea A
   RR.HH., Programaciones, Auxiliares, Mediciones, Actividad y Respaldos.
   -------------------------------------------------------------------------- */
html[data-celda-design="sgi"] #erp-root .la:not(.la-monthly-card):not(.la-activity-card){
  color:#243f5e!important;
}
html[data-celda-design="sgi"] #erp-root .la>.la-heading{
  margin:0 0 14px!important;padding:0!important;align-items:flex-start!important;
}
html[data-celda-design="sgi"] #erp-root .la>.la-heading h1,
html[data-celda-design="sgi"] #erp-root .la>h1{
  margin:0!important;color:#17395d!important;font-size:27px!important;line-height:1.08!important;letter-spacing:-.025em!important;
}
html[data-celda-design="sgi"] #erp-root .la>p,
html[data-celda-design="sgi"] #erp-root .la>.la-heading+p{
  color:#74879b!important;font-size:11px!important;line-height:1.55!important;
}
html[data-celda-design="sgi"] #erp-root .la h2{margin:20px 0 10px!important;color:#244667!important;font-size:15px!important;}
html[data-celda-design="sgi"] #erp-root .la h3{color:#2d4d6b!important;}
html[data-celda-design="sgi"] #erp-root .la .card,
html[data-celda-design="sgi"] #erp-root .la-editor{
  border:1px solid #e0e8f1!important;border-radius:14px!important;background:#fff!important;
  box-shadow:0 5px 18px rgba(34,67,101,.04)!important;
}
html[data-celda-design="sgi"] #erp-root .la-filters{
  display:grid!important;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))!important;gap:9px!important;
  margin:12px 0!important;padding:12px!important;border:1px solid #e1e9f2!important;border-radius:14px!important;background:#f8fbfe!important;
}
html[data-celda-design="sgi"] #erp-root .la-filters label{font-size:9.5px!important;color:#687e94!important;font-weight:700!important;}
html[data-celda-design="sgi"] #erp-root .la input,
html[data-celda-design="sgi"] #erp-root .la select,
html[data-celda-design="sgi"] #erp-root .la textarea{
  min-height:36px!important;border:1px solid #d9e4ee!important;border-radius:10px!important;background:#fff!important;color:#294660!important;
  padding:8px 10px!important;box-shadow:none!important;
}
html[data-celda-design="sgi"] #erp-root .la :is(input,select,textarea):focus{
  border-color:#72a8e8!important;outline:3px solid rgba(44,126,234,.10)!important;
}
html[data-celda-design="sgi"] #erp-root .la button,
html[data-celda-design="sgi"] #erp-root .la a.btn{
  min-height:34px!important;padding:7px 11px!important;border:1px solid #d4e1ed!important;border-radius:10px!important;
  background:#f8fbff!important;color:#37658f!important;font-size:10px!important;font-weight:760!important;
  box-shadow:none!important;text-decoration:none!important;transition:background .15s ease,border-color .15s ease,color .15s ease,transform .15s ease!important;
}
html[data-celda-design="sgi"] #erp-root .la button:hover,
html[data-celda-design="sgi"] #erp-root .la a.btn:hover{
  border-color:#b9d1e9!important;background:#edf5ff!important;color:#246bb7!important;transform:translateY(-1px)!important;
}
html[data-celda-design="sgi"] #erp-root .la form button[type="submit"],
html[data-celda-design="sgi"] #erp-root .la-editor button[type="submit"]{
  background:linear-gradient(180deg,#3189ef,#2478df)!important;border-color:#2478df!important;color:#fff!important;
  box-shadow:0 4px 12px rgba(36,120,223,.14)!important;
}
html[data-celda-design="sgi"] #erp-root .la .la-actions{
  gap:7px!important;margin:10px 0 14px!important;
}
html[data-celda-design="sgi"] #erp-root .la-scroll{
  margin:10px 0!important;border:1px solid #e3eaf2!important;border-radius:12px!important;background:#fff!important;overflow:auto!important;
}
html[data-celda-design="sgi"] #erp-root .la table{margin:0!important;font-size:10.5px!important;border-collapse:separate!important;border-spacing:0!important;}
html[data-celda-design="sgi"] #erp-root .la th{
  padding:9px 10px!important;background:#f6f9fc!important;color:#657b91!important;font-size:9px!important;font-weight:800!important;
  border-bottom:1px solid #e1e9f1!important;
}
html[data-celda-design="sgi"] #erp-root .la td{padding:9px 10px!important;border-bottom:1px solid #edf1f5!important;color:#29445f!important;}
html[data-celda-design="sgi"] #erp-root .la tbody tr:hover td{background:#f8fbff!important;}
html[data-celda-design="sgi"] #erp-root .la-calendar{
  gap:8px!important;padding:10px!important;border:1px solid #e2eaf2!important;border-radius:14px!important;background:#f8fbfe!important;
}
html[data-celda-design="sgi"] #erp-root .la .la-day{
  min-height:108px!important;border:1px solid #e0e8f1!important;border-radius:11px!important;background:#fff!important;
}
html[data-celda-design="sgi"] #erp-root .la .la-today{border-color:#66a0e3!important;box-shadow:0 0 0 2px rgba(66,133,214,.08)!important;}
html[data-celda-design="sgi"] #erp-root .la-event,
html[data-celda-design="sgi"] #erp-root .la-absence{border-radius:6px!important;background:#f5f8fc!important;padding:5px 6px!important;}
html[data-celda-design="sgi"] body .la-dialog{
  border:1px solid #dce6f0!important;border-radius:20px!important;background:#fff!important;box-shadow:0 28px 80px rgba(20,45,75,.24)!important;
}
html[data-celda-design="sgi"] body .la-dialog::backdrop{background:rgba(25,44,65,.45)!important;backdrop-filter:blur(5px)!important;}

/* Componentes heredados comunes fuera de Línea A. */
html[data-celda-design="sgi"] #erp-root :is(.celda-choice-card,.celda-position-node,.celda-history-list article,.cart-item,.celda-standard-choice){
  border-radius:12px!important;border-color:#e0e8f1!important;background:#fff!important;box-shadow:0 2px 10px rgba(31,66,101,.035)!important;
}
html[data-celda-design="sgi"] #erp-root .celda-choice-card:hover,
html[data-celda-design="sgi"] #erp-root .celda-standard-choice:hover{border-color:#bed4e9!important;background:#f8fbff!important;}
html[data-celda-design="sgi"] #erp-root details>summary{
  border-radius:10px;color:#315878;cursor:pointer;
}
html[data-celda-design="sgi"] #erp-root .celda-danger-link{
  color:#c34c5d!important;border-color:#efd5da!important;background:#fff7f8!important;
}
html[data-celda-design="sgi"] #erp-root .celda-danger-link:hover{background:#ffeff1!important;border-color:#e9bdc5!important;}

@media(max-width:760px){
  html[data-celda-design="sgi"] body .celda-session-expired-actions,
  html[data-celda-design="sgi"] body .celda-login-form-actions{grid-template-columns:1fr!important;}
  html[data-celda-design="sgi"] #erp-root .la-filters{grid-template-columns:1fr!important;}
  html[data-celda-design="sgi"] #erp-root .la>.la-heading h1,
  html[data-celda-design="sgi"] #erp-root .la>h1{font-size:23px!important;}
}

/* Iconos discretos en acciones Línea A: evita botones de texto planos. */
html[data-celda-design="sgi"] #erp-root .la button[data-la]{display:inline-flex!important;align-items:center!important;gap:7px!important;}
html[data-celda-design="sgi"] #erp-root .la button[data-la]::before{
  content:"";width:14px;height:14px;flex:0 0 14px;background:#5c7895;
  -webkit-mask:var(--la-action-icon) center/contain no-repeat;mask:var(--la-action-icon) center/contain no-repeat;
}
html[data-celda-design="sgi"] #erp-root .la button[data-la="refresh"],
html[data-celda-design="sgi"] #erp-root .la button[data-la="range"]{--la-action-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6v6h-6M4 18v-6h6M6.5 8A7 7 0 0 1 18 6l2 2M17.5 16A7 7 0 0 1 6 18l-2-2' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] #erp-root .la button[data-la*="new"],
html[data-celda-design="sgi"] #erp-root .la button[data-la="quick-client"],
html[data-celda-design="sgi"] #erp-root .la button[data-la="add-point"]{--la-action-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] #erp-root .la button[data-la*="edit"],
html[data-celda-design="sgi"] #erp-root .la button[data-la="resources-edit"]{--la-action-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 20h4l11-11-4-4L4 16zM13.5 6.5l4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] #erp-root .la button[data-la="settings"]{--la-action-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M19 13.5v-3l-2-.7a7 7 0 0 0-.8-1.8l.9-1.9-2.1-2.1-1.9.9a7 7 0 0 0-1.8-.8L10.5 2h-3l-.7 2a7 7 0 0 0-1.8.8L3.1 3.9 1 6l.9 1.9a7 7 0 0 0-.8 1.8L-1 10.5v3l2 .7a7 7 0 0 0 .8 1.8L1 18l2.1 2.1 1.9-.9a7 7 0 0 0 1.8.8l.7 2h3l.7-2a7 7 0 0 0 1.8-.8l1.9.9L18 18l-.9-1.9a7 7 0 0 0 .8-1.8z' transform='translate(2)' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] #erp-root .la button[data-la*="detail"],
html[data-celda-design="sgi"] #erp-root .la button[data-la*="history"],
html[data-celda-design="sgi"] #erp-root .la button[data-la="request-open"],
html[data-celda-design="sgi"] #erp-root .la button[data-la^="open-"]{--la-action-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12z' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='12' cy='12' r='2.5' fill='none' stroke='black' stroke-width='2'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] #erp-root .la button[data-la*="certificate"]{--la-action-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h9l3 3v15H6zM15 3v4h4M9 12h6M9 16h6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");}
html[data-celda-design="sgi"] #erp-root .la button[data-la="editor-cancel"]::before{display:none!important;}
html[data-celda-design="sgi"] #erp-root .la button[data-la]:hover::before{background:#246bb7;}
html[data-celda-design="sgi"] #erp-root .la form button[type="submit"]::before{background:#fff!important;}

/* ========================================================================== 
   BLOQUE 4.11 · Calendario, respaldos, desplegables y densidad de cotizaciones
   ========================================================================== */

/* Línea A: no dibujar un cuadrado genérico cuando una acción no tiene icono asignado. */
html[data-celda-design="sgi"] #erp-root .la button[data-la]::before{display:none!important;}
html[data-celda-design="sgi"] #erp-root .la button[data-la="refresh"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la="range"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la*="new"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la="quick-client"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la="add-point"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la*="edit"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la="resources-edit"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la="settings"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la*="detail"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la*="history"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la="request-open"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la^="open-"]::before,
html[data-celda-design="sgi"] #erp-root .la button[data-la*="certificate"]::before{
  display:block!important;
}

/* Programaciones: una sola toolbar, navegación de mes clara y calendario menos extraño. */
html[data-celda-design="sgi"] #erp-root .la-schedule-toolbar{
  display:grid;gap:10px;margin:12px 0 14px;
}
html[data-celda-design="sgi"] #erp-root .la-schedule-month-nav{
  display:flex;align-items:end;gap:8px;flex-wrap:wrap;
}
html[data-celda-design="sgi"] #erp-root .la-schedule-month-nav label{
  min-width:170px;margin:0;color:#657a90;font-size:9.5px;font-weight:750;
}
html[data-celda-design="sgi"] #erp-root .la-schedule-month-nav input{margin-top:4px;}
html[data-celda-design="sgi"] #erp-root .la-schedule-toolbar .la-filters{margin:0!important;}
html[data-celda-design="sgi"] #erp-root .la-schedule-toolbar>.la-actions{margin:0!important;}
html[data-celda-design="sgi"] #erp-root .la-calendar{padding:12px!important;gap:7px!important;}
html[data-celda-design="sgi"] #erp-root .la-weekday{
  padding:6px 4px 8px!important;color:#617890!important;font-size:10px!important;font-weight:800!important;letter-spacing:.03em;
}
html[data-celda-design="sgi"] #erp-root .la .la-day{
  position:relative;min-height:112px!important;padding:9px!important;gap:6px!important;
  color:#264966!important;text-align:left!important;
}
html[data-celda-design="sgi"] #erp-root .la .la-day>strong{
  display:inline-grid;place-items:center;min-width:24px;height:24px;padding:0 6px;border-radius:8px;
  background:#f4f8fc;color:#284e72;font-size:11px;font-weight:800;
}
html[data-celda-design="sgi"] #erp-root .la .la-day:hover{background:#fbfdff!important;border-color:#cbdceb!important;}
html[data-celda-design="sgi"] #erp-root .la .la-today>strong{background:#eaf3ff;color:#176bc7;}
html[data-celda-design="sgi"] #erp-root .la-event,
html[data-celda-design="sgi"] #erp-root .la-absence{
  font-size:9px!important;line-height:1.28!important;border-radius:7px!important;background:#f7f9fc!important;
}

/* Respaldos: deja claro qué se crea realmente y qué puede descargarse. */
html[data-celda-design="sgi"] #erp-root .la-backup-intro{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:16px;align-items:center;
  margin:12px 0 14px;padding:16px 17px;border:1px solid #dfe9f3;border-radius:16px;background:linear-gradient(135deg,#f8fbff,#f3f8fd);
}
html[data-celda-design="sgi"] #erp-root .la-backup-copy h2{margin:3px 0 5px!important;font-size:17px!important;color:#173b61!important;}
html[data-celda-design="sgi"] #erp-root .la-backup-copy p{margin:0!important;max-width:760px;color:#6f8499!important;font-size:10.6px!important;line-height:1.55!important;}
html[data-celda-design="sgi"] #erp-root .la-backup-intro>[data-la="backup-create"]{
  background:linear-gradient(180deg,#3189ef,#2478df)!important;border-color:#2478df!important;color:#fff!important;white-space:nowrap;
}
html[data-celda-design="sgi"] #erp-root .la-backup-status{
  display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;font-size:9px;font-weight:800;
}
html[data-celda-design="sgi"] #erp-root .la-backup-status::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;}
html[data-celda-design="sgi"] #erp-root .la-backup-status.ready{color:#16805e;background:#eaf8f2;border:1px solid #d2eee4;}
html[data-celda-design="sgi"] #erp-root .la-backup-status.stored{color:#687d91;background:#f2f5f8;border:1px solid #e0e7ee;}
html[data-celda-design="sgi"] #erp-root .la-backup-note{
  display:flex;gap:8px;align-items:baseline;flex-wrap:wrap;margin-top:10px;padding:10px 12px;border:1px solid #e4ebf3;border-radius:12px;background:#fafcfe;color:#76899d;font-size:10px;
}
html[data-celda-design="sgi"] #erp-root .la-backup-note b{color:#345979;}

/* Cotizaciones: el historial no se estira a la altura del editor de la izquierda. */
html[data-celda-design="sgi"] #erp-root .celda-quotation-workspace{align-items:start!important;}
html[data-celda-design="sgi"] #erp-root .celda-quotation-history-card{align-self:start!important;height:auto!important;min-height:0!important;}
html[data-celda-design="sgi"] #erp-root .celda-quotation-history-card>div:last-child{max-height:min(62vh,620px)!important;}

/* Desplegables globales: el chevron debe ser visible y consistente. */
html[data-celda-design="sgi"] #erp-root details:not(.celda-advisory)>summary,
html[data-celda-design="sgi"] body .la-dialog details>summary{
  position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-height:40px;padding:9px 46px 9px 12px!important;margin:0;
  border:1px solid #e0e9f2;border-radius:11px;background:#f8fbfe;color:#315a7e!important;
  font-weight:760;cursor:pointer;list-style:none;transition:background .15s ease,border-color .15s ease,color .15s ease;
}
html[data-celda-design="sgi"] #erp-root details:not(.celda-advisory)>summary::-webkit-details-marker,
html[data-celda-design="sgi"] body .la-dialog details>summary::-webkit-details-marker{display:none;}
html[data-celda-design="sgi"] #erp-root details:not(.celda-advisory)>summary::after,
html[data-celda-design="sgi"] body .la-dialog details>summary::after{
  content:"⌄";position:absolute;right:11px;top:50%;transform:translateY(-50%);
  width:25px;height:25px;display:grid;place-items:center;border:1px solid #d5e2ee;border-radius:8px;background:#fff;color:#527696;
  font-size:14px;font-weight:900;line-height:1;transition:transform .16s ease,background .16s ease,color .16s ease;
}
html[data-celda-design="sgi"] #erp-root details:not(.celda-advisory)[open]>summary::after,
html[data-celda-design="sgi"] body .la-dialog details[open]>summary::after{transform:translateY(-50%) rotate(180deg);background:#eef5ff;color:#246fbd;}
html[data-celda-design="sgi"] #erp-root details:not(.celda-advisory)>summary:hover{
  border-color:#c8dceb;background:#f3f8fd;color:#2468aa!important;
}
html[data-celda-design="sgi"] #erp-root details:not(.celda-advisory)[open]{
  border-radius:12px;
}
html[data-celda-design="sgi"] #erp-root details.la:not(.celda-advisory){
  margin:8px 0 12px;padding:0;border:0!important;background:transparent!important;
}
html[data-celda-design="sgi"] #erp-root details.la:not(.celda-advisory)>:not(summary){margin-left:2px;margin-right:2px;}

@media(max-width:760px){
  html[data-celda-design="sgi"] #erp-root .la-backup-intro{grid-template-columns:1fr;}
  html[data-celda-design="sgi"] #erp-root .la-backup-intro>[data-la="backup-create"]{width:100%;justify-content:center;}
  html[data-celda-design="sgi"] #erp-root .la-schedule-month-nav>*{flex:1 1 140px;}
}

/* ========================================================================== 
   EXPERIMENTO · MODALES / SHEETS + KPI + COMPACTACIÓN DE CABECERAS
   Rama reversible basada en UI Bloque 4.11. No modifica contratos de API.
   ========================================================================== */

/* Menos espacio muerto sobre los títulos sin invadir el chrome superior. */
@media (min-width:761px){
  html[data-celda-design="sgi"] #erp-root .main{
    padding-top:54px!important;
  }
  html[data-celda-design="sgi"] #erp-root .main>.view-title,
  html[data-celda-design="sgi"] #erp-root .main>.la>.la-heading:first-child h1{
    margin-top:0!important;
  }
}

/* Barra de creación: las altas dejan de ocupar media pantalla permanentemente. */
html[data-celda-design="sgi"] #erp-root .exp-create-toolbar{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 12px;
}
html[data-celda-design="sgi"] #erp-root .exp-new-button{
  display:inline-flex;
  align-items:center;
  gap:7px;
  min-height:36px;
  padding:8px 13px;
  border:1px solid #bfd7f4;
  border-radius:10px;
  background:linear-gradient(180deg,#eef7ff 0%,#e7f2ff 100%);
  color:#1765b6;
  font:700 10.5px/1 var(--font-body);
  box-shadow:0 3px 10px rgba(39,112,190,.07);
  cursor:pointer;
}
html[data-celda-design="sgi"] #erp-root .exp-new-button>span{
  display:grid;place-items:center;
  width:20px;height:20px;border-radius:7px;
  background:#2f80ed;color:#fff;
  font-size:14px;line-height:1;
}
html[data-celda-design="sgi"] #erp-root .exp-new-button:hover,
html[data-celda-design="sgi"] #erp-root .exp-new-button:focus-visible{
  border-color:#8ebced;background:#e4f1ff;color:#0e5ca9;outline:none;
  transform:translateY(-1px);
}

/* KPI compactos tipo mockup para aprovechar el espacio liberado. */
html[data-celda-design="sgi"] #erp-root .exp-kpi-strip{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  margin:0 0 13px;
}
html[data-celda-design="sgi"] #erp-root .exp-kpi{
  --exp-accent:#2f80ed;
  --exp-soft:#f3f8ff;
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  gap:10px;
  align-items:center;
  min-height:78px;
  padding:11px 13px;
  border:1px solid #dce7f2;
  border-radius:12px;
  background:var(--exp-soft);
  box-shadow:0 3px 12px rgba(32,67,105,.045);
}
html[data-celda-design="sgi"] #erp-root .exp-kpi.tone-green{--exp-accent:#199a70;--exp-soft:#effaf5;border-color:#d8eee5;}
html[data-celda-design="sgi"] #erp-root .exp-kpi.tone-cyan{--exp-accent:#238eb0;--exp-soft:#f0f9fb;border-color:#d7ebef;}
html[data-celda-design="sgi"] #erp-root .exp-kpi.tone-amber{--exp-accent:#d28d18;--exp-soft:#fff8e9;border-color:#f1dfb7;}
html[data-celda-design="sgi"] #erp-root .exp-kpi.tone-red{--exp-accent:#dc5965;--exp-soft:#fff2f4;border-color:#f0d9dd;}
html[data-celda-design="sgi"] #erp-root .exp-kpi-icon{
  display:grid;place-items:center;
  width:36px;height:36px;border-radius:10px;
  background:color-mix(in srgb,var(--exp-accent) 10%,#fff);
  color:var(--exp-accent);
  font:800 15px/1 var(--font-body);
}
html[data-celda-design="sgi"] #erp-root .exp-kpi small{
  display:block;color:#73869a;font-size:8.7px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;
}
html[data-celda-design="sgi"] #erp-root .exp-kpi b{
  display:block;margin-top:3px;color:#17385e;font:750 19px/1.05 var(--font-body);
}
html[data-celda-design="sgi"] #erp-root .exp-kpi em{
  display:block;margin-top:4px;color:#8595a6;font-size:8.8px;font-style:normal;
}

/* Sheet/modal experimental reutilizando los formularios reales. */
html.exp-sheet-open{overflow:hidden!important;}
html[data-celda-design="sgi"] #erp-root .exp-sheet-overlay{
  position:fixed;
  inset:0;
  z-index:10040;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:26px;
  background:rgba(26,43,63,.38);
  backdrop-filter:blur(7px);
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-overlay[hidden]{display:none!important;}
html[data-celda-design="sgi"] #erp-root .exp-sheet{
  width:min(860px,calc(100vw - 52px));
  max-height:min(86vh,860px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid #dce7f2;
  border-radius:20px;
  background:#fff;
  box-shadow:0 34px 86px rgba(20,47,80,.24);
}
html[data-celda-design="sgi"] #erp-root .exp-size-md .exp-sheet{width:min(650px,calc(100vw - 52px));}
html[data-celda-design="sgi"] #erp-root .exp-size-xl .exp-sheet{width:min(1120px,calc(100vw - 52px));}
html[data-celda-design="sgi"] #erp-root .exp-sheet-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding:18px 20px 15px;
  border-bottom:1px solid #e4ebf3;
  background:linear-gradient(180deg,#fbfdff,#f5f9fd);
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-kicker{
  display:block;margin-bottom:4px;color:#2878ed;font-size:8.5px;font-weight:800;letter-spacing:.13em;text-transform:uppercase;
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-head h2{
  margin:0;color:#18395e;font:750 18px/1.15 var(--font-body);
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-head p{
  margin:5px 0 0;color:#7c8fa2;font-size:10px;line-height:1.45;
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-close{
  width:34px;height:34px;flex:0 0 34px;
  display:grid;place-items:center;
  padding:0;border:1px solid #dce7f2;border-radius:11px;
  background:#fff;color:#6b8097;font-size:19px;line-height:1;cursor:pointer;
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-close:hover,
html[data-celda-design="sgi"] #erp-root .exp-sheet-close:focus-visible{background:#eef5fd;color:#2368b7;outline:none;}
html[data-celda-design="sgi"] #erp-root .exp-sheet-body{
  min-height:0;
  padding:16px 18px 20px;
  overflow:auto;
  background:#f7f9fc;
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-source{
  margin:0!important;
  border:0!important;
  border-radius:14px!important;
  background:#fff!important;
  box-shadow:0 4px 16px rgba(38,68,101,.05)!important;
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-source>.section-head:first-child{
  display:none!important;
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-body form{
  margin:0!important;
}
html[data-celda-design="sgi"] #erp-root .exp-sheet-body .celda-form-actions,
html[data-celda-design="sgi"] #erp-root .exp-sheet-body .user-form-actions{
  position:sticky;
  bottom:-20px;
  z-index:3;
  margin:16px -18px -20px!important;
  padding:12px 18px 14px!important;
  border-top:1px solid #e3eaf2;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(8px);
}

/* Línea A: sus editores ya nacían desde botones; ahora aparecen como modal real. */
html[data-celda-design="sgi"] #erp-root .la-editor-overlay{
  position:fixed;
  inset:0;
  z-index:10030;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
  background:rgba(26,43,63,.36);
  backdrop-filter:blur(7px);
}
html[data-celda-design="sgi"] #erp-root .la-editor-overlay .la-editor{
  width:min(980px,calc(100vw - 56px));
  max-height:min(86vh,820px);
  margin:0!important;
  overflow:auto;
  border-radius:20px!important;
  box-shadow:0 32px 82px rgba(21,48,80,.24)!important;
}
html[data-celda-design="sgi"] #erp-root .la-editor-modal-head{
  position:sticky;top:0;z-index:4;
  display:flex;align-items:flex-start;justify-content:space-between;gap:16px;
  margin:-1px -1px 14px;
  padding:16px 18px 13px;
  border-bottom:1px solid #e4ebf2;
  border-radius:19px 19px 0 0;
  background:rgba(249,252,255,.97);
  backdrop-filter:blur(8px);
}
html[data-celda-design="sgi"] #erp-root .la-editor-modal-head span{
  display:block;color:#2878ed;font-size:8px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;
}
html[data-celda-design="sgi"] #erp-root .la-editor-modal-head h2{margin:3px 0 0!important;}
html[data-celda-design="sgi"] #erp-root .la-editor-modal-head [data-la="editor-cancel"]{
  width:34px!important;height:34px!important;padding:0!important;border-radius:11px!important;font-size:18px!important;
}

@media (max-width:1180px){
  html[data-celda-design="sgi"] #erp-root .exp-kpi-strip{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:760px){
  html[data-celda-design="sgi"] #erp-root .main{padding-top:62px!important;}
  html[data-celda-design="sgi"] #erp-root .exp-kpi-strip{grid-template-columns:1fr 1fr;gap:8px;}
  html[data-celda-design="sgi"] #erp-root .exp-kpi{grid-template-columns:30px 1fr;padding:9px;min-height:68px;}
  html[data-celda-design="sgi"] #erp-root .exp-kpi-icon{width:30px;height:30px;}
  html[data-celda-design="sgi"] #erp-root .exp-kpi b{font-size:16px;}
  html[data-celda-design="sgi"] #erp-root .exp-sheet-overlay,
  html[data-celda-design="sgi"] #erp-root .la-editor-overlay{padding:10px;align-items:flex-end;}
  html[data-celda-design="sgi"] #erp-root .exp-sheet,
  html[data-celda-design="sgi"] #erp-root .exp-size-md .exp-sheet,
  html[data-celda-design="sgi"] #erp-root .exp-size-xl .exp-sheet,
  html[data-celda-design="sgi"] #erp-root .la-editor-overlay .la-editor{
    width:100%;max-height:92vh;border-radius:18px 18px 0 0!important;
  }
  html[data-celda-design="sgi"] #erp-root .exp-sheet-head{padding:15px;}
  html[data-celda-design="sgi"] #erp-root .exp-sheet-body{padding:12px;}
}

/* ========================================================================== 
   EXPERIMENTO R2 · Corrección de bugs, escala, jerarquía y modales reales
   Mantiene 4.11 como punto de retorno.
   ========================================================================== */
@media (min-width:761px){
  html[data-celda-design="sgi"] #erp-root .main{padding-top:30px!important;}
  html[data-celda-design="sgi"] #erp-root .main>.la{margin-top:0!important;}
  html[data-celda-design="sgi"] #erp-root .main>.la>.la-heading:first-child{margin-top:0!important;}
}
html[data-celda-design="sgi"] #erp-root .exp-view-head{display:flex;align-items:flex-start;justify-content:space-between;gap:22px;margin:0 0 16px;min-width:0;}
html[data-celda-design="sgi"] #erp-root .exp-view-copy{min-width:0;flex:1;}
html[data-celda-design="sgi"] #erp-root .exp-view-head .view-title{margin:0 0 5px!important;}
html[data-celda-design="sgi"] #erp-root .exp-view-head .view-sub{margin:0!important;max-width:920px;}
html[data-celda-design="sgi"] #erp-root .exp-create-toolbar{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:9px;margin:0!important;padding-top:1px;}
html[data-celda-design="sgi"] #erp-root .exp-new-button{min-height:40px;padding:9px 14px 9px 11px;gap:8px;border:1px solid #c9dcf1;border-radius:11px;background:#fff;color:#245f9f;font-size:11.5px;font-weight:800;box-shadow:0 4px 12px rgba(34,75,118,.06);}
html[data-celda-design="sgi"] #erp-root .exp-new-button>span{width:25px;height:25px;border-radius:8px;background:#edf5ff;color:#287bdb;}
html[data-celda-design="sgi"] #erp-root .exp-new-button>span svg{width:15px;height:15px;display:block;}
html[data-celda-design="sgi"] #erp-root .exp-new-button>b{font:inherit;}
html[data-celda-design="sgi"] #erp-root .exp-new-button:hover,html[data-celda-design="sgi"] #erp-root .exp-new-button:focus-visible{transform:none;background:#f5f9fe;border-color:#a9c9e9;color:#175a9d;box-shadow:0 6px 16px rgba(34,75,118,.09);outline:none;}
html[data-celda-design="sgi"] #erp-root .exp-kpi-strip{gap:12px;margin:0 0 18px;}
html[data-celda-design="sgi"] #erp-root .exp-kpi{grid-template-columns:44px minmax(0,1fr);gap:12px;min-height:90px;padding:14px 15px;border-radius:14px;}
html[data-celda-design="sgi"] #erp-root .exp-kpi-icon{width:44px;height:44px;border-radius:13px;}
html[data-celda-design="sgi"] #erp-root .exp-kpi-icon svg{width:21px;height:21px;display:block;}
html[data-celda-design="sgi"] #erp-root .exp-kpi small{font-size:9.5px;letter-spacing:.055em;}
html[data-celda-design="sgi"] #erp-root .exp-kpi b{margin-top:4px;font-size:23px;}
html[data-celda-design="sgi"] #erp-root .exp-kpi em{margin-top:5px;font-size:10.3px;line-height:1.35;}
html[data-celda-design="sgi"] #erp-root :is(button.btn,a.btn){min-height:36px!important;padding:8px 13px!important;border:1px solid #287bd8!important;border-radius:10px!important;background:linear-gradient(180deg,#328bef,#287adb)!important;color:#fff!important;font-size:11.5px!important;font-weight:800!important;line-height:1.15!important;box-shadow:0 4px 12px rgba(40,122,219,.13)!important;}
html[data-celda-design="sgi"] #erp-root :is(button.btn,a.btn):hover,html[data-celda-design="sgi"] #erp-root :is(button.btn,a.btn):focus-visible{background:linear-gradient(180deg,#2d81e3,#216dcc)!important;border-color:#216dcc!important;outline:none!important;}
html[data-celda-design="sgi"] #erp-root button.btn.copper{background:linear-gradient(180deg,#328bef,#287adb)!important;border-color:#287bd8!important;color:#fff!important;}
html[data-celda-design="sgi"] #erp-root :is(button.btn-ghost,a.btn-ghost){min-height:35px!important;padding:7px 11px!important;border:1px solid #d3e1ef!important;border-radius:10px!important;background:#fff!important;color:#2b5f91!important;font-size:11px!important;font-weight:750!important;box-shadow:none!important;}
html[data-celda-design="sgi"] #erp-root :is(button.btn-ghost,a.btn-ghost):hover,html[data-celda-design="sgi"] #erp-root :is(button.btn-ghost,a.btn-ghost):focus-visible{background:#f2f7fc!important;border-color:#b9d0e7!important;color:#1e5b98!important;outline:none!important;}
html[data-celda-design="sgi"] #erp-root :is(.celda-danger-link,button.btn-ghost[data-quote-annul],button.btn-ghost[data-annul-invoice],button.btn-ghost[data-void-tx]){color:#c94d5e!important;border-color:#efd2d7!important;background:#fff8f9!important;}
html[data-celda-design="sgi"] #erp-root .exp-sheet-overlay,html[data-celda-design="sgi"] #erp-root .la-editor-overlay{z-index:100220!important;background:rgba(21,36,54,.47)!important;backdrop-filter:blur(8px)!important;}
html[data-celda-design="sgi"] #erp-root .exp-sheet{width:min(900px,calc(100vw - 52px));max-height:min(88vh,900px);border-radius:22px;box-shadow:0 38px 100px rgba(16,39,68,.28);}
html[data-celda-design="sgi"] #erp-root .exp-size-md .exp-sheet{width:min(700px,calc(100vw - 52px));}
html[data-celda-design="sgi"] #erp-root .exp-size-xl .exp-sheet{width:min(1180px,calc(100vw - 52px));}
html[data-celda-design="sgi"] #erp-root .exp-sheet-head{padding:21px 23px 17px;}
html[data-celda-design="sgi"] #erp-root .exp-sheet-kicker{font-size:9px;}
html[data-celda-design="sgi"] #erp-root .exp-sheet-head h2{font-size:21px;}
html[data-celda-design="sgi"] #erp-root .exp-sheet-head p{font-size:11.5px;max-width:720px;}
html[data-celda-design="sgi"] #erp-root .exp-sheet-body{padding:19px 21px 23px;font-size:12px;}
html[data-celda-design="sgi"] #erp-root .exp-sheet-body :is(label,input,select,textarea,button){font-size:12px;}
html[data-celda-design="sgi"] #erp-root .exp-sheet-close{width:36px;height:36px;border-radius:11px;font-size:20px;}
html[data-celda-design="sgi"] body .modal-overlay{z-index:100230!important;background:rgba(20,35,53,.48)!important;backdrop-filter:blur(8px)!important;}
html[data-celda-design="sgi"] #erp-root .la-editor-overlay .la-editor{width:min(1040px,calc(100vw - 56px));max-height:min(88vh,880px);font-size:12px;}
html[data-celda-design="sgi"] #erp-root .la-editor-modal-head h2{font-size:20px!important;}
html[data-celda-design="sgi"] #erp-root .celda-quotation-workspace{align-items:start!important;grid-auto-rows:max-content!important;}
html[data-celda-design="sgi"] #erp-root .celda-quotation-history-card{align-self:start!important;height:max-content!important;min-height:0!important;max-height:none!important;}
html[data-celda-design="sgi"] #erp-root .celda-quotation-history-list{height:auto!important;min-height:0!important;max-height:min(62vh,620px)!important;overflow-y:auto!important;}
html[data-celda-design="sgi"] #erp-root .celda-quotation-history-list.is-short{max-height:none!important;overflow:visible!important;}
html.exp-sheet-open body #celda-system-bar,html.exp-sheet-open body #celda-context-hub,html.exp-sheet-open body #celda-action-banner{pointer-events:none!important;}
@media(max-width:1180px){html[data-celda-design="sgi"] #erp-root .exp-view-head{gap:14px;}html[data-celda-design="sgi"] #erp-root .exp-create-toolbar{max-width:48%;}}
@media(max-width:760px){html[data-celda-design="sgi"] #erp-root .exp-view-head{display:block;margin-bottom:14px;}html[data-celda-design="sgi"] #erp-root .exp-create-toolbar{max-width:none;margin-top:10px!important;justify-content:flex-start;}html[data-celda-design="sgi"] #erp-root .exp-create-toolbar>*{flex:1 1 auto;justify-content:center;}html[data-celda-design="sgi"] #erp-root .exp-kpi{grid-template-columns:38px 1fr;min-height:78px;padding:11px 12px;}html[data-celda-design="sgi"] #erp-root .exp-kpi-icon{width:38px;height:38px;}html[data-celda-design="sgi"] #erp-root .exp-kpi b{font-size:20px;}}

/* ========================================================================== 
   EXPERIMENTO R2 · estabilización visual después de prueba real
   - modal verdadero sobre toda la aplicación
   - encabezados/acciones compactos
   - controles legibles
   - botones heredados normalizados
   ========================================================================== */

/* Aprovechar mejor la parte superior sin invadir los controles flotantes de la derecha. */
@media (min-width:761px){
  html[data-celda-design="sgi"] #erp-root .main{padding-top:18px!important;}
  html[data-celda-design="sgi"] #erp-root .exp-view-head{min-height:52px;margin-bottom:14px!important;padding-right:8px;}
  html[data-celda-design="sgi"] #erp-root .exp-view-copy{padding-top:2px;}
}
html[data-celda-design="sgi"] #erp-root .exp-view-head{
  align-items:flex-start!important;
}
html[data-celda-design="sgi"] #erp-root .exp-create-toolbar{
  margin-left:auto!important;
  justify-content:flex-end!important;
  align-self:flex-start!important;
  padding-top:2px!important;
}
html[data-celda-design="sgi"] #erp-root .exp-create-toolbar .la-actions{display:contents!important;}
html[data-celda-design="sgi"] #erp-root .exp-create-toolbar button{
  min-height:40px!important;
  border-radius:11px!important;
  font-size:11.8px!important;
  font-weight:800!important;
}

/* Botón Nuevo: acción discreta, limpia y consistente con los mockups. */
html[data-celda-design="sgi"] #erp-root .exp-new-button{
  min-height:42px!important;
  padding:8px 15px 8px 10px!important;
  border:1px solid #cbdced!important;
  background:#fff!important;
  color:#234f80!important;
  box-shadow:0 5px 14px rgba(31,70,111,.07)!important;
}
html[data-celda-design="sgi"] #erp-root .exp-new-button>span{
  width:28px!important;height:28px!important;border-radius:9px!important;
  background:#eaf3ff!important;color:#2878db!important;
}
html[data-celda-design="sgi"] #erp-root .exp-new-button>span svg{width:16px!important;height:16px!important;stroke-width:1.9!important;}

/* KPI: mayor legibilidad y menos apariencia de iconografía “miniatura”. */
html[data-celda-design="sgi"] #erp-root .exp-kpi-strip{gap:13px!important;margin-bottom:19px!important;}
html[data-celda-design="sgi"] #erp-root .exp-kpi{
  grid-template-columns:48px minmax(0,1fr)!important;
  min-height:96px!important;
  padding:15px 16px!important;
  border-radius:15px!important;
}
html[data-celda-design="sgi"] #erp-root .exp-kpi-icon{
  width:48px!important;height:48px!important;border-radius:14px!important;
  background:rgba(255,255,255,.66)!important;
  border:1px solid rgba(102,145,191,.10)!important;
}
html[data-celda-design="sgi"] #erp-root .exp-kpi-icon svg{width:22px!important;height:22px!important;stroke-width:1.75!important;}
html[data-celda-design="sgi"] #erp-root .exp-kpi small{font-size:9.8px!important;}
html[data-celda-design="sgi"] #erp-root .exp-kpi b{font-size:24px!important;}
html[data-celda-design="sgi"] #erp-root .exp-kpi em{font-size:10.6px!important;}

/* --------------------------------------------------------------------------
   Modal experimental a nivel BODY. El form real se mueve sin clonarlo, por lo
   que conserva listeners, IDs, permisos y validaciones.
   -------------------------------------------------------------------------- */
html.exp-sheet-open,html.exp-sheet-open body{overflow:hidden!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay{
  position:fixed!important;
  inset:0!important;
  z-index:250000!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:28px!important;
  box-sizing:border-box!important;
  background:rgba(22,36,53,.55)!important;
  backdrop-filter:blur(9px)!important;
  -webkit-backdrop-filter:blur(9px)!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay[hidden]{display:none!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet{
  width:min(920px,calc(100vw - 56px))!important;
  max-height:min(88vh,900px)!important;
  display:flex!important;flex-direction:column!important;overflow:hidden!important;
  border:1px solid #dbe6f1!important;border-radius:22px!important;background:#fff!important;
  box-shadow:0 42px 110px rgba(11,30,52,.32)!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay.exp-size-md .exp-sheet{width:min(720px,calc(100vw - 56px))!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay.exp-size-xl .exp-sheet{width:min(1180px,calc(100vw - 56px))!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:18px;
  padding:22px 24px 18px!important;border-bottom:1px solid #e4ebf3!important;
  background:linear-gradient(180deg,#fcfdff,#f5f9fd)!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-kicker{
  display:block;margin-bottom:5px;color:#2878ed;font-size:9px;font-weight:850;letter-spacing:.13em;text-transform:uppercase;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-head h2{margin:0;color:#17385e;font-size:22px;line-height:1.15;font-weight:760;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-head p{margin:6px 0 0;max-width:760px;color:#788ca1;font-size:12px;line-height:1.5;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-close{
  width:38px;height:38px;flex:0 0 38px;display:grid;place-items:center;padding:0;
  border:1px solid #d9e5f0;border-radius:12px;background:#fff;color:#607990;font-size:21px;line-height:1;cursor:pointer;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-close:hover,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-close:focus-visible{background:#edf5ff;color:#2269b7;border-color:#bed4e9;outline:none;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-body{
  min-height:0;padding:20px 22px 24px!important;overflow:auto!important;background:#f7f9fc!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-source{
  margin:0!important;padding:18px!important;border:1px solid #e2eaf3!important;border-radius:16px!important;
  background:#fff!important;box-shadow:0 6px 20px rgba(34,67,101,.05)!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-source>.section-head:first-child{display:none!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay form{margin:0!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .form-row{gap:12px!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay label{color:#5e728a!important;font-size:11.5px!important;font-weight:700!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay :is(input,select,textarea){
  width:100%;box-sizing:border-box;min-height:42px;padding:9px 11px!important;border:1px solid #d5e1ee!important;
  border-radius:10px!important;background:#fff!important;color:#253d5c!important;font-size:12.7px!important;outline:none!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay textarea{min-height:88px!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay :is(input,select,textarea):focus{border-color:#76a9df!important;box-shadow:0 0 0 3px rgba(49,128,215,.10)!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay :is(button.btn,button.btn-ghost,button[type="submit"]){min-height:40px!important;font-size:12px!important;border-radius:10px!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .celda-form-actions,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .user-form-actions{
  position:sticky!important;bottom:-24px!important;z-index:3!important;margin:18px -22px -24px!important;padding:14px 22px!important;
  border-top:1px solid #e3ebf3!important;background:rgba(255,255,255,.97)!important;backdrop-filter:blur(8px)!important;
}

/* Nada del chrome superior debe competir visualmente con un modal. */
html.exp-sheet-open body #celda-system-bar,
html.exp-sheet-open body #celda-context-hub,
html.exp-sheet-open body #celda-action-banner{visibility:hidden!important;pointer-events:none!important;}
html[data-celda-design="sgi"] body:has(.modal-overlay) #celda-system-bar,
html[data-celda-design="sgi"] body:has(.modal-overlay) #celda-context-hub,
html[data-celda-design="sgi"] body:has(.modal-overlay) #celda-action-banner,
html[data-celda-design="sgi"] body:has(.la-editor-overlay) #celda-system-bar,
html[data-celda-design="sgi"] body:has(.la-editor-overlay) #celda-context-hub,
html[data-celda-design="sgi"] body:has(.la-editor-overlay) #celda-action-banner{visibility:hidden!important;pointer-events:none!important;}

/* Documentos/impresiones: fondo de toda la aplicación y cierre fuera del papel. */
html[data-celda-design="sgi"] body .modal-overlay{
  z-index:240000!important;background:rgba(22,36,53,.56)!important;backdrop-filter:blur(8px)!important;
}

/* --------------------------------------------------------------------------
   Controles antiguos que no tenían .btn: misma gramática visual del ERP.
   Se evita tocar navegación, chips y controles iconográficos especializados.
   -------------------------------------------------------------------------- */
html[data-celda-design="sgi"] #erp-root form[id] > button:not(.btn):not(.btn-ghost):not([data-quick-fill]),
html[data-celda-design="sgi"] #erp-root .celda-inline-actions > button:not(.btn):not(.btn-ghost),
html[data-celda-design="sgi"] #erp-root .la-actions > button,
html[data-celda-design="sgi"] #erp-root .la-filter-form > button,
html[data-celda-design="sgi"] #erp-root .la form > button[type="submit"]{
  min-height:38px!important;padding:8px 13px!important;border:1px solid #2b78d2!important;border-radius:10px!important;
  background:linear-gradient(180deg,#3389e8,#2878d5)!important;color:#fff!important;font-size:11.7px!important;font-weight:800!important;
  box-shadow:0 4px 12px rgba(43,120,210,.12)!important;cursor:pointer!important;
}
html[data-celda-design="sgi"] #erp-root .la-actions > button:hover,
html[data-celda-design="sgi"] #erp-root .la-filter-form > button:hover,
html[data-celda-design="sgi"] #erp-root form[id] > button:not(.btn):not(.btn-ghost):hover{filter:brightness(.98);}

/* Un poco más de escala en zonas de trabajo densas. */
html[data-celda-design="sgi"] #erp-root .exp-ui-experiment :is(input,select,textarea){font-size:12.2px;}
html[data-celda-design="sgi"] #erp-root .exp-ui-experiment table{font-size:11.8px;}
html[data-celda-design="sgi"] #erp-root .exp-ui-experiment .section-head h2{font-size:15px;}

/* Historial de Cotizaciones: nunca igualar la altura del editor de la izquierda. */
html[data-celda-design="sgi"] #erp-root .celda-quotation-workspace{
  align-items:start!important;grid-auto-flow:row!important;grid-auto-rows:max-content!important;
}
html[data-celda-design="sgi"] #erp-root .celda-quotation-history-card{
  align-self:start!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;
}
html[data-celda-design="sgi"] #erp-root .celda-quotation-history-card .celda-quotation-history-list{
  height:auto!important;min-height:0!important;max-height:min(62vh,620px)!important;overflow-y:auto!important;
}
html[data-celda-design="sgi"] #erp-root .celda-quotation-history-card .celda-quotation-history-list.is-short{
  height:auto!important;max-height:none!important;overflow:visible!important;
}

@media(max-width:760px){
  html[data-celda-design="sgi"] body>.exp-sheet-overlay{padding:10px!important;align-items:flex-end!important;}
  html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet,
  html[data-celda-design="sgi"] body>.exp-sheet-overlay.exp-size-md .exp-sheet,
  html[data-celda-design="sgi"] body>.exp-sheet-overlay.exp-size-xl .exp-sheet{width:100%!important;max-height:92vh!important;border-radius:18px 18px 0 0!important;}
  html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-head{padding:16px!important;}
  html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-body{padding:14px!important;}
  html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-source{padding:13px!important;}
  html[data-celda-design="sgi"] #erp-root .exp-create-toolbar{max-width:none!important;width:100%;justify-content:flex-start!important;margin-top:10px!important;}
}

/* ========================================================================== 
   EXPERIMENTO R3 · corrección funcional de edición, concurrencia y jerarquía
   ========================================================================== */

/* 1) Reservar el área superior derecha ocupada por avisos/cuenta.
   Los botones de la vista siguen a la derecha, pero nunca debajo del chrome. */
@media (min-width:1181px){
  html[data-celda-design="sgi"] #erp-root .exp-view-head{
    padding-right:390px!important;
    box-sizing:border-box!important;
  }
  html[data-celda-design="sgi"] #erp-root .exp-create-toolbar{
    max-width:min(520px,46vw)!important;
  }
}
@media (min-width:761px) and (max-width:1180px){
  html[data-celda-design="sgi"] #erp-root .exp-view-head{
    padding-right:245px!important;
    flex-wrap:wrap!important;
  }
  html[data-celda-design="sgi"] #erp-root .exp-create-toolbar{
    width:100%!important;
    justify-content:flex-end!important;
    padding-right:0!important;
  }
}

/* 2) Botones operativos: menos azul saturado, mejor contraste y sin iconos
   automáticos que compitan con el texto. */
html[data-celda-design="sgi"] #erp-root .btn,
html[data-celda-design="sgi"] #erp-root button.btn,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .btn,
html[data-celda-design="sgi"] body>.exp-sheet-overlay button.btn{
  min-height:40px!important;
  border-radius:10px!important;
  font-size:12px!important;
  font-weight:780!important;
}
html[data-celda-design="sgi"] #erp-root .btn.copper,
html[data-celda-design="sgi"] #erp-root button.btn.copper,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .btn.copper,
html[data-celda-design="sgi"] body>.exp-sheet-overlay button.btn.copper,
html[data-celda-design="sgi"] body>.exp-sheet-overlay button[type="submit"]{
  border:1px solid #2b78d2!important;
  background:#2f80df!important;
  color:#fff!important;
  box-shadow:0 4px 11px rgba(43,120,210,.14)!important;
}
html[data-celda-design="sgi"] #erp-root .btn.copper:hover,
html[data-celda-design="sgi"] #erp-root button.btn.copper:hover,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .btn.copper:hover,
html[data-celda-design="sgi"] body>.exp-sheet-overlay button[type="submit"]:hover{
  background:#2876cf!important;
  border-color:#246dbf!important;
}
html[data-celda-design="sgi"] #erp-root .btn-ghost,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .btn-ghost,
html[data-celda-design="sgi"] body>.exp-sheet-overlay button[type="button"]:not(.exp-sheet-close){
  border:1px solid #d2dfec!important;
  background:#fff!important;
  color:#315a83!important;
  box-shadow:none!important;
}
html[data-celda-design="sgi"] #erp-root .btn-ghost:hover,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .btn-ghost:hover,
html[data-celda-design="sgi"] body>.exp-sheet-overlay button[type="button"]:not(.exp-sheet-close):hover{
  background:#f4f8fd!important;
  border-color:#b8cfe5!important;
}

/* Línea A: se retiran los pseudo-iconos automáticos. Los controles ya tienen
   texto suficiente y los iconos genéricos estaban restando claridad. */
html[data-celda-design="sgi"] #erp-root .la button[data-la]::before,
html[data-celda-design="sgi"] body>.la-editor-overlay button[data-la]::before{
  display:none!important;
  content:none!important;
}

/* 3) Editor Línea A también es modal BODY de verdad. */
html.la-editor-open,html.la-editor-open body{overflow:hidden!important;}
html[data-celda-design="sgi"] body>.la-editor-overlay{
  position:fixed!important;
  inset:0!important;
  z-index:250000!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:28px!important;
  box-sizing:border-box!important;
  background:rgba(22,36,53,.55)!important;
  backdrop-filter:blur(9px)!important;
  -webkit-backdrop-filter:blur(9px)!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor{
  width:min(1080px,calc(100vw - 56px))!important;
  max-height:min(88vh,900px)!important;
  margin:0!important;
  padding:0!important;
  overflow:auto!important;
  border:1px solid #dbe6f1!important;
  border-radius:22px!important;
  background:#fff!important;
  box-shadow:0 42px 110px rgba(11,30,52,.32)!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-modal-head{
  position:sticky!important;
  top:0!important;
  z-index:6!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:16px!important;
  margin:0!important;
  padding:20px 22px 16px!important;
  border-bottom:1px solid #e4ebf3!important;
  border-radius:21px 21px 0 0!important;
  background:rgba(249,252,255,.98)!important;
  backdrop-filter:blur(8px)!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-modal-head span{
  color:#2878ed!important;
  font-size:9px!important;
  font-weight:850!important;
  letter-spacing:.13em!important;
  text-transform:uppercase!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-modal-head h2{
  margin:4px 0 0!important;
  color:#18395e!important;
  font-size:21px!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-modal-head [data-la="editor-cancel"]{
  width:38px!important;
  height:38px!important;
  min-width:38px!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  border:1px solid #d7e3ef!important;
  border-radius:12px!important;
  background:#fff!important;
  color:#607990!important;
  font-size:21px!important;
  line-height:1!important;
  box-shadow:none!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-modal-head [data-la="editor-cancel"]::before{
  display:none!important;content:none!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay form#la-editor{
  padding:18px 22px 22px!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-fields{gap:12px!important;}
html[data-celda-design="sgi"] body>.la-editor-overlay label,
html[data-celda-design="sgi"] body>.la-editor-overlay legend{
  color:#5e728a!important;
  font-size:11.5px!important;
  font-weight:700!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay :is(input,select,textarea){
  min-height:42px!important;
  border:1px solid #d5e1ee!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#263f5c!important;
  font-size:12.7px!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-actions{
  display:flex!important;
  justify-content:flex-end!important;
  gap:9px!important;
  margin:18px -22px -22px!important;
  padding:14px 22px!important;
  border-top:1px solid #e3ebf3!important;
  background:#fff!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-actions button{
  min-height:40px!important;
  padding:8px 15px!important;
  border-radius:10px!important;
  font-size:12px!important;
  font-weight:780!important;
  box-shadow:none!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-actions button[type="submit"]{
  border:1px solid #2b78d2!important;
  background:#2f80df!important;
  color:#fff!important;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-actions button[data-la="editor-cancel"]{
  border:1px solid #d2dfec!important;
  background:#fff!important;
  color:#315a83!important;
}
html.la-editor-open body #celda-system-bar,
html.la-editor-open body #celda-context-hub,
html.la-editor-open body #celda-action-banner{
  visibility:hidden!important;
  pointer-events:none!important;
}

/* 4) Formularios experimentales: botones antiguos dentro del sheet se unifican. */
html[data-celda-design="sgi"] body>.exp-sheet-overlay .celda-form-actions,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .user-form-actions{
  display:flex!important;
  justify-content:flex-end!important;
  flex-wrap:wrap!important;
  gap:9px!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .celda-form-actions button,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .user-form-actions button{
  min-width:0!important;
  padding:8px 15px!important;
}

/* 5) Botón X inequívoco y sin iconos parásitos. */
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-close{
  font-family:Arial,sans-serif!important;
  font-weight:500!important;
  color:#557089!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-close::before,
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-close::after{
  content:none!important;display:none!important;
}

/* 6) Más aire útil en tablas/listados, sin achicar tipografía. */
html[data-celda-design="sgi"] #erp-root .exp-ui-experiment table{font-size:12.2px!important;}
html[data-celda-design="sgi"] #erp-root .exp-ui-experiment th{font-size:10.3px!important;}
html[data-celda-design="sgi"] #erp-root .exp-ui-experiment td{padding-top:11px!important;padding-bottom:11px!important;}

@media(max-width:760px){
  html[data-celda-design="sgi"] body>.la-editor-overlay{padding:10px!important;align-items:flex-end!important;}
  html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor{
    width:100%!important;max-height:92vh!important;border-radius:18px 18px 0 0!important;
  }
  html[data-celda-design="sgi"] #erp-root .exp-view-head{padding-right:0!important;}
}

/* ========================================================================== 
   EXPERIMENTAL R4 · Integración modal/concurrencia/mensajes + navegación
   ========================================================================== */

/* Jerarquía única de overlays. El editor experimental queda debajo de cualquier
   evento de seguridad/concurrencia/confirmación, nunca al revés. */
html[data-celda-design="sgi"] body>.exp-sheet-overlay{z-index:250000!important;}
html[data-celda-design="sgi"] body #celda-action-banner{z-index:270000!important;}
html[data-celda-design="sgi"] body #celda-notification-stack{z-index:285000!important;}
html[data-celda-design="sgi"] body .celda-global-overlay{z-index:310000!important;}
html[data-celda-design="sgi"] body #celda-conflict-overlay{z-index:320000!important;}
html[data-celda-design="sgi"] body #celda-password-gate,
html[data-celda-design="sgi"] body #celda-login-gate{z-index:330000!important;}

/* Un cambio externo sí debe ser visible mientras se edita en un sheet. Solo se
   ocultan los botones de navegación/chrome que no deben competir con el modal. */
html.exp-sheet-open body #celda-system-bar,
html.exp-sheet-open body #celda-context-hub{visibility:hidden!important;pointer-events:none!important;}
html.exp-sheet-open body #celda-action-banner{
  visibility:visible!important;pointer-events:auto!important;
  right:24px!important;top:24px!important;
  width:min(420px,calc(100vw - 48px))!important;
  max-width:420px!important;
  box-shadow:0 28px 74px rgba(16,43,73,.25)!important;
}
html.exp-sheet-open body #celda-notification-stack{
  display:grid!important;right:24px!important;top:24px!important;
  width:min(390px,calc(100vw - 48px))!important;
}
/* Cuando existen banner y toast simultáneos, los toasts bajan para no taparse. */
html.exp-sheet-open body:has(#celda-action-banner:not([hidden])) #celda-notification-stack{top:238px!important;}

/* El sheet queda visualmente en segundo plano mientras una decisión superior
   está activa, pero no se destruye el formulario ni su dirty state. */
html[data-celda-design="sgi"] body>.exp-sheet-overlay.exp-sheet-suspended .exp-sheet{
  filter:saturate(.88) brightness(.94)!important;
  transform:scale(.992)!important;
  pointer-events:none!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay.exp-sheet-suspended::after{
  content:'';position:absolute;inset:0;background:rgba(20,35,53,.08);pointer-events:none;
}

/* Señal inequívoca cuando Editar/Nuevo redirige correctamente al formulario. */
@keyframes celdaExpSheetAttention{
  0%{box-shadow:0 42px 110px rgba(11,30,52,.32),0 0 0 0 rgba(43,126,218,0)}
  35%{box-shadow:0 42px 110px rgba(11,30,52,.32),0 0 0 5px rgba(43,126,218,.18)}
  100%{box-shadow:0 42px 110px rgba(11,30,52,.32),0 0 0 0 rgba(43,126,218,0)}
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet.exp-sheet-attention{
  animation:celdaExpSheetAttention .9s ease-out 1!important;
}

/* Highlight de avisos: visible sobre el diseño claro, no solo un outline tenue. */
html[data-celda-design="sgi"] .cch-target-highlight{
  outline:3px solid rgba(36,126,226,.42)!important;
  outline-offset:5px!important;
  border-radius:14px!important;
  box-shadow:0 0 0 7px rgba(36,126,226,.08),0 12px 30px rgba(36,91,150,.10)!important;
  animation:celdaTargetSignal .8s ease-out 2!important;
}
@keyframes celdaTargetSignal{
  0%,100%{filter:none}
  50%{filter:brightness(1.025)}
}

/* Encabezados de vista: Nuevo/Registrar se mantiene a la derecha pero por debajo
   de la zona ocupada por campana/usuario. No se centra artificialmente. */
@media (min-width:1001px){
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:start!important;
    column-gap:24px!important;
    min-height:78px!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar{
    grid-column:2!important;
    justify-self:end!important;
    align-self:start!important;
    margin-top:38px!important;
    padding-right:0!important;
    max-width:min(680px,55vw)!important;
    justify-content:flex-end!important;
  }
}
@media (max-width:1000px){
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar{
    width:100%!important;justify-content:flex-start!important;margin-top:12px!important;
  }
}

/* R4: botones de alta/edición más sobrios y legibles. */
html[data-celda-design="sgi"] #erp-root .exp-new-button{
  min-height:40px!important;padding:0 14px!important;
  background:#fff!important;color:#215f9e!important;border:1px solid #c9daec!important;
  box-shadow:0 3px 10px rgba(29,73,116,.06)!important;
}
html[data-celda-design="sgi"] #erp-root .exp-new-button:hover,
html[data-celda-design="sgi"] #erp-root .exp-new-button:focus-visible{
  background:#edf6ff!important;border-color:#9fc2e5!important;color:#155b9d!important;
}
html[data-celda-design="sgi"] #erp-root .exp-new-button svg{width:17px!important;height:17px!important;stroke-width:1.8!important;}

/* El mensaje de confirmación o conflicto siempre debe ser clicable por encima del sheet. */
html[data-celda-design="sgi"] body .celda-global-overlay,
html[data-celda-design="sgi"] body #celda-conflict-overlay{pointer-events:auto!important;}

@media (max-width:760px){
  html.exp-sheet-open body #celda-action-banner{left:10px!important;right:10px!important;top:10px!important;width:auto!important;max-width:none!important;}
  html.exp-sheet-open body #celda-notification-stack{left:10px!important;right:10px!important;top:72px!important;width:auto!important;}
  html.exp-sheet-open body:has(#celda-action-banner:not([hidden])) #celda-notification-stack{top:250px!important;}
}

/* Línea A recibe la misma jerarquía de eventos que los sheets experimentales. */
html.la-editor-open body #celda-system-bar,
html.la-editor-open body #celda-context-hub{visibility:hidden!important;pointer-events:none!important;}
html.la-editor-open body #celda-action-banner{
  visibility:visible!important;pointer-events:auto!important;z-index:270000!important;
  right:24px!important;top:24px!important;width:min(420px,calc(100vw - 48px))!important;max-width:420px!important;
}
html.la-editor-open body #celda-notification-stack{z-index:285000!important;right:24px!important;top:24px!important;}
html.la-editor-open body:has(#celda-action-banner:not([hidden])) #celda-notification-stack{top:238px!important;}
@media(max-width:760px){
  html.la-editor-open body #celda-action-banner{left:10px!important;right:10px!important;top:10px!important;width:auto!important;max-width:none!important;}
  html.la-editor-open body #celda-notification-stack{left:10px!important;right:10px!important;top:72px!important;width:auto!important;}
  html.la-editor-open body:has(#celda-action-banner:not([hidden])) #celda-notification-stack{top:250px!important;}
}

/* ========================================================================== 
   EXPERIMENTAL R5 · Estados de edición, colaboración visible y toolbar final
   ========================================================================== */

/* 1) La cuenta vuelve a comunicar el estado de protección cuando no hay modal. */
html[data-celda-design="sgi"] body #celda-system-toggle.has-protected-edit:not(.has-remote-pending){
  border-color:#bfd4e8!important;
  background:linear-gradient(180deg,#f8fbfe 0%,#eef4fa 100%)!important;
  box-shadow:0 5px 18px rgba(49,91,132,.10),inset 3px 0 0 #6d91b7!important;
}
html[data-celda-design="sgi"] body #celda-system-toggle.has-local-draft:not(.has-remote-pending){
  border-color:#a9caea!important;
  background:linear-gradient(180deg,#f4f9ff 0%,#e9f3fc 100%)!important;
  box-shadow:0 6px 20px rgba(40,108,174,.12),inset 3px 0 0 #2c7fd4!important;
}
html[data-celda-design="sgi"] body #celda-system-toggle.has-remote-pending{
  border-color:#edc26c!important;
  background:linear-gradient(180deg,#fffdf8 0%,#fff7e7 100%)!important;
  box-shadow:0 7px 22px rgba(177,116,21,.13),inset 3px 0 0 #d99318!important;
}

/* 2) Estado de seguridad dentro del propio formulario modal. Sustituye la
   información que antes solo se percibía por el color del panel de usuario. */
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety{
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  min-height:40px!important;
  margin:0!important;
  padding:8px 22px!important;
  border-top:1px solid #e5edf5!important;
  border-bottom:1px solid #e5edf5!important;
  background:#f7fafc!important;
  color:#587086!important;
  box-sizing:border-box!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-safety-icon,
html[data-celda-design="sgi"] body>.la-editor-overlay .exp-safety-icon{
  display:grid!important;place-items:center!important;
  width:28px!important;height:28px!important;flex:0 0 28px!important;
  border-radius:9px!important;background:#edf3f8!important;color:#607f9e!important;
  font:800 14px/1 Arial,sans-serif!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-safety-copy,
html[data-celda-design="sgi"] body>.la-editor-overlay .exp-safety-copy{display:flex!important;flex-direction:column!important;min-width:0!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-safety-copy b,
html[data-celda-design="sgi"] body>.la-editor-overlay .exp-safety-copy b{color:#36536f!important;font-size:10.8px!important;line-height:1.25!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-safety-copy small,
html[data-celda-design="sgi"] body>.la-editor-overlay .exp-safety-copy small{margin-top:2px!important;color:#8192a3!important;font-size:9.5px!important;line-height:1.3!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-dirty,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-dirty{
  background:#f2f8ff!important;border-color:#d2e4f5!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-dirty .exp-safety-icon,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-dirty .exp-safety-icon{background:#e1effd!important;color:#2474c4!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-remote,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-remote{
  background:#fff9ed!important;border-color:#efd5a3!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-remote .exp-safety-icon,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-remote .exp-safety-icon{background:#fff0cf!important;color:#b8780d!important;}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-remote .exp-safety-copy b,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-remote .exp-safety-copy b{color:#8e6115!important;}

/* 3) Durante un modal se oculta el chrome normal, PERO el indicador de
   colaboración sigue disponible como una pequeña píldora independiente. */
html.exp-sheet-open body #celda-system-bar,
html.la-editor-open body #celda-system-bar{visibility:hidden!important;pointer-events:none!important;}
html.exp-sheet-open body #celda-context-hub,
html.la-editor-open body #celda-context-hub{
  visibility:visible!important;display:flex!important;pointer-events:none!important;
  top:18px!important;right:20px!important;left:auto!important;z-index:298000!important;
}
html.exp-sheet-open body #celda-context-hub .celda-context-panel,
html.la-editor-open body #celda-context-hub .celda-context-panel{display:none!important;}
html.exp-sheet-open body #celda-context-hub .cch-button,
html.la-editor-open body #celda-context-hub .cch-button{display:none!important;}
html.exp-sheet-open body #celda-context-hub .cch-collaboration-button,
html.la-editor-open body #celda-context-hub .cch-collaboration-button{
  display:inline-flex!important;pointer-events:auto!important;
  width:auto!important;min-width:0!important;height:38px!important;padding:0 11px!important;gap:7px!important;
  border:1px solid #ebc36f!important;border-radius:12px!important;
  background:#fff9eb!important;color:#9b6711!important;
  box-shadow:0 10px 28px rgba(126,83,15,.16)!important;
}
html.exp-sheet-open body #celda-context-hub .cch-collaboration-glyph,
html.la-editor-open body #celda-context-hub .cch-collaboration-glyph{color:#b4760d!important;font-size:17px!important;font-weight:900!important;}
html.exp-sheet-open body #celda-context-hub .cch-collaboration-label,
html.la-editor-open body #celda-context-hub .cch-collaboration-label{display:inline!important;color:#8f6012!important;font-size:10.5px!important;font-weight:850!important;}
html.exp-sheet-open body #celda-context-hub .cch-collaboration-button .cch-badge,
html.la-editor-open body #celda-context-hub .cch-collaboration-button .cch-badge{background:#d98d10!important;color:#fff!important;border:2px solid #fff!important;}

/* 4) Primer aviso colaborativo: compacto, legible y con la acción segura como
   principal. Permanece hasta que el usuario decida qué hacer. */
html.exp-sheet-open body #celda-action-banner,
html.la-editor-open body #celda-action-banner{
  visibility:visible!important;pointer-events:auto!important;z-index:300000!important;
  top:68px!important;right:20px!important;left:auto!important;
  width:min(390px,calc(100vw - 40px))!important;max-width:390px!important;
  padding:14px!important;border:1px solid #e9c46f!important;border-left:4px solid #d49319!important;
  border-radius:16px!important;background:rgba(255,253,247,.985)!important;
  box-shadow:0 24px 64px rgba(35,55,78,.24)!important;
}
html.exp-sheet-open body #celda-action-banner .cab-row,
html.la-editor-open body #celda-action-banner .cab-row{gap:10px!important;}
html.exp-sheet-open body #celda-action-banner .cab-icon,
html.la-editor-open body #celda-action-banner .cab-icon{width:34px!important;height:34px!important;border-radius:10px!important;background:#fff0cc!important;color:#ae710d!important;}
html.exp-sheet-open body #celda-action-banner .cab-kicker,
html.la-editor-open body #celda-action-banner .cab-kicker{font-size:8px!important;}
html.exp-sheet-open body #celda-action-banner .cab-title,
html.la-editor-open body #celda-action-banner .cab-title{font-size:13.5px!important;}
html.exp-sheet-open body #celda-action-banner .cab-text,
html.la-editor-open body #celda-action-banner .cab-text{font-size:10.5px!important;line-height:1.45!important;}
html.exp-sheet-open body #celda-action-banner .cab-meta,
html.la-editor-open body #celda-action-banner .cab-meta{display:none!important;}
html.exp-sheet-open body #celda-action-banner .cab-modules,
html.la-editor-open body #celda-action-banner .cab-modules{margin-top:6px!important;}
html.exp-sheet-open body #celda-action-banner .cab-actions,
html.la-editor-open body #celda-action-banner .cab-actions{display:flex!important;justify-content:flex-end!important;gap:8px!important;margin-top:10px!important;}
html.exp-sheet-open body #celda-action-banner #celda-keep-editing,
html.la-editor-open body #celda-action-banner #celda-keep-editing{
  order:-1!important;background:#2f80df!important;border-color:#2b77cb!important;color:#fff!important;font-weight:800!important;
}
html.exp-sheet-open body #celda-action-banner #celda-discard-sync,
html.la-editor-open body #celda-action-banner #celda-discard-sync{
  background:#fff!important;border-color:#e5c278!important;color:#996412!important;box-shadow:none!important;
}

/* 5) Los toasts vuelven a ser siempre visibles a la derecha aun durante un
   formulario o conflicto. Se colocan abajo para no chocar con colaboración. */
html.exp-sheet-open body #celda-notification-stack,
html.la-editor-open body #celda-notification-stack{
  display:grid!important;visibility:visible!important;pointer-events:none!important;
  top:auto!important;bottom:22px!important;right:22px!important;left:auto!important;
  width:min(390px,calc(100vw - 44px))!important;
}
html.exp-sheet-open body #celda-notification-stack .celda-note,
html.la-editor-open body #celda-notification-stack .celda-note{pointer-events:auto!important;}

/* 6) Acciones de vista: una segunda fila dedicada permite colocar Nuevo en el
   extremo derecho SIN pelear con la barra global. */
@media (min-width:1001px){
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto!important;
    width:100%!important;min-height:0!important;gap:0!important;padding-right:0!important;margin-bottom:15px!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-view-copy{
    grid-row:1!important;grid-column:1!important;padding-right:310px!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar{
    grid-row:2!important;grid-column:1!important;justify-self:end!important;align-self:start!important;
    width:auto!important;max-width:100%!important;margin:12px 0 0!important;padding:0!important;
    justify-content:flex-end!important;
  }
}
html[data-celda-design="sgi"] #erp-root .exp-create-toolbar :is(button,a):not(.exp-new-button){
  min-height:40px!important;padding:0 13px!important;border:1px solid #d1dfed!important;border-radius:11px!important;
  background:#fff!important;color:#315d88!important;box-shadow:0 3px 10px rgba(30,68,108,.05)!important;
  font-size:11px!important;font-weight:760!important;text-decoration:none!important;
}
html[data-celda-design="sgi"] #erp-root .exp-create-toolbar :is(button,a):not(.exp-new-button):hover,
html[data-celda-design="sgi"] #erp-root .exp-create-toolbar :is(button,a):not(.exp-new-button):focus-visible{
  background:#f3f8fd!important;border-color:#b8cee4!important;color:#1d5d9c!important;outline:none!important;
}
html[data-celda-design="sgi"] #erp-root .exp-create-toolbar .la-actions{display:contents!important;}

@media(max-width:1000px){
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar{
    width:100%!important;justify-content:flex-end!important;margin-top:10px!important;
  }
}
@media(max-width:760px){
  html.exp-sheet-open body #celda-context-hub,
  html.la-editor-open body #celda-context-hub{top:10px!important;right:10px!important;}
  html.exp-sheet-open body #celda-action-banner,
  html.la-editor-open body #celda-action-banner{left:10px!important;right:10px!important;top:58px!important;width:auto!important;max-width:none!important;}
  html.exp-sheet-open body #celda-notification-stack,
  html.la-editor-open body #celda-notification-stack{left:10px!important;right:10px!important;bottom:10px!important;width:auto!important;}
  html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety,
  html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety{padding:8px 14px!important;}
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-safety-icon svg,
html[data-celda-design="sgi"] body>.la-editor-overlay .exp-safety-icon svg{width:16px!important;height:16px!important;display:block!important;}

/* ========================================================================== 
   EXPERIMENTAL R6 · Lifecycle transaccional y estado visible de edición
   ========================================================================== */

/* La barra de seguridad debe percibirse incluso antes de existir cambios. */
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-editing,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-editing{
  background:linear-gradient(90deg,#edf6ff 0%,#f7fbff 100%)!important;
  border-top-color:#cfe1f3!important;
  border-bottom-color:#cfe1f3!important;
  box-shadow:inset 4px 0 0 #5f93c7!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-editing .exp-safety-icon,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-editing .exp-safety-icon{
  background:#dfeeff!important;
  color:#3978b8!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-editing .exp-safety-copy b,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-editing .exp-safety-copy b{
  color:#245b91!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-dirty,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-dirty{
  background:linear-gradient(90deg,#e6f2ff 0%,#f3f9ff 100%)!important;
  border-color:#bcd8f1!important;
  box-shadow:inset 4px 0 0 #2379cc!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-remote,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-remote{
  box-shadow:inset 4px 0 0 #d8951f!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-safety-badge,
html[data-celda-design="sgi"] body>.la-editor-overlay .exp-safety-badge{
  margin-left:auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:24px!important;
  padding:0 9px!important;
  border-radius:999px!important;
  border:1px solid #bfd7ed!important;
  background:#fff!important;
  color:#47739d!important;
  font:800 9px/1 Arial,sans-serif!important;
  font-style:normal!important;
  letter-spacing:.035em!important;
  white-space:nowrap!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-dirty .exp-safety-badge,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-dirty .exp-safety-badge{
  border-color:#a8cceb!important;background:#f8fcff!important;color:#236cb4!important;
}
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-safety.is-remote .exp-safety-badge,
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-remote .exp-safety-badge{
  border-color:#e9c67f!important;background:#fffdf8!important;color:#a46c11!important;
}

/* Fuera del modal, el control de usuario recupera un estado azul/gris inequívoco. */
html[data-celda-design="sgi"] body #celda-system-toggle.has-protected-edit:not(.has-remote-pending){
  border-color:#9fc2e2!important;
  background:linear-gradient(180deg,#edf6ff 0%,#e5f0fa 100%)!important;
  box-shadow:0 7px 22px rgba(39,98,157,.14),inset 4px 0 0 #4e87bd!important;
}
html[data-celda-design="sgi"] body #celda-system-toggle.has-local-draft:not(.has-remote-pending){
  border-color:#75acd9!important;
  background:linear-gradient(180deg,#e7f3ff 0%,#dcecfb 100%)!important;
  box-shadow:0 8px 24px rgba(33,105,173,.17),inset 4px 0 0 #1f78c8!important;
}

/* Cierre y acciones del sheet: áreas táctiles previsibles. */
html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-sheet-close{
  width:38px!important;height:38px!important;min-width:38px!important;
  display:grid!important;place-items:center!important;padding:0!important;
  border-radius:12px!important;font:500 20px/1 Arial,sans-serif!important;
}

@media(max-width:760px){
  html[data-celda-design="sgi"] body>.exp-sheet-overlay .exp-safety-badge,
  html[data-celda-design="sgi"] body>.la-editor-overlay .exp-safety-badge{display:none!important;}
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety::after{
  content:'Protegido';margin-left:auto;display:inline-flex;align-items:center;justify-content:center;
  min-height:24px;padding:0 9px;border-radius:999px;border:1px solid #bfd7ed;background:#fff;color:#47739d;
  font:800 9px/1 Arial,sans-serif;letter-spacing:.035em;white-space:nowrap;
}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-dirty::after{content:'Borrador local';border-color:#a8cceb;color:#236cb4;}
html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety.is-remote::after{content:'Cambio externo';border-color:#e9c67f;color:#a46c11;}
@media(max-width:760px){html[data-celda-design="sgi"] body>.la-editor-overlay .la-editor-safety::after{display:none!important;}}

/* ========================================================================== 
   EXPERIMENTAL R8 · Responsive consistente + acciones siempre a la derecha
   ========================================================================== */

/* Escritorio: dos filas limpias. La segunda pertenece exclusivamente a acciones. */
@media (min-width:1001px){
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    width:100%!important;
    gap:0!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-view-copy{
    grid-column:1!important;grid-row:1!important;padding-right:300px!important;min-width:0!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar{
    grid-column:1!important;grid-row:2!important;
    width:100%!important;max-width:none!important;
    display:flex!important;justify-content:flex-end!important;align-items:center!important;
    margin:10px 0 0!important;padding:0!important;
  }
}

/* Laptop / media pantalla: anteriormente heredaba display:flex y el toolbar se
   encogía junto al título, dejando los botones visualmente en el centro. */
@media (min-width:761px) and (max-width:1000px){
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    width:100%!important;gap:0!important;min-width:0!important;
    margin-bottom:14px!important;padding-right:0!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-view-copy{
    grid-column:1!important;grid-row:1!important;min-width:0!important;padding-right:0!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar{
    grid-column:1!important;grid-row:2!important;
    display:flex!important;width:100%!important;max-width:none!important;
    justify-content:flex-end!important;align-items:center!important;flex-wrap:wrap!important;
    margin:10px 0 0!important;padding:0!important;gap:8px!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar>*{
    flex:0 0 auto!important;width:auto!important;max-width:100%!important;
  }
  html[data-celda-design="sgi"] #erp-root .exp-kpi-strip{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
}

/* Móvil/tablet angosta: las acciones siguen naciendo desde el lado derecho.
   Si no caben, envuelven hacia una nueva línea sin pasar al centro. */
@media (max-width:760px){
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto auto!important;
    width:100%!important;margin-bottom:13px!important;padding:0!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-view-copy{
    grid-column:1!important;grid-row:1!important;min-width:0!important;padding:0!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar{
    grid-column:1!important;grid-row:2!important;
    display:flex!important;width:100%!important;max-width:none!important;
    justify-content:flex-end!important;align-items:center!important;flex-wrap:wrap!important;
    margin:9px 0 0!important;padding:0!important;gap:7px!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar>*{
    flex:0 1 auto!important;width:auto!important;max-width:100%!important;
  }
  html[data-celda-design="sgi"] #erp-root .exp-kpi-strip{grid-template-columns:1fr!important;}
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment .card:has(>table),
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment .table-wrap{
    overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;
  }
}

@media (max-width:520px){
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar{
    display:grid!important;grid-template-columns:1fr!important;justify-items:stretch!important;
  }
  html[data-celda-design="sgi"] #erp-root #main.exp-ui-experiment>.exp-view-head>.exp-create-toolbar>*{
    width:100%!important;justify-content:center!important;
  }
}

/* Administrative report workspace: compact summaries, progressive detail, no decorative glow. */
.celda-reports-hub{max-width:1500px;margin:0 auto}.celda-reports-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.celda-report-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:20px 0}.celda-report-metrics article{border:1px solid #d7e2ee;border-radius:8px;background:var(--surface,#fff);padding:20px;display:grid;gap:6px}.celda-report-metrics strong{font-size:28px;color:#235f91}.celda-report-metrics span{font-size:12px;color:var(--ink-soft,#53657c)}
.celda-report-filters{display:grid;grid-template-columns:minmax(220px,2fr) repeat(2,minmax(150px,1fr)) auto auto;gap:12px;align-items:end}.celda-report-filters label{display:grid;gap:7px;font-size:12px}.celda-report-filters :is(input,select){width:100%;min-width:0;box-sizing:border-box}.celda-report-guidance{font-size:12px;padding:10px 0}.celda-report-guidance summary{cursor:pointer}
.celda-report-list{display:grid;gap:16px}.celda-reports-hub .celda-report-card{margin:0;box-shadow:none!important;border:1px solid #d7e2ee!important}.celda-report-card h2{margin:5px 0;font-size:20px}.celda-report-card .section-head p{margin:6px 0}.celda-report-card-facts{display:flex;gap:14px;align-items:center;flex-wrap:wrap;padding-bottom:16px;font-size:12px}.celda-report-results,.celda-report-versions{border-top:1px solid #e1e9f2;padding:14px 0}.celda-report-results>summary,.celda-report-versions>summary{font-size:13px;font-weight:600;cursor:pointer}.celda-report-result{border:1px solid #dce6f0;border-radius:6px;margin-top:10px;overflow:hidden}.celda-report-result>summary{cursor:pointer;padding:12px;display:flex;align-items:center;gap:12px;flex-wrap:wrap;background:var(--surface-subtle,#f6f9fc);font-size:12px}.celda-report-result>summary b{flex:1;min-width:130px}.celda-report-result-body{padding:16px}.celda-report-result-body p{white-space:pre-wrap;overflow-wrap:anywhere}.celda-report-pagination{display:flex;justify-content:center;align-items:center;gap:16px;margin:20px 0}
@media(max-width:1100px){.celda-report-filters{grid-template-columns:repeat(2,minmax(0,1fr))}.celda-report-filters label:first-child{grid-column:1/-1}}
@media(max-width:600px){.celda-report-metrics{gap:7px}.celda-report-metrics article{padding:12px}.celda-report-metrics strong{font-size:23px}.celda-report-filters{grid-template-columns:minmax(0,1fr)}.celda-report-card .section-head{align-items:start;flex-direction:column}.celda-report-result-body{padding:12px}}

/* Solicitudes: evidence-based progress and navigation without remounting forms. */
.celda-request-list-panel>summary{font-size:14px;font-weight:600;cursor:pointer;padding:12px 0}.celda-request-search{min-width:220px;flex:2;display:grid;gap:7px}.celda-request-search input{width:100%;min-width:0;box-sizing:border-box}.celda-request-list-panel .celda-stage-table-card{overflow-x:auto}.celda-request-progress{border:1px solid #d7e2ee;border-radius:8px;padding:18px;background:var(--surface,#fff);margin:16px 0}.celda-request-next{display:flex;align-items:start;justify-content:space-between;gap:15px}.celda-request-next h3{margin:6px 0!important}.celda-request-next p{font-size:13px;line-height:1.6;margin:5px 0}.celda-request-progress ol{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;list-style:none;counter-reset:request-stage;padding:0;margin:16px 0 0}.celda-request-progress li{counter-increment:request-stage;border:1px solid #dce6ef;border-radius:6px;padding:12px;display:grid;gap:8px;font-size:12px}.celda-request-progress li b::before{content:counter(request-stage) " · ";color:#53718e}.celda-request-progress li span{color:var(--ink-soft,#53657c);line-height:1.5;overflow-wrap:anywhere}.celda-request-progress li[data-evidence=recorded]{border-left:3px solid #327854}.celda-request-section-nav{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0 24px}.celda-request-section-nav:empty{display:none}#solicitud-editor-card :is(form,details,h2,h3){scroll-margin-top:65px}
@media(max-width:900px){.celda-request-progress ol{grid-template-columns:repeat(2,minmax(0,1fr))}.celda-request-search{flex-basis:100%}}
@media(max-width:600px){.celda-request-progress{padding:12px}.celda-request-progress ol{grid-template-columns:minmax(0,1fr)}.celda-request-next{flex-direction:column}.celda-request-list-panel .celda-module-toolbar{display:grid;grid-template-columns:minmax(0,1fr)}.celda-request-search{min-width:0}}
