/* =========================================================
   BIGSYS OCR BLUE OPERATIONAL V2
   Solo presentación visual.
   No modifica estados OCR, IA, validaciones ni lógica.
   ========================================================= */

body[data-bigsys-ocr-visual-theme="dark"] {
  --ocr-v2-canvas: #061226;
  --ocr-v2-surface: #0a1930;
  --ocr-v2-surface-2: #0d203b;
  --ocr-v2-surface-3: #102845;
  --ocr-v2-text: #f0f5ff;
  --ocr-v2-muted: #a8b6cf;
  --ocr-v2-line: rgba(75, 145, 238, 0.22);
  --ocr-v2-line-soft: rgba(75, 145, 238, 0.13);
  --ocr-v2-blue: #0878ef;
  --ocr-v2-blue-strong: #005bc7;
  --ocr-v2-blue-soft: rgba(8, 120, 239, 0.16);
  --ocr-v2-violet: #6f48c8;
  --ocr-v2-violet-soft: rgba(111, 72, 200, 0.17);
  --ocr-v2-shadow: rgba(0, 0, 0, 0.28);
}

body[data-bigsys-ocr-visual-theme="light"] {
  --ocr-v2-canvas: #f3f6fc;
  --ocr-v2-surface: #ffffff;
  --ocr-v2-surface-2: #f8faff;
  --ocr-v2-surface-3: #eef4ff;
  --ocr-v2-text: #14233d;
  --ocr-v2-muted: #5e6f8d;
  --ocr-v2-line: rgba(44, 111, 205, 0.22);
  --ocr-v2-line-soft: rgba(44, 111, 205, 0.12);
  --ocr-v2-blue: #096fe0;
  --ocr-v2-blue-strong: #0057bc;
  --ocr-v2-blue-soft: rgba(9, 111, 224, 0.10);
  --ocr-v2-violet: #6d4ac4;
  --ocr-v2-violet-soft: rgba(109, 74, 196, 0.10);
  --ocr-v2-shadow: rgba(37, 62, 105, 0.09);
}

/* Fondo y superficies neutrales. */
body[data-bigsys-ocr-visual-theme] {
  background:
    radial-gradient(circle at 85% 0%, var(--ocr-v2-blue-soft), transparent 28%),
    radial-gradient(circle at 8% 8%, var(--ocr-v2-violet-soft), transparent 24%),
    var(--ocr-v2-canvas) !important;
}

body[data-bigsys-ocr-visual-theme] .app-region-left,
body[data-bigsys-ocr-visual-theme] .app-region-center,
body[data-bigsys-ocr-visual-theme] .app-region-right {
  background: transparent !important;
}

body[data-bigsys-ocr-visual-theme] .zone-filters,
body[data-bigsys-ocr-visual-theme] .zone-invoice-list,
body[data-bigsys-ocr-visual-theme] .zone-invoice-header,
body[data-bigsys-ocr-visual-theme] .zone-supplier,
body[data-bigsys-ocr-visual-theme] .zone-totals,
body[data-bigsys-ocr-visual-theme] .zone-lines,
body[data-bigsys-ocr-visual-theme] .zone-preview,
body[data-bigsys-ocr-visual-theme] .zone-document-panel,
body[data-bigsys-ocr-visual-theme] .invoice-list-card,
body[data-bigsys-ocr-visual-theme] .filters-card,
body[data-bigsys-ocr-visual-theme] .document-panel {
  border-color: var(--ocr-v2-line) !important;
  box-shadow: 0 9px 22px var(--ocr-v2-shadow) !important;
}

/* Filtros neutrales y activo seleccionado. */
body[data-bigsys-ocr-visual-theme] .filter-btn,
body[data-bigsys-ocr-visual-theme] .filter-button {
  background: var(--ocr-v2-surface-2) !important;
  color: var(--ocr-v2-text) !important;
  border-color: var(--ocr-v2-line-soft) !important;
}

body[data-bigsys-ocr-visual-theme] .filter-btn.active,
body[data-bigsys-ocr-visual-theme] .filter-btn.is-active,
body[data-bigsys-ocr-visual-theme] .filter-button.active,
body[data-bigsys-ocr-visual-theme] .filter-button.is-active {
  background: linear-gradient(135deg, var(--ocr-v2-blue), var(--ocr-v2-blue-strong)) !important;
  border-color: rgba(100, 177, 255, 0.55) !important;
  color: #fff !important;
  box-shadow: 0 7px 15px rgba(0, 79, 182, 0.26) !important;
}

/* Acciones principales conocidas: azul operativo. */
body[data-bigsys-ocr-visual-theme] [data-action="triggerUploadInvoices"],
body[data-bigsys-ocr-visual-theme] [data-action="triggerUploadMultipageInvoice"],
body[data-bigsys-ocr-visual-theme] [data-action="processCurrentInvoiceOcr"],
body[data-bigsys-ocr-visual-theme] [data-action="recalculateTotals"],
body[data-bigsys-ocr-visual-theme] .btn-recalculate {
  background: linear-gradient(135deg, var(--ocr-v2-blue), var(--ocr-v2-blue-strong)) !important;
  border-color: rgba(91, 166, 255, 0.54) !important;
  color: #fff !important;
  box-shadow: 0 7px 15px rgba(0, 79, 182, 0.24) !important;
}

