/* Sistema visual «Grafito».
   Marco oscuro (lateral + barra de estado) en L alrededor de un lienzo claro.
   Una sola familia (Geist) y su mono para códigos y cifras. La tinta casi negra
   hace de color primario; el cobalto queda solo para selección y foco, y el
   ámbar/rojo/verde solo para estados. Un único estilo de rótulo en todas partes.
   El tema anterior del handoff está guardado en _tema-handoff/. */

/* ------------------------------------------------------------------ fuentes */
@font-face {
  font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fuentes/geist-latin-wght-normal.woff2") format("woff2-variations");
}
@font-face {
  font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("fuentes/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
  /* lienzo */
  --bg: #f6f6f7;
  --panel: #ffffff;
  --cabecera-tabla: #f3f4f6;      /* relleno sutil: hover, pistas, grupos */
  --fila-suave: #fafafb;
  --pista: #e4e5e9;
  --borde-control: #d7d9de;
  --divisor: #e8e9ec;

  --texto: #121418;
  --texto-2: #3d4149;
  --texto-3: #6b7079;

  /* tinta: texto fuerte y casillas */
  --tinta-ui: #16181d;
  --tinta-ui-hover: #2b2e35;

  /* primario de los botones: pizarra, sólido. Cambiar aquí el tono
     (alternativas probadas: cobalto #2F47B8 / #2A3FA3, petróleo #0E6470 / #0B5560) */
  --primario: #3b4a63;
  --primario-hover: #313e54;
  --primario-luz: #52627e;          /* parte alta del degradado */
  --primario-sombra: 22 30 44;      /* rgb de sombras y filos del primario */
  --primario-apagado: #aeb6c4;      /* deshabilitado */
  /* secundario: pizarra claro, sólido */
  --secundario: #e6eaf0;
  --secundario-luz: #f1f3f7;
  --secundario-hover: #dbe1e9;
  --secundario-texto: #2f3b50;

  /* cobalto: solo selección, foco y progreso */
  --acento: #3651d4;
  --acento-100: #f1f4fe;
  --acento-200: #e2e8fd;
  --acento-300: #c3cffa;
  --acento-400: #8ea3f2;
  --acento-700: #2a40ad;
  --acento-800: #213286;
  --acento-900: #18245f;
  --anillo: 0 0 0 3px rgba(54, 81, 212, .18);

  /* marco oscuro */
  --marco: #14161a;
  --marco-borde: #25282f;
  --marco-hover: #1c1f24;
  --marco-activo: #262930;
  --marco-texto: #a3a8b2;
  --marco-texto-3: #6d727c;
  --marco-fuerte: #f3f4f6;

  /* estados */
  --ambar-txt: #8f5207;
  --ambar-fondo: #fdf6e7;
  --ambar-borde: #efd29b;
  --rojo-txt: #b42318;
  --rojo-txt-2: #c0362c;
  --rojo-fondo: #fdf0ef;
  --rojo-borde: #f3c3be;
  --verde-txt: #17704a;
  --verde-fondo: #ecf7f1;
  --verde-borde: #a9d9be;

  --r: 8px;
  --r-sm: 6px;
  --r-xs: 4px;
  --sombra: 0 16px 40px -12px rgba(18, 20, 24, .28), 0 2px 6px rgba(18, 20, 24, .06);
  --sombra-panel: 0 1px 2px rgba(18, 20, 24, .04);

  --titulo: "Geist", "Segoe UI", system-ui, sans-serif;
  --cuerpo: "Geist", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", "Cascadia Mono", Consolas, monospace;

  /* Familias del libro de costes: único nivel con color propio. */
  --c0-h: 160; --c1-h: 130; --c2-h: 285; --c3-h: 8;   --c4-h: 110;
  --c5-h: 200; --c6-h: 325; --c7-h: 240; --c8-h: 300; --c9-h: 60;
}

.fam {
  --relleno: oklch(0.967 0.026 var(--h));
  --contorno: oklch(0.64 0.12 var(--h));
  --tinta: oklch(0.42 0.10 var(--h));
}
.fam.oscura { --relleno: oklch(0.90 0.06 var(--h)); --contorno: oklch(0.50 0.13 var(--h)); }
.fam-c0 { --h: var(--c0-h); } .fam-c1 { --h: var(--c1-h); } .fam-c2 { --h: var(--c2-h); }
.fam-c3 { --h: var(--c3-h); } .fam-c4 { --h: var(--c4-h); } .fam-c5 { --h: var(--c5-h); }
.fam-c6 { --h: var(--c6-h); } .fam-c7 { --h: var(--c7-h); } .fam-c8 { --h: var(--c8-h); }
.fam-c9 { --h: var(--c9-h); }

.cuadro-familia {
  display: inline-block;
  width: 10px; height: 10px;
  background: var(--contorno);
  border-radius: 3px;
  flex: none;
}

* { box-sizing: border-box; }
/* lo oculto se oculta siempre, aunque su clase le dé display: flex/grid */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--texto);
  font: 400 13px/1.5 var(--cuerpo);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

body {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 28px;
  grid-template-areas: "lateral principal" "barra barra";
}

code { font: 400 .92em var(--mono); background: var(--cabecera-tabla); padding: 1px 4px; border-radius: var(--r-xs); }

/* Rótulo único: el mismo en cabeceras de tabla, dt, legend y totales. */
.rotulo, .rotulo-grupo, th, .dato dt, legend {
  font: 500 11.5px/1.3 var(--cuerpo);
  color: var(--texto-3);
  letter-spacing: 0;
  text-transform: none;
}
/* los textos de rótulo vienen en minúscula desde el JS (antes los subía el CSS):
   se capitaliza solo la inicial, en tipo frase */
