/* Page-level month selector: one fixed position and size across every page. */
html body[data-page-period-local="1"] .topbar > #mpicker {
  display: none !important;
}

html body[data-page-period-local="1"] .main {
  position: relative !important;
}

html body[data-page-period-local="1"] .main > .page.show > .page-head.page-head-with-period {
  display: block !important;
  position: static !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 52px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-right: 220px !important;
  box-sizing: border-box !important;
}

html body[data-page-period-local="1"] .main > #mpicker {
  display: inline-block !important;
  position: absolute !important;
  top: 72px !important;
  right: 16px !important;
  bottom: auto !important;
  left: auto !important;
  width: 198px !important;
  height: 40px !important;
  margin: 0 !important;
  /* Keep the page-level selector above fixed page headers (the roster title is z-index: 60). */
  z-index: 80 !important;
}

/* Task defaults are reusable configuration, not month-scoped page data. */
html body[data-page-period-local="1"][data-current-page="taskconfig"] .main > #mpicker {
  display: none !important;
}

html body[data-page-period-local="1"] .main > #mpicker > .mpicker-btn {
  width: 198px !important;
  min-width: 198px !important;
  height: 40px !important;
  padding: 0 12px !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}


/* Page-header period trigger: use the same visual language as the common select. */
html body[data-page-period-local="1"] #mpicker:not(.period-in-filter) {
  width: 150px !important;
  height: 34px !important;
}

/* All filter reset actions share one secondary-button treatment. */
html body[data-page-period-local="1"] .btn:is(.global-filter-reset,.filter-reset-button) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  min-width: 82px !important;
  height: var(--control-height) !important;
  min-height: var(--control-height) !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border-color: var(--btn-secondary-bg) !important;
  border-radius: 7px !important;
  background: var(--btn-secondary-bg) !important;
  color: var(--btn-secondary-text) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 20px !important;
  white-space: nowrap !important;
  cursor: pointer;
}

html body[data-page-period-local="1"] .btn:is(.global-filter-reset,.filter-reset-button):hover {
  border-color: var(--btn-secondary-bg-hover) !important;
  background: var(--btn-secondary-bg-hover) !important;
  color: var(--text) !important;
}

html body[data-page-period-local="1"] .filter-reset-button > .reset-button-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html body[data-page-period-local="1"][data-current-page] .main :is(.page.show,.content .page.show) .btn:is(.global-filter-reset,.filter-reset-button),
html body[data-page-period-local="1"] #mpicker > .btn:is(.global-filter-reset,.filter-reset-button) {
  font-size: 13px !important;
}

html body[data-page-period-local="1"] #mpicker > .global-filter-reset {
  position: absolute;
  top: 0;
  right: calc(100% + 8px);
}

html body[data-page-period-local="1"] .page .global-filter-reset {
  position: static !important;
  flex: 0 0 auto !important;
}

html body[data-page-period-local="1"] :is(
  .dashboard-unified-filter,
  .shared-filter,
  .f2-simple-filter,
  .f2-filterbar,
  .log-filter-toolbar,
  #budget-filter,
  #dpm-filterbar,
  #roster-filterbar,
  .adj-filter-card > .card-body,
  .pd-list-toolbar,
  #page-allprojects > .toolbar
) > .global-filter-reset {
  order: initial !important;
  align-self: center !important;
}

html body[data-page-period-local="1"] .main > .page.show > .page-head.page-head-with-period,
html body[data-page-period-local="1"] .main > .content > .page.show > .page-head.page-head-with-period {
  padding-right: 224px !important;
}

html body[data-page-period-local="1"] #mpicker:not(.period-in-filter) > .mpicker-btn {
  width: 150px !important;
  min-width: 150px !important;
  height: 34px !important;
  padding: 6px 11px !important;
  gap: 8px !important;
  justify-content: flex-start !important;
  border: 1px solid var(--border) !important;
  border-radius: 9px !important;
  background: var(--side-2) !important;
  color: var(--text) !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
  box-sizing: border-box !important;
}

html body[data-page-period-local="1"] #mpicker:not(.period-in-filter) > .mpicker-btn > #mpicker-label {
  flex: 1 1 auto !important;
  text-align: left !important;
}

html body[data-page-period-local="1"] #mpicker:not(.period-in-filter) > .mpicker-btn:hover {
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
}

