/* Resumen pages visual refresh. Topbar and sidebar are intentionally untouched. */
#reports.view.active {
  position: relative;
  min-height: calc(100vh - var(--topbar-height, 112px));
  padding: 28px 38px 42px;
  overflow: auto;
  background:
    radial-gradient(circle at 82% 106%, rgba(0, 87, 217, 0.08) 0 1.3px, transparent 1.55px) 0 0 / 13px 13px,
    linear-gradient(180deg, #f7faff 0%, #f6f8fc 100%);
}

#reports.view.active::before {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -175px;
  width: 700px;
  height: 390px;
  border-radius: 58% 42% 0 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 87, 217, 0.075) 0 1.5px, transparent 1.75px) 0 0 / 12px 12px;
  opacity: 0.82;
  pointer-events: none;
  z-index: 0;
}

#reports > .panel,
#reports .report-summary-cards {
  position: relative;
  z-index: 1;
  margin: 0;
  border: 1px solid #dbe4f2;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 44px rgba(7, 26, 68, 0.08);
}

#reports > .panel {
  padding: 28px 28px 30px;
  min-height: 176px;
}

#reports[data-report-type="notes"] > .panel,
#reports[data-report-type="corrections"] > .panel {
  min-height: 430px;
}

#reports .panel-heading {
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 0;
}

#reports #reportTitle {
  position: relative;
  margin: 0;
  padding-left: 0;
  color: #071a44;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0;
}

#reports[data-report-type="corrections"] #reportTitle {
  font-size: 16px;
}

#reports[data-report-type="orders"] .report-actions > .compact-input,
#reports[data-report-type="orderAnalysis"] .report-actions > .compact-input {
  display: none;
}

#reports .report-actions {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
}

#reports .report-actions .compact-input {
  min-width: 230px;
  margin: 0;
  display: grid;
  gap: 5px;
  color: #536487;
  font-size: 12px;
  font-weight: 800;
}

#reports .report-date-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

#reports .report-date-filters[hidden] {
  display: none;
}

#reports .report-date-filters .compact-input {
  min-width: 150px;
}

#reports #clearReportDateBtn {
  min-height: 36px;
  height: 36px;
}

#reports #reportSession {
  width: 230px;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #a8c5f5;
  border-radius: 3px;
  background: #ffffff;
  color: #071a44;
  font-size: 12px;
  font-weight: 900;
}

#reports #exportBtn {
  width: 82px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9e1f2;
  border-radius: 5px;
  background: #eef4ff;
  color: #071a44;
  font-size: 12px;
  font-weight: 900;
  box-shadow: none;
}

#reports .dashboard-table-wrap {
  width: 100%;
  max-height: none;
  margin: 0;
  overflow: auto;
  border: 1px solid #dbe4f2;
  border-radius: 10px;
  background: #ffffff;
}

#reports .dashboard-table-wrap table {
  width: 100%;
  min-width: 900px;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
}

#reports .dashboard-table-wrap th,
#reports .dashboard-table-wrap td {
  height: 52px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid #e8eef7;
  color: #071a44;
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

#reports .dashboard-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 46px;
  background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
  color: #09265a;
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
}

#reports .dashboard-table-wrap td {
  font-weight: 700;
}

#reports .dashboard-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

#reports .dashboard-table-wrap td:nth-child(2),
#reports .dashboard-table-wrap td:nth-child(3),
#reports[data-report-type="count"] .dashboard-table-wrap td:nth-child(4),
#reports[data-report-type="differences"] .dashboard-table-wrap td:nth-child(2) {
  font-weight: 900;
}

#reports[data-report-type="general"] .dashboard-table-wrap td:nth-child(5),
#reports[data-report-type="count"] .dashboard-table-wrap td:nth-child(9),
#reports[data-report-type="differences"] .dashboard-table-wrap td:nth-child(5),
#reports[data-report-type="differences"] .dashboard-table-wrap td:nth-child(6) {
  color: #0057d9;
  font-weight: 900;
}

#reports[data-report-type="general"] .dashboard-table-wrap td:nth-child(8),
#reports[data-report-type="count"] .dashboard-table-wrap td:nth-child(10) {
  color: #09265a;
  font-weight: 900;
}

#reports .dashboard-table-wrap .report-positive td {
  background: #f0fbef;
  color: #078647;
  font-weight: 900;
}

#reports .dashboard-table-wrap .report-negative td {
  background: #fff2f2;
  color: #e11d48;
  font-weight: 900;
}

#reports[data-report-type="differences"] .dashboard-table-wrap .report-negative td {
  background: #fff1f1;
}

#reports[data-report-type="differences"] .dashboard-table-wrap td:nth-child(7) {
  color: #e11d48;
  font-weight: 900;
}

#reports[data-report-type="differences"] .dashboard-table-wrap .report-positive td:nth-child(7) {
  color: #078647;
}

#reports #reportBody tr:only-child td[colspan] {
  position: relative;
  height: 286px;
  padding: 174px 20px 42px;
  text-align: center;
  color: #071a44;
  font-size: 13px;
  font-weight: 800;
  white-space: normal;
  border-bottom: 0;
}