.rotulo::first-letter, th::first-letter, .dato dt::first-letter, legend::first-letter,
.fichero-cab > span::first-letter, .cab-libro > span::first-letter,
.previa-fila dt::first-letter { text-transform: uppercase; }
.fichero-cab > span, .cab-libro > span { display: block; }

/* ------------------------------------------------------------------ lateral */
.lateral {
  grid-area: lateral;
  background: var(--marco);
  border-right: 1px solid var(--marco-borde);
  color: var(--marco-texto);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* selector de buque */
.selector-buque {
  display: block;
  width: calc(100% - 20px);
  margin: 12px 10px 6px;
  text-align: left;
  background: var(--marco-hover);
  border: 1px solid var(--marco-borde);
  border-radius: var(--r);
  padding: 9px 11px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.selector-buque:hover { background: var(--marco-activo); }
.selector-buque .casco {
  display: flex;
  font: 500 11.5px var(--mono);
  color: var(--marco-texto);
  align-items: center;
  justify-content: space-between;
}
.selector-buque .casco .caret { color: var(--marco-texto-3); font-size: 10px; }
.selector-buque .nombre {
  display: block;
  font: 600 14px/1.3 var(--titulo);
  color: var(--marco-fuerte);
  letter-spacing: -.01em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.selector-buque .meta { display: block; margin-top: 1px; font: 400 11.5px var(--cuerpo); color: var(--marco-texto-3); }

.desplegable-buques {
  position: absolute;
  top: 74px; left: 10px;
  width: 300px;
  background: var(--panel);
  border: 1px solid var(--divisor);
  border-radius: var(--r);
  box-shadow: var(--sombra);
  z-index: 40;
  padding: 4px;
  max-height: 60vh;
  overflow-y: auto;
}
.buque-opcion {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  align-items: baseline;
  gap: 9px;
  width: 100%;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  padding: 7px 9px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: var(--texto);
}
.buque-opcion:hover { background: var(--cabecera-tabla); }
.buque-opcion[aria-current="true"] { background: var(--acento-100); color: var(--acento-900); }
.buque-opcion .casco { font: 500 12px var(--mono); }
.buque-opcion .est { font: 400 11.5px var(--cuerpo); color: var(--texto-3); }

/* navegación — adaptada de «Sidebar Light» (21st.dev · inference-sh): cabecera
   de grupo con icono y peso fuerte; los items cuelgan de una línea vertical;
   el activo lleva fondo suave y sube de peso. Aquí el fondo lo ponen dos
   píldoras que se desplazan por detrás (activa y hover), movidas desde app.js,
   y el tramo de la línea junto al activo se ilumina. */
.menu { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-bottom: 8px; }
.nav-indicador, .nav-hover {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-radius: var(--r-sm);
  pointer-events: none;
  will-change: transform, height, width;
}
.nav-hover {
  background: rgba(255, 255, 255, .035);
  opacity: 0;
  transition: transform .22s cubic-bezier(.3, .7, .3, 1), height .22s, width .22s, opacity .18s;
}
.nav-hover.visible { opacity: 1; }
.nav-indicador { opacity: 0; background: var(--marco-activo); }
/* el tramo iluminado de la línea del árbol: 1 px a la izquierda del item */
.nav-indicador::before {
  content: "";
  position: absolute;
  left: -9px; top: 4px; bottom: 4px;
  width: 1px;
  background: var(--acento-400);
  box-shadow: 0 0 8px rgba(142, 163, 242, .8);
}
.grupo-nav { position: relative; padding: 10px 10px 2px; }
.lateral .rotulo-grupo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 6px;
  font: 600 13px var(--cuerpo);
  color: var(--marco-fuerte);
}
.rotulo-grupo .ico {
  width: 16px; height: 16px;
  fill: none;
  stroke: var(--marco-texto);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: 19px;             /* bajo el icono de la cabecera */
  padding-left: 8px;
  border-left: 1px solid var(--marco-borde);
}

.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--marco-texto);
  font: 400 13px var(--cuerpo);
  text-align: left;
  cursor: pointer;
  transition: color .15s;
}
.nav-item:focus-visible { outline: 2px solid var(--acento-400); outline-offset: -2px; }
.nav-item .ord { font: 400 10.5px var(--mono); color: var(--marco-texto-3); flex: none; width: 14px; }
.nav-item .cuenta {
  margin-left: auto;
  font: 400 11px var(--mono);
  color: var(--marco-texto-3);
}
.nav-item:hover { color: var(--marco-fuerte); }
.nav-item.activo { color: var(--marco-fuerte); font-weight: 500; }
.nav-item .ord, .nav-item .cuenta { transition: color .15s; }
.nav-item.activo .ord { color: var(--acento-400); }
.nav-item.activo .cuenta { color: var(--marco-texto); }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.vista.activa { animation: aparecer .28s cubic-bezier(.2, .7, .3, 1); }
@media (prefers-reduced-motion: reduce) {
  .vista.activa { animation: none; }
  .nav-item, .nav-hover { transition: none; }
}
.nav-item.pendiente { color: var(--marco-texto-3); }

