/* V37.5: stable dashboard, stronger active navigation and compact movable editors. */

/* Open sidebar sections should read unmistakably as active workspaces. */
#app .sidebar details.explorer-group[open] > summary,
#app .sidebar details.v372-workspace-group[open] > summary{
  color:#fff!important;
  border-color:var(--workspace-accent,var(--accent,#38bdf8))!important;
  background:linear-gradient(100deg,
    color-mix(in srgb,var(--workspace-accent,var(--accent,#38bdf8)) 52%,#142131),
    color-mix(in srgb,var(--workspace-accent,var(--accent,#38bdf8)) 24%,#142131) 64%,
    #142131)!important;
  box-shadow:inset 5px 0 0 var(--workspace-accent,var(--accent,#38bdf8)),
             0 0 0 1px color-mix(in srgb,var(--workspace-accent,var(--accent,#38bdf8)) 58%,transparent),
             0 8px 20px color-mix(in srgb,var(--workspace-accent,var(--accent,#38bdf8)) 20%,transparent)!important;
}
#app .sidebar details.explorer-group[open] > summary .v372-summary-count,
#app .sidebar details.v372-workspace-group[open] > summary .v372-summary-count{
  background:var(--workspace-accent,var(--accent,#38bdf8))!important;
  border-color:#fff!important;
  color:#08111f!important;
  box-shadow:0 0 12px color-mix(in srgb,var(--workspace-accent,var(--accent,#38bdf8)) 70%,transparent)!important;
}

/* Monitoring is yellow throughout its title treatment. */
.v372-monitoring-group{--workspace-accent:#facc15!important;}

/* Keep bottom dashboard metrics in stable slots so counts cannot shift neighbouring fields. */
.bottom-status-bar{contain:layout paint!important;}
.bottom-status-bar span{font-variant-numeric:tabular-nums!important;box-sizing:border-box!important;overflow:hidden!important;text-overflow:ellipsis!important;}
#status-project{flex:0 0 118px!important;min-width:118px!important;}
#status-area{flex:0 0 92px!important;min-width:92px!important;text-align:right!important;}
#status-properties{flex:0 0 128px!important;min-width:128px!important;text-align:right!important;}
#status-high-risk-soils{flex:0 0 150px!important;min-width:150px!important;text-align:right!important;}
#status-waterways{flex:0 0 132px!important;min-width:132px!important;text-align:right!important;}
#status-actions{flex:0 0 108px!important;min-width:108px!important;text-align:right!important;}
#status-monitoring{flex:0 0 128px!important;min-width:128px!important;text-align:right!important;}
#status-scale{flex:0 0 96px!important;min-width:96px!important;text-align:right!important;}
#status-selected{flex:0 0 112px!important;min-width:112px!important;}
#status-coordinates{flex:1 0 210px!important;min-width:210px!important;text-align:right!important;}

/* Action editor: compact, fully viewport-contained and internally scrollable. */
#action-editor-panel.action-editor-panel:not(.hidden){
  position:fixed!important;
  bottom:auto!important;
  width:min(620px,calc(100vw - var(--v374-sidebar-width,380px) - 34px))!important;
  max-width:calc(100vw - var(--v374-sidebar-width,380px) - 34px)!important;
  max-height:calc(100dvh - 74px)!important;
  overflow:hidden!important;
  display:flex!important;
  flex-direction:column!important;
  box-sizing:border-box!important;
}
#action-editor-panel .panel-header{
  flex:0 0 48px!important;
  height:48px!important;
  min-height:48px!important;
  padding:0 12px!important;
  cursor:move!important;
}
#action-editor-panel .action-editor-body{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
  padding:10px 12px 18px!important;
  scrollbar-gutter:stable!important;
}
#action-editor-panel label{margin:5px 0!important;font-size:10px!important;}
#action-editor-panel input,
#action-editor-panel select{min-height:34px!important;height:34px!important;padding:6px 9px!important;font-size:12px!important;}
#action-editor-panel textarea{min-height:58px!important;padding:7px 9px!important;font-size:12px!important;}
#action-editor-panel .form2,
#action-editor-panel .form-stack.date-stack{gap:8px!important;}
#action-editor-panel .plant-mix-block,
#action-editor-panel .action-photo-block,
#action-editor-panel .calc-preview{padding:8px!important;margin:7px 0!important;}
#action-editor-panel .button-row{gap:7px!important;margin:8px 0!important;}
#action-editor-panel .button-row .btn{min-height:36px!important;padding:7px 9px!important;font-size:12px!important;}
#action-editor-panel .section-heading,
#action-editor-panel h4{margin:8px 0 5px!important;}

@media(max-width:900px){
  #action-editor-panel.action-editor-panel:not(.hidden){
    left:8px!important;
    top:58px!important;
    width:calc(100vw - 16px)!important;
    max-width:calc(100vw - 16px)!important;
    max-height:calc(100dvh - 66px)!important;
  }
}
