/* =========================================================
   BIGSYS OCR WEB VISUAL V1
   Solo presentación. No altera lógica, eventos ni acciones.
   ========================================================= */

:root {
  --ocr-brand-red: #ef315e;
  --ocr-brand-red-strong: #d92350;
  --ocr-brand-violet: #6d59c2;
  --ocr-brand-violet-soft: #ece8fb;
  --ocr-brand-navy: #10213e;
  --ocr-brand-navy-2: #162b50;
  --ocr-brand-line: rgba(122, 99, 203, 0.24);
}

body[data-bigsys-ocr-visual-theme="light"] {
  --ocr-visual-canvas: #f3f1fb;
  --ocr-visual-surface: #fbfaff;
  --ocr-visual-text: #162342;
  --ocr-visual-muted: #596783;
  --ocr-visual-border: rgba(103, 83, 188, 0.20);
}

body[data-bigsys-ocr-visual-theme="dark"] {
  --ocr-visual-canvas: #09162d;
  --ocr-visual-surface: #10213e;
  --ocr-visual-text: #f4f5ff;
  --ocr-visual-muted: #bdc6df;
  --ocr-visual-border: rgba(161, 143, 235, 0.28);
}

body[data-bigsys-ocr-visual-theme] .zone-header,
body[data-bigsys-ocr-visual-theme] .header-card {
  position: relative !important;
}

body[data-bigsys-ocr-visual-theme] .header-card {
  display: grid !important;
  grid-template-columns: minmax(270px, 1fr) auto !important;
  align-items: center !important;
  gap: 20px !important;
  padding: 13px 17px !important;
  border: 1px solid var(--ocr-visual-border) !important;
  border-radius: 18px !important;
  background:
    linear-gradient(120deg, rgba(109, 89, 194, 0.10), transparent 40%),
    var(--ocr-visual-surface) !important;
  box-shadow: 0 12px 30px rgba(17, 32, 62, 0.10) !important;
}

body[data-bigsys-ocr-visual-theme="dark"] .header-card {
  background:
    linear-gradient(120deg, rgba(139, 112, 230, 0.14), transparent 42%),
    var(--ocr-brand-navy) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22) !important;
}

.bigsys-ocr-web-brand-v1 {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin-bottom: 5px;
}

.bigsys-ocr-web-brand-v1 img {
  display: block;
  width: min(100%, 420px);
  max-height: 48px;
  object-fit: contain;
  object-position: left center;
}

.bigsys-ocr-web-brand-v1 .bigsys-ocr-web-title-v1 {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  border-left: 1px solid var(--ocr-visual-border);
  padding-left: 14px;
  color: var(--ocr-visual-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

body[data-bigsys-ocr-visual-theme] .header-card h1 {
  margin-top: 0 !important;
  color: var(--ocr-visual-text) !important;
  font-size: 20px !important;
}

body[data-bigsys-ocr-visual-theme] .header-card p {
  color: var(--ocr-visual-muted) !important;
}

.bigsys-ocr-web-theme-v1 {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--ocr-visual-border);
  border-radius: 999px;
  background: rgba(109, 89, 194, 0.08);
}

.bigsys-ocr-web-theme-v1 button {
  appearance: none;
  border: 0;
  width: 31px;
  height: 28px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ocr-visual-muted);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.bigsys-ocr-web-theme-v1 button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--ocr-brand-violet), #8d75df);
  box-shadow: 0 4px 10px rgba(86, 67, 162, 0.24);
}

.bigsys-ocr-web-theme-v1 button:hover {
  transform: translateY(-1px);
}

.bigsys-ocr-web-theme-v1 svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
}

