/* Mandatos · v64 · depuración visual y de compatibilidad.
   Esta capa reemplaza v61-v63: no modifica el DOM para cambiar la marca ni los controles de informes. */
:root{--v64-petrol:#01495E;--v64-line:#cfe0e5;--v64-soft:#f4f8f9}

/* Identidad: el subtítulo existe en HTML y su contenedor no puede quedar oculto por v60. */
.sidebar .brand-copy{display:block!important;visibility:visible!important;opacity:1!important;width:100%!important;text-align:center!important}
.sidebar .brand-panel .subtitle{display:block!important;visibility:visible!important;opacity:1!important;color:#d9f5fb!important;font-size:9px!important;line-height:1.22!important;font-weight:700!important;margin:3px auto 0!important;max-width:185px!important;white-space:normal!important}
.brand-logo-picture{display:block!important;width:100%!important;text-align:center!important;line-height:0!important}
.brand-logo-picture .brand-logo{display:block!important;margin:0 auto!important}

/* Login: una sola marca y una sola denominación funcional. */
.login-brand .brand-module-title{display:block!important;color:var(--v64-petrol)!important;font-weight:800!important;font-size:13px!important;line-height:1.25!important;margin:8px auto 18px!important;max-width:310px!important}
.login-brand img{opacity:1!important;mix-blend-mode:normal!important}

/* Informes: controles ya salen del servidor en su forma definitiva; no hay reemplazo posterior con JS. */
.report-actions-card{position:relative!important;overflow:visible!important}
.report-output-v64{display:flex!important;align-items:flex-start!important;gap:9px!important;flex-wrap:wrap!important}
.report-format-v64{position:relative!important;margin:0!important}
.report-format-v64>summary{list-style:none!important;cursor:pointer!important;user-select:none!important}
.report-format-v64>summary::-webkit-details-marker{display:none!important}
.report-format-v64>summary::after{content:'⌄';margin-left:7px;font-size:12px}
.report-menu-v64{position:absolute!important;left:0!important;top:calc(100% + 6px)!important;z-index:150!important;min-width:210px!important;padding:7px!important;background:#fff!important;border:1px solid var(--v64-line)!important;border-radius:10px!important;box-shadow:0 14px 30px rgba(14,55,66,.14)!important;display:grid!important;gap:4px!important}
.report-menu-v64 a,.report-menu-v64 button{width:100%!important;display:block!important;text-align:left!important;border:0!important;background:transparent!important;color:#153f4a!important;text-decoration:none!important;border-radius:7px!important;padding:10px!important;font:inherit!important;font-weight:650!important;cursor:pointer!important}
.report-menu-v64 a:hover,.report-menu-v64 button:hover{background:var(--v64-soft)!important;text-decoration:none!important}
.report-menu-v64 button[disabled]{opacity:.55!important;cursor:wait!important}

/* Estado visual definitivo de alertas: evita que sobreviva la versión intensa de style.css. */
.dashboard-alert-card,.card.dashboard-alert-card,.dashboard-alert-card-strong{background:#fff!important;border:1px solid #e1e7e9!important;box-shadow:0 1px 4px rgba(37,58,64,.04)!important}
.dashboard-alert-card::before,.card.dashboard-alert-card::before,.dashboard-alert-card-strong::before,.dash-alert-strip,.alert-legend{display:none!important;content:none!important}
.dash-alert-head,.dash-alert-head-strong{padding:4px 5px!important;margin:0 0 6px!important;border:0!important;border-radius:0!important;background:transparent!important;gap:8px!important}
.dash-alert-icon{width:25px!important;height:25px!important;flex:0 0 25px!important;border-radius:6px!important;background:#f6e9e7!important;color:#9d4e45!important;font-size:14px!important;box-shadow:none!important}
.dash-alert-head h3{font-size:12.5px!important;color:#574947!important;margin:0 0 1px!important}
.dash-alert-head p{font-size:9.7px!important;color:#748187!important;font-weight:500!important}
.dash-alert-badge,.dash-alert-badge.danger,.dash-alert-badge.ok{padding:4px 7px!important;border-radius:999px!important;font-size:9.5px!important;box-shadow:none!important;border:1px solid #ead8d5!important;background:#f8efed!important;color:#93483f!important}
.dashboard-alert-table{border:0!important;border-radius:6px!important;box-shadow:none!important;overflow:auto!important}
.dashboard-alert-table table{border-spacing:0!important;width:max-content!important;min-width:100%!important}
.dashboard-alert-table thead th{background:#536a70!important;color:#fff!important}
.dashboard-alert-table tbody tr,.dashboard-alert-table tbody tr[class*="alert-severity-"]{background:#fff!important;box-shadow:none!important}
.dashboard-alert-table tbody tr td,.dashboard-alert-table tbody tr:nth-child(even) td,.dashboard-alert-table tbody tr:hover td{background:#fff!important;border-top:0!important;border-bottom:1px solid #edf1f2!important;font-weight:500!important;height:29px!important}
.dashboard-alert-table tbody tr td:first-child{border-left:2px solid hsl(var(--alert-hue),42%,51%)!important;border-radius:0!important}
.dashboard-alert-table tbody tr td:last-child{border-radius:0!important}
.dashboard-alert-table .alert-days{min-width:auto!important;padding:3px 7px!important;border-radius:999px!important;background:#f6f2f1!important;border:1px solid #eadeda!important;color:#684b45!important;font-size:9.5px!important;font-weight:700!important;box-shadow:none!important}
.dashboard-alert-table .alert-date-dot{width:7px!important;height:7px!important;margin-right:5px!important;box-shadow:none!important}

@media screen and (max-width:900px){
  /* Menú móvil: logo petróleo real sobre tarjeta clara. La selección se hace con <picture>, antes del primer pintado. */
  .sidebar .brand-panel{background:#f6f9fa!important;background-image:none!important;border:1px solid #d6e3e6!important;box-shadow:0 3px 12px rgba(1,73,94,.07)!important;border-radius:10px!important;padding:10px 8px!important;margin:0 0 8px!important}
  .sidebar .brand-logo-picture{max-width:176px!important;margin:0 auto!important}
  .sidebar .brand-logo{width:164px!important;max-width:100%!important;max-height:88px!important;height:auto!important;filter:none!important}
  .sidebar .brand-panel .subtitle{color:var(--v64-petrol)!important;font-size:9px!important;max-width:190px!important;margin-top:4px!important}

  /* Logo superior del panel móvil: reemplaza definitivamente el pseudo-logo blanco de v60. */
  .topbar-left::before{background-image:url('mandatos_logo.png')!important;background-position:center!important;background-repeat:no-repeat!important;background-size:contain!important;filter:none!important}

  .report-output-v64{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important}
  .report-format-v64{width:100%!important}
  .report-format-v64>summary{width:100%!important;text-align:center!important}
  .report-menu-v64{min-width:min(245px,82vw)!important}
  .report-format-v64:nth-of-type(2) .report-menu-v64{left:auto!important;right:0!important}
}

/* Ctrl+P general: las páginas comunes nunca quedan en blanco. Se preservan los diseños específicos de informes y ficha. */
@media print{
  body:not(.page-reports):not(.page-collaborator_view) *{visibility:visible!important}
  body:not(.page-reports):not(.page-collaborator_view) .sidebar,
  body:not(.page-reports):not(.page-collaborator_view) .sidebar-overlay,
  body:not(.page-reports):not(.page-collaborator_view) .topbar,
  body:not(.page-reports):not(.page-collaborator_view) .module-subnav,
  body:not(.page-reports):not(.page-collaborator_view) .no-print{display:none!important}
  body:not(.page-reports):not(.page-collaborator_view) .layout{display:block!important;height:auto!important;min-height:0!important}
  body:not(.page-reports):not(.page-collaborator_view) .main{margin:0!important;width:100%!important;height:auto!important;overflow:visible!important;padding:0!important}
  body:not(.page-reports):not(.page-collaborator_view) .content-scroll{overflow:visible!important;height:auto!important;max-height:none!important;padding:0!important}
  body:not(.page-reports):not(.page-collaborator_view) .card{box-shadow:none!important;break-inside:auto!important}
  body:not(.page-reports):not(.page-collaborator_view) .table-wrap,
  body:not(.page-reports):not(.page-collaborator_view) .results-table-wrap{overflow:visible!important;max-height:none!important}
  .report-output-v64{display:none!important}
}

/* ================================================================
   Mandatos GE · Cabecera móvil fija v1 · 2026-09-28
   Mantiene siempre visibles: menú, logo, búsqueda y acceso +.
   No altera escritorio ni impresión.
   ================================================================ */
@media screen and (max-width:900px){
  :root{--mfx-topbar-h:calc(128px + env(safe-area-inset-top,0px));}
  html{scroll-padding-top:calc(var(--mfx-topbar-h) + 8px)!important;}

  body.app-shell .main{
    padding:calc(var(--mfx-topbar-h) + 7px) 8px 10px!important;
  }

  body.app-shell .topbar.no-print{
    position:fixed!important;
    top:0!important;
    left:0!important;
    right:0!important;
    z-index:1180!important;
    width:100%!important;
    height:var(--mfx-topbar-h)!important;
    min-height:var(--mfx-topbar-h)!important;
    margin:0!important;
    padding:0 10px 6px!important;
    display:block!important;
    background:rgba(248,251,252,.985)!important;
    border-bottom:1px solid #d8e5e9!important;
    box-shadow:0 6px 18px rgba(1,73,94,.10)!important;
    backdrop-filter:blur(12px)!important;
    -webkit-backdrop-filter:blur(12px)!important;
    overflow:visible!important;
  }

  body.app-shell .topbar-left{
    position:static!important;
    display:block!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
  }

  body.app-shell .topbar-left::before{
    content:""!important;
    position:absolute!important;
    top:calc(env(safe-area-inset-top,0px) + 5px)!important;
    left:50%!important;
    right:auto!important;
    bottom:auto!important;
    transform:translateX(-50%)!important;
    display:block!important;
    width:154px!important;
    height:48px!important;
    margin:0!important;
    background-image:url('mandatos_logo.png')!important;
    background-position:center!important;
    background-repeat:no-repeat!important;
    background-size:contain!important;
    filter:none!important;
    pointer-events:none!important;
  }

  body.app-shell .mobile-menu-toggle{
    display:block!important;
    position:absolute!important;
    top:calc(env(safe-area-inset-top,0px) + 11px)!important;
    left:max(10px,env(safe-area-inset-left,0px))!important;
    z-index:1183!important;
    width:38px!important;
    height:38px!important;
    min-width:38px!important;
    min-height:38px!important;
    margin:0!important;
    padding:8px!important;
    border:1px solid #cddde2!important;
    border-radius:10px!important;
    background:#fff!important;
    box-shadow:0 2px 8px rgba(1,73,94,.06)!important;
  }
  body.app-shell .mobile-menu-toggle span{height:2px!important;margin:4px 0!important;}
  body.app-shell .back-btn{display:none!important;}

  body.app-shell .p3-top-tools{
    position:absolute!important;
    top:calc(env(safe-area-inset-top,0px) + 58px)!important;
    left:max(10px,env(safe-area-inset-left,0px))!important;
    right:max(10px,env(safe-area-inset-right,0px))!important;
    z-index:1182!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 40px!important;
    align-items:center!important;
    gap:7px!important;
    width:auto!important;
    height:36px!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
  }
  body.app-shell .p3-global-search{
    position:relative!important;
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    height:36px!important;
    margin:0!important;
  }
  body.app-shell .p3-global-search input{
    display:block!important;
    width:100%!important;
    height:36px!important;
    min-height:36px!important;
    margin:0!important;
    padding:7px 34px 7px 11px!important;
    border-radius:10px!important;
    font-size:11px!important;
    line-height:1.2!important;
    background:#fff!important;
  }
  body.app-shell .p3-global-search::after{
    top:7px!important;
    right:10px!important;
    font-size:17px!important;
  }
  body.app-shell .p3-company-focus,
  body.app-shell .p3-top-tools .userbox{display:none!important;}

  body.app-shell .p3-quick-menu{
    position:relative!important;
    display:block!important;
    width:40px!important;
    height:36px!important;
    min-width:40px!important;
    margin:0!important;
  }
  body.app-shell .p3-quick-trigger{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:40px!important;
    height:36px!important;
    min-width:40px!important;
    min-height:36px!important;
    margin:0!important;
    padding:0!important;
    border-radius:10px!important;
    font-size:0!important;
    line-height:1!important;
    box-shadow:0 2px 8px rgba(1,73,94,.10)!important;
  }
  body.app-shell .p3-quick-trigger::after{
    content:'+'!important;
    display:block!important;
    font-size:23px!important;
    line-height:1!important;
    font-weight:800!important;
    color:#fff!important;
  }

  body.app-shell .page-heading{
    position:absolute!important;
    left:max(12px,env(safe-area-inset-left,0px))!important;
    right:max(12px,env(safe-area-inset-right,0px))!important;
    bottom:6px!important;
    display:block!important;
    width:auto!important;
    min-width:0!important;
    height:24px!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body.app-shell .page-heading .page-eyebrow,
  body.app-shell .page-heading .scope-chip{display:none!important;}
  body.app-shell .topbar .page-heading h1{
    display:block!important;
    max-width:100%!important;
    margin:0!important;
    padding:0!important;
    font-size:14px!important;
    line-height:24px!important;
    font-weight:800!important;
    color:#075264!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    text-align:left!important;
  }

  body.app-shell .p3-search-results{
    position:fixed!important;
    top:calc(env(safe-area-inset-top,0px) + 98px)!important;
    left:max(10px,env(safe-area-inset-left,0px))!important;
    right:max(57px,calc(env(safe-area-inset-right,0px) + 57px))!important;
    z-index:1188!important;
    max-height:min(52vh,430px)!important;
  }
  body.app-shell .p3-quick-popover{
    position:fixed!important;
    top:calc(env(safe-area-inset-top,0px) + 98px)!important;
    right:max(10px,env(safe-area-inset-right,0px))!important;
    left:auto!important;
    z-index:1189!important;
    max-height:min(58vh,440px)!important;
    overflow:auto!important;
  }

  body.sidebar-open .sidebar{z-index:1200!important;}
  body.sidebar-open .sidebar-overlay{z-index:1190!important;}
}

@media screen and (max-width:420px){
  body.app-shell .topbar-left::before{width:142px!important;height:46px!important;}
  body.app-shell .p3-global-search input{font-size:10.5px!important;}
}

@media screen and (max-width:900px) and (orientation:landscape){
  :root{--mfx-topbar-h:calc(112px + env(safe-area-inset-top,0px));}
  body.app-shell .topbar-left::before{width:132px!important;height:40px!important;top:calc(env(safe-area-inset-top,0px) + 3px)!important;}
  body.app-shell .mobile-menu-toggle{top:calc(env(safe-area-inset-top,0px) + 6px)!important;width:35px!important;height:35px!important;}
  body.app-shell .p3-top-tools{top:calc(env(safe-area-inset-top,0px) + 47px)!important;}
  body.app-shell .page-heading{bottom:4px!important;height:22px!important;}
  body.app-shell .topbar .page-heading h1{line-height:22px!important;font-size:13px!important;}
  body.app-shell .p3-search-results,
  body.app-shell .p3-quick-popover{top:calc(env(safe-area-inset-top,0px) + 87px)!important;}
}
