/* ==========================================================================
   PivotRay — Stylesheet
   ========================================================================== */

:root {
  --pr-font:           -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pr-font-size:      13px;
  --pr-text-header:    #4a5568;
  --pr-text-data:      #2d3440;
  --pr-text-muted:     #a0aec0;
  --pr-bg-header:      #f5f6f7;
  --pr-bg-row:         #ffffff;
  --pr-bg-hover:       #ebf4ff;
  --pr-bg-subtotal:    #f0f4f8;
  --pr-bg-total:       #e8edf2;
  --pr-bg-config:      #f7f8f9;
  --pr-bg-chip:        #e2e8f0;
  --pr-bg-chip-hover:  #cbd5e0;
  --pr-bg-zone:        #ffffff;
  --pr-bg-zone-drop:   #ebf4ff;
  --pr-border:         #edf2f7;
  --pr-border-strong:  #cbd5e0;
  --pr-border-header:  #e2e8f0;
  --pr-row-height:     36px;
  --pr-config-width:   272px;
  --pr-toolbar-h:      44px;
  --pr-chip-h:         26px;
  --pr-radius:         4px;
  --pr-transition:     0.18s ease;
}

/* -------------------------------------------------------------------------- Reset */
.pr-root, .pr-root * { box-sizing: border-box; margin: 0; padding: 0; }

.pr-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  font-family: var(--pr-font);
  font-size: var(--pr-font-size);
  color: var(--pr-text-data);
  background: var(--pr-bg-row);
  overflow: hidden;
}

/* -------------------------------------------------------------------------- Toolbar */
.pr-toolbar {
  display: flex;
  align-items: center;
  height: var(--pr-toolbar-h);
  padding: 0 12px;
  border-bottom: 1px solid var(--pr-border);
  background: var(--pr-bg-row);
  flex-shrink: 0;
  gap: 8px;
  z-index: 10;
}
.pr-toolbar-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--pr-text-data);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pr-toolbar-actions { display: flex; align-items: center; gap: 6px; }

.pr-btn-toggle, .pr-btn-export {
  display: flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 10px;
  font-family: var(--pr-font); font-size: 12px; font-weight: 500;
  color: var(--pr-text-header);
  background: var(--pr-bg-header);
  border: 1px solid var(--pr-border-strong);
  border-radius: var(--pr-radius);
  cursor: pointer;
  transition: background var(--pr-transition);
  user-select: none;
}
.pr-btn-toggle:hover, .pr-btn-export:hover { background: var(--pr-bg-chip-hover); }
.pr-btn-toggle.pr-active { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }

