/**
 * Reports dashboard styles.
 * Uses existing CRM utility classes and theme variables; no global element overrides.
 */
/* (app) scoped: the design's `body.layout-app { overflow-x: clip }` is left out so other pages keep theirs. */

.reports-dashboard {
  min-width: 0;
  width: 100%;
  overflow-x: clip;
}

.reports-toolbar {
  align-items: center;
}

.reports-title-wrap {
  min-width: 0;
  flex: 1 1 280px;
}

.reports-title-dropdown {
  min-width: 0;
  max-width: 100%;
}

.reports-title-button {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: clamp(1.05rem, 1.45vw, 1.45rem);
  font-weight: 700;
  text-align: left;
  white-space: normal;
}

.reports-title-button > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reports-title-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--brand, var(--brand-primary));
}

.reports-toolbar-actions {
  justify-content: flex-end;
}

.reports-toolbar-actions .dropdown__menu,
.reports-dashboard [data-dropdown-align="right"] > .dropdown__menu {
  right: 0;
  left: auto;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  transform-origin: top right;
}

.reports-subtitle {
  margin-top: -0.35rem;
}

.reports-filter-toolbar {
  border-bottom: 1px solid var(--border, #d9e0e7);
  padding-bottom: var(--sp-3, 0.75rem);
}

.reports-filter-panel[hidden],
.reports-field[hidden] {
  display: none !important;
}

.reports-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3, 0.75rem);
}

.reports-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  color: var(--text, #273444);
  font-size: 0.82rem;
  font-weight: 600;
}

.reports-field input,
.reports-field select {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--surface, #fff);
  color: var(--text, #273444);
  font: inherit;
  font-weight: 400;
}

.reports-filter-help {
  flex: 1 1 260px;
}

.reports-dashboard-content {
  min-width: 0;
}

.reports-audit-widget {
  min-width: 0;
}

.reports-audit-widget__header h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}

.reports-audit-widget__header h2 span {
  overflow-wrap: anywhere;
}

