/*
 * Keep the Issue Tracker visually isolated from the legacy Group styles.
 * src/index.css (and some Group pages) force h4/h6 into a 3-column grid with
 * ::before/::after double borders — the "==" lines in labels.
 *
 * Coverage:
 * - Page content: .data-correction-module--datacorrection
 * - Portaled Dialogs/Drawers: .data-correction-modal (theme defaultProps)
 *   and body.data-correction-route .MuiModal-root (while DC module is mounted)
 *
 * T-Logs is unaffected (no body class / no modal marker outside DC).
 */
.data-correction-module--datacorrection :is(h1, h2, h3, h4, h5, h6),
.data-correction-modal :is(h1, h2, h3, h4, h5, h6),
body.data-correction-route .MuiModal-root :is(h1, h2, h3, h4, h5, h6) {
  display: block !important;
  grid-template-columns: none !important;
  align-items: normal !important;
  gap: 0 !important;
  text-align: inherit;
}

.data-correction-module--datacorrection :is(h1, h2, h3, h4, h5, h6)::before,
.data-correction-module--datacorrection :is(h1, h2, h3, h4, h5, h6)::after,
.data-correction-modal :is(h1, h2, h3, h4, h5, h6)::before,
.data-correction-modal :is(h1, h2, h3, h4, h5, h6)::after,
body.data-correction-route .MuiModal-root :is(h1, h2, h3, h4, h5, h6)::before,
body.data-correction-route .MuiModal-root :is(h1, h2, h3, h4, h5, h6)::after {
  content: none !important;
  display: none !important;
  border: 0 !important;
  border-top: none !important;
}

/*
 * Restore a usable minimum size for Issue Tracker fields without changing
 * the Group application. Multiline fields remain content-driven.
 * Compact toolbar/date fields override below with !important.
 */
.data-correction-module--datacorrection
  .MuiInputBase-root:not(.MuiInputBase-multiline) {
  min-height: 40px;
}

.data-correction-module--datacorrection
  .data-correction-date-picker
  .MuiInputBase-root,
.data-correction-module--datacorrection
  .datacorrection_compact_input
  .MuiInputBase-root {
  min-height: 28px !important;
  height: 28px !important;
}

.data-correction-module--datacorrection .MuiSelect-select {
  min-height: 1.4375em !important;
  box-sizing: border-box;
}

.data-correction-module--datacorrection
  input:not(.MuiInputBase-input):not(.MuiSelect-nativeInput):not([type='checkbox']):not([type='radio']):not([type='range']):not([type='file']):not([type='hidden']),
.data-correction-module--datacorrection select:not(.MuiNativeSelect-select) {
  min-height: 40px;
  padding: 8px 12px;
  box-sizing: border-box;
}

/* Keep MUI DatePicker fields compact — match toolbar search (~28px). */
.data-correction-module--datacorrection
  .data-correction-date-picker
  .MuiOutlinedInput-root {
  height: 28px !important;
  min-height: 28px !important;
  box-sizing: border-box;
}

.data-correction-module--datacorrection
  .data-correction-date-picker
  .MuiInputBase-input {
  height: auto !important;
  min-height: 0 !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
  font-size: 0.72rem !important;
  box-sizing: border-box;
}

.data-correction-module--datacorrection
  .data-correction-date-picker
  .MuiInputAdornment-root,
.data-correction-module--datacorrection
  .data-correction-date-picker
  .MuiIconButton-root {
  max-height: 22px;
  width: 22px;
  height: 22px;
  padding: 2px;
}

.data-correction-module--datacorrection
  .data-correction-date-picker
  .MuiSvgIcon-root {
  font-size: 1rem !important;
}

/* Shared dashboard summary sizing for Admin, Approval, and User pages. */
.data-correction-module--datacorrection .data-correction-dashboard-summary-row {
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 1200px) {
  .data-correction-module--datacorrection .data-correction-dashboard-welcome-card {
    flex: 0 0 320px !important;
    width: 320px !important;
    min-width: 320px !important;
    max-width: 320px !important;
  }

  .data-correction-module--datacorrection
    .data-correction-dashboard-summary-row
    > .MuiPaper-root:not(.data-correction-dashboard-welcome-card) {
    flex: 1 1 150px !important;
    width: auto !important;
    max-width: none !important;
  }

  .data-correction-module--datacorrection .data-correction-dashboard-single-stat-group {
    flex: 0 0 150px !important;
    width: 150px !important;
    max-width: 150px !important;
  }

  .data-correction-module--datacorrection
    .data-correction-dashboard-single-stat-group
    > .MuiGrid-item {
    flex-basis: 100% !important;
    max-width: 100% !important;
  }

  .data-correction-module--datacorrection
    .data-correction-dashboard-single-stat-group
    .MuiCard-root {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/*
 * The permanent sidebar already reserves its own width in Layout's flex row.
 * Top-level page containers therefore should not add another desktop gutter.
 * Keep the rule limited to direct page children so dialog containers and
 * nested content retain their intended spacing.
 */
@media (min-width: 900px) {
  .data-correction-module--datacorrection
    .data-correction-main-content
    > .MuiContainer-root {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}