@media (max-width: 900px) {
  body[data-bigsys-ocr-visual-theme] .header-card {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .bigsys-ocr-web-brand-v1 img {
    width: min(100%, 330px);
    max-height: 40px;
  }

  .bigsys-ocr-web-brand-v1 .bigsys-ocr-web-title-v1 {
    font-size: 10px;
  }
}

@media (max-width: 620px) {
  .bigsys-ocr-web-brand-v1 {
    gap: 9px;
  }

  .bigsys-ocr-web-brand-v1 img {
    width: min(100%, 250px);
    max-height: 32px;
  }

  .bigsys-ocr-web-brand-v1 .bigsys-ocr-web-title-v1 {
    display: none;
  }
}

/* BIGSYS_OCR_WEB_HEADER_VISUAL_V2_START
   Solo presentación visual. Conserva el contenido original
   y los eventos del header operativo.
*/
body[data-bigsys-ocr-visual-theme] .header-card {
  padding-top: 11px !important;
  padding-bottom: 11px !important;
}

.bigsys-ocr-web-brand-v1 {
  margin-bottom: 2px !important;
}

.bigsys-ocr-web-brand-v1 img {
  width: min(100%, 395px) !important;
  max-height: 43px !important;
}

/* Se conserva el H1 en el DOM por compatibilidad,
   pero se oculta visualmente para evitar repetir la marca. */
body[data-bigsys-ocr-visual-theme] .header-card > div:first-child > h1 {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* El subtítulo original pasa a ser la segunda línea operativa. */
body[data-bigsys-ocr-visual-theme] .header-card > div:first-child > p {
  margin: 0 0 0 0 !important;
  color: var(--ocr-visual-muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.035em !important;
  text-transform: uppercase !important;
}

@media (max-width: 900px) {
  .bigsys-ocr-web-brand-v1 img {
    width: min(100%, 320px) !important;
    max-height: 37px !important;
  }
}

@media (max-width: 620px) {
  body[data-bigsys-ocr-visual-theme] .header-card {
    padding-top: 9px !important;
    padding-bottom: 9px !important;
  }

  .bigsys-ocr-web-brand-v1 img {
    width: min(100%, 245px) !important;
    max-height: 30px !important;
  }

  body[data-bigsys-ocr-visual-theme] .header-card > div:first-child > p {
    font-size: 10px !important;
  }
}
/* BIGSYS_OCR_WEB_HEADER_VISUAL_V2_END */

/* BIGSYS_OCR_WEB_HEADER_VISUAL_V3_START
   Solo presentación visual.
   Centra y compacta contenido existente del header.
*/
@media (min-width: 901px) {
  body[data-bigsys-ocr-visual-theme] .header-card {
    grid-template-columns: minmax(420px, 500px) minmax(520px, 640px) !important;
    justify-content: center !important;
    column-gap: 34px !important;
  }

  body[data-bigsys-ocr-visual-theme] .header-card > div:first-child {
    min-width: 0 !important;
  }

  body[data-bigsys-ocr-visual-theme] .header-card .header-actions {
    justify-content: flex-end !important;
    gap: 9px !important;
    min-width: 0 !important;
  }
}

.bigsys-ocr-web-brand-v1 {
  gap: 11px !important;
}

.bigsys-ocr-web-brand-v1 img {
  width: min(100%, 385px) !important;
  max-height: 41px !important;
}

.bigsys-ocr-web-brand-v1 .bigsys-ocr-web-title-v1 {
  padding-left: 11px !important;
  font-size: 11px !important;
  letter-spacing: 0.065em !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-inline {
  display: inline-flex !important;
  align-items: center !important;
  gap: 9px !important;
  min-width: 0 !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-text {
  min-width: 0 !important;
  max-width: 340px !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-title {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-meta {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  font-size: 10px !important;
  line-height: 1.25 !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-pill {
  flex: 0 0 auto !important;
  padding: 6px 10px !important;
  font-size: 10px !important;
  letter-spacing: 0.045em !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-logout {
  flex: 0 0 auto !important;
  padding: 9px 14px !important;
  white-space: nowrap !important;
}

@media (max-width: 1220px) and (min-width: 901px) {
  body[data-bigsys-ocr-visual-theme] .header-card {
    grid-template-columns: minmax(355px, 430px) minmax(475px, 560px) !important;
    column-gap: 22px !important;
  }

  .bigsys-ocr-web-brand-v1 img {
    width: min(100%, 340px) !important;
    max-height: 37px !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-text {
    max-width: 260px !important;
  }
}

@media (max-width: 900px) {
  body[data-bigsys-ocr-visual-theme] .header-card .header-actions {
    justify-content: flex-start !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-inline {
    flex-wrap: wrap !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-text {
    max-width: none !important;
  }
}
/* BIGSYS_OCR_WEB_HEADER_VISUAL_V3_END */

/* BIGSYS_OCR_HEADER_GLOBAL_VISIBLE_V4_START
   Solo presentación visual.
   Mantiene visible el header existente en todas las vistas OCR,
   aunque el sistema active bigsys-header-hidden por scroll.
   No modifica el script, eventos ni acciones operativas.
*/
@media (min-width: 761px) {
  body.bigsys-header-hidden .app-region-top {
    max-height: none !important;
    opacity: 1 !important;
    margin-bottom: initial !important;
    pointer-events: auto !important;
    overflow: visible !important;
  }

  body.bigsys-header-hidden .zone-header,
  body.bigsys-header-hidden .header-card {
    display: grid !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.bigsys-header-hidden #app-sticky-actions.app-sticky-actions {
    margin-top: initial !important;
  }
}

/* Conserva el comportamiento móvil oficial intacto. */
/* BIGSYS_OCR_HEADER_GLOBAL_VISIBLE_V4_END */

/* BIGSYS_OCR_HEADER_REAL_INTEGRATED_V1_START
   Header real renderizado desde zone-header.js.
*/

.bigsys-ocr-header-copy-real-v1 {
  min-width: 0;
}

.bigsys-ocr-header-copy-real-v1 > h1 {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.bigsys-ocr-header-copy-real-v1 > p {
  margin: 0 !important;
  color: var(--ocr-visual-muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.035em !important;
  text-transform: uppercase !important;
}

.bigsys-ocr-web-brand-v1 {
  margin-bottom: 2px !important;
}

@media (min-width: 901px) {
  body[data-bigsys-ocr-visual-theme] .header-card {
    grid-template-columns: minmax(420px, 500px) minmax(520px, 640px) !important;
    justify-content: center !important;
    column-gap: 34px !important;
  }
}

@media (max-width: 900px) {
  .bigsys-ocr-header-copy-real-v1 > p {
    font-size: 10px !important;
  }
}
/* BIGSYS_OCR_HEADER_REAL_INTEGRATED_V1_END */

/* BIGSYS_OCR_HEADER_VISUAL_V5_START
   Solo presentación visual.
   Reorganiza contenido existente sin cambiar eventos ni lógica.
*/
@media (min-width: 1101px) {
  body[data-bigsys-ocr-visual-theme] .header-card {
    display: grid !important;
    grid-template-columns: minmax(430px, 1.25fr) minmax(300px, .9fr) auto !important;
    align-items: center !important;
    justify-content: stretch !important;
    column-gap: 28px !important;
    padding: 14px 22px !important;
  }

  /*
    Se conserva el HTML operativo.
    La estructura visual se redistribuye por CSS:
    marca izquierda / sesión centro / controles derecha.
  */
  body[data-bigsys-ocr-visual-theme] .header-card > .header-actions {
    display: contents !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-ocr-header-copy-real-v1 {
    grid-column: 1 !important;
    min-width: 0 !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-inline {
    display: contents !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-text {
    grid-column: 2 !important;
    min-width: 0 !important;
    max-width: none !important;
    padding-left: 18px !important;
    border-left: 1px solid var(--ocr-visual-border) !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-ocr-web-theme-v1 {
    grid-column: 3 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: center !important;
  }

  body[data-bigsys-ocr-visual-theme] .loading-pill {
    grid-column: 3 !important;
    justify-self: end !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-pill {
    grid-column: 3 !important;
    justify-self: end !important;
    margin-top: 34px !important;
    margin-right: 122px !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-logout {
    grid-column: 3 !important;
    justify-self: end !important;
    margin-top: 34px !important;
  }
}

/* Marca más grande y protagonista. */
.bigsys-ocr-web-brand-v1 {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  margin-bottom: 4px !important;
}

.bigsys-ocr-web-brand-v1 img {
  width: min(100%, 465px) !important;
  max-height: 54px !important;
}

.bigsys-ocr-web-brand-v1 .bigsys-ocr-web-title-v1 {
  padding-left: 13px !important;
  font-size: 12px !important;
  letter-spacing: 0.075em !important;
}

/* Subtítulo bajo OCR Operativo. */
body[data-bigsys-ocr-visual-theme] .bigsys-ocr-header-copy-real-v1 > p {
  margin: 0 !important;
  color: var(--ocr-visual-muted) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.045em !important;
  text-transform: uppercase !important;
}

/* Centro: información operativa compacta y más legible. */
body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-title {
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.22 !important;
  color: var(--ocr-visual-text) !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-meta {
  margin-top: 3px !important;
  font-size: 10px !important;
  line-height: 1.3 !important;
  color: var(--ocr-visual-muted) !important;
}

/* Derecha: acciones ordenadas y compactas. */
body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-pill {
  padding: 6px 10px !important;
  font-size: 10px !important;
  line-height: 1 !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-logout {
  padding: 9px 14px !important;
  font-size: 12px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

@media (max-width: 1250px) and (min-width: 1101px) {
  body[data-bigsys-ocr-visual-theme] .header-card {
    grid-template-columns: minmax(370px, 1.15fr) minmax(245px, .85fr) auto !important;
    column-gap: 18px !important;
  }

  .bigsys-ocr-web-brand-v1 img {
    width: min(100%, 390px) !important;
    max-height: 46px !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-text {
    padding-left: 14px !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-pill {
    margin-right: 112px !important;
  }
}

/* En tamaños intermedios conserva la versión compacta previa. */
@media (max-width: 1100px) {
  .bigsys-ocr-web-brand-v1 img {
    width: min(100%, 355px) !important;
    max-height: 41px !important;
  }
}

@media (max-width: 760px) {
  .bigsys-ocr-web-brand-v1 img {
    width: min(100%, 245px) !important;
    max-height: 31px !important;
  }
}
/* BIGSYS_OCR_HEADER_VISUAL_V5_END */

/* BIGSYS_OCR_HEADER_COMPACT_V6_START
   Solo presentación visual.
   Corrige filas implícitas creadas por la grilla V5.
*/
@media (min-width: 1101px) {
  body[data-bigsys-ocr-visual-theme] .header-card {
    display: grid !important;
    grid-template-columns: minmax(430px, 1fr) auto !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    justify-content: stretch !important;
    column-gap: 28px !important;
    row-gap: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 13px 22px !important;
  }

  /* Anula la distribución que generaba filas vacías. */
  body[data-bigsys-ocr-visual-theme] .header-card > .header-actions,
  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-inline {
    display: flex !important;
  }

  body[data-bigsys-ocr-visual-theme] .header-card > .header-actions {
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    min-width: 0 !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-ocr-header-copy-real-v1 {
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-inline {
    align-items: center !important;
    gap: 10px !important;
    min-width: 0 !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-text {
    display: block !important;
    min-width: 220px !important;
    max-width: 370px !important;
    padding-left: 16px !important;
    border-left: 1px solid var(--ocr-visual-border) !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-ocr-web-theme-v1,
  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-pill,
  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-logout,
  body[data-bigsys-ocr-visual-theme] .loading-pill {
    grid-column: auto !important;
    grid-row: auto !important;
    margin: 0 !important;
    justify-self: auto !important;
    align-self: auto !important;
  }
}

.bigsys-ocr-web-brand-v1 {
  margin-bottom: 3px !important;
}

.bigsys-ocr-web-brand-v1 img {
  width: min(100%, 455px) !important;
  max-height: 52px !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-title {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 13px !important;
}

body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-meta {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 10px !important;
}

@media (max-width: 1250px) and (min-width: 1101px) {
  body[data-bigsys-ocr-visual-theme] .header-card {
    grid-template-columns: minmax(355px, 1fr) auto !important;
    column-gap: 18px !important;
  }

  .bigsys-ocr-web-brand-v1 img {
    width: min(100%, 380px) !important;
    max-height: 44px !important;
  }

  body[data-bigsys-ocr-visual-theme] .bigsys-platform-session-text {
    min-width: 180px !important;
    max-width: 270px !important;
    padding-left: 12px !important;
  }
}
/* BIGSYS_OCR_HEADER_COMPACT_V6_END */

/* BIGSYS_OCR_HEADER_INLINE_SUBTITLE_V8_START
   Solo presentación. El subtítulo pasa a la misma línea del lockup.
*/
.bigsys-ocr-web-subtitle-inline-v8 {
  display: inline-flex !important;
  align-items: center !important;
  min-height: 22px !important;
  margin-left: 2px !important;
  padding-left: 13px !important;
  border-left: 1px solid var(--ocr-visual-border) !important;
  color: var(--ocr-visual-muted) !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.055em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

.bigsys-ocr-header-copy-real-v1 > p {
  display: none !important;
}

@media (max-width: 1250px) {
  .bigsys-ocr-web-subtitle-inline-v8 {
    padding-left: 10px !important;
    font-size: 9px !important;
  }
}

@media (max-width: 900px) {
  .bigsys-ocr-web-subtitle-inline-v8 {
    display: none !important;
  }
}
/* BIGSYS_OCR_HEADER_INLINE_SUBTITLE_V8_END */