.lateral-pie {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--marco-borde);
  display: grid;
  gap: 2px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  font: 400 12px var(--cuerpo);
  padding: 5px 8px;
  border-radius: var(--r-sm);
  border: 0;
  background: none;
  color: var(--marco-texto);
  cursor: pointer;
  text-align: left;
}
.chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--marco-texto-3);
  flex: none;
}
.chip:hover { background: var(--marco-hover); color: var(--marco-fuerte); }
.chip.ambar::before { background: #f0b44c; box-shadow: 0 0 0 3px rgba(240, 180, 76, .16); }
.chip.verde::before { background: #4fc58a; box-shadow: 0 0 0 3px rgba(79, 197, 138, .16); }

/* --------------------------------------------------------------- principal */
main { grid-area: principal; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.cabecera-vista {
  height: 54px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--divisor);
  background: var(--panel);
}
.cabecera-vista h1 { margin: 0; font: 600 17px/1 var(--titulo); letter-spacing: -.015em; }
.cabecera-vista .meta { font: 400 12px var(--cuerpo); color: var(--texto-3); }
.cabecera-vista .modo {
  margin-left: auto;
  font: 500 11.5px var(--cuerpo);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.cabecera-vista .modo:empty { display: none; }
.cabecera-vista .modo.ambar { color: var(--ambar-txt); background: var(--ambar-fondo); border-color: var(--ambar-borde); }
.cabecera-vista .modo.verde { color: var(--verde-txt); background: var(--verde-fondo); border-color: var(--verde-borde); }

.lienzo { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 20px 24px 28px; min-width: 0; }

.vista { display: none; }
.vista.activa { display: block; }

/* --------------------------------------------------------------- avisos */
.aviso {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--ambar-borde);
  background: var(--ambar-fondo);
  color: var(--ambar-txt);
  border-radius: var(--r);
  margin-bottom: 16px;
  font-size: 12.5px;
}
.aviso b { font-weight: 600; }
.aviso code { background: rgba(143, 82, 7, .08); }
.aviso.rojo { border-color: var(--rojo-borde); background: var(--rojo-fondo); color: var(--rojo-txt); }
.aviso .btn { margin-left: auto; }

/* ---------------------------------------------------------------- paneles */
.panel {
  background: var(--panel);
  border: 1px solid var(--divisor);
  border-radius: var(--r);
  box-shadow: var(--sombra-panel);
  margin-bottom: 16px;
}
.panel > .cuerpo { padding: 14px 16px; }
.panel-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--divisor);
}
.panel-cabecera h2 {
  margin: 0;
  font: 600 13px var(--titulo);
  letter-spacing: -.005em;
  color: var(--texto);
}

.dos-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.crece { min-width: 0; }

/* --------------------------------------------------------------- tarjetas */
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tarjeta {
  background: var(--panel);
  border: 1px solid var(--divisor);
  border-radius: var(--r);
  box-shadow: var(--sombra-panel);
  padding: 12px 14px;
}
.tarjeta .cifra { font: 600 22px/1.15 var(--cuerpo); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tarjeta .rotulo { margin-top: 3px; }
.tarjeta.alerta { border-color: var(--ambar-borde); background: var(--ambar-fondo); }
.tarjeta.alerta .cifra, .tarjeta.alerta .rotulo { color: var(--ambar-txt); }

/* ------------------------------------------------------------ listas dato */
.lista-datos { display: grid; gap: 8px; }
.lista-datos.horizontal {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--divisor);
}
.dato { display: flex; justify-content: space-between; gap: 12px; }
.lista-datos.horizontal .dato { display: block; }
.dato dt { flex: none; }
.dato dd { margin: 0; font: 400 12px var(--mono); overflow-wrap: anywhere; text-align: right; }
.lista-datos.horizontal .dato dd {
  margin-top: 3px;
  font: 600 15px var(--cuerpo);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

/* -------------------------------------------------------------- controles */
/* Botones — adaptados de «Glass Button» (21st.dev · jahed): cristal casi
   transparente, anillo de borde con gradiente cónico que gira al pasar el
   ratón, reflejo que barre la cápsula e inclinación 3D al pulsar. El original
   envuelve el botón en dos div; aquí todo va en un solo <button> (::after es
   el anillo, ::before el reflejo) porque la app crea botones desde JS.
   Aquí van SÓLIDOS: el claro es blanco opaco y el primario cobalto opaco (el
   original es translúcido). Se conservan el anillo, el reflejo y la sombra. */
@property --angulo-1 { syntax: "<angle>"; inherits: false; initial-value: -75deg; }
@property --angulo-2 { syntax: "<angle>"; inherits: false; initial-value: -45deg; }

.btn {
  --t: .4s;
  --e: cubic-bezier(.25, 1, .5, 1);
  --grosor: clamp(1px, .0625em, 4px);
  --luz: 255 255 255;
  --tinta: 18 20 24;
  --anillo-punto: rgb(var(--primario-sombra) / .45);
  --anillo-base: rgb(var(--primario-sombra) / .16);
  position: relative;
  isolation: isolate;
  border: 0;
  border-radius: 999px;
  padding: 6px 15px;
  font: 500 12.5px var(--cuerpo);
  letter-spacing: -.01em;
  color: var(--secundario-texto);
  text-shadow: none;                 /* sobre fondo opaco la del original se ve doble */
  background: linear-gradient(180deg, var(--secundario-luz), var(--secundario) 60%);
  box-shadow:
    inset 0 .125em .125em rgb(var(--tinta) / .05),
    inset 0 -.125em .125em rgb(var(--luz) / .5),
    0 .25em .125em -.125em rgb(var(--tinta) / .2),
    0 0 .1em .25em inset rgb(var(--luz) / .2),
    0 .5em .7em -.45em rgb(var(--tinta) / .22);      /* la sombra que el original pinta en un div aparte */
  cursor: pointer;
  transition: all var(--t) var(--e);
}
/* anillo: gradiente cónico recortado al borde con máscara */
.btn::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--grosor) / -2);
  padding: var(--grosor);
  border-radius: 999px;
  background:
    conic-gradient(from var(--angulo-1) at 50% 50%,
      var(--anillo-punto) 0%, transparent 5% 40%, var(--anillo-punto) 50%, transparent 60% 95%, var(--anillo-punto) 100%),
    linear-gradient(180deg, var(--anillo-base), var(--anillo-base));
  box-shadow: inset 0 0 0 calc(var(--grosor) / 2) var(--anillo-base);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  transition: all var(--t) var(--e), --angulo-1 .5s ease;
}
/* reflejo que barre la cápsula */
.btn::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: calc(var(--grosor) / 2);
  border-radius: 999px;
  background: linear-gradient(var(--angulo-2), transparent 0%, rgb(var(--luz) / .5) 40% 50%, transparent 55%);
  background-size: 200% 200%;
  background-position: 0%;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: background-position calc(var(--t) * 1.25) var(--e), --angulo-2 calc(var(--t) * 1.25) var(--e);
}
.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--secundario), var(--secundario-hover) 60%);
  box-shadow:
    inset 0 .125em .125em rgb(var(--tinta) / .05),
    inset 0 -.125em .125em rgb(var(--luz) / .5),
    0 .15em .05em -.1em rgb(var(--tinta) / .25),
    0 0 .05em .1em inset rgb(var(--luz) / .5),
    0 .3em .5em -.35em rgb(var(--tinta) / .2);
  transform: scale(.975);
}
.btn:hover:not(:disabled)::after { --angulo-1: -125deg; }
.btn:hover:not(:disabled)::before { background-position: 25%; }
.btn:active:not(:disabled) {
  transform: perspective(500px) rotateX(25deg) scale(.975);
  box-shadow:
    inset 0 .125em .125em rgb(var(--tinta) / .05),
    inset 0 -.125em .125em rgb(var(--luz) / .5),
    0 .125em .125em -.125em rgb(var(--tinta) / .2),
    0 0 .1em .25em inset rgb(var(--luz) / .2),
    0 .225em .05em rgb(var(--tinta) / .05),
    0 .25em rgb(var(--luz) / .75),
    inset 0 .25em .05em rgb(var(--tinta) / .15);
}
.btn:active:not(:disabled)::after { --angulo-1: -75deg; }
.btn:active:not(:disabled)::before { --angulo-2: -15deg; background-position: 50% 15%; }
.btn:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.btn:disabled {
  cursor: not-allowed;
  color: var(--texto-3);
  text-shadow: none;
  background: var(--cabecera-tabla);
  box-shadow: inset 0 0 0 1px var(--divisor);
  --anillo-punto: transparent;
  --anillo-base: transparent;
}
.btn:disabled::before { display: none; }