html body[data-page-period-local="1"] #mpicker:not(.period-in-filter) > .mpicker-btn.open {
  border-color: var(--accent) !important;
  background: var(--surface) !important;
  color: var(--text) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

html body[data-page-period-local="1"] #mpicker:not(.period-in-filter) > .mpicker-btn > .caret {
  display: block !important;
  margin-left: auto !important;
}

html body[data-page-period-local="1"] .period-filter-host > #mpicker.period-in-filter {
  display: inline-block !important;
  position: relative !important;
  inset: auto !important;
  flex: 0 0 198px !important;
  width: 198px !important;
  height: 34px !important;
  margin: 0 !important;
  z-index: 40 !important;
}

html body[data-page-period-local="1"] .period-filter-host > #mpicker.period-in-filter > .mpicker-btn {
  width: 198px !important;
  min-width: 198px !important;
  height: 34px !important;
  padding: 6px 11px !important;
  justify-content: flex-start !important;
  border: 1px solid var(--border) !important;
  border-radius: 9px !important;
  background: var(--side-2) !important;
  color: var(--text) !important;
  font-family: inherit !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
  box-sizing: border-box !important;
}

html body[data-page-period-local="1"] .period-filter-host > #mpicker.period-in-filter > .mpicker-btn > #mpicker-label {
  flex: 1 1 auto !important;
  text-align: left !important;
}

html body[data-page-period-local="1"] .period-filter-host > #mpicker.period-in-filter > .mpicker-btn:hover {
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
}

html body[data-page-period-local="1"] .period-filter-host > #mpicker.period-in-filter > .mpicker-btn.open {
  border-color: var(--accent) !important;
  background: var(--surface) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

html body[data-page-period-local="1"][data-current-page="roster"] #roster-filterbar > #roster-period {
  display: none !important;
}

html body[data-page-period-local="1"] #page-roles .rfilter.period-filter-host {
  display: flex !important;
  align-items: flex-end !important;
  gap: 12px !important;
}

/* The task progress table owns this body-level sticky clone. Never let a
   stale clone leak into another page after navigation. */
html body:not([data-current-page="task"]) > #task-page-sticky-head {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

@media (max-width: 760px) {
  html body[data-page-period-local="1"] .main > .page.show > .page-head.page-head-with-period {
    position: relative !important;
    min-height: 0 !important;
    padding-right: 0 !important;
  }

  html body[data-page-period-local="1"] .main > .page.show > .page-head.page-head-with-period > #mpicker {
    display: flex !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 40px !important;
    margin-top: 10px !important;
  }

  html body[data-page-period-local="1"] .main > .page.show > .page-head.page-head-with-period > #mpicker > .global-filter-reset,
  html body[data-page-period-local="1"] .main > .content > .page.show > .page-head.page-head-with-period > #mpicker > .global-filter-reset {
    position: static !important;
    flex: 0 0 auto !important;
  }

  html body[data-page-period-local="1"] .main > .page.show > .page-head.page-head-with-period > #mpicker > .mpicker-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    justify-content: center !important;
  }
  html body[data-page-period-local="1"] .main > .content > .page.show > .page-head.page-head-with-period {
    position: relative !important;
    min-height: 0 !important;
    padding-right: 0 !important;
  }

  html body[data-page-period-local="1"] .main > .content > .page.show > .page-head.page-head-with-period > #mpicker {
    display: flex !important;
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 40px !important;
    margin-top: 10px !important;
  }

  html body[data-page-period-local="1"] .main > .content > .page.show > .page-head.page-head-with-period > #mpicker > .mpicker-btn {
    width: 100% !important;
    min-width: 0 !important;
    height: 40px !important;
    justify-content: center !important;
  }
}

/* Keep the project-period popover above the sticky project table header. */
html body[data-page-period-local="1"][data-current-page="deptprojects"] #dpm-filterbar.period-filter-host > #mpicker.period-in-filter.dpm-filter-period {
  z-index: 60 !important;
}

/* Hide the page-level reset control in every view; modal and table reset controls remain available. */
html body[data-page-period-local="1"] #mpicker > #global-filter-reset {
  display: none !important;
}

/* Role management is not month-scoped; suppress the shared picker wherever it is mounted. */
html body[data-page-period-local="1"][data-current-page="roles"] .main > #mpicker,
html body[data-current-page="roles"] .topbar > #mpicker,
html body[data-current-page="roles"] #page-roles .page-head > #mpicker {
  display: none !important;
}
