/* Shared ERP report output controls */
html body[data-view="reports"] .erp-report-page {
  display: grid;
  gap: 14px;
}

html body[data-view="reports"] .erp-report-output-bar {
  min-height: 76px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--aq-border, #dce4ee);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 35, 62, .045);
}

html body[data-view="reports"] .erp-report-output-bar > div:first-child {
  display: grid;
  gap: 3px;
}

html body[data-view="reports"] .erp-report-output-bar span {
  color: #64748b;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .13em;
}

html body[data-view="reports"] .erp-report-output-bar h2 {
  margin: 0;
  color: #0b203d;
  font-size: 17px;
}

html body[data-view="reports"] .erp-report-output-bar p {
  margin: 0;
  color: #64748b;
  font-size: 10.5px;
}

html body[data-view="reports"] .erp-report-output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

html body[data-view="reports"] .erp-report-output-actions button {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

html body[data-view="reports"] .erp-report-output-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

@media (max-width: 760px) {
  html body[data-view="reports"] .erp-report-output-bar {
    align-items: stretch;
    flex-direction: column;
  }

  html body[data-view="reports"] .erp-report-output-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  html body[data-view="reports"] .erp-report-output-actions button {
    justify-content: center;
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body.printing-erp-reports {
    background: #fff !important;
  }

  body.printing-erp-reports .sidebar,
  body.printing-erp-reports .topbar,
  body.printing-erp-reports .erp-report-output-bar,
  body.printing-erp-reports .crm-report-filter-card,
  body.printing-erp-reports .crm-report-tabs,
  body.printing-erp-reports .toolbar-actions,
  body.printing-erp-reports [data-action="export-crm-report"],
  body.printing-erp-reports [data-action="download-backup"] {
    display: none !important;
  }

  body.printing-erp-reports .app-shell,
  body.printing-erp-reports .main,
  body.printing-erp-reports .view,
  body.printing-erp-reports .erp-report-page {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body.printing-erp-reports .erp-report-page::before {
    content: "AQ360 ERP Reports";
    display: block;
    margin-bottom: 8mm;
    padding-bottom: 4mm;
    border-bottom: 2px solid #174f7d;
    color: #0b203d;
    font-size: 20pt;
    font-weight: 800;
  }

  body.printing-erp-reports .card,
  body.printing-erp-reports .crm-report-block,
  body.printing-erp-reports .crm-report-card {
    break-inside: avoid;
    box-shadow: none !important;
  }

  body.printing-erp-reports .table-wrap {
    max-height: none !important;
    overflow: visible !important;
  }
}