.btn.primario {
  --anillo-punto: rgb(255 255 255 / .6);
  --anillo-base: rgb(255 255 255 / .14);
  color: #fff;
  text-shadow: 0 1px 0 rgb(var(--primario-sombra) / .25);
  background: linear-gradient(180deg, var(--primario-luz), var(--primario) 60%);
  box-shadow:
    inset 0 .125em .125em rgb(255 255 255 / .18),
    inset 0 -.125em .125em rgb(var(--primario-sombra) / .30),
    0 .25em .125em -.125em rgb(var(--primario-sombra) / .40),
    0 .55em .8em -.45em rgb(var(--primario-sombra) / .50);
}
.btn.primario::before { background-image: linear-gradient(var(--angulo-2), transparent 0%, rgb(255 255 255 / .28) 40% 50%, transparent 55%); }
.btn.primario:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--primario), var(--primario-hover) 60%);
  box-shadow:
    inset 0 .125em .125em rgb(255 255 255 / .16),
    inset 0 -.125em .125em rgb(var(--primario-sombra) / .30),
    0 .15em .05em -.1em rgb(var(--primario-sombra) / .45),
    0 .3em .5em -.35em rgb(var(--primario-sombra) / .45);
}
.btn.primario:active:not(:disabled) {
  box-shadow:
    inset 0 .25em .1em rgb(var(--primario-sombra) / .40),
    inset 0 -.125em .125em rgb(255 255 255 / .08),
    0 .125em .125em -.125em rgb(var(--primario-sombra) / .40);
}
.btn.primario:disabled { color: #fff; background: var(--primario-apagado); box-shadow: none; }
.btn.activo:disabled { opacity: 1; color: var(--verde-txt); --anillo-punto: rgb(23 112 74 / .5); cursor: default; }
.btn.ancho { width: 100%; margin-top: 6px; padding: 9px 15px; }
.btn.mini { padding: 3px 11px; font-size: 12px; }
@media (prefers-reduced-motion: reduce) {
  .btn, .btn::before, .btn::after { transition: none; }
  .btn:hover:not(:disabled), .btn:active:not(:disabled) { transform: none; }
}
.grupo-btn { display: flex; gap: 8px; align-items: center; }

label { display: block; margin-bottom: 12px; color: var(--texto-2); font: 500 12px var(--cuerpo); }
select, input[type="number"], input[type="text"], input[type="password"], input[type="search"], input:not([type]) {
  width: 100%;
  margin-top: 5px;
  background: var(--panel);
  border: 1px solid var(--borde-control);
  border-radius: var(--r-sm);
  color: var(--texto);
  padding: 6px 9px;
  font: 400 12.5px var(--cuerpo);
  transition: border-color .12s, box-shadow .12s;
}
input[readonly] { background: var(--fila-suave); color: var(--texto-2); }
select:focus, input:focus { outline: 0; border-color: var(--acento); box-shadow: var(--anillo); }
/* bloqueado hasta pulsar Editar: que no parezca que se puede tocar y falla.
   Sin cursor de texto, sin anillo al hacer clic, sin reacción al pasar */
input[readonly], textarea[readonly] { cursor: default; }
input[readonly]:focus, textarea[readonly]:focus { border-color: var(--borde-control); box-shadow: none; }
select:disabled, input:disabled, textarea:disabled { cursor: default; }
.fila-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sufijo { color: var(--texto-3); font-size: 11.5px; }
.entrada-ruta { width: 190px; margin: 0; font-family: var(--mono); font-size: 11.5px; }

/* segmentado ES / EN / Bilingüe */
.segmentado {
  display: flex;
  margin-top: 5px;
  padding: 2px;
  gap: 2px;
  background: var(--cabecera-tabla);
  border: 1px solid var(--divisor);
  border-radius: var(--r-sm);
}
.segmentado button {
  flex: 1;
  padding: 4px 4px;
  background: none;
  border: 0;
  border-radius: var(--r-xs);
  font: 500 12px var(--cuerpo);
  color: var(--texto-3);
  cursor: pointer;
}
.segmentado button:hover:not(:disabled) { color: var(--texto); }
.segmentado button:disabled { cursor: default; }
.segmentado button:disabled:not([aria-pressed="true"]) { opacity: .55; }
.segmentado button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--texto);
  box-shadow: 0 1px 2px rgba(18, 20, 24, .10), 0 0 0 1px rgba(18, 20, 24, .04);
}

