/* Reserved for the next approved migration phase: Pivot Fiches workflow. */


/* PIVOT CONTROL — FICHE WORKSPACE FIX + BRAND MARK */
/* Desktop/tablet: the Fiche editor must live inside the Pivot workspace,
   not underneath the fixed command bar / control rail. */
@media (min-width:821px){
  body.pivot-ui:not([data-active-view="home"]) #ficheModal.fiche-route-dialog[open]{
    position:fixed!important;
    top:72px!important;
    left:86px!important;
    right:0!important;
    bottom:0!important;
    width:calc(100vw - 86px)!important;
    max-width:calc(100vw - 86px)!important;
    height:calc(100dvh - 72px)!important;
    max-height:calc(100dvh - 72px)!important;
    margin:0!important;
    transform:none!important;
    zoom:1!important;
    z-index:130!important;
  }
}
/* Mobile: align the editor exactly to the Pivot mobile workspace,
   preserving the command bar and bottom navigation. */
@media (max-width:820px){
  body.pivot-ui:not([data-active-view="home"]) #ficheModal.fiche-route-dialog[open]{
    position:fixed!important;
    top:56px!important;
    left:0!important;
    right:0!important;
    bottom:68px!important;
    width:100vw!important;
    max-width:100vw!important;
    height:calc(100dvh - 124px)!important;
    max-height:calc(100dvh - 124px)!important;
    min-height:0!important;
    margin:0!important;
    transform:none!important;
    zoom:1!important;
    z-index:130!important;
  }
}
body.pivot-ui #ficheModal .fiche-form{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important;}
body.pivot-ui #ficheModal .fiche-layout{width:100%!important;min-width:0!important;min-height:0!important;}

/* Pivot Control branded Fiche mark. */
body.pivot-ui #view-fiches .salon-fiche-icon{
  border:1.5px solid var(--pc-red)!important;
  border-radius:7px!important;
  background:#fff!important;
  overflow:hidden!important;
  padding:3px!important;
  box-sizing:border-box!important;
}
body.pivot-ui #view-fiches .salon-fiche-icon .fiche-list-png{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  padding:0!important;
  margin:0!important;
}


/* PIVOT CONTROL R21 — Fiche follows the chrome-less workspace */
@media (min-width:821px){
  body.pivot-ui:not([data-active-view="home"]) #ficheModal.fiche-route-dialog[open]{
    top:0!important;left:86px!important;right:0!important;bottom:0!important;
    width:calc(100vw - 86px)!important;max-width:calc(100vw - 86px)!important;
    height:100dvh!important;max-height:100dvh!important;
  }
}
@media (max-width:820px){
  body.pivot-ui:not([data-active-view="home"]) #ficheModal.fiche-route-dialog[open]{
    top:0!important;left:0!important;right:0!important;bottom:68px!important;
    width:100vw!important;max-width:100vw!important;
    height:calc(100dvh - 68px)!important;max-height:calc(100dvh - 68px)!important;
  }
}


/* PIVOT PROD FICHE SHARED CALENDAR R28
   Modifica Fiche and Fiches/Periodo share the same custom calendar modal. */
#ficheModal .fiche-header-date-wrap .fiche-date-button{
  pointer-events:auto!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
  position:relative!important;
  z-index:9!important;
}
#ficheModal .fiche-header-date-native{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
  width:0!important;height:0!important;
  min-width:0!important;min-height:0!important;
  opacity:0!important;
}
/* END PIVOT PROD FICHE SHARED CALENDAR R28 */

/* FICHES DESKTOP SPLIT VIEW — KEEP RIGHT COUNTER VISIBLE */
@media (min-width: 761px) and (max-width: 1180px) {
  body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-totals-bar{
    padding-left:8px!important;
    padding-right:8px!important;
    column-gap:5px!important;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
  }
  body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-footer-metric{
    gap:4px!important;
    min-width:0!important;
  }
  body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-footer-metric b,
  body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-total-separator{
    font-size:14px!important;
    line-height:1!important;
  }
  body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-total-separator{
    padding-left:5px!important;
    margin-left:0!important;
    flex:0 0 auto!important;
  }
  body.pivot-ui[data-active-view="fiches"] #view-fiches .mini-calendar-icon,
  body.pivot-ui[data-active-view="fiches"] #view-fiches .mini-list-icon{
    width:17px!important;
    height:17px!important;
    flex-basis:17px!important;
  }
  body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-footer-metric.collected{
    justify-self:end!important;
    max-width:100%!important;
    overflow:visible!important;
  }
}

/* FICHES SPLIT-PANE FOOTER — FINAL SAFE ORIGINAL LAYOUT */
body.pivot-ui[data-active-view="fiches"] #view-fiches{container-type:inline-size;container-name:fichesPane;}
@media (min-width:761px){
  @container fichesPane (max-width: 920px){
    body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-totals-bar{
      position:relative!important;
      display:flex!important;
      align-items:center!important;
      justify-content:space-between!important;
      padding-left:8px!important;
      padding-right:150px!important;
      gap:8px!important;
      overflow:visible!important;
    }
    body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-footer-metric{
      gap:4px!important;
      white-space:nowrap!important;
      min-width:0!important;
    }
    body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-footer-metric.outstanding{
      flex:0 1 auto!important;
    }
    body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-footer-metric.collected{
      position:absolute!important;
      right:150px!important;
      top:50%!important;
      transform:translateY(-50%)!important;
      display:flex!important;
      align-items:center!important;
      gap:4px!important;
      width:max-content!important;
      min-width:max-content!important;
      max-width:none!important;
      overflow:visible!important;
      z-index:3!important;
    }
    body.pivot-ui[data-active-view="fiches"] #view-fiches .p74807-fiche-total-eye{
      position:absolute!important;
      left:50%!important;
      top:50%!important;
      transform:translate(-50%,-50%)!important;
      z-index:2!important;
    }
    body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-footer-metric b,
    body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-total-separator{
      font-size:13px!important;
      line-height:1!important;
    }
    body.pivot-ui[data-active-view="fiches"] #view-fiches .fiche-total-separator{
      border-left:1px solid #9fa3ae!important;
      padding-left:5px!important;
      margin-left:1px!important;
      flex:0 0 auto!important;
    }
    body.pivot-ui[data-active-view="fiches"] #view-fiches .mini-calendar-icon,
    body.pivot-ui[data-active-view="fiches"] #view-fiches .mini-list-icon{
      width:16px!important;
      height:16px!important;
      flex-basis:16px!important;
    }
  }
}
/* END FICHES SPLIT-PANE FOOTER — FINAL SAFE ORIGINAL LAYOUT */