#reports #reportBody tr:only-child td[colspan]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 72px;
  width: 78px;
  height: 78px;
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(232, 240, 255, 0.92), rgba(255, 255, 255, 0.94)) padding-box,
    linear-gradient(135deg, #c7dcff, #edf4ff) border-box;
  border: 1px solid transparent;
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(7, 26, 68, 0.08);
}

#reports #reportBody tr:only-child td[colspan]::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 91px;
  width: 38px;
  height: 38px;
  transform: translateX(-50%);
  background: #1767d8;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6M9 13h6M9 17h4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6M9 13h6M9 17h4'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

#reports[data-report-type="corrections"] #reportBody tr:only-child td[colspan]::after {
  background: #22c55e;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

#reports .report-summary-cards {
  margin: 0 0 24px;
  padding: 28px;
}

#reports .report-summary-cards[hidden] {
  display: none;
}

#reports .report-summary-cards .panel-heading {
  margin-bottom: 22px;
}

#reports .report-summary-cards h2 {
  margin: 0;
  color: #071a44;
  font-size: 17px;
  font-weight: 900;
}

#reports .report-difference-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

#reports .report-summary-card {
  position: relative;
  min-height: 96px;
  padding: 22px 22px 18px 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid #dbe4f2;
  border-radius: 10px;
  background: #ffffff;
}

#reports .report-summary-card::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 50px;
  height: 50px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--summary-soft, #ffe8e8);
}

#reports .report-summary-card::after {
  content: "";
  position: absolute;
  left: 37px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  background: var(--summary-color, #e11d48);
  -webkit-mask: var(--summary-icon) center / contain no-repeat;
  mask: var(--summary-icon) center / contain no-repeat;
}

#reports .report-summary-card.danger {
  --summary-color: #ef1736;
  --summary-soft: #ffe5ea;
  --summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13'/%3E%3Cpath d='M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/g%3E%3C/svg%3E");
}

#reports .report-summary-card.ok {
  --summary-color: #16a34a;
  --summary-soft: #e8f8ee;
  --summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/g%3E%3C/svg%3E");
}

#reports .report-summary-card.danger-alt {
  --summary-color: #ef1736;
  --summary-soft: #ffe8e8;
  --summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/g%3E%3C/svg%3E");
}

#reports .report-summary-card.neutral {
  --summary-color: #1767d8;
  --summary-soft: #e8f0ff;
  --summary-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5v14'/%3E%3C/g%3E%3C/svg%3E");
}

#reports .report-summary-card span {
  margin: 0 0 7px;
  color: #536487;
  font-size: 13px;
  font-weight: 800;
}

#reports .report-summary-card strong {
  color: var(--summary-color, #ef1736);
  font-size: 28px;
  line-height: 1;
  font-weight: 900;
}

@media (max-width: 1400px) {
  #reports.view.active {
    padding: 24px 30px 36px;
  }

  #reports .report-difference-summary {
    gap: 18px;
  }
}

/* Match Diferencias summary with Historial de stock metric summary. */
#reports[data-report-type="differences"] .report-summary-cards {
  min-height: 0;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#reports[data-report-type="orders"] .report-summary-cards {
  min-height: 0;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#reports[data-report-type="differences"] .report-difference-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

#reports[data-report-type="orders"] .report-orders-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

#reports[data-report-type="differences"] .report-summary-card {
  min-height: 88px;
  padding: 18px 20px 16px 82px;
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(7, 26, 68, 0.07);
}

#reports[data-report-type="orders"] .report-summary-card {
  min-height: 82px;
  padding: 15px 16px 14px 70px;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(7, 26, 68, 0.06);
}

#reports[data-report-type="differences"] .report-summary-card::before {
  left: 22px;
  width: 48px;
  height: 48px;
}

#reports[data-report-type="orders"] .report-summary-card::before {
  left: 18px;
  width: 40px;
  height: 40px;
}

#reports[data-report-type="differences"] .report-summary-card::after {
  left: 34px;
  width: 24px;
  height: 24px;
}

#reports[data-report-type="orders"] .report-summary-card::after {
  left: 28px;
  width: 20px;
  height: 20px;
}

#reports[data-report-type="differences"] .report-summary-card span {
  margin-bottom: 6px;
  font-size: 13px;
}

#reports[data-report-type="orders"] .report-summary-card span {
  margin-bottom: 5px;
  font-size: 12px;
}

#reports[data-report-type="differences"] .report-summary-card strong {
  font-size: 28px;
}

#reports[data-report-type="orders"] .report-summary-card strong {
  font-size: 23px;
}

@media (max-width: 1400px) {
  #reports[data-report-type="differences"] .report-difference-summary {
    gap: 18px;
  }

  #reports[data-report-type="orders"] .report-orders-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  #reports[data-report-type="differences"] .report-difference-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #reports[data-report-type="orders"] .report-orders-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