/* paso − n + */
.paso { display: flex; align-items: stretch; margin-top: 5px; }
.paso button {
  width: 30px;
  background: var(--panel);
  border: 1px solid var(--borde-control);
  color: var(--texto-2);
  font: 400 14px var(--cuerpo);
  cursor: pointer;
}
.paso button:hover { background: var(--cabecera-tabla); }
.paso input {
  width: 56px;
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  text-align: center;
  font-family: var(--mono);
}
.paso button:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.paso button:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

fieldset { border: 1px solid var(--divisor); border-radius: var(--r); padding: 8px 12px 10px; margin: 0 0 12px; }
legend { padding: 0 4px; }
.casillas { display: grid; gap: 5px; max-height: 190px; overflow-y: auto; }
.casilla { display: flex; align-items: baseline; gap: 8px; margin: 0; color: var(--texto); font: 400 12.5px var(--cuerpo); }
.casilla input { width: auto; margin: 0; accent-color: var(--tinta-ui); }
.casilla .pais { color: var(--texto-3); font: 400 11px var(--mono); }

.fila-control { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.fila-control label { display: flex; align-items: center; gap: 8px; margin: 0; }
input[type="range"] { width: 148px; margin: 0; accent-color: var(--acento); }
output { font: 500 13px var(--mono); color: var(--acento-700); min-width: 26px; }
.nota { color: var(--texto-3); font-size: 12px; }

/* ---------------------------------------------------------------- reparto */
.reparto { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.reparto-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  background: var(--fila-suave);
  border: 1px solid var(--divisor);
  border-radius: var(--r-sm);
  padding: 5px 9px;
  font: 400 12px var(--mono);
}
.reparto-item span:last-child { color: var(--texto); font-weight: 500; }

/* ----------------------------------------------------------------- tablas */
.tabla-envoltorio { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left;
  padding: 9px 12px;
  background: none;
  border-bottom: 1px solid var(--divisor);
  white-space: nowrap;
}
td { padding: 7px 12px; border-bottom: 1px solid var(--divisor); font: 400 12px var(--mono); }
tbody tr:last-child td { border-bottom: 0; }
td.texto { font-family: var(--cuerpo); font-size: 12.5px; }
tbody tr:hover { background: var(--fila-suave); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.barra-medida {
  display: inline-block;
  height: 4px;
  background: var(--acento);
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 8px;
}
.pista-medida {
  display: inline-block;
  width: 36px; height: 4px;
  background: var(--pista);
  border-radius: 2px;
  overflow: hidden;
  vertical-align: middle;
  margin-left: 8px;
  position: relative;
}
.pista-medida > i { position: absolute; inset: 0 auto 0 0; background: var(--acento); }
.flojo { color: var(--ambar-txt); }
.malo { color: var(--rojo-txt); }

/* ------------------------------------------------------- sistemas/paquete */
.lista-sistemas { padding: 6px; max-height: calc(100vh - 240px); overflow-y: auto; }
.sistema-item {
  display: grid;
  grid-template-columns: 12px 40px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  padding: 6px 9px;
  color: var(--texto-2);
  font: 400 12.5px var(--cuerpo);
  text-align: left;
  cursor: pointer;
}
.sistema-item:hover { background: var(--cabecera-tabla); color: var(--texto); }
.sistema-item.activo { background: var(--acento-100); color: var(--acento-900); box-shadow: inset 2px 0 0 var(--acento); }
.sistema-item .cod { font: 500 12px var(--mono); }
.sistema-item .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sistema-item .n { font: 400 11px var(--mono); color: var(--texto-3); }

.fragmentos { display: grid; gap: 8px; max-height: calc(100vh - 330px); overflow-y: auto; }
.fragmento { background: var(--panel); border: 1px solid var(--divisor); border-radius: var(--r); overflow: hidden; }
.fragmento-cab {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
}
.fragmento-cab:hover { background: var(--fila-suave); }
.fragmento[data-abierto="si"] .fragmento-cab { border-bottom: 1px solid var(--divisor); }
.fragmento-cab .ref { font: 500 12px var(--mono); color: var(--texto); min-width: 44px; }
.fragmento-cab .tit { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 500; }
.fragmento-cab .tramo { color: var(--texto-3); font: 400 11.5px var(--cuerpo); white-space: nowrap; }
.fragmento-cab .score { font: 400 11px var(--mono); color: var(--texto-3); }
.fragmento-cuerpo { padding: 10px 12px; display: grid; gap: 7px; background: var(--fila-suave); }
.fragmento[data-abierto="no"] .fragmento-cuerpo { display: none; }
.parrafo { display: block; }
.parrafo .idx { color: var(--texto-3); font: 400 11px var(--mono); padding-top: 1px; }
.parrafo .txt { color: var(--texto-2); font-size: 12.5px; }
.parrafo.relleno .txt { color: var(--texto-3); font-style: italic; }
.corte { color: var(--texto-3); font: 400 11px var(--mono); }

/* ------------------------------------------------------------- lista rfq */
.lista-rfq { display: grid; gap: 10px; }
.rfq-item { background: var(--panel); border: 1px solid var(--divisor); border-radius: var(--r); padding: 11px 14px; }
.rfq-cab { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rfq-cab .token { font: 500 12.5px var(--mono); color: var(--texto); }
.rfq-cab .sis { color: var(--texto-2); flex: 1; min-width: 0; font-size: 12.5px; }
.etiqueta {
  font: 500 11px/1.5 var(--cuerpo);
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--divisor);
  color: var(--texto-2);
  background: var(--cabecera-tabla);
  white-space: nowrap;
}
.etiqueta.enviada { color: var(--verde-txt); border-color: var(--verde-borde); background: var(--verde-fondo); }
.etiqueta.borrador { color: var(--ambar-txt); border-color: var(--ambar-borde); background: var(--ambar-fondo); }
.rfq-meta { margin-top: 5px; color: var(--texto-3); font: 400 11px var(--mono); }
.rfq-envios { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--divisor); display: grid; gap: 4px; }
.envio { display: flex; align-items: baseline; gap: 9px; font-size: 12.5px; }
.envio .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envio .est { font: 500 11px var(--cuerpo); color: var(--texto-3); }
.rfq-acciones { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* --------------------------------------------------------------- resultado */
.resultado { display: grid; gap: 4px; font: 400 12px var(--mono); }
.resultado .ok { color: var(--verde-txt); }
.resultado .mal { color: var(--ambar-txt); }

.log { display: grid; gap: 0; max-height: 260px; overflow-y: auto; }
.log-linea {
  display: grid;
  grid-template-columns: 116px minmax(160px, 260px) minmax(0, 1fr);
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--divisor);
  font: 400 11.5px var(--mono);
}
.log-linea:last-child { border-bottom: 0; }
.log-linea .ts { color: var(--texto-3); white-space: nowrap; }
.log-linea .acc { color: var(--texto); font: 400 12px var(--cuerpo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-linea .acc b { font-weight: 600; }
.log-linea .det { color: var(--texto-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vacio { font-family: var(--cuerpo); color: var(--texto-3); padding: 22px 2px; text-align: center; font-size: 12.5px; }

/* estado vacío / pendiente, con la causa dicha en voz alta */
.pendiente-caja {
  border: 1px dashed var(--borde-control);
  border-radius: var(--r);
  padding: 32px 24px;
  text-align: center;
  background: var(--panel);
}
.pendiente-caja h3 { margin: 0 0 8px; font: 600 16px var(--titulo); letter-spacing: -.01em; }
.pendiente-caja p { margin: 0 auto; max-width: 560px; color: var(--texto-3); font-size: 12.5px; }
.pendiente-caja ul {
  margin: 12px auto 0;
  max-width: 560px;
  text-align: left;
  color: var(--texto-3);
  font-size: 12.5px;
  padding-left: 18px;
}
.pendiente-caja li { margin-bottom: 3px; }

/* ------------------------------------------------------------------- barra */
.barra-estado {
  grid-area: barra;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: var(--marco);
  border-top: 1px solid var(--marco-borde);
  font: 400 11px var(--mono);
  color: var(--marco-texto);
}
.barra-estado .traza { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%; color: var(--marco-texto-3); }
.barra-estado.trabajando #estado-txt { color: var(--acento-400); }
.barra-estado.error #estado-txt { color: #f08c84; }

/* ------------------------------------------------------------------- visor */
dialog {
  width: min(1000px, 92vw);
  height: 86vh;
  padding: 0;
  border: 1px solid var(--divisor);
  border-radius: 12px;
  background: var(--panel);
  color: var(--texto);
  box-shadow: var(--sombra);
  overflow: hidden;
  display: none;
  flex-direction: column;
}
dialog[open] { display: flex; }
dialog::backdrop { background: rgba(18, 20, 24, .42); }
.visor-cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--divisor);
}
.visor-cabecera h3 { margin: 0; font: 600 15px var(--titulo); letter-spacing: -.01em; }
#visor-marco { flex: 1; width: 100%; border: 0; background: #fff; }
#visor-texto {
  flex: 1;
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre-wrap;
  font: 400 12px/1.65 var(--mono);
  color: var(--texto-2);
  background: var(--fila-suave);
}

/* pistas finas */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--pista); border-radius: 4px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--borde-control); background-clip: content-box; }
.lateral ::-webkit-scrollbar-thumb { background: var(--marco-borde); background-clip: content-box; }

