/* Eureka WebUI sobre ZK10 - reportes HTML.
   Hoja autónoma: tabla, encabezado fijo, totales y espaciado final. */

@media screen {
  html[data-eureka-credit-preview] {
    --rp-credit-heading: linear-gradient(119deg, #d5f6f2, #b0d9ee);
    --rp-credit-heading-text: #132e42;
  }
  html[data-eureka-credit-preview][data-eureka-theme="dark"] {
    --rp-credit-heading: linear-gradient(119deg, #245b60, #1d3b59);
    --rp-credit-heading-text: #e7f2fb;
  }
  html[data-eureka-credit-preview] .rp-table { width: 100%; }
  html[data-eureka-credit-preview] .rp-table tbody tr:first-child th {
    background: var(--rp-credit-heading);
    color: var(--rp-credit-heading-text);
  }
  html[data-eureka-credit-preview] .rp-table tbody td:first-child { white-space: nowrap; }
}

/* The embedded report follows the ERP theme; printed output keeps its palette. */
@media screen {
  html[data-eureka-theme="dark"] {
    color-scheme: dark;
    --rp-text: #edf3fa;
    background: #101923;
    color: var(--rp-text);
  }
  html[data-eureka-theme="dark"] body {
    background: #101923;
    color: var(--rp-text);
  }
  html[data-eureka-theme="dark"] .rp-table {
    background: #192634;
    color: var(--rp-text);
    border-color: #37485b;
  }
  html[data-eureka-theme="dark"] .rp-table :is(td, th) { border-color: #37485b; }
  html[data-eureka-theme="dark"] .rp-table th,
  html[data-eureka-theme="dark"] .rp-table tbody tr:first-child th {
    background-color: #26394d;
    color: #edf3fa;
  }
  html[data-eureka-theme="dark"] .rp-odd { background: #1d2d3e; }
  html[data-eureka-theme="dark"] .rp-functionrow td {
    background: #244c69;
    border-color: #526479;
  }
  html[data-eureka-theme="dark"] .rp-href { color: #8bd9e4; }
  html[data-eureka-theme="dark"] .rp-column-menu {
    background: #192634;
    color: #edf3fa;
    border-color: #526479;
  }
  html[data-eureka-theme="dark"] .rp-column-menu-item:hover { background: #26394d; }
  html[data-eureka-theme="dark"] .rp-column-menu-item a { color: #8bd9e4; }
}

.rp-href {
	color: #000000;
}

.rp-column-menu {
	position: absolute;
	display: none;
	top: 0;
	left: 0;
	z-index: 30;
	border: 1px solid lightgray;
	background-color: white;
}
.rp-column-menu-item { padding: 3px; vertical-align: middle; }
.rp-column-menu-item:hover { background-color: lightgray; }
.rp-column-menu-item a { text-decoration: none; font-size: 10px; vertical-align: middle; }

.rp-table-container {
  max-height: 600px;
  overflow-y: auto;
  position: relative;          /* necesario para sticky */
  overflow-anchor: none;       /* evita posiciones raras tras refrescar */
}

/* === Cabecera pegajosa === */
/* Nota: los <th> están en el primer <tr> del <tbody>, no en <thead> */
.rp-table tbody tr:first-child th {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: #1F9BDE;
  color: #FFF;
}

/* === Tabla base === */
.rp-table {
  border-collapse: collapse;
  width: 90%;
  font-family: sans-serif;
  font-size: smaller;
  border: 1px solid #BBBBBB;
}

/* Encabezados */
.rp-table th {
  text-align: center;
  padding: 4px 6px;
  font-weight: bold;
  background-color: #1F9BDE;
  color: #FFF;
  border: 1px solid #FFF;
}
.rp-table th:last-child {
  border-right: none;
}

/* Celdas */
.rp-table td {
  border: 1px solid #BBBBBB;
  padding: 3px 6px;
  vertical-align: top;
}
.rp-table td:last-child {
  border-right: none;
}

/* Alineación */
.rp-number { text-align: right !important; }
.rp-text, .rp-date { text-align: left; }

/* Fila de totales/funciones */
.rp-functionrow td {
  background-color: #D6EAF6;
  font-weight: bold;
  border: 1px solid #BBBBBB;
  white-space: nowrap;
  padding: 3px;
  height: 24px;
  box-sizing: border-box;
}

/* Fila impar */
.rp-odd {
  background-color: #f7f7f7;
}

/* Espaciador real al final del contenido (para que no se corte al refrescar) */
body::after,
.rp-table-container::after {
  content: "";
  display: block;
  height: 48px;
}

.rp-table-container {
	max-height: 600px;
	overflow-y: auto;
	position: relative;
	overflow-anchor: none;
}

/* Los reportes generan los encabezados dentro del primer tr del tbody. */
.rp-table tbody tr:first-child th {
	position: sticky;
	top: 0;
	z-index: 20;
	background-color: #1F9BDE;
	color: #FFF;
}

.rp-functionrow td {
	white-space: nowrap;
	height: 24px;
	box-sizing: border-box;
}

body::after,
.rp-table-container::after {
	content: "";
	display: block;
	height: 48px;
}

/* Eureka native print-format customization (ZK components rendered from Java). */
.ek-print-copy-window,
.ek-print-custom-window {
	border-radius: 10px;
	box-shadow: 0 14px 35px rgba(18, 48, 71, .24);
}

.ek-print-copy-body,
.ek-print-custom-shell {
	box-sizing: border-box;
	padding: 18px;
	background: #f7fafc;
}

.ek-print-copy-help,
.ek-print-custom-legend {
	display: block;
	margin-bottom: 10px;
	color: #506579;
}

.ek-print-copy-name,
.ek-print-custom-input,
.ek-print-custom-select,
.ek-print-custom-mini-select,
.ek-print-custom-number {
	box-sizing: border-box;
	width: 100%;
}

.ek-print-copy-validation {
	min-height: 20px;
	margin-top: 5px;
	color: #b42318;
}

.ek-print-copy-actions,
.ek-print-custom-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 14px;
}

/* Keeps copy-dialog actions consistent with the native report designer commands. */
.ek-print-action-button {
	min-width: 104px;
	min-height: 38px;
	padding: 7px 16px;
	border-radius: 5px;
	box-shadow: 0 2px 6px rgba(20, 61, 89, .18);
	font-weight: 600;
}

.ek-print-primary-button {
	background: #0877b9;
	border-color: #0877b9;
	color: #fff;
}

.ek-print-secondary-button {
	background: #fff;
	border-color: #b8c7d2;
	color: #253b4a;
}

.ek-print-custom-header {
	display: grid;
	grid-template-columns: minmax(220px, 1.4fr) minmax(200px, 1fr);
	gap: 10px 14px;
	margin-bottom: 12px;
}

.ek-print-custom-field,
.ek-print-custom-label {
	display: block;
}

.ek-print-custom-label {
	margin-bottom: 4px;
	font-weight: 600;
	color: #29485d;
}

.ek-print-custom-flags {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 4px 0 12px;
}

.ek-print-custom-items {
	width: 100%;
	border: 1px solid #cad8e2;
	background: #fff;
}

.ek-print-custom-items .z-listbox-body {
	overflow: auto;
}

.ek-print-property {
	display: grid;
	grid-template-columns: minmax(48px, 1fr) 24px;
	align-items: center;
	gap: 3px;
	padding: 2px;
	border-radius: 4px;
}

.ek-print-property-system {
	background: #f1f5f8;
	border: 1px solid transparent;
}

.ek-print-property-custom {
	background: #fff3d6;
	border: 1px solid #f0b84b;
}

.ek-print-property-reset {
	min-width: 22px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #0877b9;
}

/* Eureka master-detail native report designer. */
.ek-pf-filter-content {
	height: 100%;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	background: #f5f9fc;
}

.ek-pf-filter-grid {
	width: 100%;
	flex: 1 1 auto;
	min-height: 260px;
	background: #fff;
	border: 1px solid #c9d9e4;
}

.ek-pf-filter-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(220px, 1fr));
	gap: 12px 18px;
	padding: 16px;
	border: 1px solid #c9d9e4;
	border-radius: 10px;
	background: #fff;
}

.ek-pf-editor-window,
.ek-pf-editor {
	height: 100%;
	box-sizing: border-box;
}

.ek-pf-editor {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px 22px;
	overflow-y: auto;
	background: linear-gradient(180deg, #f5f9fc 0, #eef4f8 100%);
}

.ek-pf-title {
	font-size: 22px;
	font-weight: 700;
	color: #123e5b;
}

.ek-pf-titlebar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ek-pf-open-button {
	min-width: 76px;
	min-height: 38px;
	padding: 7px 16px;
	border-radius: 4px;
	font-weight: 600;
	box-shadow: 0 2px 6px rgba(20, 61, 89, .18);
}

.ek-pf-header {
	display: grid;
	grid-template-columns: repeat(3, minmax(220px, 1fr));
	gap: 12px 18px;
	padding: 16px;
	border: 1px solid #c9d9e4;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 4px 14px rgba(25, 67, 94, .08);
}

.ek-pf-field,
.ek-pf-label,
.ek-pf-help,
.ek-pf-panel-title {
	display: block;
}

.ek-pf-label {
	margin-bottom: 5px;
	font-weight: 600;
	color: #29485d;
}

.ek-pf-input,
.ek-pf-readonly {
	box-sizing: border-box;
	width: 100%;
}

.ek-pf-readonly {
	display: block;
	min-height: 28px;
	padding: 6px 9px;
	border: 1px solid #d6e1e8;
	border-radius: 4px;
	background: #f1f5f8;
	color: #35566b;
}

.ek-pf-flags {
	display: flex;
	align-items: center;
	gap: 18px;
	min-height: 30px;
}

.ek-pf-help {
	color: #536f82;
}

.ek-pf-body {
	display: grid;
	grid-template-columns: minmax(190px, 24%) 54px minmax(430px, 1fr);
	gap: 10px;
	min-height: 350px;
	flex: 1 1 auto;
}

.ek-pf-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 12px;
	border: 1px solid #c9d9e4;
	border-radius: 10px;
	background: #fff;
}

.ek-pf-panel-title {
	margin-bottom: 9px;
	font-size: 15px;
	font-weight: 700;
	color: #194f70;
}

.ek-pf-editor .ek-pf-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 6px 12px;
	margin-bottom: 9px;
}

.ek-pf-editor .ek-pf-panel-header .ek-pf-panel-title {
	margin-bottom: 0;
}

.ek-pf-editor .ek-pf-field-search {
	box-sizing: border-box;
	width: 190px;
	max-width: 100%;
	min-width: 0;
	font-size: 13px;
}

.ek-pf-list {
	width: 100%;
	min-height: 300px;
	border: 1px solid #cad8e2;
}

.ek-pf-transfer {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 9px;
}

.ek-pf-transfer-separator {
	height: 1px;
	margin: 3px 2px;
	background: #b8cad7;
}

.ek-pf-icon-button {
	min-width: 46px;
	min-height: 42px;
	font-size: 22px;
	font-weight: 700;
	color: #0877b9;
	background: #fff;
	border: 1px solid #a9c4d5;
	border-radius: 8px;
}

.ek-pf-list .z-listitem {
	cursor: move;
}

.ek-pf-order-actions {
	position: absolute;
	top: 7px;
	right: 10px;
	display: flex;
	gap: 6px;
}

.ek-pf-order-actions .ek-pf-icon-button {
	min-width: 32px;
	min-height: 27px;
	font-size: 16px;
}

.ek-pf-sort {
	width: 105px;
}

.ek-pf-system-cell {
	border-left: 4px solid #4a9dca;
}

.ek-pf-custom-cell {
	border-left: 4px solid #e8a62d;
	background: #fff8e8;
}

.ek-pf-actions,
.ek-pf-item-actions {
	display: flex;
	justify-content: flex-end;
	gap: 9px;
}

.ek-pf-actions {
	align-items: center;
	gap: 12px;
	padding: 16px 4px 6px;
}

.ek-pf-action-button {
	min-width: 104px;
	min-height: 38px;
	padding: 7px 16px;
	border-radius: 5px;
	box-shadow: 0 2px 6px rgba(20, 61, 89, .18);
	font-weight: 600;
}

.ek-pf-restore-button {
	min-width: 168px;
}

.ek-pf-item-window.z-window {
	max-width: 1440px;
	padding: 0 !important;
	border-radius: 12px;
	box-shadow: 0 18px 45px rgba(18, 48, 71, .28);
	overflow: hidden;
}

.ek-pf-item-header {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	flex-wrap: wrap;
	min-width: 0;
	min-height: 48px;
	gap: 12px;
	padding: 8px 16px;
	box-sizing: border-box;
	background: #f5f8fa;
	border-bottom: 1px solid #d4e0e8;
}

.ek-pf-item-title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 15px;
	font-weight: 700;
	color: #26485d;
}

.ek-pf-item-legend {
	flex: 2 1 360px;
	min-width: 0;
	text-align: center;
	font-style: italic;
	color: #536b7a;
}

.ek-pf-item-legend-system { color: #2877a3; }
.ek-pf-item-legend-custom { color: #a86a00; }

.ek-pf-item-actions {
	margin-left: auto;
	flex: 0 0 auto;
}

.ek-pf-item-window .ek-pf-item-button.z-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	height: 31px;
	min-height: 31px;
	padding: 0 11px;
	border: 1px solid #b9cbd6;
	border-radius: 4px;
	background: #fff;
	color: #35566b;
	font-size: 11px;
	font-weight: 800;
	line-height: 1.2;
	box-shadow: none;
}

.ek-pf-item-window .ek-pf-item-save.z-button {
	background: #e3f3e7;
	border-color: #b6d7bd;
	color: #264f32;
}

.ek-pf-item-window > .z-window-content {
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	height: 100%;
	min-height: 0;
	padding: 0;
	overflow: hidden;
	background: #fff;
}

.ek-pf-item-shell {
	box-sizing: border-box;
	height: 100%;
	flex: 1 1 auto;
	min-height: 0;
	padding: 18px;
	overflow: auto;
	background: #fff;
}

.ek-pf-item-groups {
	display: grid;
	grid-template-columns: repeat(3, minmax(280px, 1fr));
	align-items: start;
	gap: 14px;
	margin: 12px 0 18px;
}

.ek-pf-item-group {
	box-sizing: border-box;
	min-width: 0;
	border: 1px solid #d4e0e8;
	border-radius: 10px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 2px 7px rgba(33, 73, 101, .07);
}

.ek-pf-item-group-title {
	display: block;
	padding: 9px 12px;
	border-bottom: 1px solid #d4e0e8;
	background: #eaf3f8;
	color: #164d70;
	font-size: 14px;
	font-weight: 700;
}

.ek-pf-item-group-fields {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 9px 12px;
	padding: 11px;
}

.ek-pf-item-group-position .ek-pf-item-group-fields {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ek-pf-item-group-calculations {
	grid-column: 1 / -1;
}

.ek-pf-item-group-ranges {
	grid-column: 1 / -1;
}

.ek-pf-item-group-ranges .ek-pf-item-group-fields,
.ek-pf-item-inline-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 9px 12px;
}

.ek-pf-item-group-calculations .ek-pf-item-group-fields {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ek-pf-item-field {
	min-width: 0;
	padding: 0;
}

@media (max-width: 1250px) {
	.ek-pf-item-groups { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
	.ek-pf-item-group-position,
	.ek-pf-item-group-calculations,
	.ek-pf-item-group-ranges { grid-column: 1 / -1; }
}

@media (max-width: 1050px) {
	.ek-pf-header { grid-template-columns: repeat(2, minmax(210px, 1fr)); }
	.ek-pf-body { grid-template-columns: minmax(170px, 30%) 48px minmax(330px, 1fr); }
	.ek-pf-item-groups { grid-template-columns: 1fr; }
	.ek-pf-item-group-position,
	.ek-pf-item-group-calculations,
	.ek-pf-item-group-ranges { grid-column: auto; }
	.ek-pf-item-group-calculations .ek-pf-item-group-fields {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.ek-pf-item-group-position .ek-pf-item-group-fields,
	.ek-pf-item-group-calculations .ek-pf-item-group-fields,
	.ek-pf-item-group-ranges .ek-pf-item-group-fields,
	.ek-pf-item-inline-fields {
		grid-template-columns: 1fr;
	}
}