/* -------------------------------------------------------------------------- Body */
.pr-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* -------------------------------------------------------------------------- Config panel */
.pr-config-panel {
  width: 0;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--pr-bg-config);
  border-right: 1px solid var(--pr-border);
  transition: width var(--pr-transition);
  display: flex;
  flex-direction: column;
}
.pr-config-open .pr-config-panel { width: var(--pr-config-width); overflow-y: auto; }
.pr-config-panel-inner {
  width: var(--pr-config-width);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* -------------------------------------------------------------------------- Table area */
.pr-table-area {
  flex: 1;
  display: flex;
  flex-direction: column;   /* thead-wrapper arriba, scroll abajo */
  overflow: hidden;
  min-width: 0;
  position: relative;
}

/* -------------------------------------------------------------------------- Thead wrapper (fijo, sin scroll) */
.pr-thead-wrapper {
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 2px solid var(--pr-border-header);
  background: var(--pr-bg-header);
}

/* -------------------------------------------------------------------------- Scroll container */
.pr-scroll-container {
  flex: 1;
  overflow: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.pr-scroll-container::-webkit-scrollbar { width: 8px; height: 8px; }
.pr-scroll-container::-webkit-scrollbar-track { background: var(--pr-bg-header); }
.pr-scroll-container::-webkit-scrollbar-thumb { background: var(--pr-border-strong); border-radius: 4px; }
.pr-scroll-container::-webkit-scrollbar-thumb:hover { background: var(--pr-text-muted); }

.pr-spacer { position: relative; }

/* -------------------------------------------------------------------------- Tablas */
.pr-table-header,
.pr-table-body {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

/* -------------------------------------------------------------------------- Cabeceras */
.pr-thead { /* no sticky — la tabla header está fuera del scroll */ }
.pr-header-row { background: var(--pr-bg-header); }

.pr-th {
  height: var(--pr-row-height);
  padding: 0 10px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--pr-text-header);
  background: var(--pr-bg-header);
  border-right: 1px solid var(--pr-border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  user-select: none;
}
.pr-th:last-child { border-right: none; }

.pr-th-row-field { cursor: pointer; text-align: left; }
.pr-th-row-field:hover { background: #edf0f4; }

.pr-th-measure { text-align: right; cursor: pointer; }
.pr-th-measure:hover { background: #edf0f4; }

.pr-th-sorted { color: #2b6cb0; background: #ebf4ff; }
.pr-sort-icon { display: inline-flex; align-items: center; margin-left: 4px; font-size: 10px; color: var(--pr-text-muted); vertical-align: middle; }
.pr-sort-neutral { opacity: 0.35; }
.pr-th-label { display: inline-block; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; max-width: calc(100% - 44px); }

/* Botón de nivel en cabecera */
.pr-level-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; min-width: 18px;
  font-size: 13px; font-weight: 700; line-height: 1;
  color: var(--pr-text-muted);
  background: transparent;
  border: 1px solid var(--pr-border-strong);
  border-radius: 3px;
  cursor: pointer;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background var(--pr-transition), color var(--pr-transition);
  user-select: none;
}
.pr-level-toggle:hover { background: var(--pr-border-strong); color: var(--pr-text-data); }

/* -------------------------------------------------------------------------- Filas */
.pr-row { background: var(--pr-bg-row); border-bottom: 1px solid var(--pr-border); }
.pr-row:hover { background: var(--pr-bg-hover); }
.pr-row-group-root { font-weight: 600; }
.pr-row-subtotal { background: var(--pr-bg-subtotal); border-top: 1px solid var(--pr-border-strong); font-weight: 600; }
.pr-row-subtotal:hover { background: #e3eaf2; }
.pr-row-grand-total { background: var(--pr-bg-total); border-top: 2px solid var(--pr-border-strong); font-weight: 700; }
.pr-row-grand-total:hover { background: var(--pr-bg-total); }

/* -------------------------------------------------------------------------- Celdas */
.pr-td, .pr-td-label, .pr-td-indent {
  height: var(--pr-row-height);
  padding: 0 10px;
  border-right: 1px solid var(--pr-border);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pr-td:last-child, .pr-td-label:last-child { border-right: none; }

.pr-td-label {
  display: flex;
  align-items: center;
  gap: 0;
  text-align: left;
}

.pr-td-value { text-align: right; font-variant-numeric: tabular-nums; }
.pr-td-empty { text-align: right; }
.pr-td-total { font-weight: 600; }
.pr-null { color: var(--pr-text-muted); font-size: 12px; }
.pr-td-indent { border-right: 1px solid var(--pr-border); }

/* -------------------------------------------------------------------------- Botón expand/collapse en filas */
.pr-expand-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; min-width: 20px;
  font-size: 15px; font-weight: 700; line-height: 1;
  color: #4a5568;
  background: var(--pr-bg-header);
  border: 1px solid var(--pr-border-strong);
  border-radius: 3px;
  cursor: pointer;
  margin-right: 6px;
  flex-shrink: 0;
  transition: background var(--pr-transition), color var(--pr-transition);
  user-select: none;
}
.pr-expand-toggle:hover { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
.pr-expand-toggle.pr-collapsed { color: #2b6cb0; }
.pr-expand-toggle.pr-expanded  { color: #276749; }

.pr-leaf {
  display: inline-block;
  width: 20px; min-width: 20px; height: 20px;
  margin-right: 6px;
  flex-shrink: 0;
}

.pr-label-text { display: block; flex: 1 1 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* -------------------------------------------------------------------------- Estado vacío */
.pr-empty-state { text-align: center; padding: 40px 20px; color: var(--pr-text-muted); font-size: 14px; }

/* -------------------------------------------------------------------------- Loading */
.pr-loading-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 20; pointer-events: none; opacity: 0;
  transition: opacity 0.15s ease;
}
.pr-loading .pr-loading-overlay { opacity: 1; pointer-events: all; }
.pr-spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--pr-border-strong);
  border-top-color: #2b6cb0;
  border-radius: 50%;
  animation: pr-spin 0.7s linear infinite;
}
@keyframes pr-spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------------------- Config panel — zonas */
.pr-config-panel-inner .pr-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--pr-text-muted);
  padding: 8px 4px 4px;
}
.pr-zone {
  background: var(--pr-bg-zone);
  border: 1px solid var(--pr-border);
  border-radius: var(--pr-radius);
  padding: 6px; min-height: 44px;
  transition: border-color var(--pr-transition), background var(--pr-transition);
}
.pr-zone-drop-active { border-color: #63b3ed; background: var(--pr-bg-zone-drop); box-shadow: 0 0 0 2px rgba(99,179,237,0.25); }
.pr-zone-title { font-size: 11px; font-weight: 600; color: var(--pr-text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; padding: 0 2px; }
.pr-zone-chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 26px; }
.pr-zone-hint  { font-size: 11px; color: var(--pr-text-muted); padding: 4px 2px; font-style: italic; }
.pr-zone-unused { background: var(--pr-bg-config); border: 1px dashed var(--pr-border-strong); border-radius: var(--pr-radius); padding: 6px; min-height: 44px; }

/* -------------------------------------------------------------------------- Chips */
.pr-chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: var(--pr-chip-h); padding: 0 8px;
  background: var(--pr-bg-chip);
  border: 1px solid var(--pr-border-strong);
  border-radius: 3px;
  font-size: 12px; font-weight: 500; color: var(--pr-text-data);
  cursor: grab; user-select: none; white-space: nowrap;
  transition: background var(--pr-transition), box-shadow var(--pr-transition);
  max-width: 220px;
}
.pr-chip:hover { background: var(--pr-bg-chip-hover); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.pr-chip:active { cursor: grabbing; }
.pr-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.pr-chip-remove {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; font-size: 11px; color: var(--pr-text-muted);
  border-radius: 50%; flex-shrink: 0;
  transition: color var(--pr-transition), background var(--pr-transition);
}
.pr-chip-remove:hover { color: #e53e3e; background: #fff5f5; }
.pr-chip-ghost {
  position: fixed; pointer-events: none; z-index: 99999;
  opacity: 0.88; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transform: rotate(2deg);
}
.pr-chip-dragging { opacity: 0.35; cursor: grabbing; }

/* -------------------------------------------------------------------------- Filter panel */
.pr-filter-panel { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.pr-filter-section { background: var(--pr-bg-zone); border: 1px solid var(--pr-border); border-radius: var(--pr-radius); overflow: hidden; }
.pr-filter-section-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--pr-text-header);
  background: var(--pr-bg-header); border-bottom: 1px solid var(--pr-border);
  cursor: pointer; user-select: none;
}
.pr-filter-section-title:hover { background: #eceff3; }
.pr-filter-search {
  display: block; width: calc(100% - 16px); margin: 8px;
  padding: 4px 8px; height: 28px;
  font-family: var(--pr-font); font-size: 12px; color: var(--pr-text-data);
  background: var(--pr-bg-row); border: 1px solid var(--pr-border-strong);
  border-radius: var(--pr-radius); outline: none;
}
.pr-filter-search:focus { border-color: #63b3ed; box-shadow: 0 0 0 2px rgba(99,179,237,0.2); }
.pr-filter-values { max-height: 180px; overflow-y: auto; padding: 4px 0; }
.pr-filter-select-all { display: flex; align-items: center; gap: 6px; padding: 5px 10px; font-size: 11px; font-weight: 600; color: var(--pr-text-muted); border-bottom: 1px solid var(--pr-border); cursor: pointer; }
.pr-filter-select-all:hover { background: var(--pr-bg-hover); }
.pr-filter-item { display: flex; align-items: center; gap: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.pr-filter-item:hover { background: var(--pr-bg-hover); }
.pr-filter-cb { width: 13px; height: 13px; flex-shrink: 0; cursor: pointer; accent-color: #2b6cb0; }
.pr-filter-loading { padding: 12px; text-align: center; color: var(--pr-text-muted); font-size: 12px; }

/* --------------------------------------------------------------------------
   Filter bar — barra horizontal entre toolbar y tabla
   -------------------------------------------------------------------------- */
.pr-filter-bar-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 12px;
  height: 48px;
  border-bottom: 1px solid var(--pr-border);
  background: var(--pr-bg-row);
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
}

.pr-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.pr-filter-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--pr-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.pr-filter-bar-hint {
  font-size: 12px;
  color: var(--pr-text-muted);
  font-style: italic;
}

/* Chip de filtro en la barra */
.pr-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 10px;
  background: var(--pr-bg-header);
  border: 1px solid var(--pr-border-strong);
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background var(--pr-transition), border-color var(--pr-transition);
  flex-shrink: 0;
}

.pr-filter-chip:hover {
  background: var(--pr-bg-chip-hover);
  border-color: #a0aec0;
}

.pr-filter-chip.pr-open {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.pr-filter-chip.pr-filter-chip-active {
  background: #dbeafe;
  border-color: #93c5fd;
}

.pr-filter-chip-label {
  font-weight: 600;
  color: var(--pr-text-muted);
}

.pr-filter-chip-value {
  color: var(--pr-text-data);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-filter-chip-arrow {
  color: var(--pr-text-muted);
  font-size: 10px;
}

.pr-filter-clear-all {
  font-size: 11px;
  color: var(--pr-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--pr-transition);
}

.pr-filter-clear-all:hover {
  color: #e53e3e;
}

/* --------------------------------------------------------------------------
   Filter dropdown
   -------------------------------------------------------------------------- */
.pr-filter-dropdown {
  position: fixed;
  background: var(--pr-bg-row);
  border: 1px solid var(--pr-border-strong);
  border-radius: var(--pr-radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  width: 240px;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9990;
}

.pr-filter-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--pr-border);
  background: var(--pr-bg-header);
  flex-shrink: 0;
}

.pr-filter-dropdown-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--pr-text-header);
}

.pr-filter-dropdown-close {
  font-size: 12px;
  color: var(--pr-text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  transition: background var(--pr-transition);
}
.pr-filter-dropdown-close:hover { background: var(--pr-bg-chip); }

.pr-filter-dropdown-scroll {
  flex: 1;
  overflow-y: auto;
  max-height: 240px;
}

.pr-filter-dropdown-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--pr-border);
  background: var(--pr-bg-header);
  flex-shrink: 0;
}

.pr-filter-footer-btn {
  font-size: 12px;
  color: var(--pr-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 3px;
  transition: background var(--pr-transition), color var(--pr-transition);
}
.pr-filter-footer-btn:hover { background: var(--pr-bg-chip); color: var(--pr-text-data); }

.pr-filter-apply {
  background: #2b6cb0;
  color: white !important;
  font-weight: 600;
}
.pr-filter-apply:hover { background: #2c5282 !important; color: white !important; }

/* --------------------------------------------------------------------------
   Tfoot — total general fijo en el footer
   -------------------------------------------------------------------------- */
.pr-tfoot {
  /* Vive en la misma tabla del thead (pr-thead-wrapper) */
}

.pr-tfoot tr {
  background: var(--pr-bg-total);
  border-top: 2px solid var(--pr-border-strong);
  font-weight: 700;
}

.pr-tfoot td {
  height: var(--pr-row-height);
  padding: 0 10px;
  border-right: 1px solid var(--pr-border);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: var(--pr-text-data);
}

.pr-tfoot td:last-child { border-right: none; }

.pr-tfoot .pr-td-value,
.pr-tfoot .pr-td-label {
  font-weight: 700;
  background: var(--pr-bg-total);
}

/* Thead wrapper con tfoot incluido (2 filas) */
.pr-thead-wrapper {
  /* La altura se gestiona desde Java: ROW_HEIGHT o ROW_HEIGHT*2 */
  border-bottom: 1px solid var(--pr-border-header);
}

/* --------------------------------------------------------------------------
   Filter dropdown — tipografía y layout corregidos
   -------------------------------------------------------------------------- */
.pr-filter-dropdown {
  font-family: var(--pr-font);
  font-size: var(--pr-font-size);
}

.pr-filter-dropdown * {
  font-family: var(--pr-font);
  font-size: var(--pr-font-size);
  box-sizing: border-box;
}

/* Buscador ocupa todo el ancho del dropdown */
.pr-filter-search {
  display: block;
  width: calc(100% - 16px);
  margin: 8px;
  padding: 5px 8px;
  height: 30px;
  font-family: var(--pr-font);
  font-size: 12px;
  color: var(--pr-text-data);
  background: var(--pr-bg-row);
  border: 1px solid var(--pr-border-strong);
  border-radius: var(--pr-radius);
  outline: none;
  transition: border-color var(--pr-transition);
  /* Ancho total menos los márgenes */
  box-sizing: border-box;
  width: calc(100% - 16px) !important;
}

.pr-filter-search:focus {
  border-color: #63b3ed;
  box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.2);
}

/* --------------------------------------------------------------------------
   Tfoot wrapper — fijo debajo del scroll
   -------------------------------------------------------------------------- */
.pr-tfoot-wrapper {
  flex-shrink: 0;
  overflow: hidden;
  border-top: 2px solid var(--pr-border-strong);
  background: var(--pr-bg-total);
}

.pr-table-footer {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

.pr-table-footer td {
  height: var(--pr-row-height);
  padding: 0 10px;
  border-right: 1px solid var(--pr-border);
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  color: var(--pr-text-data);
  background: var(--pr-bg-total);
}

.pr-table-footer td:last-child { border-right: none; }

.pr-table-footer .pr-td-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Filter dropdown — botones de selección rápida
   -------------------------------------------------------------------------- */
.pr-filter-quick-btns {
  display: flex;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--pr-border);
  background: var(--pr-bg-header);
}

.pr-filter-quick-btn {
  font-family: var(--pr-font);
  font-size: 11px;
  color: #2b6cb0;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #93c5fd;
  background: #ebf4ff;
  transition: background var(--pr-transition);
  user-select: none;
}

.pr-filter-quick-btn:hover {
  background: #dbeafe;
}

.pr-filter-item-label {
  font-family: var(--pr-font);
  font-size: 12px;
  color: var(--pr-text-data);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Filter dropdown footer — sel/desel izquierda, aplicar derecha
   -------------------------------------------------------------------------- */
.pr-filter-dropdown-footer {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.pr-filter-footer-left {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Quitar el bloque de quickBtns separado */
.pr-filter-quick-btns { display: none; }

/* --------------------------------------------------------------------------
   Filter bar — estilo Metabase revisado
   -------------------------------------------------------------------------- */
.pr-filter-bar-wrap {
  background: var(--pr-bg-row);
  border-bottom: 1px solid var(--pr-border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 48px;
}

.pr-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* Chip estilo Metabase — borde redondeado, icono de tipo */
.pr-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 12px 0 10px;
  background: var(--pr-bg-row);
  border: 1.5px solid var(--pr-border-strong);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--pr-text-data);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.pr-filter-chip:hover {
  border-color: #4299e1;
  box-shadow: 0 0 0 2px rgba(66,153,225,0.15);
}

.pr-filter-chip.pr-open {
  border-color: #2b6cb0;
  background: #ebf8ff;
  box-shadow: 0 0 0 2px rgba(43,108,176,0.2);
}

.pr-filter-chip.pr-filter-chip-active {
  border-color: #2b6cb0;
  background: #ebf8ff;
  color: #1a365d;
}

.pr-fchip-icon {
  font-size: 11px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  flex-shrink: 0;
}
.pr-fchip-icon-str  { color: #718096; background: #edf2f7; }
.pr-fchip-icon-num  { color: #2b6cb0; background: #ebf4ff; }
.pr-fchip-icon-date { color: #6b46c1; background: #faf5ff; font-size: 10px; }

.pr-fchip-label {
  font-weight: 600;
  color: var(--pr-text-header);
}

.pr-fchip-sep {
  color: var(--pr-text-muted);
  margin: 0 1px;
}

.pr-fchip-value {
  color: #2b6cb0;
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-fchip-arrow {
  color: var(--pr-text-muted);
  font-size: 9px;
  margin-left: 2px;
}

.pr-filter-clear-all {
  font-size: 12px;
  color: var(--pr-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.15s;
}
.pr-filter-clear-all:hover { color: #e53e3e; }

/* --------------------------------------------------------------------------
   Filter dropdown — estilo Metabase
   -------------------------------------------------------------------------- */
.pr-filter-dropdown {
  position: fixed;
  background: var(--pr-bg-row);
  border: 1px solid var(--pr-border-strong);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
  width: 260px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9990;
  font-family: var(--pr-font);
  font-size: 13px;
}

.pr-fdd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--pr-border);
  background: var(--pr-bg-header);
  flex-shrink: 0;
}

.pr-fdd-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--pr-text-data);
}

.pr-fdd-close {
  font-size: 13px;
  color: var(--pr-text-muted);
  cursor: pointer;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.12s;
}
.pr-fdd-close:hover { background: var(--pr-bg-chip); color: var(--pr-text-data); }

.pr-fdd-search-wrap {
  padding: 8px 10px 4px;
  flex-shrink: 0;
}

.pr-fdd-search {
  width: 100%;
  box-sizing: border-box;
  height: 30px;
  padding: 0 10px;
  font-family: var(--pr-font);
  font-size: 12px;
  color: var(--pr-text-data);
  background: var(--pr-bg-row);
  border: 1px solid var(--pr-border-strong);
  border-radius: 5px;
  outline: none;
}
.pr-fdd-search:focus { border-color: #4299e1; box-shadow: 0 0 0 2px rgba(66,153,225,0.2); }

.pr-fdd-list-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.pr-fdd-list-wrap::-webkit-scrollbar { width: 6px; }
.pr-fdd-list-wrap::-webkit-scrollbar-thumb { background: var(--pr-border-strong); border-radius: 3px; }

.pr-fdd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.pr-fdd-item:hover { background: var(--pr-bg-hover); }

.pr-fdd-cb {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: #2b6cb0;
}

.pr-fdd-item-label {
  font-size: 13px;
  color: var(--pr-text-data);
  cursor: pointer;
  user-select: none;
}

.pr-fdd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid var(--pr-border);
  background: var(--pr-bg-header);
  flex-shrink: 0;
  gap: 8px;
}

.pr-fdd-footer-btn {
  font-family: var(--pr-font);
  font-size: 12px;
  font-weight: 500;
  color: var(--pr-text-muted);
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 5px;
  transition: background 0.12s, color 0.12s;
  user-select: none;
  white-space: nowrap;
}
.pr-fdd-footer-btn:hover { background: var(--pr-bg-chip); color: var(--pr-text-data); }

.pr-fdd-apply {
  background: #2b6cb0 !important;
  color: white !important;
  font-weight: 600 !important;
}
.pr-fdd-apply:hover { background: #2c5282 !important; }

/* --------------------------------------------------------------------------
   Dropdown de fechas
   -------------------------------------------------------------------------- */
.pr-fdd-date { width: 300px !important; }

.pr-fdd-tabs {
  display: flex;
  border-bottom: 1px solid var(--pr-border);
  padding: 0 10px;
  flex-shrink: 0;
}

.pr-fdd-tab {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--pr-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
  user-select: none;
}
.pr-fdd-tab:hover { color: var(--pr-text-data); }
.pr-fdd-tab-active { color: #2b6cb0 !important; border-bottom-color: #2b6cb0 !important; }

.pr-fdd-tab-content { padding: 8px 0; overflow-y: auto; max-height: 240px; }

.pr-fdd-preset-list { display: flex; flex-direction: column; }

.pr-fdd-preset {
  padding: 7px 16px;
  font-size: 13px;
  color: var(--pr-text-data);
  cursor: pointer;
  transition: background 0.1s;
  user-select: none;
}
.pr-fdd-preset:hover { background: var(--pr-bg-hover); }
.pr-fdd-preset-active { background: #ebf4ff !important; color: #2b6cb0; font-weight: 600; }

.pr-fdd-range-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
}

.pr-fdd-range-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--pr-text-muted);
  width: 42px;
  flex-shrink: 0;
}

.pr-fdd-date-input {
  flex: 1;
  height: 30px;
  padding: 0 8px;
  font-family: var(--pr-font);
  font-size: 12px;
  color: var(--pr-text-data);
  background: var(--pr-bg-row);
  border: 1px solid var(--pr-border-strong);
  border-radius: 5px;
  outline: none;
  box-sizing: border-box;
}
.pr-fdd-date-input:focus { border-color: #4299e1; }

/* --------------------------------------------------------------------------
   Template de celda de fecha
   -------------------------------------------------------------------------- */
.pr-date-cell { font-variant-numeric: tabular-nums; }
.pr-day-name  { color: var(--pr-text-muted); font-size: 11px; font-weight: 400; }

/* --------------------------------------------------------------------------
   Dropdown fecha — diseño sin tabs, grupos semánticos
   -------------------------------------------------------------------------- */
.pr-fdd-date { width: 320px !important; max-height: 520px !important; }

.pr-fdd-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 8px;
}

.pr-fdd-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--pr-text-muted);
  padding: 10px 14px 4px;
}

/* Grid 3 columnas para opciones rápidas */
.pr-fdd-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 10px;
}

.pr-fdd-opt {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--pr-text-data);
  background: var(--pr-bg-header);
  border: 1px solid var(--pr-border);
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  transition: background 0.1s, border-color 0.1s;
  user-select: none;
}
.pr-fdd-opt:hover { background: var(--pr-bg-hover); border-color: #4299e1; }
.pr-fdd-preset-active {
  background: #ebf4ff !important;
  border-color: #2b6cb0 !important;
  color: #2b6cb0;
  font-weight: 600;
}

/* Fila inline: select + botón */
.pr-fdd-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  flex-wrap: wrap;
}

.pr-fdd-select {
  flex: 1;
  height: 28px;
  padding: 0 6px;
  font-family: var(--pr-font);
  font-size: 12px;
  color: var(--pr-text-data);
  background: var(--pr-bg-row);
  border: 1px solid var(--pr-border-strong);
  border-radius: 5px;
  outline: none;
  min-width: 70px;
}
.pr-fdd-select:focus { border-color: #4299e1; }

.pr-fdd-inline-btn {
  font-size: 11px;
  font-weight: 600;
  color: #2b6cb0;
  background: #ebf4ff;
  border: 1px solid #93c5fd;
  border-radius: 5px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.1s;
  user-select: none;
}
.pr-fdd-inline-btn:hover { background: #dbeafe; }

/* Fix ancho de date inputs y number inputs */
.pr-fdd-date-input {
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  height: 28px;
  padding: 0 8px;
  font-family: var(--pr-font);
  font-size: 12px;
  color: var(--pr-text-data);
  background: var(--pr-bg-row);
  border: 1px solid var(--pr-border-strong);
  border-radius: 5px;
  outline: none;
}
.pr-fdd-date-input:focus { border-color: #4299e1; }

input[type=number].pr-fdd-date-input {
  -moz-appearance: textfield;
}

.pr-fdd-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
}

.pr-fdd-range-row label {
  font-size: 11px;
  font-weight: 600;
  color: var(--pr-text-muted);
  width: 38px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Fix sort — los spans dentro de th no capturan el click
   -------------------------------------------------------------------------- */
.pr-th .pr-sort-icon,
.pr-th .pr-th-label,
.pr-th .pr-sort-neutral,
.pr-th .pr-expand-toggle {
  pointer-events: none;
}

/* pr-expand-toggle dentro de th SÍ necesita pointer-events para level-toggle */
.pr-th .pr-expand-toggle {
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Column resize
   -------------------------------------------------------------------------- */
.pr-th { position: relative; }

/* Línea visual al hacer hover en el borde */
.pr-th::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: transparent;
  border-radius: 2px;
  transition: background 0.15s;
  cursor: col-resize;
}

.pr-th:hover::after {
  background: rgba(43,108,176,0.3);
}

/* --------------------------------------------------------------------------
   Subtotal — "Total X" alineado a la derecha, sin toggle
   -------------------------------------------------------------------------- */
.pr-subtotal-label {
  display: block;
  width: 100%;
  text-align: right;
  font-style: italic;
  color: var(--pr-text-muted);
  font-size: 12px;
  padding-right: 8px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Fixes: filter bar sin scroll, fuente chips más grande, fecha más alta
   -------------------------------------------------------------------------- */

/* Filter bar — altura adaptable, sin overflow */
.pr-filter-bar-wrap {
  height: auto !important;
  min-height: 44px !important;
  padding: 6px 16px !important;
  overflow: visible !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  box-sizing: border-box !important;
}

.pr-filter-bar {
  flex-wrap: wrap !important;
  row-gap: 4px !important;
}

/* Chips de filtro — fuente más grande */
.pr-filter-chip {
  font-size: 13px !important;
  height: 30px !important;
}

.pr-fchip-label {
  font-size: 13px !important;
}

.pr-fchip-value {
  font-size: 13px !important;
}

.pr-filter-clear-all {
  font-size: 13px !important;
}

/* Dropdown fecha — altura suficiente para todas las opciones sin scroll */
.pr-fdd-date {
  width: 320px !important;
  max-height: 680px !important;
}

.pr-fdd-body {
  max-height: 580px !important;
  overflow-y: auto !important;
}

/* --------------------------------------------------------------------------
   Filter chips — fuente aumentada
   -------------------------------------------------------------------------- */
.pr-filter-chip      { font-size: 14px !important; height: 32px !important; }
.pr-fchip-label      { font-size: 14px !important; }
.pr-fchip-value      { font-size: 14px !important; }
.pr-filter-clear-all { font-size: 14px !important; }
.pr-filter-bar-label { font-size: 13px !important; }

/* --------------------------------------------------------------------------
   Cabecera — columnas de dimensión vs medida con color sutil
   -------------------------------------------------------------------------- */

/* Dimensiones — fondo ligeramente azul grisáceo */
.pr-th.pr-th-row-field {
  background: #f0f4f8;
  color: #2d3748;
  border-bottom: 2px solid #90cdf4;
}

/* Medidas — fondo ligeramente cálido */
.pr-th.pr-th-measure {
  background: #faf5ff;
  color: #2d3748;
  border-bottom: 2px solid #d6bcfa;
  text-align: right;
}

/* Icono de sort en medidas alineado a la derecha */
.pr-th.pr-th-measure .pr-th-label {
  flex: 1;
  text-align: right;
}

/* Estado ordenado — mantener coherencia de color */
.pr-th.pr-th-row-field.pr-th-sorted {
  background: #e2ecf7;
  border-bottom-color: #4299e1;
  color: #1a365d;
}

.pr-th.pr-th-measure.pr-th-sorted {
  background: #f3e8ff;
  border-bottom-color: #9f7aea;
  color: #44337a;
}

/* Hover — feedback visual al acercarse */
.pr-th.pr-th-row-field:hover { background: #e2ecf7; }
.pr-th.pr-th-measure:hover   { background: #ede9fe; }

/* --------------------------------------------------------------------------
   Panel de configuración — fuentes aumentadas
   -------------------------------------------------------------------------- */

/* Títulos de sección (DIMENSIONES, MEDIDAS, DISPONIBLES) */
.pr-config-panel-inner .pr-section-title {
  font-size: 12px !important;
  padding: 10px 4px 5px !important;
}

/* Chips de campo */
.pr-chip {
  font-size: 13px !important;
  height: 28px !important;
}

.pr-chip-label {
  font-size: 13px !important;
}

.pr-chip-remove {
  font-size: 12px !important;
  width: 16px !important;
  height: 16px !important;
}

/* Hint "Arrastra campos aquí" */
.pr-zone-hint {
  font-size: 12px !important;
}

/* Icono de tipo en el chip */
.pr-chip-type-icon span {
  font-size: 11px !important;
}

/* --------------------------------------------------------------------------
   Filtro fecha — pills de selección de tipo
   -------------------------------------------------------------------------- */
.pr-fdd-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 4px 10px 8px;
}

.pr-fdd-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--pr-text-muted);
  background: var(--pr-bg-header);
  border: 1px solid var(--pr-border-strong);
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.pr-fdd-pill:hover {
  background: #ebf4ff;
  border-color: #90cdf4;
  color: #2b6cb0;
}

.pr-fdd-pill-active {
  background: #2b6cb0 !important;
  border-color: #2b6cb0 !important;
  color: white !important;
  font-weight: 600;
}

.pr-fdd-panel {
  border-top: 1px solid var(--pr-border);
  background: var(--pr-bg-row);
}

.pr-fdd-range-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--pr-text-muted);
  width: 38px;
  flex-shrink: 0;
}

/* Grid de periodos rápidos — 3 columnas */
.pr-fdd-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}

/* --------------------------------------------------------------------------
   Celda de campo linked — sin display:flex, alineación simple
   -------------------------------------------------------------------------- */
.pr-td-linked {
  vertical-align: middle;
  padding: 0 10px;
  color: var(--pr-text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;      /* necesario para text-overflow en td */
}

.pr-td-linked .pr-label-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Subtotal — celda con colspan no debe usar display:flex
   -------------------------------------------------------------------------- */
.pr-row-subtotal .pr-td-label {
  display: table-cell;
  vertical-align: middle;
}

.pr-row-subtotal .pr-subtotal-label {
  display: block;
  width: 100%;
  text-align: right;
  font-style: italic;
  color: var(--pr-text-muted);
  font-size: 12px;
  padding-right: 8px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Contador de registros en la filter bar
   -------------------------------------------------------------------------- */
.pr-record-count {
  margin-left: auto;
  padding: 0 8px;
  font-size: 12px;
  color: var(--pr-text-muted);
  white-space: nowrap;
  align-self: center;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Loading overlay con rayo
   -------------------------------------------------------------------------- */
.pr-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 9999;
  background: rgba(255,255,255,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  backdrop-filter: blur(1px);
  transition: opacity 0.15s ease;
}

.pr-loading .pr-loading-overlay {
  opacity: 1 !important;
  pointer-events: all !important;
}

.pr-root {
  position: relative; /* para que el overlay se posicione dentro */
}


/* --------------------------------------------------------------------------
   Loading overlay — rayo que se dibuja solo
   -------------------------------------------------------------------------- */
.pr-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pr-loading-bolt {
  width: 40px;
  height: 65px;
}

.pr-loading-text { display: none; }

.pr-bolt-shadow {
  opacity: 0.5;
}

.pr-bolt-path {
  animation: pr-bolt-pulse 1.4s ease-in-out infinite;
}

@keyframes pr-bolt-pulse {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Botón recarga
   -------------------------------------------------------------------------- */
.pr-reload-btn {
  padding: 0 8px;
  font-size: 15px;
  color: var(--pr-text-muted);
  cursor: pointer !important;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
  transition: color 0.15s, transform 0.2s;
  border-radius: 4px;
}

.pr-reload-btn:hover {
  color: #4299e1;
  transform: rotate(-30deg);
}

.pr-reload-btn:active {
  transform: rotate(-180deg);
}

/* --------------------------------------------------------------------------

/* --------------------------------------------------------------------------
   pr-td-ancestor — celda de ancestro expandido
   Mismo display:flex que pr-td-label para no romper anchos de columna
   -------------------------------------------------------------------------- */
.pr-td-ancestor {
  padding: 0 10px;
}

/* --------------------------------------------------------------------------
   Modal de opciones de exportación
   -------------------------------------------------------------------------- */
.pr-export-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pr-export-modal {
  background: var(--pr-bg-row);
  border: 1px solid var(--pr-border-strong);
  border-radius: 10px;
  width: 340px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  overflow: hidden;
}

.pr-export-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--pr-border-light);
}

.pr-export-modal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--pr-text-data);
}

.pr-export-modal-close {
  font-size: 13px;
  color: var(--pr-text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.1s;
}

.pr-export-modal-close:hover {
  background: var(--pr-bg-hover);
  color: var(--pr-text-data);
}

.pr-export-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pr-export-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.pr-export-opt-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--pr-text-data);
  line-height: 1.4;
}

.pr-export-opt-hint {
  display: block;
  font-size: 12px;
  color: var(--pr-text-muted);
  margin-top: 2px;
}

.pr-export-opt .pr-fdd-cb {
  margin-top: 1px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Botones footer modales — apply y clear
   -------------------------------------------------------------------------- */
.pr-fdd-footer {
  justify-content: flex-end !important;
}

.pr-fdd-apply-btn {
  background: #4299e1;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--pr-font);
  transition: background 0.15s;
  white-space: nowrap;
}

.pr-fdd-apply-btn:hover { background: #3182ce; }
.pr-fdd-apply-btn:active { background: #2b6cb0; }

.pr-fdd-clear-btn {
  background: none;
  color: var(--pr-text-muted);
  border: 1.5px solid var(--pr-border-strong);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--pr-font);
  margin-right: auto;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.pr-fdd-clear-btn:hover {
  border-color: #94a3b8;
  color: var(--pr-text-data);
}

/* Ocultar botones legacy */
.pr-fdd-footer-btn { display: none !important; }

/* --------------------------------------------------------------------------
   Checks custom estilo Metabase — span en lugar de input
   -------------------------------------------------------------------------- */
.pr-fdd-cb {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  border: 2px solid #c8d0e0 !important;
  border-radius: 4px !important;
  background: #fff !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.12s !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  accent-color: unset !important;
}

.pr-fdd-cb-checked {
  background: #4299e1 !important;
  border-color: #4299e1 !important;
}

.pr-fdd-cb-checked::after {
  content: '';
  display: block;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* Check "Selecciona todos" — fondo ligeramente diferente */
.pr-fdd-cb-all {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  border: 2px solid #c8d0e0 !important;
  border-radius: 4px !important;
  background: #f0f4f8 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: all 0.12s !important;
}

.pr-fdd-cb-all-checked {
  background: #4299e1 !important;
  border-color: #4299e1 !important;
}

.pr-fdd-cb-all-checked::after {
  content: '';
  display: block;
  width: 4px;
  height: 7px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* --------------------------------------------------------------------------
   Chips filtro — iconos sin fondo, coherentes con SVG stroke del resto
   -------------------------------------------------------------------------- */
.pr-fchip-icon {
  background: none !important;
  border-radius: 0 !important;
  width: 14px !important;
  height: 14px !important;
  font-size: 13px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.pr-fchip-icon-str  { color: #64748b !important; background: none !important; }
.pr-fchip-icon-num  { color: #3b82f6 !important; background: none !important; }
.pr-fchip-icon-date { color: #8b5cf6 !important; background: none !important; font-size: 13px !important; }

/* --------------------------------------------------------------------------
   Botones de formato en el footer de exportación
   -------------------------------------------------------------------------- */
.pr-exp-fmt-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}

/* --------------------------------------------------------------------------
   Search wrap — × bien posicionada dentro del input
   -------------------------------------------------------------------------- */
.pr-fdd-search-wrap {
  position: relative !important;
}

.pr-fdd-search {
  padding: 0 28px 0 10px !important; /* espacio para la × a la derecha */
}

.pr-fdd-search-clear {
  position: absolute !important;
  right: 18px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px !important;
  height: 16px !important;
  font-size: 11px !important;
  color: var(--pr-text-muted) !important;
  cursor: pointer !important;
  border-radius: 50% !important;
  transition: background 0.1s !important;
}

.pr-fdd-search-clear:hover {
  background: var(--pr-bg-hover) !important;
  color: var(--pr-text-data) !important;
}

/* -------------------------------------------------------------------------- FilterChip single-select */
.pr-fdd-single .pr-fdd-item-single {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; cursor: pointer;
  transition: background var(--pr-transition);
}
.pr-fdd-single .pr-fdd-item-single:hover { background: var(--pr-bg-chip-hover); }
.pr-fdd-single .pr-fdd-item-single.pr-fdd-item-checked {
  background: var(--pr-blue-light);
}

.pr-fdd-radio {
  flex-shrink: 0;
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid var(--pr-border-strong);
  background: var(--pr-bg);
  transition: border-color var(--pr-transition), background var(--pr-transition);
}
.pr-fdd-radio-checked,
.pr-fdd-item-checked .pr-fdd-radio {
  border-color: var(--pr-blue);
  background: var(--pr-blue);
  box-shadow: inset 0 0 0 3px var(--pr-bg);
}

/* -------------------------------------------------------------------------- measureOnly chips */
.pr-chip.pr-chip-measure-only {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}
.pr-chip.pr-chip-measure-only .pr-chip-type-num {
  color: #d97706;
}

/* Zona bloqueada para el drop */
.pr-zone.pr-zone-drop-blocked {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  outline: 2px dashed #ef4444 !important;
}

/* Animación rebote al intentar drop inválido */
@keyframes pr-chip-bounce {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}
.pr-chip-bounce {
  animation: pr-chip-bounce 0.4s ease;
}

/* -------------------------------------------------------------------------- null-gray cells */
.pr-cell-null-gray {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(0,0,0,0.04) 3px,
    rgba(0,0,0,0.04) 4px
  );
  background-color: #f7f8fa;
}

/* Cuando la fila está en hover, la celda null-gray toma el color del hover */
.pr-row:hover .pr-cell-null-gray {
  background-color: var(--pr-bg-hover);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 3px,
    rgba(59,130,246,0.08) 3px,
    rgba(59,130,246,0.08) 4px
  );
}

/* -------------------------------------------------------------------------- split field cells */
.pr-split-total {
  font-weight: 600;
  margin-right: 6px;
}
.pr-split-parts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--pr-text-secondary);
}
.pr-split-sep {
  color: var(--pr-border-strong);
  margin: 0 1px;
}
.pr-split-part {
  white-space: nowrap;
}
.pr-split-part-cafe  { color: #744210; }
.pr-split-part-frio  { color: #2a4365; }