/* SIGEL Responsive V1.4 - shell estable sin depender del motor responsive de AdminLTE */
:root{
  --sigel-sidebar:260px;
  --sigel-header:58px;
  --sigel-bg:#f4f6f9;
  --sigel-sidebar-bg:#332e4f;
  --sigel-border:#e3e8ef;
  --sigel-shadow:0 8px 28px rgba(15,23,42,.10);
}
*,*::before,*::after{box-sizing:border-box}
html{width:100%;max-width:100%;overflow-x:hidden}
body.sigel-shell{margin:0;min-height:100vh;width:100%;max-width:100%;overflow-x:hidden;background:var(--sigel-bg);color:#263238}
body.sigel-shell img,body.sigel-shell svg,body.sigel-shell video,body.sigel-shell canvas{max-width:100%;height:auto}
body.sigel-shell .app-wrapper{display:block!important;min-height:100vh;width:100%;max-width:100%;overflow:visible!important}

/* Sidebar: geometría propia, no la de AdminLTE */
body.sigel-shell .app-sidebar{
  position:fixed!important;inset:0 auto 0 0!important;width:var(--sigel-sidebar)!important;min-width:var(--sigel-sidebar)!important;
  height:100dvh!important;transform:none!important;margin:0!important;z-index:1040!important;background:var(--sigel-sidebar-bg)!important;
  border:0!important;box-shadow:none!important;overflow:hidden!important;transition:transform .22s ease!important;
}
body.sigel-shell .sidebar-brand{height:var(--sigel-header)!important;min-height:var(--sigel-header)!important;display:flex!important;align-items:center!important;border-bottom:1px solid rgba(255,255,255,.08)!important;padding:0 14px!important}
body.sigel-shell .brand-link{display:flex!important;align-items:center!important;width:100%!important;min-width:0!important;text-decoration:none!important;color:#fff!important}
body.sigel-shell .brand-text{color:#fff!important;font-size:1.1rem!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
body.sigel-shell .sidebar-wrapper{height:calc(100dvh - var(--sigel-header))!important;overflow-y:auto!important;overflow-x:hidden!important;padding:8px 8px 20px!important;overscroll-behavior:contain}
body.sigel-shell #navigation{width:100%!important;min-width:0!important}
body.sigel-shell #navigation .nav-item{width:100%!important;min-width:0!important}
body.sigel-shell #navigation .nav-link{display:flex!important;align-items:center!important;gap:9px!important;width:100%!important;min-width:0!important;min-height:42px!important;padding:9px 11px!important;border-radius:8px!important}
body.sigel-shell #navigation .nav-link .nav-icon{flex:0 0 20px!important;margin:0!important;text-align:center!important}
body.sigel-shell #navigation .nav-link p{display:flex!important;align-items:center!important;gap:6px!important;flex:1 1 auto!important;min-width:0!important;margin:0!important;white-space:normal!important;overflow:visible!important;text-overflow:clip!important;line-height:1.2!important;overflow-wrap:anywhere!important}
body.sigel-shell #navigation .collapse{max-width:100%!important}
body.sigel-shell #navigation .collapse .nav-link{padding-left:13px!important;font-size:.92rem!important}
body.sigel-shell .sigel-sidebar-close{display:none;border:0;background:rgba(255,255,255,.10);color:#fff;width:38px;height:38px;border-radius:9px;margin-left:auto;align-items:center;justify-content:center;font-size:1.25rem}

/* Header / main / footer siempre ocupan el espacio restante */
body.sigel-shell .app-header{position:sticky!important;top:0!important;left:auto!important;right:auto!important;margin:0 0 0 var(--sigel-sidebar)!important;width:calc(100% - var(--sigel-sidebar))!important;max-width:calc(100% - var(--sigel-sidebar))!important;min-height:var(--sigel-header)!important;z-index:1030!important;background:#fff!important;border-bottom:1px solid var(--sigel-border)!important;box-shadow:0 1px 4px rgba(15,23,42,.04)!important}
body.sigel-shell .app-header .container-fluid{min-height:var(--sigel-header)!important;padding:0 14px!important;display:flex!important;align-items:center!important;max-width:100%!important}
body.sigel-shell .app-header .navbar-nav{display:flex!important;flex-direction:row!important;align-items:center!important;min-width:0!important}
body.sigel-shell .app-header .nav-link{min-height:44px!important;display:flex!important;align-items:center!important;justify-content:center!important}
body.sigel-shell .app-main{display:block!important;margin:0 0 0 var(--sigel-sidebar)!important;width:calc(100% - var(--sigel-sidebar))!important;max-width:calc(100% - var(--sigel-sidebar))!important;min-width:0!important;padding:0!important;overflow:visible!important;background:var(--sigel-bg)!important}
body.sigel-shell .app-content{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;padding:14px 0 24px!important;overflow:visible!important}
body.sigel-shell .app-content>.container-fluid,body.sigel-shell .sigel-content{width:100%!important;max-width:100%!important;min-width:0!important;padding-left:16px!important;padding-right:16px!important}
body.sigel-shell .app-footer{position:relative!important;inset:auto!important;margin:0 0 0 var(--sigel-sidebar)!important;width:calc(100% - var(--sigel-sidebar))!important;max-width:calc(100% - var(--sigel-sidebar))!important;padding:10px 16px!important;background:#fff!important;border-top:1px solid var(--sigel-border)!important;font-size:.84rem!important}

/* Evitar que cualquier vista fuerce ancho de escritorio */
body.sigel-shell .app-main *,body.sigel-shell .app-content *{min-width:0}
body.sigel-shell .container,body.sigel-shell .container-fluid{max-width:100%!important}
body.sigel-shell .row{max-width:100%!important}
body.sigel-shell .card,body.sigel-shell .panel,body.sigel-shell .modal-content,body.sigel-shell .lo-head,body.sigel-shell .lo-filters,body.sigel-shell .lo-table{max-width:100%!important}
body.sigel-shell pre,body.sigel-shell code{white-space:pre-wrap;overflow-wrap:anywhere}
body.sigel-shell iframe{max-width:100%;border:0}
body.sigel-shell input,body.sigel-shell select,body.sigel-shell textarea,body.sigel-shell .form-control,body.sigel-shell .form-select{max-width:100%}
body.sigel-shell .btn-toolbar,body.sigel-shell .btn-group,body.sigel-shell .lo-actions,body.sigel-shell .lo-filter-top,body.sigel-shell .lo-cat-row,body.sigel-shell .lo-stage,body.sigel-shell .flow-nav,body.sigel-shell .hero-actions{flex-wrap:wrap!important}

/* Tablas: nunca empujan el layout. Se envuelven por JS cuando una vista no lo hizo. */
body.sigel-shell .sigel-table-scroll,body.sigel-shell .table-responsive,body.sigel-shell .dt-layout-table,body.sigel-shell .lo-table-body{display:block!important;width:100%!important;max-width:100%!important;overflow-x:auto!important;overflow-y:visible!important;-webkit-overflow-scrolling:touch!important}
body.sigel-shell .sigel-table-scroll>table{margin-bottom:0!important}
body.sigel-shell table{max-width:none}
body.sigel-shell .dt-container{width:100%!important;max-width:100%!important;min-width:0!important}
body.sigel-shell .dt-layout-row{display:flex!important;flex-wrap:wrap!important;gap:8px!important;max-width:100%!important}
body.sigel-shell .dt-layout-cell{min-width:0!important;max-width:100%!important}
body.sigel-shell .dt-search input{max-width:100%!important}

#sigel-shell-overlay{display:none}

@media (max-width:991.98px){
  :root{--sigel-sidebar:min(84vw,310px)}
  body.sigel-shell .app-sidebar{transform:translateX(-102%)!important;box-shadow:none!important}
  body.sigel-shell.sigel-menu-open .app-sidebar{transform:translateX(0)!important;box-shadow:16px 0 40px rgba(15,23,42,.28)!important}
  body.sigel-shell .sigel-sidebar-close{display:flex!important}
  body.sigel-shell .app-header,body.sigel-shell .app-main,body.sigel-shell .app-footer{margin-left:0!important;width:100%!important;max-width:100%!important}
  body.sigel-shell .app-header{position:sticky!important;left:0!important;right:0!important}
  body.sigel-shell .app-content>.container-fluid,body.sigel-shell .sigel-content{padding-left:12px!important;padding-right:12px!important}
  #sigel-shell-overlay{display:block;position:fixed;inset:0;background:rgba(15,23,42,.48);z-index:1035;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease,visibility .2s ease}
  body.sigel-shell.sigel-menu-open #sigel-shell-overlay{opacity:1;visibility:visible;pointer-events:auto}
  body.sigel-shell.sigel-menu-open{overflow:hidden}
  body.sigel-shell .app-header .user-menu span{display:none!important}
  body.sigel-shell .app-header [data-sigel-fullscreen]{display:none!important}
  body.sigel-shell .lo-search{flex:1 1 100%!important;min-width:100%!important}
}

@media (max-width:767.98px){
  body.sigel-shell .app-content{padding-top:8px!important}
  body.sigel-shell .app-content>.container-fluid,body.sigel-shell .sigel-content{padding-left:8px!important;padding-right:8px!important}
  body.sigel-shell .app-content .row{--bs-gutter-x:.75rem!important}
  body.sigel-shell h1,body.sigel-shell .h1{font-size:clamp(1.35rem,6vw,1.75rem)!important}
  body.sigel-shell h2,body.sigel-shell .h2{font-size:clamp(1.15rem,5vw,1.45rem)!important}
  body.sigel-shell h3,body.sigel-shell .h3{font-size:clamp(1.02rem,4.5vw,1.25rem)!important}
  body.sigel-shell input,body.sigel-shell select,body.sigel-shell textarea,body.sigel-shell .form-control,body.sigel-shell .form-select{font-size:16px!important}
  body.sigel-shell .btn{min-height:40px}
  body.sigel-shell .card-body{padding:12px!important}
  body.sigel-shell .modal-dialog{margin:8px!important;max-width:calc(100vw - 16px)!important}
  body.sigel-shell .modal-content{max-height:calc(100dvh - 16px)!important}
  body.sigel-shell .modal-body{overflow-y:auto!important}
  body.sigel-shell .input-group{flex-wrap:wrap!important}
  body.sigel-shell .dt-layout-row>div{width:100%!important;margin:0!important}
  body.sigel-shell .dt-search,body.sigel-shell .dt-length{width:100%!important;text-align:left!important}
  body.sigel-shell .dt-search input{width:100%!important;margin:4px 0 0!important}
  body.sigel-shell .lo-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}
  body.sigel-shell .lo-actions>*{width:100%!important}
  body.sigel-shell .lo-legend{grid-template-columns:1fr!important}
  body.sigel-shell .ficha-grid{grid-template-columns:1fr!important}
}

@media (max-width:575.98px){
  body.sigel-shell .app-header .container-fluid{padding-left:6px!important;padding-right:6px!important}
  body.sigel-shell .app-footer{font-size:.76rem!important;padding:8px!important}
  body.sigel-shell .app-footer .float-end{display:none!important}
  body.sigel-shell .lo-actions{grid-template-columns:1fr!important}
  body.sigel-shell .dropdown-menu{max-width:calc(100vw - 16px)!important}
}

@media (min-width:992px){
  body.sigel-shell.sigel-sidebar-collapsed .app-sidebar{transform:translateX(-100%)!important}
  body.sigel-shell.sigel-sidebar-collapsed .app-header,body.sigel-shell.sigel-sidebar-collapsed .app-main,body.sigel-shell.sigel-sidebar-collapsed .app-footer{margin-left:0!important;width:100%!important;max-width:100%!important}
}

@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation-duration:.01ms!important}}
