/* Comparativa: mismos controles y jerarquía en Biblioteca y dashboard. */
.cmp-dialog-header {
  min-height: 54px !important; padding: 9px 16px !important;
  background: #063d7d !important; border-bottom: 2px solid #c9a227 !important;
  flex-shrink: 0; gap: 12px;
}
.cmp-dialog-header .cmp-dialog-title,
.cmp-dialog-header > div:first-child > div:first-child {
  color: #fff !important; font-size: 17px !important; font-weight: 750 !important;
}
.cmp-dialog-header .cmp-dialog-subtitle,
.cmp-dialog-header > div:first-child > div:nth-child(2) {
  color: #dbeafe !important; font-size: 12px !important; line-height: 1.3;
}
.cmp-dialog-actions { display: flex; align-items: center; gap: 8px; }
.cmp-dialog-header .cmp-dialog-actions button {
  width: 36px !important; height: 36px !important; margin: 0 !important;
  border-radius: 8px !important;
}
.cmp-dialog-header .cmp-dialog-actions button:not(.cmp-toolbar-button) {
  background: #fff !important; color: #064b94 !important;
  border: 1px solid #c7d9ef !important; font-size: 20px !important;
}
.cmp-dialog-window.modal-dialog, .cmp-dialog-window .modal-dialog {
  width: 98vw !important; max-width: 98vw !important; height: 98vh !important; margin: 1vh auto !important;
}
.cmp-dialog-window .modal-content {
  height: 98vh !important; display: flex; flex-direction: column;
  border-radius: 14px !important; overflow: hidden;
}
.cmp-dialog-window .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 14px !important; }
.cmp-toolbar-button {
  width: 36px; height: 36px; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 8px; border: 1px solid #ffffff70;
  background: #ffffff18; color: #fff; cursor: pointer;
}
.cmp-toolbar-button:hover { background: #ffffff30; }
.cmp-toolbar-button:focus-visible, .cmp-fs-btn:focus-visible,
.cmp-summary-toggle:focus-visible { outline: 3px solid #c9a227; outline-offset: 3px; }
.cmp-icon {
  width: 16px; height: 16px; display: inline-block; flex: 0 0 auto;
  background: currentColor; vertical-align: middle;
  mask: var(--cmp-icon) center / contain no-repeat;
  -webkit-mask: var(--cmp-icon) center / contain no-repeat;
}
.cmp-icon-expand { --cmp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M8 3H3v5m13-5h5v5M3 16v5h5m13-5v5h-5'/%3E%3C/svg%3E"); }
.cmp-icon-summary { --cmp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M4 20V10m8 10V4m8 16v-7'/%3E%3C/svg%3E"); }
.cmp-icon-calendar { --cmp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M7 2v6m10-6v6M3 11h18'/%3E%3C/svg%3E"); }
.cmp-icon-clock { --cmp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='13' r='8'/%3E%3Cpath d='M9 2h6m-3 3v8l4 2'/%3E%3C/svg%3E"); }
.cmp-context-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 16px; margin-bottom: 8px; }
.cmp-context-line > div { margin: 0 !important; }
.cmp-context-line > div:first-child { font-size: 14px !important; font-weight: 800 !important; color: #064b94 !important; }
.cmp-context-line > div:nth-child(2) { font-size: 12px !important; color: #64748b !important; }
.cmp-summary-toolbar { display: flex; padding: 0 10px 4px; }
.cmp-summary-details { position: relative; width: 100%; z-index: 80; }
.cmp-summary-toggle {
  display: flex !important; flex-wrap: wrap; gap: 8px 20px; height: auto !important;
  min-height: 36px; padding: 6px 12px !important; border-radius: 8px !important;
  font-size: 13px !important; background: #f5f8fc !important;
}
.cmp-summary-toggle::-webkit-details-marker { display: none; }
.cmp-total { color: #475569; font-weight: 500; white-space: nowrap; }
.cmp-total strong { font-size: 15px; margin-right: 4px; }
.cmp-total.sale strong { color: #b91c1c; }
.cmp-total.entra strong { color: #15803d; }
.cmp-summary-label { margin-left: auto; color: #064b94; }
.cmp-summary-label::after { content: ' +'; }
.cmp-summary-details[open] .cmp-summary-label::after { content: ' −'; }
.cmp-summary-popover { position: absolute; top: 100%; right: 0; width: min(600px, 100%); box-sizing: border-box; }
.cmp-summary-popover > div:first-child { display: none !important; } /* conteos ya visibles en la barra */
.cmp-summary-popover > div:last-child { margin-top: 0 !important; }
#modal-comparar-campograma-auto .modal-body { padding: 10px 14px !important; }
#cbd-modal-comparar-auto .cmp-preview-pitch { width: 100% !important; }
#campograma-comparativa-pitch-only:fullscreen {
  width: min(100vw, calc(100vh * 16 / 9)) !important;
  height: min(100vh, calc(100vw * 9 / 16)) !important;
  max-width: none !important; margin: auto !important; border-radius: 0 !important;
  overflow: hidden; background: #fff;
}
#campograma-comparativa-pitch-only::backdrop { background: #090f19; }
#campograma-comparativa-pitch-only:fullscreen .cmp-fs-controls { display: flex; }
#campograma-comparativa-pitch-only.cmp-stage-fullscreen {
  position: fixed !important; inset: 0 !important; margin: auto !important;
  width: min(100vw, calc(100vh * 16 / 9)) !important;
  height: min(100vh, calc(100vw * 9 / 16)) !important;
  max-width: none !important; z-index: 20000; border-radius: 0 !important;
  box-shadow: 0 0 0 100vmax #090f19;
}
.cmp-stage-fullscreen .cmp-fs-controls { display: flex; }
.cmp-profile-block { translate: 0 var(--cmp-fit-y, 0px); }
.cmp-modal-fullscreen { position: fixed !important; inset: 0 !important; margin: 0 !important; overflow: visible !important; border-radius: 0 !important; background: #090f19 !important; z-index: 20000 !important; }
.cmp-modal-fullscreen .modal-dialog { width: 100vw !important; max-width: none !important; margin: 0 !important; transform: none !important; }
.cmp-modal-fullscreen .modal-content { height: 100vh !important; overflow: visible !important; }
.cmp-modal-fullscreen .modal-body { overflow: visible !important; }
.cmp-modal-fullscreen .cmp-dialog-header,
.cmp-modal-fullscreen .cmp-context-line,
.cmp-modal-fullscreen .cmp-summary-toolbar { visibility: hidden; }
.cmp-fs-btn { gap: 5px; }
.cmp-comparison-view .cmp-icon-calendar,
.cmp-comparison-view .cmp-icon-clock { width: 11px; height: 11px; color: #967300; margin-right: 5px; }
@media (max-width: 650px) {
  .cmp-dialog-header { padding: 8px 10px !important; }
  .cmp-dialog-subtitle { display: none; }
  .cmp-summary-toggle { gap: 6px 10px; font-size: 11px !important; }
  .cmp-fs-controls { gap: 4px; top: 5px; right: 5px; }
  .cmp-fs-btn { padding: 0 8px; font-size: 11px; }
}
