:root {
  --navy: #071728;
  --navy2: #10263d;
  --gold: #d2aa45;
  --bg: #f3f0e9;
  --panel: #fff;
  --border: #ded8cb;
  --text: #152339;
  --muted: #6d7889;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
.reportsPage {
  width: min(1500px, calc(100% - 28px));
  margin: 18px auto 48px;
}
.reportsHeaderActions,
.reportExportControls,
.reportCustomDates {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}
.reportsWelcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.reportsUpdatedBox {
  min-width: 190px;
  padding: 14px 18px;
  background: #fff;
  border-right: 4px solid var(--gold);
}
.reportsUpdatedBox span,
.reportsUpdatedBox strong {
  display: block;
}
.reportsUpdatedBox span {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}
.reportFilters {
  margin-top: 22px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: #fff;
  border-top: 3px solid var(--gold);
}
.reportQuickRanges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.reportQuickRanges button,
.reportsSecondaryBtn,
.reportsPrimaryBtn,
.reportModalHeader button {
  border: 0;
  min-height: 43px;
  padding: 0 17px;
  cursor: pointer;
  font-weight: 800;
}
.reportQuickRanges button,
.reportsSecondaryBtn {
  background: #eef0f2;
  color: var(--navy);
  border: 1px solid #d7dce1;
}
.reportQuickRanges button.active,
.reportsPrimaryBtn {
  background: var(--gold);
  color: #10151c;
  border: 1px solid var(--gold);
}
.reportCustomDates label,
.reportExportControls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.reportCustomDates input,
.reportExportControls select {
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid #d5d1c7;
  background: #fff;
  color: var(--text);
}
.reportStatus {
  margin-top: 16px;
  padding: 14px 16px;
  background: #fff4d8;
  border-right: 4px solid var(--gold);
  font-weight: 700;
}
.reportKpiGrid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.reportKpiCard {
  min-height: 142px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
}
.reportKpiCard span,
.reportKpiCard strong,
.reportKpiCard small {
  display: block;
}
.reportKpiCard span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.reportKpiCard strong {
  margin: 12px 0 10px;
  color: var(--navy);
  font-size: clamp(24px, 2vw, 34px);
}
.reportKpiCard small {
  color: var(--muted);
  line-height: 1.5;
}
.profitCard {
  background: var(--navy);
  color: #fff;
}
.profitCard span,
.profitCard strong,
.profitCard small {
  color: inherit;
}
.reportChartsGrid,
.reportTablesGrid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.reportPanel,
.reportInsights,
.reportExportSection {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
}
.reportPanelWide,
.reportPanelFull {
  grid-column: 1/-1;
}
.reportPanelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}
.reportPanelHeader h2,
.reportExportSection h2 {
  margin: 0 0 5px;
  color: var(--navy);
  font-size: 22px;
}
.reportPanelHeader p,
.reportExportSection p {
  margin: 0;
  color: var(--muted);
}
.chartWrap {
  position: relative;
  min-height: 310px;
}
.chartWrapLarge {
  min-height: 390px;
}
.reportTableWrap {
  width: 100%;
  overflow-x: auto;
}
.reportTable {
  width: 100%;
  border-collapse: collapse;
}
.reportTable th,
.reportTable td {
  padding: 13px 12px;
  text-align: right;
  border-bottom: 1px solid #e8e4dc;
  white-space: nowrap;
}
.reportTable th {
  background: #f4f1ea;
  color: var(--navy);
  font-size: 13px;
}
.reportTable td {
  font-size: 14px;
}
.reportTableEmpty {
  padding: 25px !important;
  text-align: center !important;
  color: var(--muted);
}
.orderStatusBadge {
  display: inline-block;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #e9edf1;
}
.orderStatusBadge.paid {
  color: #0b6438;
  background: #dff3e8;
}
.orderStatusBadge.refunded {
  color: #7a2b2b;
  background: #f7dfdf;
}
.orderStatusBadge.pending {
  color: #74570b;
  background: #fff1c4;
}
.reportInsights {
  margin-top: 20px;
}
.insightsGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.insightCard {
  min-height: 120px;
  padding: 16px;
  background: #f7f5f0;
  border-right: 4px solid var(--gold);
}
.insightCard strong {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
}
.insightCard p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.reportExportSection {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  border-top: 4px solid var(--gold);
}
.reportLoader {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  background: var(--bg);
}
.reportLoaderBox {
  width: min(360px, calc(100% - 32px));
  padding: 32px;
  text-align: center;
  background: #fff;
  border-top: 4px solid var(--gold);
}
.reportLoaderBox img {
  width: 76px;
  height: 76px;
  object-fit: contain;
}
.reportLoaderLine {
  height: 4px;
  margin-top: 20px;
  overflow: hidden;
  background: #e5e5e5;
}
.reportLoaderLine:after {
  content: "";
  display: block;
  width: 45%;
  height: 100%;
  background: var(--gold);
  animation: move 1.1s infinite ease-in-out;
}
@keyframes move {
  from {
    transform: translateX(150%);
  }
  to {
    transform: translateX(-250%);
  }
}
.reportModal[hidden] {
  display: none;
}
.reportModal {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: grid;
  place-items: center;
  padding: 18px;
}
.reportModalBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 12, 24, 0.78);
}
.reportModalDialog {
  position: relative;
  width: min(1080px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #f0eee9;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
}
.reportModalHeader,
.reportModalActions {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--navy);
  color: #fff;
}
.reportModalHeader h2,
.reportModalHeader p {
  margin: 0;
}
.reportModalHeader button {
  width: 43px;
  padding: 0;
  background: #fff;
  color: var(--navy);
  font-size: 28px;
}
.printableReport {
  width: 794px;
  min-height: 1123px;
  margin: 24px auto;
  padding: 44px;
  background: #fff;
  color: #162238;
  direction: rtl;
}
.printableReportHeader {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 20px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 4px solid var(--gold);
}
.printableReportHeader img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}
.printableReportHeader h1 {
  margin: 0 0 6px;
  color: var(--navy);
}
.printableReportMeta {
  display: grid;
  gap: 4px;
  text-align: left;
  font-size: 12px;
}
.previewKpis {
  margin: 24px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.previewKpi {
  padding: 14px;
  background: #f4f1ea;
  border-top: 3px solid var(--gold);
}
.previewKpi span,
.previewKpi strong {
  display: block;
}
.previewKpi strong {
  margin-top: 7px;
  font-size: 20px;
}
.previewContent h2 {
  margin-top: 28px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ded8cb;
  color: var(--navy);
}
.previewContent table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.previewContent th,
.previewContent td {
  padding: 9px;
  border-bottom: 1px solid #e5e0d6;
  text-align: right;
}
.previewContent th {
  background: #f2efe8;
}
.printableReportFooter {
  margin-top: 38px;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #dcd6cb;
  color: var(--muted);
  font-size: 11px;
}
@media (max-width: 1250px) {
  .reportKpiGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .insightsGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 800px) {
  .reportsPage {
    width: calc(100% - 18px);
    margin-top: 9px;
  }
  .reportsWelcome,
  .reportExportSection {
    align-items: stretch;
    flex-direction: column;
  }
  .reportKpiGrid,
  .reportChartsGrid,
  .reportTablesGrid,
  .insightsGrid {
    grid-template-columns: 1fr;
  }
  .reportPanelWide,
  .reportPanelFull {
    grid-column: auto;
  }
  .reportCustomDates,
  .reportCustomDates label,
  .reportCustomDates input,
  .reportCustomDates button,
  .reportExportControls,
  .reportExportControls label,
  .reportExportControls select,
  .reportExportControls button {
    width: 100%;
  }
}


#printableReport {
  direction: rtl;
  text-align: right;
}

#printableReport * {
  box-sizing: border-box;
}

#printableReport img {
  image-rendering: auto;
}

#printableReport table {
  page-break-inside: auto;
}

#printableReport tr {
  page-break-inside: avoid;
  break-inside: avoid;
}

#printableReport h1,
#printableReport h2,
#printableReport h3 {
  page-break-after: avoid;
  break-after: avoid;
}
#printableReport[dir="ltr"] {
  direction: ltr;
  text-align: left;
}
#printableReport[dir="ltr"] .previewContent th,
#printableReport[dir="ltr"] .previewContent td {
  text-align: left;
}