body[data-bigsys-ocr-visual-theme] [data-action="triggerUploadInvoices"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="triggerUploadMultipageInvoice"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="processCurrentInvoiceOcr"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="recalculateTotals"]:hover,
body[data-bigsys-ocr-visual-theme] .btn-recalculate:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Acciones IA: azul más profundo, sin tocar el resultado de IA. */
body[data-bigsys-ocr-visual-theme] .btn-ai,
body[data-bigsys-ocr-visual-theme] [data-action*="ai"] {
  background: linear-gradient(135deg, #075bc4, #063b8b) !important;
  border-color: rgba(87, 163, 255, 0.48) !important;
  color: #fff !important;
}

/* Pestañas y navegación: violeta como secundario. */
body[data-bigsys-ocr-visual-theme] .tab.active,
body[data-bigsys-ocr-visual-theme] .tab.is-active,
body[data-bigsys-ocr-visual-theme] .view-tab.active,
body[data-bigsys-ocr-visual-theme] .view-tab.is-active {
  background: linear-gradient(135deg, var(--ocr-v2-violet), #4d299c) !important;
  border-color: rgba(175, 140, 255, 0.52) !important;
  color: #fff !important;
}

/* Listado de facturas: solo superficie neutral, no IDs ni estados. */
body[data-bigsys-ocr-visual-theme] .invoice-list-item,
body[data-bigsys-ocr-visual-theme] .document-list-item,
body[data-bigsys-ocr-visual-theme] .invoice-item {
  background: var(--ocr-v2-surface-2) !important;
  border-color: var(--ocr-v2-line-soft) !important;
}

body[data-bigsys-ocr-visual-theme] .invoice-list-item:hover,
body[data-bigsys-ocr-visual-theme] .document-list-item:hover,
body[data-bigsys-ocr-visual-theme] .invoice-item:hover {
  background: var(--ocr-v2-surface-3) !important;
  border-color: rgba(56, 144, 245, 0.48) !important;
}

/* Protección explícita: no se asignan colores a estados OCR. */
body[data-bigsys-ocr-visual-theme] .field-review,
body[data-bigsys-ocr-visual-theme] .field-error,
body[data-bigsys-ocr-visual-theme] .field-confirmed,
body[data-bigsys-ocr-visual-theme] .field-ai-applied,
body[data-bigsys-ocr-visual-theme] .ai-applied,
body[data-bigsys-ocr-visual-theme] .status-success,
body[data-bigsys-ocr-visual-theme] .status-warning,
body[data-bigsys-ocr-visual-theme] .status-error,
body[data-bigsys-ocr-visual-theme] .invoice-line-card,
body[data-bigsys-ocr-visual-theme] [data-status],
body[data-bigsys-ocr-visual-theme] [data-validation-state] {
  /* Administrados por los estilos OCR existentes. */
}

/* BIGSYS_OCR_BUTTONS_BLUE_V3_START
   Solo presentación visual.
   Azul para acciones operativas e IA.
   No toca confirmaciones verdes, errores rojos,
   revisión amarilla ni estados controlados por OCR.
*/

/* Acciones principales de carga y procesamiento. */
body[data-bigsys-ocr-visual-theme] [data-action="triggerUploadInvoices"],
body[data-bigsys-ocr-visual-theme] [data-action="triggerUploadMultipageInvoice"],
body[data-bigsys-ocr-visual-theme] [data-action="processCurrentInvoiceOcr"],
body[data-bigsys-ocr-visual-theme] [data-action="processSelectedInvoicesOcr"] {
  background: linear-gradient(135deg, #087cf2, #0058bc) !important;
  border-color: rgba(95, 181, 255, 0.58) !important;
  color: #ffffff !important;
  box-shadow: 0 7px 16px rgba(0, 79, 182, 0.28) !important;
}

/* Acciones IA: azul profundo, separado visualmente del azul de carga. */
body[data-bigsys-ocr-visual-theme] [data-action="applySupplierIaSuggestion"],
body[data-bigsys-ocr-visual-theme] [data-action="applyTotalsIaSuggestion"],
body[data-bigsys-ocr-visual-theme] [data-action="applySupplierFieldSuggestion"],
body[data-bigsys-ocr-visual-theme] [data-action="applyTotalsFieldSuggestion"],
body[data-bigsys-ocr-visual-theme] [data-action="rebuildSuggestionsWithSupplier"],
body[data-bigsys-ocr-visual-theme] .btn-ai {
  background: linear-gradient(135deg, #075fc7, #063b8c) !important;
  border-color: rgba(85, 160, 255, 0.50) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 14px rgba(0, 63, 156, 0.25) !important;
}

/* Recalcular: azul operativo compacto. */
body[data-bigsys-ocr-visual-theme] [data-action="recalculateTotals"],
body[data-bigsys-ocr-visual-theme] [data-action="openTotalsReview"],
body[data-bigsys-ocr-visual-theme] .btn-recalculate {
  background: linear-gradient(135deg, #176fd2, #0754ad) !important;
  border-color: rgba(104, 177, 255, 0.48) !important;
  color: #ffffff !important;
}

/* Hover uniforme, sin cambiar significados OCR. */
body[data-bigsys-ocr-visual-theme] [data-action="triggerUploadInvoices"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="triggerUploadMultipageInvoice"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="processCurrentInvoiceOcr"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="processSelectedInvoicesOcr"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="applySupplierIaSuggestion"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="applyTotalsIaSuggestion"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="applySupplierFieldSuggestion"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="applyTotalsFieldSuggestion"]:hover,
body[data-bigsys-ocr-visual-theme] [data-action="rebuildSuggestionsWithSupplier"]:hover,
body[data-bigsys-ocr-visual-theme] .btn-ai:hover {
  filter: brightness(1.10) !important;
  transform: translateY(-1px);
}

/*
  Protección explícita:
  confirmSupplierLocal y confirmTotalsLocal permanecen verdes.
  Estados de revisión/error/IA aplicada conservan CSS OCR original.
*/
/* BIGSYS_OCR_BUTTONS_BLUE_V3_END */