/* ------------------------------------------------------------------- cuenta */
.usuario-actual {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 9px;
  padding: 8px 6px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--marco-borde);
}
.avatar {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #3a4a68, #26324a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  color: var(--marco-fuerte);
  font: 600 11.5px var(--cuerpo);
  letter-spacing: .02em;
}
.ua-txt { display: grid; min-width: 0; }
.ua-nombre { font: 500 12.5px var(--cuerpo); color: var(--marco-fuerte); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua-rol { font: 400 11px var(--cuerpo); color: var(--marco-texto-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua-boton {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm);
  background: none; cursor: pointer;
}
.ua-boton svg { width: 16px; height: 16px; fill: var(--marco-texto); }
.ua-boton:hover { background: var(--marco-hover); }
.ua-desplegable {
  position: absolute;
  left: 0; right: 0; bottom: calc(100% + 6px);
  padding: 4px;
  background: var(--marco-activo);
  border: 1px solid var(--marco-borde);
  border-radius: var(--r);
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6);
  display: grid;
  z-index: 30;
  animation: aparecer .16s ease-out;
}
.ua-desplegable button {
  padding: 7px 10px;
  border: 0; border-radius: var(--r-sm);
  background: none; color: var(--marco-fuerte);
  font: 400 12.5px var(--cuerpo);
  text-align: left; cursor: pointer;
}
.ua-desplegable button:hover { background: var(--marco-hover); }
#ua-salir { color: #f0a29b; }

/* lo que solo puede hacer IT: fuera de la vista para el resto (el puente
   lo rechaza igualmente si alguien lo intenta) */
body:not(.es-admin) .solo-admin { display: none !important; }
.acciones-usuario { white-space: nowrap; }
.acciones-usuario .btn + .btn { margin-left: 6px; }
tr.sin-clave td:first-child::after { content: " · sin contraseña"; color: var(--ambar-txt); font: 400 11px var(--cuerpo); }

/* ================================================================ menú
   Lateral plegable (Ctrl+B) y, como alternativa por usuario, barra superior
   (portada de «Header 3» de 21st · efferd). Lo monta ui/menu.js. */

body { transition: grid-template-columns .22s cubic-bezier(.3, .7, .3, 1); }

/* cabecera del lateral con el botón de plegar (icono que se transforma, de
   «Menu Toggle Icon» del mismo autor) */
.lateral-cab { display: flex; justify-content: flex-end; padding: 10px 10px 0; }
.btn-plegar {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--marco-borde); border-radius: var(--r-sm);
  background: none; color: var(--marco-texto); cursor: pointer;
}
.btn-plegar:hover { background: var(--marco-hover); color: var(--marco-fuerte); }
.btn-plegar:focus-visible { outline: 2px solid var(--acento-400); outline-offset: 2px; }
.icono-menu {
  width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform .3s ease-in-out;
}
.icono-menu path { transition: stroke-dasharray .3s ease-in-out, stroke-dashoffset .3s ease-in-out; }
.icono-menu .trazo-largo { stroke-dasharray: 12 63; }
/* desplegado = "abierto": la hamburguesa se convierte en aspa */
.btn-plegar[aria-expanded="true"] .icono-menu { transform: rotate(-45deg); }
.btn-plegar[aria-expanded="true"] .icono-menu .trazo-largo { stroke-dasharray: 20 300; stroke-dashoffset: -32.42px; }