.reports-audit-scroll {
  max-height: min(45vh, 450px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0.4rem 0.4rem 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.reports-audit-key__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reports-audit-key__list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.reports-audit-group {
  margin: 0 0 1.5rem;
  color: var(--text, #273444);
  font-size: 0.9rem;
  line-height: 1.6;
}

.reports-audit-group h3 {
  margin: 0 0 0.7rem;
  color: var(--text-orange, var(--brand-orange, #f28c00));
  font-size: 1.2rem;
  font-weight: 700;
}

.reports-audit-group ul,
.reports-note-list,
.reports-note-list ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.25rem;
}

.reports-audit-group ul ul,
.reports-note-list ul {
  margin-top: 0.4rem;
  padding-left: 1.4rem;
}

.reports-audit-group li,
.reports-note-list li {
  padding-left: 0.1rem;
}
.reports-audit-group li strong a:hover,
.reports-note-list li strong a:hover {
  text-decoration: underline;
}

.reports-audit-group em {
  color: var(--text-muted, #6b7280);
}

.reports-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  line-height: 1;
  vertical-align: middle;
}

.reports-status .icon {
  display: inline-block;
  vertical-align: middle;
}

.reports-status--good {
  color: var(--success, #067647);
}

.reports-status--warning {
  color: var(--warning, #b54708);
}

.reports-status--bad {
  color: var(--danger, #c01048);
}

.reports-section {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--sp-3, 0.75rem);
  align-items: stretch;
  min-width: 0;
}

.reports-section-note {
  grid-column: span 2;
  min-width: 0;
  min-height: 150px;
  overflow-wrap: anywhere;
}

.reports-section-note__eyebrow {
  margin-bottom: 0.3rem;
  color: var(--text-muted, #758397);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

.reports-note-list {
  color: var(--text, #273444);
  font-size: 0.82rem;
  line-height: 1.55;
}

.reports-note-list__highlight {
  color: var(--text-orange, var(--brand-orange, #f28c00));
}

.reports-section__grid {
  display: contents;
}

.reports-metric-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 150px;
  padding-bottom: 2rem !important;
  overflow-wrap: anywhere;
  transition:
    border-color var(--fast, 160ms) var(--ease, ease),
    box-shadow var(--fast, 160ms) var(--ease, ease),
    transform var(--fast, 160ms) var(--ease, ease);
}

.reports-metric-card:hover {
  border-color: var(--border-strong, #b8c4d0);
  box-shadow: var(--shadow-sm, 0 4px 14px rgb(20 35 50 / 8%));
  transform: translateY(-1px);
}

.reports-metric-card__top {
  min-width: 0;
}

.reports-metric-card__title {
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.reports-metric-card__info {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
}
/* 
.reports-metric-card__badges {
  min-height: 22px;
} */

.reports-metric-card__badges .badge {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

.reports-metric-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 1rem 0 0.2rem;
  text-align: center;
}

.reports-metric-card__label {
  max-width: 100%;
  text-align: center;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.reports-metric-card__value {
  max-width: 100%;
  color: var(--brand, var(--brand-primary, #2457e6));
  font-size: clamp(1.35rem, 1.55vw, 1.9rem);
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.reports-metric-card__more {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  width: 24px;
  height: 24px;
  padding: 0;
  opacity: 0.65;
}

.reports-metric-card__more:hover {
  opacity: 1;
}

.reports-analytics-card {
  min-width: 0;
}

.reports-analytics-card__header {
  margin-bottom: 1rem;
}

.reports-inline-info {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted, #748094);
  vertical-align: middle;
}

.reports-analytics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sp-3, 0.75rem);
}

.reports-analytics-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 1rem 0.25rem;
  text-align: center;
}

.reports-analytics-metric > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  color: var(--text, #273444);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.reports-analytics-metric strong {
  color: var(--brand, var(--brand-primary, #2457e6));
  font-size: clamp(1.25rem, 1.8vw, 2rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.reports-toast {
  position: fixed;
  z-index: 1200;
  right: 1.25rem;
  bottom: 1.25rem;
  max-width: min(420px, calc(100vw - 2rem));
  padding: 0.8rem 1rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-lg, 0.75rem);
  background: var(--surface, #fff);
  color: var(--text, #273444);
  box-shadow: var(--shadow, 0 8px 28px rgb(20 35 50 / 16%));
  font-size: 0.875rem;
}

.reports-toast[hidden] {
  display: none;
}

.reports-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(12 24 40 / 45%);
}

.reports-modal {
  width: min(520px, 100%);
  max-height: min(85vh, 720px);
  overflow: auto;
  padding: 1.25rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-lg);
  background: var(--surface, #fff);
  color: var(--text, #273444);
  box-shadow: var(--shadow, 0 12px 36px rgb(20 35 50 / 18%));
}

.reports-modal h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
}

.reports-modal p {
  margin: 0.75rem 0 1rem;
  line-height: 1.55;
}

.reports-modal__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  font-weight: 600;
}

.reports-modal__field input,
.reports-modal__field textarea,
.reports-modal__field select {
  width: 100%;
  min-width: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--surface, #fff);
  color: var(--text, #273444);
  font: inherit;
  font-weight: 400;
}

.reports-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

@media (max-width: 1499px) {
  .reports-section {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .reports-section-note {
    grid-column: span 2;
  }

  .reports-analytics-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .reports-section {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reports-section-note {
    grid-column: 1 / -1;
  }

  .reports-analytics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reports-toolbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 767px) {
  .reports-toolbar {
    align-items: flex-start;
  }

  .reports-title-wrap {
    flex-basis: 100%;
  }

  .reports-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .reports-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-section-note {
    grid-column: 1 / -1;
  }

  .reports-metric-card {
    min-height: 145px;
  }

  .reports-analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-analytics-metric:last-child {
    grid-column: 1 / -1;
  }

  .reports-audit-scroll {
    max-height: 50vh;
  }
}

@media (max-width: 480px) {
  .reports-title-button {
    width: 100%;
    font-size: 1rem;
  }

  .reports-toolbar-actions > * {
    max-width: 100%;
  }

  .reports-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .reports-section-note {
    grid-column: 1;
  }

  .reports-analytics-grid,
  .reports-filter-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .reports-analytics-metric:last-child {
    grid-column: auto;
  }

  .reports-metric-card {
    min-height: 132px;
  }

  .reports-audit-widget__header {
    align-items: flex-start;
  }

  .reports-audit-widget__header h2 {
    font-size: 0.9rem;
  }
}

/* Final layout guardrails: prevent dashboard content from widening the CRM viewport. */
.reports-dashboard,
.reports-dashboard-content,
.reports-section,
.reports-section-note,
.reports-section__grid,
.reports-metric-card,
.reports-analytics-card {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.reports-dashboard {
  overflow-x: clip;
}

.reports-dashboard .reports-toolbar,
.reports-dashboard .reports-toolbar-actions {
  min-width: 0;
  max-width: 100%;
}

.reports-dashboard .reports-toolbar-actions > * {
  flex-shrink: 0;
}

.reports-metric-card__value-button {
  display: inline-block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm, 0.35rem);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
  transition:
    color var(--fast, 160ms) var(--ease, ease),
    transform var(--fast, 160ms) var(--ease, ease);
}

.reports-metric-card__value-button:hover {
  color: var(--brand-hover, var(--brand-primary, #1748c7));
  transform: translateY(-1px);
}

.reports-metric-card__value-button:focus-visible {
  outline: 2px solid var(--brand, var(--brand-primary, #2457e6));
  outline-offset: 4px;
}

.reports-metric-card__value-button:active {
  transform: translateY(0);
}

/* Keep grid tracks shrinkable when metric names are long. */
.reports-section {
  grid-auto-flow: row;
}

.reports-section-note,
.reports-metric-card {
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  .reports-section {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .reports-section-note {
    grid-column: span 2;
  }
}

@media (max-width: 1050px) {
  .reports-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reports-section-note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .reports-section {
    grid-template-columns: minmax(0, 1fr);
  }

  .reports-section-note {
    grid-column: 1;
  }
}

/* Dashboard card overflow: scroll inside cards only when their content exceeds the card. */
.reports-dashboard {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.reports-section-note {
  height: 220px;
  min-height: 0;
  max-height: 220px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong, #aab4bf) transparent;
}

.reports-section-note::-webkit-scrollbar,
.reports-metric-card::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.reports-section-note::-webkit-scrollbar-thumb,
.reports-metric-card::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--border-strong, #aab4bf);
}

.reports-section-note::-webkit-scrollbar-track,
.reports-metric-card::-webkit-scrollbar-track {
  background: transparent;
}

.reports-metric-card {
  height: 220px;
  min-height: 0;
  max-height: 220px;
  overflow: auto;
  /* overscroll-behavior: contain;
  scrollbar-gutter: stable; */
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong, #aab4bf) transparent;
}

.reports-metric-card__body {
  flex: 1 0 auto;
  min-height: 105px;
}

.reports-metric-card__value-button {
  display: inline-block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm, 0.35rem);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.reports-metric-card__value-button:hover {
  filter: brightness(0.9);
}

.reports-metric-card__value-button:focus-visible {
  outline: 2px solid var(--brand, var(--brand-primary, #2457e6));
  outline-offset: 4px;
}

@media (max-width: 1050px) {
  .reports-section-note,
  .reports-metric-card {
    height: 250px;
    max-height: 250px;
  }
}

@media (max-width: 560px) {
  .reports-section-note {
    height: auto;
    min-height: 220px;
    max-height: 320px;
  }

  .reports-metric-card {
    height: auto;
    min-height: 210px;
    max-height: 300px;
  }
}

/* Report-detail modal, based on the supplied CRM report screenshot. */
.reports-modal-backdrop {
  overflow: auto;
}

.reports-modal {
  overflow: hidden;
}

.reports-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border, #d9e0e7);
}

.reports-modal__close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--text, #273444);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.reports-modal--report {
  display: flex;
  flex-direction: column;
  width: min(1440px, calc(100vw - 2rem));
  height: min(820px, calc(100vh - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1.25rem 1.5rem 1rem;
}

.reports-modal__report-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding-top: 1rem;
}

.reports-modal__report-content[hidden],
.reports-modal__form-content[hidden] {
  display: none !important;
}

.reports-record-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  min-width: 0;
}

.reports-record-summary {
  padding-right: 0.75rem;
  border-right: 1px solid var(--border, #d9e0e7);
  color: var(--text, #273444);
}

.reports-record-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.reports-record-group select,
.reports-record-footer select {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.reports-record-time {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-muted, #f0f1f3);
  font-size: 0.8rem;
  font-weight: 700;
}

.reports-record-more-wrap {
  position: relative;
  margin-left: auto;
}

.reports-record-more {
  padding: 0.55rem 1rem;
  border: 1px solid var(--border-strong, #aeb8c3);
  border-radius: 999px;
  background: var(--surface, #fff);
  color: var(--text, #273444);
  cursor: pointer;
}

.reports-record-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 5;
  display: grid;
  width: max-content;
  min-width: 230px;
  padding: 0.35rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: 0.8rem;
  background: var(--surface, #fff);
  box-shadow: var(--shadow, 0 12px 36px rgb(20 35 50 / 18%));
}

.reports-record-menu[hidden] {
  display: none !important;
}

.reports-record-menu button {
  padding: 0.7rem 0.75rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.reports-record-menu button:hover {
  background: var(--surface-muted, #f4f6f8);
}

.reports-record-search {
  display: flex;
  align-items: center;
  width: min(320px, 100%);
  margin: 1rem 0 0.65rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border-strong, #aeb8c3);
  border-radius: 999px;
}

.reports-record-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.reports-record-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  border-bottom: 1px solid var(--border, #d9e0e7);
}

.reports-record-table {
  width: 100%;
  font-size: 0.9rem;
}

/* Table spacing, borders, header colors, sorting and responsive behavior come
   from the shared CRM .table / .crm-table component in table.css. */

.reports-record-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 220px;
  padding: 2rem;
  color: var(--text-muted, #6b7280);
  text-align: center;
}

.reports-record-empty strong {
  color: var(--text, #273444);
}

.reports-record-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.75rem;
  font-size: 0.85rem;
}

.reports-record-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.reports-record-pagination button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.reports-record-pagination button:disabled {
  opacity: 0.45;
}

.reports-dashboard .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .reports-modal--report {
    width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
    max-height: calc(100vh - 1rem);
    padding: 1rem;
  }

  .reports-record-toolbar {
    align-items: flex-start;
  }

  .reports-record-more-wrap {
    margin-left: 0;
  }

  .reports-record-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Keep metric names on one line like the reference; preserve full text on hover. */
.reports-metric-card__top {
  min-width: 0;
}
.reports-metric-card__title {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  hyphens: none;
}

/* Keep report dialog scrolling inside the table, not on the page/backdrop. */
.reports-modal-backdrop {
  overflow: hidden;
}
.reports-modal--report {
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
.reports-modal__report-content {
  min-width: 0;
}
.reports-record-table-wrap {
  min-width: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.reports-record-table th[data-sortable="true"] {
  cursor: pointer;
  user-select: none;
}
.reports-record-table th[data-sortable="true"]:focus-visible {
  outline: 2px solid var(--brand, var(--brand-primary, #2457e6));
  outline-offset: -2px;
}
.reports-record-check-col {
  width: 48px;
}
.reports-record-check-col input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand, var(--brand-primary, #2457e6));
}
.reports-record-name,
.reports-record-email {
  display: inline-block;
  max-width: 250px;
  overflow: hidden;
  color: var(--brand-ink, var(--brand, var(--brand-primary, #2457e6)));
  font-weight: 700;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}
.reports-record-email {
  max-width: 280px;
}
.reports-record-external {
  color: var(--brand-ink, var(--brand, var(--brand-primary, #2457e6)));
}
.reports-record-empty[hidden] {
  display: none !important;
}

/* Preserve the shared dropdown component; constrain only this page's menu
   so long labels wrap instead of introducing a horizontal scrollbar. */
.reports-dashboard .dropdown__menu {
  box-sizing: border-box;
  max-width: min(20rem, calc(100vw - 2rem));
  max-height: min(75vh, 480px);
  overflow-y: auto;
  overflow-x: hidden;
}
.reports-dashboard .dropdown__item {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .reports-modal-backdrop {
    padding: 0.5rem;
  }
  .reports-modal--report {
    width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
    max-height: calc(100vh - 1rem);
    padding: 1rem;
  }
}

/* Modal record table: keep the shared CRM table styles in control. */
.reports-record-search {
  width: min(230px, 100%);
  min-height: 38px;
  margin: 0.85rem 0 0.75rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--surface, #fff);
  color: var(--text-muted, #6b7280);
}

.reports-record-search input {
  font-size: 0.875rem;
}

.reports-record-search > span[aria-hidden="true"] {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  color: var(--text-muted, #6b7280);
}

.reports-record-table-wrap {
  flex: 1 1 auto;
  min-height: 180px;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-lg, 0.75rem);
  background: var(--surface, #fff);
}

.reports-record-table {
  width: 100%;
  margin: 0;
  font-size: 0.875rem;
}

.reports-record-table th,
.reports-record-table td {
  vertical-align: middle;
  word-wrap: break-word;
}

.reports-record-table thead th:first-child,
.reports-record-table tbody td:first-child {
  width: 44px;
  text-align: center;
}

.reports-record-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand, var(--brand-primary, #2457e6));
}

.reports-record-pagination {
  min-width: 0;
  padding-top: 0.75rem;
}

@media (max-width: 991px) {
  .reports-record-table-wrap {
    border: 0;
    border-radius: 0;
  }
}

/* Report actions shown in the supplied workflow video. These are scoped to
   this page; shared CRM buttons, inputs and theme tokens are reused. */
.reports-action-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1120;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(12 24 40 / 48%);
}

.reports-action-modal {
  width: min(440px, 100%);
  max-height: min(90vh, 760px);
  overflow: visible;
  padding: 1.25rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-lg, 0.75rem);
  background: var(--surface, #fff);
  color: var(--text, #273444);
  box-shadow: var(--shadow, 0 12px 36px rgb(20 35 50 / 18%));
}

.reports-action-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.1rem 0 1rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border, #d9e0e7);
}

.reports-action-modal__header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.reports-action-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius-md, 0.5rem);
  background: transparent;
  color: var(--text-muted, #6b7280);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.reports-action-close:hover {
  background: var(--surface-hover);
  color: var(--text, #273444);
}

.reports-action-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.9rem 0;
  color: var(--text, #273444);
  font-size: 0.82rem;
  font-weight: 600;
}

.reports-action-field > span em {
  color: var(--danger, #d92d20);
  font-style: normal;
}

.reports-action-field input,
.reports-action-field select,
.reports-action-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--surface, #fff);
  color: var(--text, #273444);
  font: inherit;
  font-weight: 400;
}

.reports-action-field textarea {
  min-height: 80px;
  resize: none !important;
  line-height: 1.45;
}

.reports-action-field small {
  align-self: flex-start;
  color: var(--text-muted, #6b7280);
  font-size: 0.75rem;
  font-weight: 400;
}

.reports-action-choice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.8rem 0;
  color: var(--text, #273444);
  font-size: 0.875rem;
  font-weight: 500;
}

.reports-action-choice input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  margin-top: 0.15rem;
  accent-color: var(--brand, var(--brand-primary, #2457e6));
}

.reports-action-help {
  margin: 0.9rem 0;
  color: var(--text-muted, #6b7280);
  font-size: 0.78rem;
  line-height: 1.5;
}

.reports-action-section-label {
  margin: 1.2rem 0 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.reports-action-modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border, #d9e0e7);
}

.reports-action-backdrop--drawer {
  display: flex;
  justify-content: flex-end;
  padding: 0;
}

.reports-save-drawer {
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  padding: 1.25rem;
  background: var(--surface, #fff);
  color: var(--text, #273444);
  box-shadow: var(--shadow, 0 12px 36px rgb(20 35 50 / 18%));
}

.reports-save-drawer .reports-action-modal__header {
  flex: 0 0 auto;
}

.reports-save-drawer__form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.reports-save-drawer__footer {
  position: sticky;
  bottom: -1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: auto;
  padding: 1rem 0 0.25rem;
  background: var(--surface, #fff);
}

.reports-action-field[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .reports-action-backdrop {
    padding: 0.5rem;
  }

  .reports-action-backdrop--drawer {
    padding: 0;
  }

  .reports-action-modal {
    padding: 1rem;
  }

  .reports-save-drawer {
    width: 100%;
    padding: 1rem;
  }
}

/* Small consistency fixes for shared selects, empty states and sortable tables. */
.reports-action-field[hidden],
.reports-action-choice[hidden],
.reports-record-empty[hidden] {
  display: none !important;
}

.reports-action-field .custom-select-wrapper,
.reports-record-group .custom-select-wrapper {
  width: 100%;
  min-width: 0;
  position: relative;
}

.reports-action-field .custom-select-wrapper.is-open {
  z-index: 50;
}

.reports-record-group .custom-select-wrapper {
  min-width: 8rem;
}

.reports-record-table th[data-sortable="true"] {
  position: relative;
  padding-right: 1.7rem;
  white-space: nowrap;
}

.reports-record-table th[data-sortable="true"]::after {
  content: "↕";
  display: inline-block;
  margin-left: 0.45rem;
  color: var(--text-muted, #8993a1);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  vertical-align: middle;
}

.reports-record-table th[data-sortable="true"][aria-sort="ascending"]::after {
  content: "↑";
  color: var(--brand, var(--brand-primary, #2457e6));
}

.reports-record-table th[data-sortable="true"][aria-sort="descending"]::after {
  content: "↓";
  color: var(--brand, var(--brand-primary, #2457e6));
}

.reports-record-table th[data-sortable="true"]:focus-visible {
  outline: 2px solid var(--brand, var(--brand-primary, #2457e6));
  outline-offset: -2px;
}

.reports-record-preview-note {
  margin: 0.55rem 0 0;
  color: var(--text-muted, #6b7280);
  font-size: 0.75rem;
  line-height: 1.45;
}

.reports-custom-select {
  max-width: 100%;
}

.reports-custom-select .custom-select-trigger,
.reports-custom-select .custom-select-button {
  max-width: 100%;
}

.reports-analytics-metric[data-report-action="metric-details"] {
  cursor: pointer;
  border-radius: var(--radius-md, 0.5rem);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.reports-analytics-metric[data-report-action="metric-details"]:hover {
  background: var(--surface-hover);
}

.reports-analytics-metric[data-report-action="metric-details"]:focus-visible {
  outline: 2px solid var(--brand, var(--brand-primary, #2457e6));
  outline-offset: 2px;
}

/* Hover toolbar shown on metric cards, matching the CRM report widget controls. */
.reports-metric-card {
  position: relative;
}

.reports-card-actions {
  position: absolute;
  z-index: 20;
  top: 0.45rem;
  right: 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-md, 0.55rem);
  background: var(--surface, #fff);
  box-shadow: var(--shadow-sm, 0 3px 10px rgb(20 35 50 / 10%));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-3px);
  transition:
    opacity 140ms ease,
    transform 140ms ease,
    visibility 140ms ease;
}

.reports-metric-card:hover .reports-card-actions,
.reports-metric-card:focus-within .reports-card-actions,
.reports-metric-card--refreshing .reports-card-actions,
.reports-card-actions:focus-within {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.reports-card-actions__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm, 0.35rem);
  background: transparent;
  color: var(--text-muted, #687588);
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}

.reports-card-actions__button svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reports-card-actions__button:hover,
.reports-card-actions__button:focus-visible,
.reports-card-actions__button[aria-expanded="true"] {
  outline: none;
  background: var(--surface-hover);
  color: var(--text, #273444);
}

.reports-card-actions__button:focus-visible {
  box-shadow: 0 0 0 2px var(--brand, var(--brand-primary, #2457e6));
}

.reports-card-actions__dropdown {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.reports-dashboard .reports-widget-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 100;
  width: min(18.25rem, calc(100vw - 2rem));
  min-width: min(15rem, calc(100vw - 2rem));
  max-height: min(72vh, 620px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.35rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-lg, 0.85rem);
  background: var(--surface, #fff);
  box-shadow: var(--shadow-lg, 0 12px 36px rgb(20 35 50 / 18%));
}

.reports-dashboard .reports-widget-menu[hidden] {
  display: none !important;
}

.reports-dashboard .reports-widget-menu .reports-widget-menu__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 42px;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm, 0.35rem);
  color: var(--text, #273444);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.35;
}

.reports-dashboard .reports-widget-menu .reports-widget-menu__item:hover,
.reports-dashboard
  .reports-widget-menu
  .reports-widget-menu__item:focus-visible {
  background: var(--surface-muted, #f4f6f8);
  color: var(--text, #273444);
}

.reports-widget-menu__label {
  flex: 1 1 auto;
  min-width: 0;
}

.reports-widget-menu__badge {
  flex: 0 0 auto;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--success, #14804a);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.reports-widget-menu__divider {
  display: block;
  height: 1px;
  margin: 0.35rem -0.35rem;
  background: var(--border, #d9e0e7);
}

.reports-dashboard .reports-widget-menu .reports-widget-menu__item--danger {
  color: var(--danger, #c43c3c);
}

.reports-dashboard
  .reports-widget-menu
  .reports-widget-menu__item--danger:hover {
  background: var(--danger-soft, #fff1f1);
  color: var(--danger, #c43c3c);
}

.reports-metric-card--refreshing
  .reports-card-actions__button[data-report-action="metric-refresh"]
  svg {
  animation: reports-card-refresh 650ms linear infinite;
}

@keyframes reports-card-refresh {
  to {
    transform: rotate(360deg);
  }
}

@media (hover: none) and (max-width: 767px) {
  /* Touch devices have no hover, so keep the controls visible and tappable on mobile touchscreens. */
  .reports-card-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    gap: 0.1rem;
    top: 0.35rem;
    right: 0.35rem;
  }

  .reports-card-actions__button {
    width: 28px;
    height: 28px;
  }

  .reports-metric-card__title {
    padding-right: 6.75rem;
  }

  .reports-dashboard .reports-widget-menu {
    position: fixed;
    top: auto;
    right: 0.75rem;
    bottom: 0.75rem;
    width: min(19rem, calc(100vw - 1.5rem));
    min-width: 0;
    max-height: min(72vh, 560px);
  }
}

@media (max-width: 420px) {
  .reports-card-actions {
    gap: 0;
    padding: 0.1rem;
  }

  .reports-card-actions__button {
    width: 26px;
    height: 26px;
  }
}

@media (hover: none) and (max-width: 420px) {
  .reports-metric-card__title {
    padding-right: 6rem;
  }
}

/* Report-card action dialogs only. Keep existing record-details and save dialogs untouched. */
.reports-action-modal--rename,
.reports-action-modal--export,
.reports-action-modal--move {
  max-width: 520px;
}
.reports-action-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text, #273444);
}

.reports-action-field > span {
  font-weight: 600;
}

.reports-action-field input,
.reports-action-field select,
.reports-action-field textarea {
  width: 100%;
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border, #d9e0e7);
  border-radius: var(--radius-md, 0.375rem);
  background: var(--surface, #fff);
  color: var(--text, #273444);
  font: inherit;
  font-size: 0.875rem;
}

.reports-action-field textarea {
  min-height: 70px;
  resize: vertical;
}
.reports-action-help {
  font-size: 0.8125rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.35rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.reports-action-modal__notice {
  font-size: 0.875rem;
  color: var(--text, #273444);
  margin: 0.75rem 0;
  line-height: 1.45;
}

.reports-action-warning {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--warning, #d99500);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--warning-bg,#fff8e8);
  color: var(--text, #273444);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.reports-action-warning strong {
  color: var(--brand-ink, var(--brand, #005c5c));
}

.reports-action-error {
  color: var(--danger, #c43c3c) !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  margin-top: 0.25rem;
}

/* Blur only the newly added card-action overlays; existing record/table dialogs retain their original styling. */
.reports-action-backdrop[data-widget-action-modal] {
  backdrop-filter: blur(3px);
}

/* Report owner / tags pickers reuse the existing report-action modal and shared custom-select. */
.reports-action-backdrop--report-owner,
.reports-action-backdrop--report-tags {
  z-index: 1140;
}
.reports-action-modal--owner,
.reports-action-modal--tags {
  width: min(588px, calc(100vw - 2rem));
  padding: 1.25rem 1.5rem 1.5rem;
  border-radius: 1.25rem;
  overflow: visible;
}
.reports-action-modal--owner .reports-action-modal__header,
.reports-action-modal--tags .reports-action-modal__header {
  margin: 0 -1.5rem 1.25rem;
  padding: 0 1.5rem 1.1rem;
}
.reports-action-modal--owner .reports-action-modal__header h2,
.reports-action-modal--tags .reports-action-modal__header h2 {
  font-size: 1.25rem;
  font-weight: 650;
}
.reports-action-modal__body {
  min-width: 0;
}
.reports-action-modal--owner .reports-action-field,
.reports-action-modal--tags .reports-action-field {
  margin: 0;
  gap: 0.5rem;
  font-size: 0.95rem;
}
.reports-action-modal--tags .reports-action-help {
  margin: -0.15rem 0 0.05rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.reports-owner-select,
.reports-tags-select {
  display: block;
  width: 100%;
  min-width: 0;
}
.reports-owner-select .custom-select__trigger,
.reports-tags-select .custom-select__trigger {
  min-height: 48px;
  padding: 0.7rem 1rem;
  border-radius: 0.7rem;
  border-color: var(--border-strong, #b8b8b8);
  color: var(--text, #273444);
  font-size: 1rem;
  background: var(--surface, #fff);
}
.reports-owner-select .custom-select__dropdown,
.reports-tags-select .custom-select__dropdown {
  top: calc(100% + 3px);
  min-width: 100%;
  max-height: min(430px, 58vh);
  overflow: hidden;
  border-radius: 1.25rem;
  border-color: var(--border, #d4d7dc);
  box-shadow: 0 18px 42px rgb(20 24 35 / 18%);
  z-index: 1160;
}
.reports-owner-select .custom-select__search {
  padding: 0.75rem 0.85rem;
  border-bottom: 0;
}
.reports-owner-select .custom-select__search input {
  min-height: 44px;
  border: 2px solid var(--brand, #0065e8);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}
.reports-owner-select .custom-select__options,
.reports-tags-select .custom-select__options {
  max-height: min(300px, 40vh);
  padding: 0.25rem 0;
}
.reports-owner-select .custom-select__option,
.reports-tags-select .custom-select__option {
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
}
.reports-owner-select .custom-select__option.is-selected,
.reports-tags-select .custom-select__option.is-selected {
  background: var(--surface-2, #f0f1f3);
}
.reports-owner-select__footer,
.reports-tags-select__footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border, #d4d7dc);
  background: var(--surface, #fff);
}
.reports-owner-select__footer button,
.reports-tags-select__footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--brand-ink, #005c5c);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
}
.reports-owner-select__footer button:hover,
.reports-tags-select__footer a:hover {
  text-decoration: underline;
}
.reports-tags-select__empty {
  padding: 1rem 1.25rem;
  color: var(--text-muted, #9ca3af);
  font-size: 0.9rem;
}
.reports-tag-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 560px) {
  .reports-action-modal--owner,
  .reports-action-modal--tags {
    padding: 1rem;
  }
  .reports-action-modal--owner .reports-action-modal__header,
  .reports-action-modal--tags .reports-action-modal__header {
    margin: 0 -1rem 1rem;
    padding: 0 1rem 0.9rem;
  }
}

/* Advanced dashboard filter drawer — uses the shared CRM popup-drawer shell. */
.reports-dashboard-filter-backdrop:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: block;
  background: rgba(24, 28, 34, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

/* The shared CRM popup-overlay component becomes visible through this state. */
.reports-dashboard-filter-backdrop.popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.reports-dashboard-filter-drawer[hidden],
.reports-dashboard-filter-backdrop[hidden],
.reports-dashboard-filter-rule-editor[hidden] {
  display: none !important;
}

.reports-dashboard-filter-drawer:not([hidden]) {
  position: fixed;
  z-index: 1091;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(520px, 100vw);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  overflow: visible;
  transform: translateX(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
  border: 0;
  border-left: 1px solid var(--border, #ded6c8);
  border-radius: 0;
  background: var(--surface, #fffbe5);
  color: var(--text, #252b33);
  box-shadow: -12px 0 36px rgba(20, 24, 30, 0.12);
}

.reports-dashboard-filter-drawer__header {
  flex: 0 0 auto;
  min-height: 72px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border, #ded6c8);
}

.reports-dashboard-filter-drawer__header .drawer-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.reports-dashboard-filter-drawer__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem 1.25rem 1.5rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.reports-dashboard-filter-main {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.reports-dashboard-filter-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  color: var(--text, #252b33);
  font-size: 0.85rem;
  font-weight: 600;
}

.reports-dashboard-filter-field > label,
.reports-dashboard-filter-field > span,
.reports-dashboard-filter-field--frequency > label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
}

.reports-dashboard-filter-field--frequency small {
  color: var(--text-muted, #7b7e80);
  font-size: 0.72rem;
  font-weight: 500;
}

.reports-dashboard-filter-select {
  width: 100%;
  min-width: 0;
}

.reports-dashboard-filter-select .custom-select-trigger,
.reports-dashboard-filter-select .custom-select__trigger,
.reports-dashboard-filter-select button {
  width: 100%;
  min-height: 44px;
  text-align: left;
}

.reports-dashboard-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.1rem 0 0.15rem;
  font-size: 0.86rem;
  font-weight: 400;
}

.reports-dashboard-filter-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand, #0068c9);
}

.reports-dashboard-filter-info {
  color: var(--text-muted, #777);
  cursor: help;
}

.reports-dashboard-filter-divider {
  height: 1px;
  margin: 0.25rem 0 0.15rem;
  background: var(--border, #ded6c8);
}

.reports-dashboard-add-filter {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border, #ded6c8);
  border-radius: 999px;
  background: transparent;
  color: var(--text, #252b33);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
}

.reports-dashboard-add-filter:hover {
  background: var(--surface-hover, rgba(0, 0, 0, 0.035));
}

.reports-dashboard-filter-empty {
  margin: 0;
  color: var(--text-muted, #777);
  font-size: 0.84rem;
}

.reports-dashboard-applied-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border, #ded6c8);
  border-radius: var(--radius-md, 0.55rem);
  background: var(--surface, #fffbe5);
  font-size: 0.82rem;
}

.reports-dashboard-applied-rule__text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.reports-dashboard-applied-rule__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted, #666);
  font-size: 1.2rem;
  cursor: pointer;
}

.reports-dashboard-applied-rule__remove:hover {
  background: var(--surface-hover, rgba(0, 0, 0, 0.05));
}

.reports-dashboard-filter-rule-editor {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--border, #ded6c8);
  border-radius: var(--radius-lg, 0.75rem);
  background: var(--surface-subtle, rgba(255, 255, 255, 0.25));
}

.reports-dashboard-filter-rule-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
}

.reports-dashboard-filter-rule-editor input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border, #ded6c8);
  border-radius: var(--radius-md, 0.55rem);
  background: var(--surface, #fffbe5);
  color: var(--text, #252b33);
  font: inherit;
  font-size: 0.86rem;
}

.reports-dashboard-filter-rule-editor input[type="text"]:focus-visible {
  outline: 2px solid var(--brand, #0068c9);
  outline-offset: 1px;
}

.reports-dashboard-filter-rule-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reports-dashboard-filter-drawer__footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.reports-dashboard-filter-help {
  color: var(--brand-ink, #006b68);
  font-size: 0.78rem;
  text-decoration: none;
}

.reports-dashboard-filter-help:hover {
  text-decoration: underline;
}

.reports-dashboard-filter-drawer__footer .drawer-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

body.reports-dashboard-filter-open {
  overflow: hidden;
}

@media (max-width: 575.98px) {
  .reports-dashboard-filter-drawer__header,
  .reports-dashboard-filter-drawer__body,
  .reports-dashboard-filter-drawer__footer {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .reports-dashboard-filter-drawer__footer {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .reports-dashboard-filter-drawer__footer .drawer-footer-actions {
    width: 100%;
  }

  .reports-dashboard-filter-drawer__footer .drawer-footer-actions > button {
    flex: 1 1 auto;
  }
}

/* Dashboard settings drawer — shares the exact CRM popup-drawer shell, header, close button, and theme tokens. */
.reports-dashboard-settings-backdrop:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: block;
  background: rgba(24, 28, 34, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.reports-dashboard-settings-backdrop.popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.reports-dashboard-settings-drawer[hidden],
.reports-dashboard-settings-backdrop[hidden],
.reports-settings-panel[hidden],
.reports-dashboard-settings-drawer__footer[hidden] {
  display: none !important;
}

.reports-dashboard-settings-drawer:not([hidden]) {
  position: fixed;
  z-index: 1091;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(520px, 100vw);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  overflow: visible;
  transform: translateX(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: -12px 0 36px rgba(20, 24, 30, 0.12);
}

.reports-settings-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.reports-settings-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  min-height: 48px;
  padding: 0.65rem 1rem;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--fast) var(--ease);
}

.reports-settings-tab:hover {
  color: var(--text);
}

.reports-settings-tab.is-active {
  color: var(--text);
  font-weight: 600;
}

.reports-settings-tab.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--brand);
}

.reports-settings-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.reports-settings-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.reports-settings-field .custom-select-wrapper.reports-custom-select {
  width: 100%;
}

.reports-settings-label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.reports-settings-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

.reports-settings-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--fast) var(--ease);
}

.reports-settings-icon-btn:hover {
  color: var(--text);
}

.reports-settings-icon-btn.is-hidden-state {
  opacity: 0.55;
}

.reports-settings-input,
.reports-settings-select {
  width: 100%;
  padding: 0.2rem 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.45;
  transition: border-color var(--fast) var(--ease);
}

.reports-settings-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.reports-settings-select option {
  background: var(--surface);
  color: var(--text);
}

.reports-settings-input:hover,
.reports-settings-select:hover {
  border-bottom-color: var(--border-strong);
}

.reports-settings-input:focus,
.reports-settings-select:focus {
  outline: none;
  border-bottom-color: var(--brand);
}

.reports-settings-field--underlined {
  width: 100%;
}

.reports-settings-select-wrap {
  position: relative;
  width: 100%;
  border-bottom: 1px solid var(--border-strong);
}

.reports-settings-select--caret {
  width: auto;
  padding-right: 1.15rem;
  border-bottom: 0 !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23475467' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.15rem center;
  background-size: 8px 5px;
}

.reports-settings-description {
  margin: 0.1rem 0 0.25rem;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.reports-settings-see-all {
  margin-top: 0.1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.reports-settings-see-all[aria-expanded="true"]
  .reports-settings-see-all__icon {
  transform: rotate(180deg);
}

/* History Tab */
.reports-history-list {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  margin: 0;
  padding: 0.25rem 0 0;
  list-style: none;
}

.reports-history-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.reports-history-avatar {
  flex: 0 0 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--orange-bg);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.reports-history-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.reports-history-title {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.reports-history-title strong {
  margin-right: 0.3rem;
  color: var(--text);
  font-weight: 700;
}

.reports-history-time {
  color: var(--text-subtle);
  font-size: 0.78rem;
  line-height: 1.25;
}

/* Footer */
.reports-dashboard-settings-drawer__footer {
  justify-content: flex-start;
}

.reports-dashboard-settings-drawer__footer .drawer-footer-actions {
  justify-content: flex-start;
}

.reports-settings-save-btn {
  border-radius: var(--radius-pill);
}

body.reports-dashboard-settings-open {
  overflow: hidden;
}

@media (max-width: 575.98px) {
  .reports-settings-tabs {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

/* ==========================================================================
   Clone report drawer — shares the exact CRM popup-drawer shell, header,
   close button, and theme tokens.
   ========================================================================== */
.reports-clone-backdrop:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: block;
  background: rgba(24, 28, 34, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.reports-clone-backdrop.popup-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.reports-clone-drawer[hidden],
.reports-clone-backdrop[hidden] {
  display: none !important;
}

.reports-clone-drawer:not([hidden]) {
  position: fixed;
  z-index: 1091;
  inset: 0 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(520px, 100vw);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  overflow: visible;
  transform: translateX(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: -12px 0 36px rgba(20, 24, 30, 0.12);
}

.reports-clone-drawer__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1.5rem;
}

.reports-clone-drawer__footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* Custom Dropdown Trigger */
.reports-clone-select-btn {
  height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  user-select: none;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow var(--fast) var(--ease);
}

.reports-clone-select-btn:hover {
  background: var(--surface-hover);
  border-color: var(--brand);
}

.reports-clone-select-btn:focus-visible,
.reports-clone-tags-dropdown.is-open .reports-clone-select-btn,
.reports-clone-dash-dropdown.is-open .reports-clone-select-btn {
  border-color: var(--brand);
  outline: none;
  box-shadow: var(--focus-ring);
}

.reports-clone-select-btn svg,
.reports-clone-select-btn .icon {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--fast) var(--ease);
}

.reports-clone-dash-dropdown.is-open .reports-clone-select-btn svg {
  transform: rotate(180deg);
}

/* Description Textarea & AI Generate */
.reports-clone-desc-textarea {
  min-height: 110px;
  max-height: 280px;
  resize: vertical;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.reports-clone-desc-textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
  outline: none;
}

.reports-clone-gen-btn {
  color: var(--brand);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: color var(--fast) var(--ease);
}

.reports-clone-gen-btn:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

/* Dashboard Dropdown Menu */
.reports-clone-dash-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  width: 100% !important;
  min-width: 100% !important;
  box-sizing: border-box;
  z-index: 1050;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
}

/* Search Box Inside Dashboard Dropdown */
.reports-clone-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
}

.reports-clone-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.reports-clone-search-icon svg,
.reports-clone-search-icon .icon {
  width: 14px !important;
  height: 14px !important;
  display: block;
}

.reports-clone-search-input {
  width: 100% !important;
  height: 36px !important;
  padding-left: 34px !important;
  padding-right: 12px !important;
  border-radius: var(--radius-pill) !important;
  border: 1px solid var(--border-strong) !important;
  background: var(--surface) !important;
  font-size: 13px !important;
  color: var(--text) !important;
  outline: none;
}

.reports-clone-search-input:focus {
  border-color: var(--brand) !important;
  box-shadow: var(--focus-ring) !important;
}

.reports-clone-dash-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reports-clone-dash-list .dropdown__item {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 13.5px;
  border-radius: var(--radius-sm, 6px);
  color: var(--text);
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}

.reports-clone-dash-list .dropdown__item:hover,
.reports-clone-dash-list .dropdown__item:focus-visible {
  background: var(--surface-hover);
  outline: none;
}

.reports-clone-dash-list .dropdown__item.is-selected {
  background: var(--surface-3, #eef1f5);
  font-weight: 600;
}

.reports-clone-dash-select-wrap {
  width: 100%;
}

.reports-clone-dash-select-wrap[hidden] {
  display: none !important;
}

/* Custom Checkbox & Radio consistency (reusing .check and .check__box) */
.reports-clone-drawer .check {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.reports-clone-drawer .check input {
  position: absolute;
  opacity: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.reports-clone-drawer .check__box {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease);
}

.reports-clone-drawer .check__box::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid var(--brand-contrast, #ffffff);
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform var(--fast) var(--ease);
}

.reports-clone-drawer .check input[type="checkbox"]:checked + .check__box {
  background: var(--brand);
  border-color: var(--brand);
}

.reports-clone-drawer
  .check
  input[type="checkbox"]:checked
  + .check__box::after {
  transform: rotate(-45deg) translate(1px, -1px) scale(1);
}

/* Custom Radio button styling using theme brand color */
.reports-clone-drawer .check__box--radio {
  border-radius: 50% !important;
}

.reports-clone-drawer .check__box--radio::after {
  content: "" !important;
  width: 8px !important;
  height: 8px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--brand-contrast, #ffffff) !important;
  transform: scale(0) !important;
  transition: transform var(--fast) var(--ease) !important;
}

.reports-clone-drawer .check:hover .check__box--radio {
  border-color: var(--brand);
}

.reports-clone-drawer .check input[type="radio"]:checked + .check__box--radio {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
}

.reports-clone-drawer
  .check
  input[type="radio"]:checked
  + .check__box--radio::after {
  transform: scale(1) !important;
}

.reports-clone-drawer .check input:focus-visible + .check__box {
  box-shadow: var(--focus-ring);
}

body.reports-dashboard-clone-open {
  overflow: hidden;
}

/* Highlight pulse for cloned report added to page */
@keyframes crmClonePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(36, 86, 230, 0.5);
  }
  60% {
    box-shadow: 0 0 0 10px rgba(36, 86, 230, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(36, 86, 230, 0);
  }
}

.crm-highlight-pulse {
  animation: crmClonePulse 1.8s ease-out;
}

/* ==========================================================================
   REPORTS AUDIT NOTE EDIT MODAL & TOOLBAR
   ========================================================================== */
.reports-audit-edit-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.reports-audit-edit-modal-backdrop.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

.reports-audit-edit-modal-backdrop[hidden] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.reports-audit-edit-modal {
  max-width: 680px;
  width: min(680px, calc(100vw - 32px));
  max-height: 90vh;
}

.reports-audit-edit-input {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--radius-sm, 6px);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: 0;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.reports-audit-edit-input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

/* ------------------------------------------------------------- Audit Editor Mount (HubSpot ActivityComposer) */
#reportsAuditEditorMount .acx-editor {
  border: 1px solid var(--border-strong, var(--border));
  border-radius: var(--radius-sm, 6px);
  background: var(--surface);
  overflow: hidden;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

#reportsAuditEditorMount .acx-editor:focus-within {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

#reportsAuditEditorMount .acx-editor__area {
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text, #273444);
  outline: none;
  scrollbar-width: thin;
}

#reportsAuditEditorMount .acx-toolbar {
  border-top: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
  padding: 8px 12px;
}

/* Ensure popovers like More formatting, swatches, links appear on top of modal */
.acx-pop {
  z-index: 1500 !important;
}

/* Ensure audit key list items stay properly aligned inside the editor without bullets */
#reportsAuditEditorMount .acx-editor__area .reports-audit-key__list {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.35rem !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

#reportsAuditEditorMount .acx-editor__area .reports-audit-key__list li {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  list-style: none !important;
  margin-bottom: 0 !important;
  font-size: 0.86rem !important;
  font-weight: 600 !important;
  padding: 0 !important;
}

#reportsAuditEditorMount .acx-editor__area .reports-audit-key__list li::before,
#reportsAuditEditorMount .acx-editor__area .reports-audit-key__list li::marker {
  display: none !important;
  content: none !important;
}

/* Ensure audit groups keep original styling inside the editor */
#reportsAuditEditorMount .acx-editor__area .reports-audit-group {
  margin: 0 0 1.5rem !important;
  color: var(--text, #273444) !important;
  font-size: 0.9rem !important;
  line-height: 1.6 !important;
}

#reportsAuditEditorMount .acx-editor__area .reports-audit-group h3 {
  margin: 0 0 0.7rem !important;
  color: var(--text-orange, var(--brand-orange, #f28c00)) !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
}

#reportsAuditEditorMount .acx-editor__area .reports-audit-group ul {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.45rem !important;
  margin: 0 !important;
  padding-left: 1.25rem !important;
}

#reportsAuditEditorMount .acx-editor__area .reports-audit-group ul ul {
  margin-top: 0.4rem !important;
  padding-left: 1.4rem !important;
}

#reportsAuditEditorMount .acx-editor__area .reports-status {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

#reportsAuditEditorMount .acx-editor__area a {
  color: var(--brand);
  text-decoration: underline;
}

#reportsAuditEditorMount .acx-editor__area img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm, 6px);
}

/* ------------------------------------------------------------- Delete Report Modal */
.reports-delete-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1060;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.reports-delete-modal-backdrop.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

.reports-delete-modal-backdrop[hidden] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.reports-delete-modal {
  max-width: 580px;
  width: min(580px, calc(100vw - 32px));
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.reports-delete-modal__header {
  padding: 24px 28px 12px;
  border-bottom: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.reports-delete-modal__title {
  flex-wrap: wrap;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin: 0;
}

.reports-delete-modal__body {
  padding: 0 28px 20px;
}

.reports-delete-modal__lead {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
}

.reports-delete-table {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0 14px;
  margin-bottom: 20px;
}

.reports-delete-table__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.reports-delete-table__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
}

.reports-delete-table__name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.reports-delete-table__dashboards {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal, #0e7c86);
}

.reports-delete-notes {
  margin: 0 0 8px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: disc outside;
}

.reports-delete-notes li {
  font-size: 0.88rem;
  color: var(--text-muted, var(--text));
  line-height: 1.45;
}

.reports-delete-modal__footer {
  padding: 12px 28px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border-top: 0;
}

.reports-delete-modal__footer .btn-crm--danger {
  background: var(--danger, #c01048) !important;
  border-color: var(--danger, #c01048) !important;
  color: #ffffff !important;
}

.reports-delete-modal__footer .btn-crm--danger:hover {
  filter: brightness(0.92);
  background: var(--danger, #c01048) !important;
}

.reports-delete-modal__footer .btn-crm--danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--danger-bg, rgba(192, 16, 72, 0.22));
}

.reports-delete-modal__footer .btn-crm--outline {
  border-color: var(--border-strong, #cbd5e1);
  color: var(--text);
}

.reports-delete-modal__footer .btn-crm--outline:hover {
  background: var(--surface-hover);
  border-color: var(--text);
}

/* ------------------------------------------------------------- Remove Report Modal */
.reports-remove-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1060;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.reports-remove-modal-backdrop.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

.reports-remove-modal-backdrop[hidden] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.reports-remove-modal {
  max-width: 480px;
  width: min(480px, calc(100vw - 32px));
  background: var(--surface, #ffffff);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
  border: 1px solid var(--border, #e2e8f0);
  overflow: hidden;
}

.reports-remove-modal .modal__close {
  display: none !important;
}

.reports-remove-modal__header {
  padding: 28px 32px 22px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.reports-remove-modal__title {
  flex-wrap: wrap;
  font-size: 1.625rem;
  font-weight: 500;
  color: var(--text, #1e293b);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.015em;
  word-break: break-word;
}

.reports-remove-modal__title span {
  font-weight: 500;
}

.reports-remove-modal__body {
  padding: 24px 32px 20px;
}

.reports-remove-modal__text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted, #334155);
  margin: 0;
}

.reports-remove-modal__footer {
  padding: 12px 32px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border-top: 0;
}

.reports-remove-modal__footer .btn-crm--danger {
  background: var(--danger, #a00b28) !important;
  border-color: var(--danger, #a00b28) !important;
  color: #ffffff !important;
}

.reports-remove-modal__footer .btn-crm--danger:hover {
  filter: brightness(0.92);
  background: var(--danger, #a00b28) !important;
}

.reports-remove-modal__footer .btn-crm--danger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--danger-bg, rgba(160, 11, 40, 0.22));
}

.reports-remove-modal__footer .btn-crm--outline {
  border: 1px solid var(--border-strong, #94a3b8);
  color: var(--text, #1e293b);
  background: transparent;
}

.reports-remove-modal__footer .btn-crm--outline:hover {
  background: var(--surface-hover, #f8fafc);
  border-color: var(--text, #1e293b);
}

/* ------------------------------------------------------------- Add to Dashboard Modal */
.reports-add-dashboard-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1060;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.reports-add-dashboard-modal-backdrop.is-open {
  opacity: 1 !important;
  visibility: visible !important;
  display: flex !important;
}

.reports-add-dashboard-modal-backdrop[hidden] {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.reports-add-dashboard-modal {
  max-width: 480px;
  width: min(480px, calc(100vw - 32px));
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
  border: 1px solid var(--border);
  overflow: visible !important;
}

.reports-add-dashboard-modal .modal__body {
  overflow: visible !important;
  padding: 20px 24px;
}

.reports-add-dashboard-warning {
  border: 1px solid var(--warning, #eab308);
  border-radius: var(--radius-md, 8px);
  background: var(--warning-bg,#fefce8);
}

.reports-add-dashboard-warning a {
  color: var(--brand-ink, var(--brand, #0068c9));
  text-decoration: none;
}

.reports-add-dashboard-warning a:hover {
  text-decoration: underline;
}

#reportsAddDashboardSelectWrap .custom-select__options {
  max-height: 220px;
  overflow-y: auto;
}

#reportsAddDashboardSelectWrap .custom-select__group-header {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.02em;
  user-select: none;
}

