/* ============================================================
   workspace.css | Acta-Levapan-TI · Workspace Corporativo
   ------------------------------------------------------------
   Paleta oficial:
     Vino autoridad  #990012  / carmesí #B3121C / oscuro #6D0010
     Blanco limpio   #F6F4F2
     Champagne       #F7E1C7
     Bronce cálido   #A27D54

   Estructura: barra lateral vertical fija + área principal.
   Acabado Liquid Glass: cristal translúcido, blur/saturación
   equilibrados, reflejos finos y sombras suaves.
   ============================================================ */

:root {
  --lv-vino: #990012;
  --lv-vino-claro: #b3121c;
  --lv-vino-oscuro: #6d0010;
  --lv-blanco: #f6f4f2;
  --lv-crema: #f7e1c7;
  --lv-bronce: #a27d54;

  --ws-texto: #3a2527;
  --ws-texto-medio: #6d5656;
  --ws-texto-suave: #8d7770;
  --ws-cristal: rgba(255, 255, 255, 0.62);
  --ws-cristal-fuerte: rgba(255, 255, 255, 0.82);
  --ws-borde: rgba(162, 125, 84, 0.22);
  --ws-borde-cristal: rgba(255, 255, 255, 0.78);
  --ws-sombra: 0 16px 42px rgba(110, 74, 48, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --ws-sombra-vino: 0 16px 38px rgba(153, 0, 18, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --ws-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ws-blur: blur(18px) saturate(145%);
}

/* ---------------- Fondo del workspace autenticado ---------------- */

body[data-autenticado="true"] {
  color: var(--ws-texto);
  background-color: #ece5dc;
  background-image:
    radial-gradient(70% 55% at 8% 0%, rgba(247, 225, 199, 0.92) 0%, transparent 62%),
    radial-gradient(60% 50% at 100% 8%, rgba(162, 125, 84, 0.16) 0%, transparent 60%),
    radial-gradient(90% 80% at 60% 110%, rgba(153, 0, 18, 0.09) 0%, transparent 64%),
    linear-gradient(135deg, #f6f4f2 0%, #f0e9e1 52%, #e9ded2 100%);
  background-attachment: fixed;
}

body[data-autenticado="true"] .velo-fondo {
  background: linear-gradient(180deg, rgba(246, 244, 242, 0.82) 0%, rgba(236, 229, 220, 0.9) 100%);
}

body[data-autenticado="true"] .video-fondo {
  filter: grayscale(85%) brightness(1.35) blur(6px);
  opacity: 0.28;
}

body[data-autenticado="true"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.34;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ---------------- Transición login → workspace ---------------- */

#pantallaLogin {
  transition: opacity 0.5s var(--ws-ease), transform 0.5s var(--ws-ease),
    filter 0.5s var(--ws-ease);
}

#pantallaLogin[hidden] {
  display: grid !important;
  pointer-events: none;
  animation: loginSalida 0.55s var(--ws-ease) forwards;
}

@keyframes loginSalida {
  from { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
  to {
    opacity: 0;
    transform: scale(0.94) translateY(-14px);
    filter: blur(8px);
    visibility: hidden;
  }
}

body[data-autenticado="true"] #appContent {
  animation: workspaceEntrada 0.65s var(--ws-ease) both;
}

@keyframes workspaceEntrada {
  from { opacity: 0; transform: translateY(16px) scale(0.99); filter: blur(5px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* ============================================================
   ESTRUCTURA: SIDEBAR + PRINCIPAL
   ============================================================ */

.ws-app {
  position: relative;
  z-index: 1;
  width: min(1600px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 18px clamp(12px, 2vw, 26px);
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 20px;
  color: var(--ws-texto);
}

.ws-sidebar {
  position: sticky;
  top: 18px;
  height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.02) 42%),
    radial-gradient(90% 60% at 0% 0%, rgba(179, 18, 28, 0.55), transparent 65%),
    linear-gradient(180deg, #990012 0%, #7c0010 55%, #5f000c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(247, 225, 199, 0.14),
    0 22px 54px rgba(93, 0, 12, 0.26);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  overflow: hidden;
}

.ws-sidebar::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 225, 199, 0.16), transparent 70%);
  pointer-events: none;
}

/* ---------------- Marca protagonista ---------------- */

.ws-marca {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 8px 20px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(247, 225, 199, 0.22);
}

.ws-logo {
  width: 52px;
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.ws-marca-texto {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-marca-nombre {
  font-size: clamp(2rem, 3.2vw, 2.55rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0.2em;
  color: var(--lv-blanco);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.28), 0 0 30px rgba(247, 225, 199, 0.18);
}

.ws-marca-sub {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--lv-crema);
}

/* ---------------- Menú vertical ---------------- */

.ws-nav-vertical {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ws-nav-grupo {
  padding: 0 12px 8px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(247, 225, 199, 0.62);
}

.ws-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(246, 244, 242, 0.72);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.4s var(--ws-ease), background 0.4s var(--ws-ease),
    border-color 0.4s var(--ws-ease), box-shadow 0.4s var(--ws-ease),
    color 0.35s var(--ws-ease);
}

.ws-tab[hidden] {
  display: none !important;
}

.ws-tab-icono {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(247, 225, 199, 0.12);
  color: var(--lv-crema);
  font-size: 0.92rem;
  transition: background 0.35s var(--ws-ease), color 0.35s var(--ws-ease),
    transform 0.35s var(--ws-ease);
}

.ws-tab-texto {
  white-space: nowrap;
}

.ws-tab:hover {
  transform: translateX(4px) scale(1.01);
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(247, 225, 199, 0.32);
  color: var(--lv-blanco);
  box-shadow: 0 10px 24px rgba(41, 0, 6, 0.22);
}

.ws-tab:hover .ws-tab-icono {
  transform: scale(1.08);
  background: rgba(247, 225, 199, 0.2);
}

.ws-tab:active {
  transform: scale(0.97);
}

.ws-tab.activa {
  color: var(--lv-blanco);
  background: linear-gradient(100deg, var(--lv-vino-claro) 0%, var(--lv-vino) 48%, var(--lv-vino-oscuro) 100%);
  border-color: rgba(247, 225, 199, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 12px 28px rgba(41, 0, 6, 0.35);
}

.ws-tab.activa .ws-tab-icono {
  color: var(--lv-vino);
  background: var(--lv-crema);
  box-shadow: 0 4px 12px rgba(247, 225, 199, 0.28);
}

.ws-nav-indicador {
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 24px;
  border-radius: 999px;
  background: var(--lv-crema);
  box-shadow: 0 0 12px rgba(247, 225, 199, 0.8);
  opacity: 0;
  pointer-events: none;
  transition: top 0.45s var(--ws-ease), height 0.45s var(--ws-ease), opacity 0.3s;
}

.ws-sidebar-pie {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 14px 12px 2px;
  border-top: 1px solid rgba(247, 225, 199, 0.2);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ws-sidebar-titulo {
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--lv-blanco);
}

.ws-sidebar-nota {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 225, 199, 0.7);
}

/* ---------------- Área principal ---------------- */

.ws-principal {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ws-top {
  position: sticky;
  top: 18px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 20px;
  border: 1px solid var(--ws-borde-cristal);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.88), rgba(247, 225, 199, 0.3)),
    rgba(255, 255, 255, 0.58);
  box-shadow: var(--ws-sombra);
  backdrop-filter: var(--ws-blur);
  -webkit-backdrop-filter: var(--ws-blur);
}

.ws-top-encabezado {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ws-top-encabezado h2 {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.28rem);
  font-weight: 750;
  letter-spacing: -0.01em;
  color: var(--lv-vino-oscuro);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ws-menu-movil {
  display: none;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 11px;
  border: 1px solid var(--ws-borde);
  background: rgba(255, 255, 255, 0.7);
  color: var(--lv-vino);
  font-size: 1.05rem;
  cursor: pointer;
}

.ws-eyebrow {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lv-bronce);
}

/* ---------------- Sesión ---------------- */

.ws-sesion {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--ws-borde);
  background: rgba(247, 225, 199, 0.32);
  color: var(--lv-bronce);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.ws-chip:empty { display: none; }
.ws-chip.ok { color: #3f7d55; border-color: rgba(63, 125, 85, 0.35); background: rgba(63, 125, 85, 0.1); }
.ws-chip.error { color: var(--lv-vino); border-color: rgba(153, 0, 18, 0.34); background: rgba(153, 0, 18, 0.08); }
.ws-chip-oro { color: #8a6534; border-color: rgba(162, 125, 84, 0.4); background: rgba(247, 225, 199, 0.55); }
.ws-chip-accion { cursor: pointer; font: inherit; font-size: 0.66rem; font-weight: 700; }
.ws-chip-accion:hover { border-color: var(--lv-vino); color: var(--lv-vino); }

/* inventario-storage.js reescribe className con .estado */
.ws-sesion .estado {
  margin: 0;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--ws-borde);
  background: rgba(247, 225, 199, 0.32);
  color: var(--lv-bronce);
  font-size: 0.66rem;
  font-weight: 700;
  box-shadow: none;
}
.ws-sesion .estado:empty { display: none; }
.ws-sesion .estado.ok { color: #3f7d55; border-color: rgba(63, 125, 85, 0.35); background: rgba(63, 125, 85, 0.1); }
.ws-sesion .estado.error { color: var(--lv-vino); border-color: rgba(153, 0, 18, 0.34); background: rgba(153, 0, 18, 0.08); }
.ws-sesion #inventarioStatus { color: #8a6534; border-color: rgba(162, 125, 84, 0.4); background: rgba(247, 225, 199, 0.55); }

.ws-usuario {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  max-width: 210px;
}
.ws-usuario-nombre {
  font-size: 0.76rem;
  font-weight: 750;
  color: var(--lv-vino-oscuro);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-usuario-rol { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--lv-bronce); }

.ws-salir {
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid rgba(153, 0, 18, 0.28);
  background: rgba(153, 0, 18, 0.07);
  color: var(--lv-vino);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.3s var(--ws-ease), color 0.3s var(--ws-ease), transform 0.3s var(--ws-ease);
}
.ws-salir:hover { background: var(--lv-vino); color: var(--lv-blanco); transform: translateY(-2px); }
.ws-salir:active { transform: scale(0.97); }

/* ---------------- Paneles ---------------- */

.ws-cuerpo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ws-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: panelEntrada 0.5s var(--ws-ease) both;
}
.ws-panel[hidden] { display: none !important; }
@keyframes panelEntrada {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.ws-panel-cab {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}
.ws-panel-cab h1 {
  margin: 4px 0 2px;
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--lv-vino-oscuro);
}
.ws-panel-sub { max-width: 62ch; font-size: 0.84rem; color: var(--ws-texto-medio); }
.ws-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-mensaje { min-height: 1.1em; margin: 0; font-size: 0.78rem; color: var(--ws-texto-suave); }
.ws-mensaje.ok { color: #3f7d55; font-weight: 700; }
.ws-mensaje.error { color: var(--lv-vino); font-weight: 700; }

.ws-vacio {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px 20px;
  border-radius: 16px;
  border: 1px dashed rgba(162, 125, 84, 0.4);
  background: rgba(255, 255, 255, 0.4);
  color: var(--ws-texto-suave);
  font-size: 0.84rem;
  text-align: center;
}

/* ---------------- Botones y micro-interacciones ---------------- */

.ws-boton,
.ws-boton-rojo,
.ws-boton-oro,
.ws-boton-mini {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 13px;
  border: 1px solid rgba(162, 125, 84, 0.34);
  background: rgba(255, 255, 255, 0.72);
  color: var(--lv-vino-oscuro);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: transform 0.4s var(--ws-ease), box-shadow 0.4s var(--ws-ease),
    border-color 0.4s var(--ws-ease), background 0.4s var(--ws-ease);
}
.ws-boton:hover {
  transform: translateY(-3px) scale(1.01);
  border-color: rgba(153, 0, 18, 0.5);
  box-shadow: var(--ws-sombra-vino);
}
.ws-boton:active { transform: scale(0.98); }
.ws-boton:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.ws-boton-rojo {
  border-color: rgba(153, 0, 18, 0.5);
  background: linear-gradient(135deg, var(--lv-vino-claro), var(--lv-vino) 55%, var(--lv-vino-oscuro));
  color: var(--lv-blanco);
  box-shadow: var(--ws-sombra-vino);
}
.ws-boton-rojo:hover { box-shadow: 0 20px 44px rgba(153, 0, 18, 0.34); }
.ws-boton-oro { border-color: rgba(162, 125, 84, 0.48); background: rgba(247, 225, 199, 0.65); color: #7c5a30; }
.ws-boton-mini { padding: 6px 11px; font-size: 0.7rem; border-radius: 10px; }

.ws-onda {
  position: absolute;
  border-radius: 50%;
  background: rgba(153, 0, 18, 0.28);
  transform: scale(0);
  opacity: 0.9;
  pointer-events: none;
  animation: ondaExpandir 0.62s var(--ws-ease) forwards;
}
.ws-boton-rojo .ws-onda, .ws-tab.activa .ws-onda { background: rgba(247, 225, 199, 0.42); }
@keyframes ondaExpandir { to { transform: scale(2.8); opacity: 0; } }

[data-glow] { position: relative; overflow: hidden; }
[data-glow]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(153, 0, 18, 0.13), transparent 62%);
  opacity: 0;
  transition: opacity 0.45s var(--ws-ease);
  pointer-events: none;
}
[data-glow]:hover::before { opacity: 1; }

/* Superficie de cristal reutilizable */
.ws-metrica,
.ws-sistema,
.ws-tabla-caja,
.ws-placas-lista,
.ws-360,
.ws-doc,
.ws-visor,
.ws-bloque,
.ws-admin-tarjeta {
  border: 1px solid var(--ws-borde-cristal);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.88) 0%, rgba(247, 225, 199, 0.24) 100%),
    rgba(255, 255, 255, 0.56);
  box-shadow: var(--ws-sombra);
  backdrop-filter: var(--ws-blur);
  -webkit-backdrop-filter: var(--ws-blur);
  transition: transform 0.42s var(--ws-ease), border-color 0.42s var(--ws-ease),
    box-shadow 0.42s var(--ws-ease);
}

.ws-metrica:hover,
.ws-sistema:hover,
.ws-doc:hover,
.ws-360:hover,
.ws-admin-tarjeta:hover {
  transform: translateY(-4px) scale(1.005);
  border-color: rgba(153, 0, 18, 0.35);
  box-shadow: 0 20px 46px rgba(153, 0, 18, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* ============================================================
   SISTEMAS
   ============================================================ */

.ws-grid-sistemas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 14px;
}

.ws-sistema {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  min-height: 190px;
  border-radius: 20px;
  cursor: pointer;
}
.ws-sistema::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--lv-vino), var(--lv-bronce));
}
.ws-sistema:active { transform: scale(0.98); }
.ws-sistema-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ws-sistema-codigo { font-size: 0.62rem; font-weight: 850; letter-spacing: 0.18em; text-transform: uppercase; color: var(--lv-bronce); }
.ws-sistema-nombre { margin-top: 3px; font-size: 1.05rem; font-weight: 800; line-height: 1.2; color: var(--lv-vino-oscuro); }
.ws-sistema-desc { font-size: 0.78rem; line-height: 1.45; color: var(--ws-texto-medio); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.ws-criticidad {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.ws-criticidad.critica { color: var(--lv-vino); border-color: rgba(153, 0, 18, 0.32); background: rgba(153, 0, 18, 0.08); }
.ws-criticidad.alta { color: #8a6534; border-color: rgba(162, 125, 84, 0.4); background: rgba(247, 225, 199, 0.6); }
.ws-criticidad.media { color: #5b6a7a; border-color: rgba(91, 106, 122, 0.28); background: rgba(91, 106, 122, 0.08); }
.ws-criticidad.baja { color: var(--ws-texto-suave); border-color: rgba(162, 125, 84, 0.24); background: rgba(162, 125, 84, 0.08); }

.ws-sistema-pie {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(162, 125, 84, 0.2);
}
.ws-sistema-datos { display: flex; gap: 16px; }
.ws-dato { display: flex; flex-direction: column; line-height: 1.1; }
.ws-dato strong { font-size: 1.05rem; color: var(--lv-vino-oscuro); }
.ws-dato span { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--lv-bronce); }
.ws-sistema-acciones { display: flex; gap: 4px; opacity: 0; transition: opacity 0.35s var(--ws-ease); }
.ws-sistema:hover .ws-sistema-acciones, .ws-sistema:focus-within .ws-sistema-acciones { opacity: 1; }
.ws-icono-boton {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid rgba(162, 125, 84, 0.25);
  background: rgba(255, 255, 255, 0.75);
  color: var(--lv-vino);
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, transform 0.3s var(--ws-ease);
}
.ws-icono-boton:hover { border-color: var(--lv-vino); transform: translateY(-2px); }

/* ============================================================
   PLACAS · VISTA 360°
   ============================================================ */

.ws-placas { display: grid; grid-template-columns: minmax(260px, 330px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ws-placas-lista { padding: 14px; border-radius: 20px; display: flex; flex-direction: column; gap: 10px; }
.ws-buscador {
  display: flex; align-items: center; gap: 9px;
  padding: 0 12px;
  border-radius: 13px;
  border: 1px solid rgba(162, 125, 84, 0.32);
  background: rgba(255, 255, 255, 0.78);
  color: var(--lv-bronce);
  transition: border-color 0.3s var(--ws-ease), box-shadow 0.3s var(--ws-ease);
}
.ws-buscador:focus-within { border-color: rgba(153, 0, 18, 0.5); box-shadow: 0 0 0 4px rgba(153, 0, 18, 0.1); }
.ws-buscador input { flex: 1; min-width: 0; padding: 11px 0; border: 0; background: transparent; color: var(--ws-texto); font: inherit; font-size: 0.86rem; outline: none; }
.ws-buscador input::placeholder { color: var(--ws-texto-suave); }
.ws-resultados { display: flex; flex-direction: column; gap: 7px; max-height: 58vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(153, 0, 18, 0.4) transparent; }
.ws-resultado {
  position: relative;
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid rgba(162, 125, 84, 0.18);
  background: rgba(255, 255, 255, 0.6);
  color: inherit; text-align: left; font: inherit; cursor: pointer; overflow: hidden;
  transition: transform 0.4s var(--ws-ease), border-color 0.4s var(--ws-ease), background 0.4s var(--ws-ease), box-shadow 0.4s var(--ws-ease);
}
.ws-resultado:hover { transform: translateY(-3px) scale(1.005); border-color: rgba(153, 0, 18, 0.45); background: rgba(247, 225, 199, 0.4); box-shadow: 0 12px 26px rgba(153, 0, 18, 0.12); }
.ws-resultado:active { transform: scale(0.98); }
.ws-resultado.activo { border-color: rgba(162, 125, 84, 0.6); background: rgba(247, 225, 199, 0.62); box-shadow: inset 3px 0 0 var(--lv-vino); }
.ws-resultado strong { font-size: 0.86rem; color: var(--lv-vino-oscuro); }
.ws-resultado span { font-size: 0.7rem; color: var(--ws-texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ws-360 {
  min-height: 420px; padding: 18px; border-radius: 22px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(247, 225, 199, 0.45) 0%, transparent 55%),
    rgba(255, 255, 255, 0.7);
  animation: vista360Entrada 0.5s var(--ws-ease) both;
}
@keyframes vista360Entrada { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.ws-360-vacio { min-height: 380px; justify-content: center; }
.ws-360-vacio strong { font-size: 1rem; color: var(--lv-vino-oscuro); }
.ws-360-cab { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ws-360-placa h2 { font-size: 1.5rem; font-weight: 800; color: var(--lv-vino-oscuro); }
.ws-360-placa p { font-size: 0.78rem; color: var(--ws-texto-medio); }
.ws-360-acciones { display: flex; flex-wrap: wrap; gap: 8px; }

.ws-arbol { display: flex; flex-direction: column; margin-bottom: 18px; padding: 6px 0; }
.ws-nodo {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; margin-left: 8px;
  border-radius: 16px;
  border: 1px solid rgba(162, 125, 84, 0.22);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  transition: transform 0.42s var(--ws-ease), border-color 0.42s var(--ws-ease), box-shadow 0.42s var(--ws-ease);
}
.ws-nodo:hover { transform: translateX(5px) scale(1.005); border-color: rgba(153, 0, 18, 0.4); box-shadow: 0 12px 28px rgba(153, 0, 18, 0.12); }
.ws-nodo-icono {
  flex: 0 0 auto; width: 38px; height: 38px;
  display: grid; place-items: center; border-radius: 12px;
  font-size: 1rem; color: var(--lv-blanco);
  background: linear-gradient(135deg, var(--lv-vino-claro), var(--lv-vino-oscuro));
  box-shadow: 0 8px 18px rgba(153, 0, 18, 0.24);
}
.ws-nodo-oro .ws-nodo-icono { background: linear-gradient(135deg, var(--lv-crema), var(--lv-bronce)); color: var(--lv-vino-oscuro); box-shadow: 0 8px 18px rgba(162, 125, 84, 0.25); }
.ws-nodo-texto { display: flex; flex-direction: column; min-width: 0; }
.ws-nodo-texto strong { font-size: 0.86rem; color: var(--lv-vino-oscuro); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-nodo-texto span { font-size: 0.7rem; color: var(--ws-texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-nodo-meta { margin-left: auto; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lv-bronce); white-space: nowrap; }
.ws-conector {
  width: 2px; height: 30px; margin-left: 34px;
  background-image: linear-gradient(180deg, var(--lv-vino) 0, var(--lv-vino) 7px, transparent 7px, transparent 14px);
  background-size: 2px 14px; background-repeat: repeat-y;
  animation: flujoLinea 1.1s linear infinite;
  filter: drop-shadow(0 0 5px rgba(153, 0, 18, 0.55));
}
@keyframes flujoLinea { from { background-position-y: 0; } to { background-position-y: 14px; } }

.ws-360-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.ws-bloque { padding: 15px; border-radius: 16px; }
.ws-bloque h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.7rem; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lv-vino-oscuro); }
.ws-bloque h3::before { content: ""; width: 3px; height: 14px; border-radius: 999px; background: linear-gradient(180deg, var(--lv-vino), var(--lv-bronce)); }
.ws-linea-tiempo { display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; padding-left: 4px; }
.ws-evento { position: relative; padding-left: 18px; font-size: 0.76rem; color: var(--ws-texto-medio); }
.ws-evento::before { content: ""; position: absolute; left: 0; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--lv-vino); box-shadow: 0 0 9px rgba(153, 0, 18, 0.6); }
.ws-evento::after { content: ""; position: absolute; left: 3px; top: 15px; bottom: -10px; width: 1px; background: linear-gradient(180deg, rgba(153, 0, 18, 0.4), transparent); }
.ws-evento:last-child::after { display: none; }
.ws-evento strong { display: block; color: var(--lv-vino-oscuro); font-size: 0.78rem; }
.ws-evento time { font-size: 0.64rem; color: var(--ws-texto-suave); }
.ws-ficha { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.ws-ficha-item { display: flex; flex-direction: column; gap: 2px; }
.ws-ficha-item span { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lv-bronce); }
.ws-ficha-item strong { font-size: 0.82rem; color: var(--ws-texto); }
.ws-doc-mini {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border-radius: 11px;
  border: 1px solid rgba(162, 125, 84, 0.2);
  background: rgba(255, 255, 255, 0.66);
  color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.35s var(--ws-ease), transform 0.35s var(--ws-ease);
}
.ws-doc-mini + .ws-doc-mini { margin-top: 6px; }
.ws-doc-mini:hover { border-color: rgba(162, 125, 84, 0.6); transform: translateY(-2px); }
.ws-doc-mini strong { font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-doc-mini span:last-child { margin-left: auto; font-size: 0.64rem; color: var(--lv-bronce); white-space: nowrap; }

/* ============================================================
   EQUIPOS
   ============================================================ */

.ws-metricas { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ws-metrica { padding: 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 3px; }
.ws-metrica-valor { font-size: clamp(1.4rem, 2.3vw, 1.85rem); font-weight: 850; line-height: 1.05; color: var(--lv-vino-oscuro); }
.ws-metrica-label { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--lv-bronce); }
.ws-metrica-rojo .ws-metrica-valor { color: var(--lv-vino); }
.ws-metrica-verde .ws-metrica-valor { color: #3f7d55; }
.ws-metrica-oro .ws-metrica-valor { color: #8a6534; }

.ws-filtros { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-input, .ws-select {
  min-height: 42px; padding: 9px 13px; border-radius: 12px;
  border: 1px solid rgba(162, 125, 84, 0.32);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ws-texto); font: inherit; font-size: 0.84rem; outline: none;
  transition: border-color 0.3s var(--ws-ease), box-shadow 0.3s var(--ws-ease);
}
.ws-input { flex: 2 1 260px; }
.ws-select { flex: 1 1 160px; cursor: pointer; }
.ws-input::placeholder { color: var(--ws-texto-suave); }
.ws-input:focus, .ws-select:focus { border-color: rgba(153, 0, 18, 0.5); box-shadow: 0 0 0 4px rgba(153, 0, 18, 0.09); }
.ws-select option { color: var(--ws-texto); background: #fffaf3; }

.ws-tabla-caja { width: 100%; overflow-x: auto; border-radius: 18px; }
.ws-tabla { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 0.78rem; }
.ws-tabla th, .ws-tabla td { padding: 11px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid rgba(162, 125, 84, 0.16); }
.ws-tabla th {
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(247, 225, 199, 0.82), rgba(255, 255, 255, 0.82));
  font-size: 0.62rem; font-weight: 850; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--lv-bronce);
  backdrop-filter: blur(12px);
}
.ws-tabla tbody tr { transition: background 0.35s var(--ws-ease), transform 0.35s var(--ws-ease), box-shadow 0.35s var(--ws-ease); }
.ws-tabla tbody tr:hover { background: linear-gradient(90deg, rgba(153, 0, 18, 0.07), rgba(247, 225, 199, 0.16)); box-shadow: inset 3px 0 0 var(--lv-vino); transform: translateX(2px); }
.ws-tabla td strong { font-weight: 700; color: var(--lv-vino-oscuro); }
.ws-placa-link { padding: 0; border: 0; background: none; color: var(--lv-vino); font: inherit; font-weight: 750; text-decoration: underline; text-decoration-color: rgba(153, 0, 18, 0.4); text-underline-offset: 3px; cursor: pointer; }
.ws-placa-link:hover { color: var(--lv-bronce); }

.ws-etiqueta { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 0.64rem; font-weight: 800; white-space: nowrap; border: 1px solid transparent; background: rgba(255, 255, 255, 0.7); }
.ws-etiqueta.disponible { color: #3f7d55; border-color: rgba(63, 125, 85, 0.32); background: rgba(63, 125, 85, 0.09); }
.ws-etiqueta.asignado { color: var(--lv-vino); border-color: rgba(153, 0, 18, 0.28); background: rgba(153, 0, 18, 0.07); }
.ws-etiqueta.mantenimiento { color: #8a6534; border-color: rgba(162, 125, 84, 0.4); background: rgba(247, 225, 199, 0.55); }
.ws-etiqueta.prestamo { color: #7a5a8a; border-color: rgba(122, 90, 138, 0.3); background: rgba(122, 90, 138, 0.09); }
.ws-etiqueta.baja { color: var(--ws-texto-suave); border-color: rgba(162, 125, 84, 0.24); background: rgba(162, 125, 84, 0.08); }
.ws-garantia { display: inline-flex; align-items: center; gap: 5px; font-size: 0.68rem; color: var(--ws-texto-suave); }
.ws-garantia.proxima { color: #8a6534; font-weight: 750; }
.ws-garantia.vencida { color: var(--lv-vino); font-weight: 750; }
.ws-paginacion { display: flex; justify-content: center; }

/* ============================================================
   BÓVEDA PDF
   ============================================================ */

.ws-boveda { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.ws-boveda-lista { display: flex; flex-direction: column; gap: 10px; }
.ws-filtros-boveda .ws-input { flex: 1 1 100%; }
.ws-docs { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: rgba(153, 0, 18, 0.4) transparent; }
.ws-doc { position: relative; display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border-radius: 15px; cursor: pointer; overflow: hidden; }
.ws-doc:active { transform: scale(0.985); }
.ws-doc.activo { border-color: rgba(162, 125, 84, 0.7); background: rgba(247, 225, 199, 0.5); box-shadow: inset 3px 0 0 var(--lv-vino); }
.ws-doc-icono { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(153, 0, 18, 0.08); border: 1px solid rgba(153, 0, 18, 0.2); color: var(--lv-vino); font-size: 0.9rem; }
.ws-doc-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ws-doc-info strong { font-size: 0.82rem; color: var(--lv-vino-oscuro); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-doc-info small { font-size: 0.68rem; color: var(--ws-texto-suave); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-doc-cat { margin-left: auto; padding: 3px 8px; border-radius: 999px; font-size: 0.6rem; font-weight: 850; letter-spacing: 0.06em; text-transform: uppercase; color: #8a6534; background: rgba(247, 225, 199, 0.65); border: 1px solid rgba(162, 125, 84, 0.3); white-space: nowrap; }
.ws-visor { min-height: 480px; border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; }
.ws-visor iframe { flex: 1; width: 100%; min-height: 66vh; border: 0; background: #f3eee8; }
.ws-visor-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid rgba(162, 125, 84, 0.2); }
.ws-visor-cab h3 { font-size: 0.9rem; font-weight: 750; color: var(--lv-vino-oscuro); }
.ws-visor-cab span { font-size: 0.68rem; color: var(--ws-texto-suave); }
.ws-visor-acciones { display: flex; gap: 6px; }

/* ============================================================
   ADMINISTRACIÓN TI
   ============================================================ */

.ws-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ws-admin-tarjeta { padding: 16px; border-radius: 18px; display: flex; flex-direction: column; gap: 4px; }
.ws-admin-etiqueta { font-size: 0.6rem; font-weight: 850; letter-spacing: 0.14em; text-transform: uppercase; color: var(--lv-bronce); }
.ws-admin-tarjeta strong { font-size: 1rem; color: var(--lv-vino-oscuro); word-break: break-word; }
.ws-admin-nota { font-size: 0.68rem; color: var(--ws-texto-suave); }
.ws-admin-acciones { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   AUTOCOMPLETADO
   ============================================================ */

.ws-autocomplete-wrap { position: relative; flex: 1 1 auto; min-width: 0; }
.ws-autocomplete-wrap > input { width: 100%; }
.ws-autocomplete {
  position: absolute; z-index: 120; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 280px; overflow-y: auto; padding: 6px; border-radius: 16px;
  border: 1px solid var(--ws-borde-cristal);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(247, 225, 199, 0.72));
  box-shadow: 0 24px 56px rgba(110, 74, 48, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  scrollbar-width: thin; scrollbar-color: rgba(153, 0, 18, 0.4) transparent;
  animation: panelEntrada 0.25s var(--ws-ease) both;
}
.ws-autocomplete[hidden] { display: none !important; }
.ws-auto-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 9px 11px; border: 1px solid transparent; border-radius: 11px;
  background: transparent; color: var(--ws-texto); font: inherit; text-align: left; cursor: pointer;
  transition: background 0.3s var(--ws-ease), border-color 0.3s var(--ws-ease), transform 0.3s var(--ws-ease);
}
.ws-auto-item:hover, .ws-auto-item.activo { background: rgba(247, 225, 199, 0.65); border-color: rgba(153, 0, 18, 0.25); transform: translateX(3px); }
.ws-auto-item strong { color: var(--lv-vino-oscuro); font-size: 0.8rem; }
.ws-auto-item span { color: var(--ws-texto-suave); font-size: 0.7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-auto-vacio { margin: 0; padding: 10px 11px; font-size: 0.74rem; color: var(--ws-texto-suave); }
.ws-auto-pista { margin-left: auto; font-size: 0.62rem; font-weight: 800; color: var(--lv-bronce); }

/* ============================================================
   CAJÓN DEL ACTA (formulario oficial intacto, tema claro)
   ============================================================ */

.ws-drawer { position: fixed; inset: 0; z-index: 10020; display: flex; justify-content: flex-end; }
.ws-drawer[hidden] { display: none !important; }
.ws-drawer-fondo { position: absolute; inset: 0; background: rgba(58, 37, 39, 0.32); backdrop-filter: blur(8px); animation: veloEntrada 0.35s ease both; }
@keyframes veloEntrada { from { opacity: 0; } to { opacity: 1; } }
.ws-drawer-caja {
  position: relative; width: min(720px, 100%); height: 100%;
  display: flex; flex-direction: column;
  border-left: 1px solid var(--ws-borde-cristal);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.94), rgba(247, 225, 199, 0.62)), rgba(250, 247, 243, 0.96);
  box-shadow: -30px 0 80px rgba(90, 60, 40, 0.24);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  animation: cajonEntrada 0.45s var(--ws-ease) both;
}
@keyframes cajonEntrada { from { transform: translateX(100%); } to { transform: none; } }
.ws-drawer-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid rgba(162, 125, 84, 0.22); }
.ws-drawer-cab h2 { font-size: 1.05rem; font-weight: 800; color: var(--lv-vino-oscuro); }
.ws-drawer-cuerpo { flex: 1; overflow-y: auto; padding: 16px 18px 30px; scrollbar-width: thin; scrollbar-color: rgba(153, 0, 18, 0.4) transparent; }
.ws-cerrar {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(162, 125, 84, 0.3); background: rgba(255, 255, 255, 0.7);
  color: var(--lv-vino); font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: color 0.3s, border-color 0.3s, transform 0.3s var(--ws-ease);
}
.ws-cerrar:hover { border-color: var(--lv-vino); transform: rotate(90deg); }

/* Overrides claros del formulario heredado */
#drawerActa .formulario { color: var(--ws-texto); }
#drawerActa .seccion {
  padding: 16px; margin-bottom: 12px; border-radius: 18px;
  border: 1px solid var(--ws-borde-cristal);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.86), rgba(247, 225, 199, 0.28));
  box-shadow: var(--ws-sombra);
  backdrop-filter: blur(14px) saturate(140%);
}
#drawerActa .seccion-titulo { color: var(--lv-vino-oscuro); font-size: 0.76rem; }
#drawerActa .seccion-titulo::before { background: linear-gradient(180deg, var(--lv-vino), var(--lv-bronce)); box-shadow: 0 0 10px rgba(153, 0, 18, 0.3); }
#drawerActa .campo label, #drawerActa .campo-foto label, #drawerActa .subbloque-ti-titulo, #drawerActa .firma-titulo, #drawerActa .grupo-etiqueta { color: var(--lv-vino-oscuro); }
#drawerActa .subbloque-ti { border-top-color: rgba(162, 125, 84, 0.3); }
#drawerActa input[type="text"], #drawerActa input[type="number"], #drawerActa input[type="email"], #drawerActa select, #drawerActa textarea {
  color: var(--ws-texto); background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(162, 125, 84, 0.32); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
#drawerActa input::placeholder, #drawerActa textarea::placeholder { color: #a08e87; }
#drawerActa input:focus, #drawerActa select:focus, #drawerActa textarea:focus { border-color: rgba(153, 0, 18, 0.5); box-shadow: 0 0 0 4px rgba(153, 0, 18, 0.09); }
#drawerActa select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='12' viewBox='0 0 20 12'%3E%3Cpath d='M2 2l8 8 8-8' fill='none' stroke='%23990012' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"), linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.86)); background-repeat: no-repeat; background-position: right 13px center, center; background-size: 12px 7px, 100% 100%; }
#drawerActa select option { color: var(--ws-texto); background: #fffaf3; }
#drawerActa .ayuda, #drawerActa small, #drawerActa .estado { color: var(--ws-texto-suave); }
#drawerActa .check, #drawerActa .radio {
  color: var(--ws-texto-medio); background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(162, 125, 84, 0.24); border-radius: 11px;
  transition: border-color 0.3s var(--ws-ease), background 0.3s var(--ws-ease), transform 0.3s var(--ws-ease);
}
#drawerActa .check:hover, #drawerActa .radio:hover { border-color: rgba(153, 0, 18, 0.4); background: rgba(247, 225, 199, 0.5); transform: translateY(-2px); }
#drawerActa .otro-input { color: var(--ws-texto); background: rgba(255, 255, 255, 0.86); border: 1px solid rgba(162, 125, 84, 0.32); }
#drawerActa .equipo-info { color: var(--ws-texto-medio); background: rgba(247, 225, 199, 0.5); border: 1px solid rgba(162, 125, 84, 0.34); }
#drawerActa .equipo-info-etiqueta { color: var(--lv-bronce); }
#drawerActa .equipo-info-valor { color: var(--lv-vino-oscuro); }
#drawerActa .campo-foto input[type="file"] { color: var(--ws-texto-suave); }
#drawerActa .preview { border-color: rgba(162, 125, 84, 0.3); }
#drawerActa .bloque-firma { background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(162, 125, 84, 0.22); }
#drawerActa .lienzo-firma { background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(162, 125, 84, 0.3); }
#drawerActa .firma-guia { color: #a08e87; }
#drawerActa .pie-formulario {
  position: sticky; bottom: -1px; z-index: 3; padding: 12px; margin-top: 4px;
  border-radius: 16px; border: 1px solid var(--ws-borde-cristal);
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(14px);
}
#drawerActa .estado.ok { color: #3f7d55; }
#drawerActa .estado.error { color: var(--lv-vino); }
#drawerActa .estado a { color: var(--lv-bronce); }

/* ============================================================
   MODALES
   ============================================================ */

.ws-modal { position: fixed; inset: 0; z-index: 10030; display: grid; place-items: center; padding: 16px; background: rgba(58, 37, 39, 0.28); backdrop-filter: blur(10px); animation: veloEntrada 0.3s ease both; }
.ws-modal[hidden] { display: none !important; }
.ws-modal-caja {
  width: min(600px, 100%); max-height: 92dvh; display: flex; flex-direction: column;
  border-radius: 22px; border: 1px solid var(--ws-borde-cristal);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(247, 225, 199, 0.55)), rgba(252, 250, 247, 0.96);
  box-shadow: 0 40px 90px rgba(90, 60, 40, 0.26);
  backdrop-filter: blur(22px) saturate(150%);
  animation: modalEntrada 0.4s var(--ws-ease) both; overflow: hidden;
}
.ws-modal-ancha { width: min(940px, 100%); }
@keyframes modalEntrada { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: none; } }
.ws-modal-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px; border-bottom: 1px solid rgba(162, 125, 84, 0.2); }
.ws-modal-cab h2 { font-size: 1rem; font-weight: 800; color: var(--lv-vino-oscuro); }
.ws-modal-cuerpo { padding: 16px 18px 22px; overflow-y: auto; color: var(--ws-texto-medio); font-size: 0.84rem; }
.ws-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 18px 18px; overflow-y: auto; }
.ws-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--lv-bronce); }
.ws-form input, .ws-form select, .ws-form textarea {
  width: 100%; min-height: 42px; padding: 9px 11px; border-radius: 11px;
  border: 1px solid rgba(162, 125, 84, 0.32); background: rgba(255, 255, 255, 0.86);
  color: var(--ws-texto); font: inherit; font-size: 0.86rem; text-transform: none; outline: none;
}
.ws-form input:focus, .ws-form select:focus, .ws-form textarea:focus { border-color: rgba(153, 0, 18, 0.5); box-shadow: 0 0 0 4px rgba(153, 0, 18, 0.09); }
.ws-form select option { color: var(--ws-texto); background: #fffaf3; }
.ws-form select[multiple] { min-height: 110px; padding: 6px; }
.ws-ancho { grid-column: 1 / -1; }
.ws-modal-pie { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.ws-error { grid-column: 1 / -1; padding: 9px 11px; border-radius: 10px; border: 1px solid rgba(153, 0, 18, 0.3); background: rgba(153, 0, 18, 0.08); color: var(--lv-vino); font-size: 0.76rem; }
.ws-error[hidden] { display: none !important; }
.ws-modal-cuerpo h3 { font-size: 1.1rem; color: var(--lv-vino-oscuro); }
.ws-modal-cuerpo h4 { margin: 16px 0 8px; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lv-bronce); }

/* ---------------- Pie ---------------- */

.ws-pie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 8px; padding: 14px 4px 0; border-top: 1px solid rgba(162, 125, 84, 0.2); font-size: 0.66rem; color: var(--ws-texto-suave); }

/* ============================================================
   RESPONSIVO
   ============================================================ */

@media (max-width: 1180px) {
  .ws-app { grid-template-columns: 230px minmax(0, 1fr); gap: 14px; }
  .ws-marca-nombre { font-size: 2.05rem; letter-spacing: 0.16em; }
}

@media (max-width: 980px) {
  .ws-app { display: block; }
  .ws-menu-movil { display: grid; place-items: center; }
  .ws-sidebar {
    position: fixed; z-index: 90; top: 0; bottom: 0; left: 0;
    width: 268px; height: 100dvh; border-radius: 0 24px 24px 0;
    transform: translateX(-102%); transition: transform 0.45s var(--ws-ease);
  }
  .ws-sidebar.abierto { transform: none; }
  .ws-principal { margin-top: 0; }
  .ws-top { top: 8px; }
  .ws-placas, .ws-boveda { grid-template-columns: 1fr; }
  .ws-resultados { max-height: 34vh; }
  .ws-visor iframe { min-height: 52vh; }
}

@media (max-width: 760px) {
  .ws-app { padding: 10px; }
  .ws-top { padding: 10px 12px; gap: 10px; border-radius: 16px; }
  .ws-top-encabezado h2 { font-size: 0.95rem; }
  .ws-sesion .estado, .ws-chip { display: none; }
  .ws-sesion #inventarioStatus { display: inline-flex; }
  .ws-usuario { max-width: 130px; }
  .ws-metricas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-panel-cab { align-items: flex-start; }
  .ws-acciones, .ws-360-acciones { width: 100%; }
  .ws-acciones .ws-boton, .ws-360-acciones .ws-boton { flex: 1 1 100%; }
  .ws-form { grid-template-columns: 1fr; }
  .ws-filtros .ws-input, .ws-filtros .ws-select { flex: 1 1 100%; }
  .ws-drawer-caja { width: 100%; border-left: 0; }
  #drawerActa .pie-formulario { flex-direction: column; }
  #drawerActa .pie-formulario .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ============================================================
   FONDO DE VIDEO 4K + CRISTAL + MARCA AJUSTADA
   ============================================================ */

/* El video cubre el 100 % del viewport sin barras ni desbordes. */
#videoFondo {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  z-index: -1 !important;
  display: block;
  filter: none !important;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: none;
}

/* Velo de cristal: oscurece y difumina solo lo justo para leer con claridad. */
.velo-fondo {
  position: fixed !important;
  inset: 0 !important;
  z-index: 0 !important;
  pointer-events: none;
  backdrop-filter: blur(3px) saturate(125%);
  -webkit-backdrop-filter: blur(3px) saturate(125%);
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(246, 244, 242, 0.52) 0%, transparent 58%),
    linear-gradient(
      180deg,
      rgba(246, 244, 242, 0.5) 0%,
      rgba(247, 225, 199, 0.22) 42%,
      rgba(153, 0, 18, 0.12) 100%
    ) !important;
}

body[data-autenticado="true"] {
  background-color: rgba(246, 244, 242, 0.5);
  background-image: none !important;
}

body[data-autenticado="true"] .video-fondo {
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
}

body[data-autenticado="true"] .velo-fondo {
  background:
    radial-gradient(110% 80% at 50% 0%, rgba(246, 244, 242, 0.5) 0%, transparent 58%),
    linear-gradient(
      180deg,
      rgba(246, 244, 242, 0.52) 0%,
      rgba(247, 225, 199, 0.2) 42%,
      rgba(109, 0, 16, 0.16) 100%
    ) !important;
}

/* Más holgura lateral para que la marca nunca roce el borde. */
.ws-app { grid-template-columns: 288px minmax(0, 1fr); }
.ws-sidebar { width: 100%; padding-inline: 18px; }

/* Logotipo protagonista, nítido y con contraste sobre el vino. */
.ws-logo {
  width: 78px;
  height: 78px;
  padding: 10px;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  border-radius: 20px;
  border: 1px solid rgba(247, 225, 199, 0.55);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.94), rgba(247, 225, 199, 0.72));
  box-shadow: 0 12px 28px rgba(41, 0, 6, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* Título completo, sin cortes y con margen a la derecha. */
.ws-marca { padding: 4px 6px 20px; margin-right: 4px; }
.ws-marca-texto { min-width: 0; max-width: 100%; padding-right: 6px; }
.ws-marca-nombre {
  font-size: clamp(1.65rem, 2.2vw, 2.05rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1.05;
  white-space: nowrap;
  overflow: visible;
  word-break: keep-all;
  max-width: 100%;
}
.ws-marca-sub {
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  line-height: 1.25;
  white-space: normal;
  max-width: 100%;
  padding-right: 4px;
}

@media (max-width: 1180px) {
  .ws-app { grid-template-columns: 264px minmax(0, 1fr); }
  .ws-logo { width: 68px; height: 68px; padding: 9px; }
  .ws-marca-nombre { font-size: 1.7rem; letter-spacing: 0.075em; }
  .ws-marca-sub { font-size: 0.52rem; letter-spacing: 0.09em; }
}

@media (max-width: 980px) {
  .ws-sidebar { width: 288px; }
  .ws-marca-nombre { font-size: 1.95rem; letter-spacing: 0.1em; }
}

@media (max-width: 420px) {
  .ws-sidebar { width: 268px; }
  .ws-logo { width: 64px; height: 64px; }
  .ws-marca-nombre { font-size: 1.55rem; letter-spacing: 0.05em; }
  .ws-marca-sub { font-size: 0.5rem; letter-spacing: 0.06em; }
}

@media (prefers-reduced-motion: reduce) {
  #videoFondo { display: none !important; }
}

/* ============================================================
   CORRECCIÓN DE CAPAS: EL VIDEO SIEMPRE DETRÁS, NUNCA TAPADO
   ============================================================ */

html,
body,
#appContent,
.ws-app,
.ws-principal,
.ws-cuerpo {
  background: transparent !important;
}

body[data-autenticado="true"]::before {
  display: none !important;
}

#videoFondo {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  object-fit: cover !important;
  object-position: center center !important;
  z-index: 0 !important;
  pointer-events: none !important;
  display: block !important;
  filter: none !important;
  opacity: 1 !important;
  transform: none !important;
}

.velo-fondo {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  backdrop-filter: blur(2px) saturate(115%);
  -webkit-backdrop-filter: blur(2px) saturate(115%);
  background: linear-gradient(
    180deg,
    rgba(246, 244, 242, 0.25) 0%,
    rgba(247, 225, 199, 0.14) 48%,
    rgba(153, 0, 18, 0.1) 100%
  ) !important;
}

body[data-autenticado="true"] .velo-fondo {
  background: linear-gradient(
    180deg,
    rgba(246, 244, 242, 0.25) 0%,
    rgba(247, 225, 199, 0.14) 48%,
    rgba(109, 0, 16, 0.12) 100%
  ) !important;
}

.ws-app {
  position: relative !important;
  z-index: 2 !important;
}

.ws-sidebar,
.ws-principal {
  position: relative !important;
  z-index: 2 !important;
}

.pantalla-login {
  z-index: 10000 !important;
}

/* ============================================================
   TEXTO NEGRO DE ALTO CONTRASTE + CÁPSULAS DE CRISTAL
   ============================================================ */

body[data-autenticado="true"] .ws-principal,
body[data-autenticado="true"] .ws-modal-caja,
body[data-autenticado="true"] .ws-drawer-caja,
body[data-autenticado="true"] .ws-autocomplete {
  color: #000000 !important;
  -webkit-font-smoothing: antialiased;
}

body[data-autenticado="true"] .ws-principal *,
body[data-autenticado="true"] .ws-modal-caja *,
body[data-autenticado="true"] .ws-drawer-caja *,
body[data-autenticado="true"] .ws-autocomplete * {
  color: #111111 !important;
  text-shadow: none !important;
}

/* El blanco se reserva para el texto sobre barras/botones rojos. */
body[data-autenticado="true"] .ws-boton-rojo,
body[data-autenticado="true"] .ws-boton-rojo *,
body[data-autenticado="true"] .ws-salir:hover,
body[data-autenticado="true"] .ws-salir:hover * {
  color: #f6f4f2 !important;
}

body[data-autenticado="true"] .ws-sidebar,
body[data-autenticado="true"] .ws-sidebar * {
  color: #f6f4f2 !important;
}

body[data-autenticado="true"] .ws-sidebar .ws-marca-sub,
body[data-autenticado="true"] .ws-sidebar .ws-nav-grupo,
body[data-autenticado="true"] .ws-sidebar .ws-sidebar-nota {
  color: #f7e1c7 !important;
}

body[data-autenticado="true"] .ws-sidebar .ws-tab.activa .ws-tab-icono {
  color: #990012 !important;
}

/* Cápsulas Liquid Glass para el texto que flota sobre el video. */
.ws-top-encabezado,
.ws-panel-cab > div:first-child,
.ws-pie {
  padding: 10px 14px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  background: rgba(246, 244, 242, 0.82) !important;
  box-shadow: 0 10px 26px rgba(90, 60, 40, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}

.ws-top-encabezado h2,
.ws-panel-cab h1,
.ws-panel-sub,
.ws-pie span {
  color: #000000 !important;
  font-weight: 800 !important;
}

/* Pestañas de acceso / registro */
.login-contenedor {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(153, 0, 18, 0.22);
  background: rgba(246, 244, 242, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-tab {
  flex: 1;
  padding: 9px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #111111;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.3s var(--ws-ease), color 0.3s var(--ws-ease);
}

.login-tab.activa {
  background: linear-gradient(135deg, #990012, #6d0010);
  color: #f6f4f2;
}

.login-tarjeta[hidden] {
  display: none !important;
}

/* Administración de usuarios */
.ws-admin-subtitulo {
  margin: 6px 0 0;
  font-size: 1rem;
  font-weight: 800;
  color: #000000 !important;
}

.ws-form-admin {
  border-radius: 18px;
  border: 1px solid var(--ws-borde-cristal);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

#listaUsuariosAdmin .ws-tabla th,
#listaUsuariosAdmin .ws-tabla td {
  color: #111111 !important;
}

.ws-usuario-activo { color: #1b6b3a !important; font-weight: 800; }
/* ============================================================
   AJUSTE FINAL: ANCHO, LIMPIEZA Y LIQUID GLASS LIGERO
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box !important;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

#appContent,
.ws-app,
.ws-principal,
.ws-cuerpo,
.ws-panel,
.ws-top,
.ws-boton,
.ws-tabla-caja {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden;
}

.ws-app {
  grid-template-columns: minmax(0, 268px) minmax(0, 1fr);
}

@media (max-width: 1180px) {
  .ws-app { grid-template-columns: minmax(0, 252px) minmax(0, 1fr); }
}

/* Una sola cabecera: el título vive en la barra superior. */
.ws-panel-cab > div:first-child > .ws-eyebrow,
.ws-panel-cab > div:first-child > h1 {
  display: none !important;
}

.ws-panel-cab > div:first-child {
  padding: 8px 12px !important;
}

.ws-top {
  min-height: 58px;
  padding: 8px 14px !important;
  gap: 10px !important;
}

.ws-top .ws-sesion {
  gap: 6px !important;
}

.ws-tab-texto,
.ws-boton,
.ws-panel-sub,
.ws-pie span {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

/* Cristal equilibrado, sin saturación excesiva. */
.ws-top,
.ws-metrica,
.ws-sistema,
.ws-tabla-caja,
.ws-placas-lista,
.ws-360,
.ws-doc,
.ws-visor,
.ws-bloque,
.ws-admin-tarjeta,
.ws-modal-caja {
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.62) 0%, rgba(246, 244, 242, 0.28) 100%),
    rgba(246, 244, 242, 0.76) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(162, 125, 84, 0.16),
    0 16px 38px rgba(90, 60, 40, 0.12) !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
  padding: clamp(14px, 1.6vw, 22px);
}

.ws-top { padding: 8px 14px !important; }
.ws-tabla-caja { padding: 0 !important; }
.ws-bloque { padding: 14px !important; }

.ws-principal :is(h1, h2, h3, p, th, td, label, input, select, textarea, strong, span, small) {
  color: #111111 !important;
}

.ws-panel-cab > div:first-child,
.ws-pie {
  background: rgba(246, 244, 242, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(12px) saturate(140%) !important;
  box-shadow: 0 10px 26px rgba(90, 60, 40, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

.ws-pie {
  padding: 10px 14px !important;
  border-radius: 16px !important;
  color: #111111 !important;
}

.ws-boton-rojo,
.ws-boton-rojo * {
  color: #f6f4f2 !important;
}

/* Tablas y textos largos sin desbordes. */
.ws-tabla { table-layout: auto; }
.ws-tabla th, .ws-tabla td { overflow-wrap: anywhere; max-width: 260px; }

/* Formularios de administración más aireados. */
.ws-form-admin {
  padding: 16px !important;
  gap: 12px !important;
}

.ws-permisos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px;
}

.ws-permisos label {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 6px;
  font-size: 0.66rem !important;
  text-transform: none !important;
}

.ws-sync-codigo {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 9px 11px;
  margin-top: 5px;
  border-radius: 10px;
  border: 1px solid rgba(162, 125, 84, 0.3);
  background: rgba(255, 255, 255, 0.9);
  color: #111111 !important;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .ws-app { grid-template-columns: minmax(0, 1fr); }
  .ws-top { flex-wrap: wrap; }
  .ws-sesion { justify-content: flex-start !important; width: 100%; }
}

/* ============================================================
   TIPOGRAFÍA EDITORIAL + VIDEO DIFUMINADO
   ============================================================ */

body[data-autenticado="true"] {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif !important;
  color: #111111 !important;
}

.ws-principal h1,
.ws-principal h2,
.ws-principal h3,
.ws-drawer-cab h2,
.ws-modal-cab h2,
.ws-top-encabezado h2 {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  color: #111111 !important;
}

.ws-principal :is(label, .ws-metrica-label, .ws-admin-etiqueta, .ws-eyebrow, th) {
  color: #333333 !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

.ws-principal :is(p, td, span, small, input, select, textarea) {
  font-family: "Inter", system-ui, sans-serif !important;
  color: #111111 !important;
}

/* Placas, seriales, CECO y contratos en monoespacio. */
.ws-mono,
.ws-placa-link,
.ws-tabla td:first-child,
.ws-auto-item strong,
.ws-ficha-item strong,
.ws-sync-codigo {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace !important;
  font-variant-ligatures: none !important;
  letter-spacing: -0.01em !important;
}

.ws-principal :is(h1, h2, h3, p, td, th, span, label, strong) {
  text-shadow: none !important;
  -webkit-font-smoothing: antialiased !important;
}

/* Video más suave: el scale evita bordes claros por el blur. */
#videoFondo {
  filter: blur(9px) brightness(0.96) !important;
  transform: scale(1.05) !important;
  z-index: 0 !important;
}

.velo-fondo,
body[data-autenticado="true"] .velo-fondo {
  backdrop-filter: blur(10px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(120%) !important;
  background: linear-gradient(
    180deg,
    rgba(246, 244, 242, 0.38) 0%,
    rgba(247, 225, 199, 0.2) 50%,
    rgba(153, 0, 18, 0.08) 100%
  ) !important;
}

/* Botones y pestaña activa conservan blanco sobre vino. */
.ws-boton-rojo,
.ws-boton-rojo *,
.ws-tab.activa,
.ws-tab.activa * {
  color: #f6f4f2 !important;
  font-family: "Plus Jakarta Sans", "Inter", sans-serif !important;
}

/* ============================================================
   ASISTENTE TI FLOTANTE
   ============================================================ */

.ws-form-seccion {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(162, 125, 84, 0.28);
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 0.72rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
  color: #990012 !important;
}

.ws-asistente {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.ws-asistente-boton {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(247, 225, 199, 0.65);
  background: linear-gradient(135deg, #b3121c, #990012 55%, #6d0010);
  color: #f6f4f2;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(153, 0, 18, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(12px) saturate(150%);
  transition: transform 0.4s var(--ws-ease), box-shadow 0.4s var(--ws-ease);
}
.ws-asistente-boton:hover { transform: translateY(-4px) scale(1.04); }
.ws-asistente-boton:active { transform: scale(0.97); }

.ws-asistente-panel {
  width: min(390px, calc(100vw - 32px));
  max-height: min(70dvh, 620px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.86), rgba(246, 244, 242, 0.5)), rgba(246, 244, 242, 0.88);
  box-shadow: 0 24px 60px rgba(80, 50, 30, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  animation: panelEntrada 0.35s var(--ws-ease) both;
}
.ws-asistente-panel[hidden] { display: none !important; }

.ws-asistente-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(162, 125, 84, 0.22);
}
.ws-asistente-cab strong { display: block; font-family: "Plus Jakarta Sans", sans-serif; color: #990012; font-size: 0.92rem; }
.ws-asistente-cab small { color: #333333; font-size: 0.68rem; }

.ws-chat-mensajes {
  flex: 1;
  min-height: 180px;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(153, 0, 18, 0.4) transparent;
}
.ws-chat-mensajes .ws-vacio { margin: auto 0; }

.ws-chat-burbuja {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #111111;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(162, 125, 84, 0.24);
  overflow-wrap: anywhere;
}
.ws-chat-burbuja.usuario {
  align-self: flex-end;
  background: linear-gradient(135deg, #b3121c, #990012);
  color: #f6f4f2;
  border-color: rgba(247, 225, 199, 0.4);
}
.ws-chat-burbuja.asistente { align-self: flex-start; }

.ws-chat-tarjeta {
  align-self: stretch;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(153, 0, 18, 0.22);
  background: rgba(247, 225, 199, 0.32);
}
.ws-chat-tarjeta h4 { margin: 0 0 8px; font-family: "JetBrains Mono", monospace; color: #990012; font-size: 0.84rem; }
.ws-chat-tarjeta dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px 10px; margin: 0; }
.ws-chat-tarjeta dt { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #a27d54; }
.ws-chat-tarjeta dd { margin: 0; font-size: 0.76rem; color: #111111; overflow-wrap: anywhere; }
.ws-chat-acciones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.ws-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(162, 125, 84, 0.22);
}
.ws-chat-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(162, 125, 84, 0.32);
  background: rgba(255, 255, 255, 0.9);
  color: #111111;
  font: inherit;
  font-size: 0.8rem;
}
.ws-chat-form input:focus { outline: none; border-color: #990012; box-shadow: 0 0 0 3px rgba(153, 0, 18, 0.1); }

@media (max-width: 520px) {
  .ws-asistente { right: 12px; bottom: 12px; }
  .ws-asistente-boton { width: 50px; height: 50px; }
}

body:not([data-autenticado="true"]) .ws-asistente {
  display: none !important;
}

/* ============================================================
   BLOQUE 1 · BARRA SUPERIOR Y BARRA DE SECCIÓN SIMÉTRICAS
   ============================================================ */

.ws-top,
.ws-seccion-barra,
.ws-panel-cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 100%;
  padding: 14px 20px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.85) !important;
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: 0 10px 30px rgba(17, 17, 17, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(22px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
}

.ws-top { position: sticky !important; top: 14px !important; z-index: 60 !important; }
.ws-top-izquierda,
.ws-top-derecha {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.ws-top-derecha { justify-content: flex-end; margin-left: auto; }
.ws-top-encabezado { min-width: 0; }
.ws-top-encabezado .ws-eyebrow {
  display: block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a27d54 !important;
}
.ws-top-encabezado h2 { margin: 2px 0 0; color: #111111 !important; }

.ws-seccion-barra { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 18px !important; }
.ws-seccion-barra .ws-panel-cab {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.ws-mensaje { margin: 0 !important; color: #3a3a3a !important; font-size: 0.78rem; }

/* inventario-storage.js reescribe el className de estos chips con .estado. */
.ws-top .estado,
.ws-top .estado.ok,
.ws-top .estado.error {
  margin: 0;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(162, 125, 84, 0.3);
  background: rgba(247, 225, 199, 0.42);
  color: #111111 !important;
  font-size: 0.68rem;
  font-weight: 700;
  box-shadow: none;
}
.ws-top .estado:empty { display: none; }

.ws-top .ws-usuario-nombre { color: #111111 !important; }
.ws-top .ws-usuario-rol { color: #990012 !important; }

@media (max-width: 860px) {
  .ws-top { position: relative !important; top: 0 !important; }
  .ws-top-derecha { margin-left: 0; justify-content: flex-start; width: 100%; }
}

/* ============================================================
   BLOQUE 2 · COPILOTO TI: DISPARADOR Y CABECERA
   ============================================================ */

.ws-asistente-boton {
  width: auto;
  height: 54px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid #a27d54;
  background: linear-gradient(135deg, #990012, #7a000e);
  color: #f6f4f2;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.ws-asistente-ico { font-size: 1.1rem; color: #f7e1c7; }
.ws-asistente-texto { white-space: nowrap; }
.ws-asistente-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #35d07f;
  box-shadow: 0 0 0 4px rgba(53, 208, 127, 0.18), 0 0 12px rgba(53, 208, 127, 0.8);
  animation: latidoAsistente 2s ease-in-out infinite;
}
@keyframes latidoAsistente { 50% { opacity: 0.55; transform: scale(0.86); } }
.ws-asistente-boton:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 18px 40px rgba(153, 0, 18, 0.42); }

.ws-asistente-cab {
  background: linear-gradient(135deg, #990012, #7a000e);
  border: 1px solid rgba(162, 125, 84, 0.6);
  border-radius: 22px 22px 0 0;
}
.ws-asistente-cab strong { color: #f6f4f2 !important; }
.ws-asistente-cab small { color: #f7e1c7 !important; }
.ws-asistente-cab .ws-cerrar { color: #f6f4f2; border-color: rgba(247, 225, 199, 0.5); background: rgba(255, 255, 255, 0.12); }

.ws-chat-sugerencias {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 0;
}
.ws-chat-sugerencias button {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(162, 125, 84, 0.4);
  background: rgba(247, 225, 199, 0.55);
  color: #111111;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s var(--ws-ease), transform 0.25s var(--ws-ease);
}
.ws-chat-sugerencias button:hover { background: rgba(153, 0, 18, 0.1); transform: translateY(-2px); }
.ws-chat-sugerencias button:active { transform: scale(0.97); }
.ws-chat-sugerencias:empty { display: none; }

@media (max-width: 520px) {
  .ws-asistente-boton { height: 48px; padding: 0 14px; font-size: 0.78rem; }
  .ws-asistente-texto { display: none; }
}

/* Hoja de vida / timeline */
.ws-hv-ficha {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 10px 30px rgba(17, 17, 17, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.ws-hv-ficha .ws-ficha-item span { color: #a27d54 !important; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.ws-hv-ficha .ws-ficha-item strong { color: #111111 !important; font-size: 0.82rem; overflow-wrap: anywhere; }

.ws-hv-form {
  margin: 10px 0 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(162, 125, 84, 0.28);
  background: rgba(247, 225, 199, 0.28);
}
.ws-hv-form h4 { margin: 0 0 10px; color: #990012 !important; font-family: "Plus Jakarta Sans", sans-serif; }
.ws-hv-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.ws-hv-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.68rem; font-weight: 700; color: #3a3a3a !important; }
.ws-hv-form input,
.ws-hv-form select,
.ws-hv-form textarea {
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid rgba(162, 125, 84, 0.32);
  background: #ffffff;
  color: #111111;
  font: inherit;
  font-size: 0.82rem;
}
.ws-hv-form .ws-ancho { grid-column: 1 / -1; }
.ws-hv-form .ws-mensaje { display: block; margin-left: 10px; }

@media (max-width: 520px) {
  .ws-hv-form-grid { grid-template-columns: 1fr; }
}

/* Edge: el copiloto siempre por encima y con eventos activos. */
.ws-asistente,
.ws-asistente-boton,
.ws-asistente-panel {
  z-index: 999999 !important;
}
.ws-asistente { pointer-events: none; }
.ws-asistente-boton,
.ws-asistente-panel {
  pointer-events: auto !important;
  position: relative;
}
.ws-chat-burbuja.ws-chat-error {
  color: #990012 !important;
  border-color: rgba(153, 0, 18, 0.5) !important;
  background: rgba(247, 225, 199, 0.75) !important;
  font-weight: 600;
}
.ws-chat-burbuja.ws-chat-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
}
.ws-chat-burbuja.ws-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #990012;
  animation: aiTyping 1s ease-in-out infinite;
}
.ws-chat-burbuja.ws-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.ws-chat-burbuja.ws-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aiTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}
#wsAsistentePanel[hidden] { display: none !important; }