.ico-item { display: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8;
            stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ----------------------------------------------------------- plegado */
body.menu-plegado { grid-template-columns: 60px minmax(0, 1fr); }
body.menu-plegado .lateral-cab { justify-content: center; padding: 10px 0 0; }
body.menu-plegado .selector-buque { width: 44px; margin: 10px 8px 4px; padding: 7px 0; text-align: center; }
body.menu-plegado .selector-buque .casco { justify-content: center; font-size: 9.5px; }
body.menu-plegado .selector-buque .casco .caret,
body.menu-plegado .selector-buque .nombre,
body.menu-plegado .selector-buque .meta { display: none; }
body.menu-plegado .desplegable-buques { left: 64px; top: 50px; }
body.menu-plegado .grupo-nav { padding: 8px 8px 2px; }
body.menu-plegado .lateral .rotulo-grupo { font-size: 0; gap: 0; justify-content: center; padding: 6px 0 4px;
                                           border-top: 1px solid var(--marco-borde); }
body.menu-plegado .grupo-nav:first-child .rotulo-grupo { border-top: 0; }
body.menu-plegado .rotulo-grupo .ico { width: 12px; height: 12px; stroke: var(--marco-texto-3); }
body.menu-plegado .lateral nav { margin-left: 0; padding-left: 0; border-left: 0; }
body.menu-plegado .lateral .nav-item { font-size: 0; justify-content: center; align-items: center; padding: 9px 0; }
body.menu-plegado .lateral .nav-item .ord { display: none; }
body.menu-plegado .lateral .nav-item .ico-item { display: block; }
body.menu-plegado .lateral .nav-item .cuenta {
  position: absolute; top: 2px; right: 3px; margin: 0; font-size: 9px; line-height: 1;
}
body.menu-plegado .nav-indicador::before { display: none; }
body.menu-plegado .lateral-pie { padding: 8px 6px; }
body.menu-plegado .usuario-actual { grid-template-columns: 1fr; justify-items: center; padding: 6px 0 8px; }
body.menu-plegado .usuario-actual .ua-txt,
body.menu-plegado .usuario-actual .ua-boton { display: none; }
body.menu-plegado #ua-iniciales { cursor: pointer; }
body.menu-plegado .ua-desplegable { position: fixed; left: 66px; right: auto; bottom: 64px; width: 210px; }
body.menu-plegado .desplegable-buques { position: fixed; }
body.menu-plegado .chip { font-size: 0; justify-content: center; gap: 0; padding: 7px 0; }

/* ------------------------------------------------------ barra superior */
body.menu-arriba {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 56px minmax(0, 1fr) 28px;
  grid-template-areas: "superior" "principal" "barra";
}
body.menu-arriba .lateral { display: none; }
.barra-superior {
  grid-area: superior;
  position: relative; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  padding: 0 14px 0 16px;
  background: var(--marco);
  border-bottom: 1px solid var(--marco-borde);
  color: var(--marco-texto);
  transition: box-shadow .2s;
}
.barra-superior[hidden] { display: none; }
.barra-superior.desplazada { box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .45); }
.bs-izquierda { display: flex; align-items: center; gap: 12px; flex: none; }
.bs-marca { display: flex; align-items: center; gap: 9px; font: 600 14px var(--cuerpo); color: var(--marco-fuerte); letter-spacing: -.01em; }
.bs-logo { width: 26px; height: 26px; }
.bs-logo rect { fill: var(--marco-activo); stroke: var(--marco-borde); }
.bs-logo path { fill: none; stroke: var(--acento-400); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }

/* el selector de buque, en una línea */
.barra-superior .selector-buque { display: flex; align-items: baseline; gap: 8px; width: auto; max-width: 280px; margin: 0; padding: 6px 10px; }
.barra-superior .selector-buque .casco { gap: 6px; }
.barra-superior .selector-buque .nombre { margin: 0; font-size: 13px; }
.barra-superior .selector-buque .meta { display: none; }
.barra-superior .desplegable-buques { top: 50px; left: 150px; }

/* grupos: el nav global del lateral trae sangría y línea; aquí no */
.barra-superior nav.bs-grupos { flex-direction: row; gap: 2px; margin: 0; padding: 0; border: 0; flex: 1; }
.bs-grupo { position: relative; }
.bs-disparador {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 12px;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--marco-texto);
  font: 500 13px var(--cuerpo); cursor: pointer; transition: background .15s, color .15s;
}
.bs-disparador:hover, .bs-grupo.abierto .bs-disparador { background: var(--marco-hover); color: var(--marco-fuerte); }
.bs-grupo.actual .bs-disparador { color: var(--marco-fuerte); }
.bs-grupo.actual .bs-disparador::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -11px; height: 2px;
  background: var(--acento-400); border-radius: 2px; box-shadow: 0 0 8px rgba(142, 163, 242, .7);
}
.bs-disparador:focus-visible { outline: 2px solid var(--acento-400); outline-offset: -2px; }
.bs-flecha { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.4;
             stroke-linecap: round; stroke-linejoin: round; transition: transform .3s; position: relative; top: 1px; }
.bs-grupo.abierto .bs-flecha { transform: rotate(180deg); }

.bs-panel {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
  width: 520px; padding: 6px;
  background: var(--panel); color: var(--texto);
  border: 1px solid var(--divisor); border-radius: 12px;
  box-shadow: 0 24px 48px -18px rgba(18, 20, 24, .45), 0 2px 6px rgba(18, 20, 24, .06);
  transform-origin: top left;
  animation: bs-abrir .18s cubic-bezier(.2, .7, .3, 1);
}
.bs-panel[hidden] { display: none; }
@keyframes bs-abrir { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.bs-lista { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.bs-acceso {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px; text-align: left;
  border: 0; border-radius: var(--r-sm); background: none; cursor: pointer; color: var(--texto);
}
.bs-acceso:hover, .bs-acceso:focus-visible { background: var(--cabecera-tabla); outline: none; }
.bs-acceso.activo { background: var(--acento-100); }
.bs-caja {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--divisor); border-radius: var(--r-sm); background: var(--fila-suave);
  box-shadow: 0 1px 2px rgba(18, 20, 24, .06);
}
.bs-acceso.activo .bs-caja { border-color: var(--acento-300); background: var(--panel); }
.ico-acceso { width: 19px; height: 19px; fill: none; stroke: var(--texto); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bs-acceso.activo .ico-acceso { stroke: var(--acento-700); }
.bs-txt { display: grid; gap: 1px; min-width: 0; }
.bs-titulo { font: 500 13px var(--cuerpo); }
.bs-desc { font: 400 11.5px/1.35 var(--cuerpo); color: var(--texto-3); }
.bs-cuenta { margin-left: auto; align-self: flex-start; font: 500 11px var(--mono); color: var(--texto-3); }

/* derecha: estado del correo/almacén y la cuenta */
.bs-derecha { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.bs-chips { display: flex; gap: 2px; }
.barra-superior .chip { width: auto; padding: 5px 9px; font-size: 11.5px; }
.barra-superior .usuario-actual { grid-template-columns: 28px auto 26px; gap: 8px; margin: 0; padding: 0 0 0 10px;
                                  border-bottom: 0; border-left: 1px solid var(--marco-borde); }
.barra-superior .avatar { width: 28px; height: 28px; }
.barra-superior .ua-txt { max-width: 160px; }
.barra-superior .ua-desplegable { top: calc(100% + 12px); bottom: auto; left: auto; right: 0; width: 220px; }

@media (max-width: 1180px) {
  .bs-marca span, .barra-superior .ua-txt { display: none; }
  .barra-superior .usuario-actual { grid-template-columns: 28px 26px; }
}
@media (prefers-reduced-motion: reduce) {
  body, .icono-menu, .icono-menu path, .bs-flecha { transition: none; }
  .bs-panel { animation: none; }
}

/* cuenta › opciones del menú */
.ua-rotulo { padding: 6px 10px 2px; font: 500 11px var(--cuerpo); color: var(--marco-texto-3); }
.ua-sep { height: 1px; margin: 4px 2px; background: var(--marco-borde); }
.ua-desplegable .ua-opcion { display: flex; align-items: center; gap: 8px; }
.ua-desplegable .ua-opcion::before { content: ""; width: 14px; flex: none; text-align: center; font-size: 12px; color: var(--acento-400); }
.ua-desplegable .ua-opcion[aria-checked="true"]::before { content: "✓"; }
.ua-desplegable .ua-opcion:disabled { color: var(--marco-texto-3); cursor: default; background: none; }

/* padrón: varios emails, uno por línea y sin partirlos por la mitad */
td.varios .varios-linea { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
