/* Puente Gotta → Monitorios.
   Cargado después de ops.css, portal.css y objetivos.css.
   Solo actúa con <html class="theme-gotta">. app.css no se modifica.
   Apagar: THEME_GOTTA=0 (el middleware quita el bloque) o borrar el include. */

html.theme-gotta {
  --tg-acento: #5980a6;
  --tg-oscuro: #1d2d3d;
  --tg-exito: #2f6d4f;
  --tg-texto: #1d1f20;
  --tg-borde: #d5d6d8;
  --tg-aviso: #8a5a12;
  --tg-alerta: #9c3b34;
  --verde: var(--tg-acento);
  --verde-osc: var(--tg-oscuro);
  --papel: #ffffff;
  --blanco: #ffffff;
  --bg: #ffffff;
  --tinta: var(--tg-texto);
  --linea: var(--tg-borde);
  --gris: #5c5e61;
  --ambar: var(--tg-aviso);
  --ambar-bg: #f7f1e4;
  --rojo: var(--tg-alerta);
  --rojo-bg: #f8eceb;
  --azul: var(--tg-oscuro);
  --azul-bg: #e8eef3;
  --verde-bg: #e7f0ea;
  --focus: var(--tg-acento);
  --radius: 0px;
  --morado: var(--tg-acento);
  --morado-800: var(--tg-oscuro);
  --morado-100: #e8eef3;
  --teal: var(--tg-exito);
  --campo: var(--tg-oscuro);
}

html.theme-gotta body {
  font-family: Barlow, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  background: #fff;
  color: var(--tinta);
  -webkit-font-smoothing: antialiased;
}

html.theme-gotta h1 {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  font-size: 26px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--tg-oscuro);
}

html.theme-gotta h3,
html.theme-gotta h4 {
  color: var(--tg-oscuro);
}

html.theme-gotta .wrap {
  max-width: 1480px;
  padding: 20px 28px 48px;
}

html.theme-gotta .top {
  background: #fff;
  color: var(--tg-texto);
  padding: 12px 20px;
  border-bottom: 1px solid var(--tg-borde);
}

html.theme-gotta .marca {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

html.theme-gotta .marca::before {
  content: "M";
  width: 38px;
  height: 38px;
  background: var(--tg-acento);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: Barlow, "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
}

html.theme-gotta .marca.marca-logo::before {
  content: none;
  display: none;
}

html.theme-gotta .marca .marca-img {
  width: auto;
  height: 34px;
  max-width: 180px;
  object-fit: contain;
  background: transparent;
}

html.theme-gotta #panelApariencia .brand-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--tg-borde);
  margin: 4px 0 12px;
}

html.theme-gotta #panelApariencia .brand-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #5c5e61;
  font-weight: 700;
  padding: 8px 14px;
  margin-bottom: -1px;
}

html.theme-gotta #panelApariencia .brand-tabs button.act {
  color: var(--tg-oscuro);
  border-bottom-color: var(--tg-acento);
}

html.theme-gotta #panelApariencia .brand-preview {
  display: block;
  max-width: 240px;
  max-height: 96px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--tg-borde);
  margin: 6px 0 8px;
}

html.theme-gotta #panelApariencia .brand-file {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

html.theme-gotta #panelApariencia .brand-colores {
  display: grid;
  gap: 8px;
  margin: 8px 0 14px;
}

html.theme-gotta #panelApariencia .brand-color-row {
  display: grid;
  grid-template-columns: 6.5rem 36px 28px minmax(6.5rem, 8.5rem);
  gap: 8px;
  align-items: center;
}

html.theme-gotta #panelApariencia .brand-color-row > span {
  font-weight: 700;
  color: var(--tg-oscuro);
}

html.theme-gotta #panelApariencia .brand-swatch {
  display: block;
  width: 28px;
  height: 28px;
  border: 1px solid var(--tg-borde);
  background: var(--tg-acento);
}

html.theme-gotta #panelApariencia input[type="color"] {
  width: 36px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--tg-borde);
  background: #fff;
  cursor: pointer;
}

html.theme-gotta #panelApariencia .brand-hex {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.02em;
}

html.theme-gotta #panelApariencia .brand-muestra {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

html.theme-gotta .rol-tag {
  border-radius: 0;
  background: #e8eef3;
  color: var(--tg-oscuro);
  border-color: #c5d0dc;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 11px;
}

html.theme-gotta .btn-logout {
  border-radius: 0;
  font-weight: 700;
  color: var(--tg-oscuro);
  border-color: var(--tg-borde);
}

html.theme-gotta .btn-logout:hover {
  background: #e8eef3;
  color: var(--tg-oscuro);
}

html.theme-gotta .nav {
  background: #fff;
  border-bottom: 1px solid var(--tg-borde);
  padding: 0 16px;
  gap: 0;
}

html.theme-gotta .nav > button,
html.theme-gotta .nav-ico {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #5c5e61;
  font-weight: 700;
  padding: 11px 16px;
  margin-bottom: -1px;
}

html.theme-gotta .nav > button:hover,
html.theme-gotta .nav-ico:hover {
  color: var(--tg-texto);
  background: #e8eef3;
}

html.theme-gotta .nav > button.act,
html.theme-gotta .nav-ico.act {
  color: var(--tg-oscuro);
  border-bottom-color: var(--tg-acento);
  background: transparent;
}

html.theme-gotta .sub {
  color: #5c5e61;
}

html.theme-gotta .kpis {
  gap: 12px;
  border: 0;
  background: transparent;
  margin-bottom: 18px;
}

html.theme-gotta .kpi {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  border: 1px solid var(--tg-borde);
  border-radius: 0;
  background: #fff;
  padding: 14px 16px;
}

html.theme-gotta .kpi .tg-ico {
  grid-row: 1 / span 2;
}

html.theme-gotta .kpi b,
html.theme-gotta .kpi > span:last-child {
  grid-column: 2;
}

html.theme-gotta .kpi .tg-ico {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #e8eef3;
  color: var(--tg-acento);
}

html.theme-gotta .kpi .tg-ico svg {
  width: 18px;
  height: 18px;
}

html.theme-gotta .kpi b {
  font-weight: 800;
  color: var(--tg-oscuro);
  letter-spacing: -0.02em;
}

html.theme-gotta .kpi span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c5e61;
}

html.theme-gotta .panel,
html.theme-gotta .tabla,
html.theme-gotta .estado-cabecera,
html.theme-gotta .dropzone,
html.theme-gotta dialog,
html.theme-gotta .nota,
html.theme-gotta .resultado-humano,
html.theme-gotta .cambiar-menu,
html.theme-gotta .menu-fila {
  border-radius: 0;
  box-shadow: none;
}

html.theme-gotta .tabla {
  border: 1px solid var(--tg-borde);
}

html.theme-gotta .cab {
  background: #fff;
  color: var(--tg-oscuro);
  border-bottom: 2px solid var(--tg-acento);
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.theme-gotta .fila {
  border-top: 1px solid var(--tg-borde);
}

html.theme-gotta .fila:hover {
  background: #e8eef3;
}

html.theme-gotta .btn-menu-fila {
  color: rgba(255, 255, 255, 0.75);
}

html.theme-gotta .fila .btn-menu-fila {
  color: #5c5e61;
}

html.theme-gotta .fila .btn-menu-fila:hover,
html.theme-gotta .fila .btn-menu-fila[aria-expanded="true"] {
  color: var(--tg-oscuro);
  background: transparent;
}

html.theme-gotta table.tabla-fac thead th {
  background: #fff;
  color: var(--tg-oscuro);
  border-bottom: 2px solid var(--tg-acento);
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.theme-gotta .chip {
  height: 24px;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-weight: 700;
}

html.theme-gotta .chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

html.theme-gotta .btn,
html.theme-gotta a.btn,
html.theme-gotta label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 0;
  font-weight: 700;
  font-size: 13px;
  color: var(--tg-acento);
  border-color: var(--tg-borde);
  box-shadow: none;
}

html.theme-gotta .btn-block {
  display: flex;
  width: 100%;
}

html.theme-gotta .btn:hover:not(.prim):not(.primario):not(.btn-peligro):not(:disabled) {
  background: #e8eef3;
  color: var(--tg-oscuro);
}

html.theme-gotta .btn.prim,
html.theme-gotta .btn.primario {
  background: var(--tg-acento);
  border-color: var(--tg-acento);
  color: #fff;
}

html.theme-gotta .btn.prim:hover,
html.theme-gotta .btn.primario:hover {
  background: var(--tg-oscuro);
  border-color: var(--tg-oscuro);
  color: #fff;
}

html.theme-gotta .btn-peligro {
  color: var(--tg-alerta);
  border-color: #e4c8c5;
}

html.theme-gotta .btn-peligro:hover {
  background: #f8eceb;
  color: var(--tg-alerta);
}

html.theme-gotta input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html.theme-gotta select,
html.theme-gotta textarea,
html.theme-gotta .ctrl {
  border-radius: 0;
  border-color: var(--tg-borde);
  background: #fff;
}

html.theme-gotta input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus,
html.theme-gotta select:focus,
html.theme-gotta textarea:focus {
  border-color: var(--tg-acento);
  box-shadow: 0 0 0 3px rgba(89, 128, 166, 0.18);
}

html.theme-gotta .tabs {
  gap: 0;
  border-bottom: 1px solid var(--tg-borde);
  margin-bottom: 14px;
}

html.theme-gotta .tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #5c5e61;
  font-weight: 700;
  margin-bottom: -1px;
}

html.theme-gotta .tabs button:hover {
  color: var(--tg-texto);
  background: #e8eef3;
}

html.theme-gotta .tabs button.act {
  background: transparent;
  color: var(--tg-oscuro);
  border-bottom-color: var(--tg-acento);
}

html.theme-gotta .bloque-campos h4 {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--tg-oscuro);
}

html.theme-gotta .badge-estado {
  border-radius: 0;
  background: #e8eef3;
  color: var(--tg-oscuro);
  border-color: var(--tg-borde);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

html.theme-gotta .stepper li.done {
  color: var(--tg-exito);
}

html.theme-gotta .stepper li.done .step-sep {
  background: #b7d0c4;
}

html.theme-gotta .stepper li.act,
html.theme-gotta .stepper li.view {
  color: var(--tg-acento);
}

html.theme-gotta .stepper li.view {
  outline-color: var(--tg-acento);
}

html.theme-gotta .resultado-humano .ok,
html.theme-gotta .asistente-checklist li.ok,
html.theme-gotta .plazo-countdown.ok {
  color: var(--tg-exito);
}

html.theme-gotta .dropzone {
  border-radius: 0;
  border-color: #c4c5c8;
  background: #fff;
}

html.theme-gotta .dropzone:hover,
html.theme-gotta .dropzone:focus,
html.theme-gotta .dropzone.drag {
  border-color: var(--tg-acento);
  background: #e8eef3;
}

html.theme-gotta a:not(.btn) {
  color: var(--tg-acento);
}

html.theme-gotta a:not(.btn):hover {
  color: var(--tg-oscuro);
}

html.theme-gotta .nota {
  border-radius: 0;
  background: #f7f1e4;
  color: var(--tg-aviso);
  border: 1px solid #ead9b0;
}

/* Login / registro / changelog base (el login branded usa body.wl-body). */
html.theme-gotta body.login-body:not(.wl-body) {
  background: #fff;
  font-family: Barlow, "Segoe UI", sans-serif;
}

html.theme-gotta body.login-body:not(.wl-body) .login-card {
  border-radius: 0;
  border: 1px solid var(--tg-borde);
  box-shadow: none;
}

html.theme-gotta body.login-body:not(.wl-body) .login-brand {
  font-family: "Barlow Condensed", Barlow, sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tg-oscuro);
}

html.theme-gotta body.login-body:not(.wl-body) h1 {
  font-size: 28px;
}

html.theme-gotta .wrap,
html.theme-gotta .panel,
html.theme-gotta .pantalla,
html.theme-gotta .estado-cabecera,
html.theme-gotta .admin-masonry {
  background: #fff;
}

html.theme-gotta .pantalla > h1,
html.theme-gotta .detalle-head h1,
html.theme-gotta .bloque-campos h4,
html.theme-gotta .panel > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

html.theme-gotta .tg-ico {
  display: inline-flex;
  flex: none;
  color: var(--tg-acento);
}

html.theme-gotta .tg-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}

html.theme-gotta h1 > .tg-ico svg {
  width: 22px;
  height: 22px;
}

html.theme-gotta .tg-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
}

html.theme-gotta .pasos-asistente {
  align-items: flex-start;
  padding: 8px 2px 16px;
  overflow-x: auto;
}

html.theme-gotta .pasos-asistente li,
html.theme-gotta .pasos-asistente li:last-child {
  position: relative;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 96px;
  text-align: center;
}

html.theme-gotta .pasos-asistente li .step-hit,
html.theme-gotta .pasos-asistente li > span:first-child {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font: inherit;
  text-align: center;
}

html.theme-gotta .pasos-asistente .step-check {
  display: none;
}

html.theme-gotta .pasos-asistente li.act .step-label,
html.theme-gotta .pasos-asistente li.view .step-label,
html.theme-gotta .pasos-asistente li.done .step-label,
html.theme-gotta .pasos-asistente .step-label {
  background: transparent !important;
  color: var(--tg-texto) !important;
  border-radius: 0 !important;
  padding: 0 !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

html.theme-gotta .pasos-asistente li.future .step-label,
html.theme-gotta .pasos-asistente li.locked .step-label {
  color: #7a7c80 !important;
  font-weight: 600;
}

html.theme-gotta .pasos-asistente li.view,
html.theme-gotta .pasos-asistente li.act {
  outline: none;
  background: transparent;
}

html.theme-gotta .pasos-asistente .step-fecha {
  color: #5c5e61;
  font-size: 11px;
}

html.theme-gotta .pasos-asistente .tg-step-ico {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid #c4c5c8;
  background: #fff;
  color: #7a7c80;
  position: relative;
  z-index: 1;
}

html.theme-gotta .pasos-asistente .tg-step-ico svg {
  width: 22px;
  height: 22px;
}

html.theme-gotta .pasos-asistente li.done .tg-step-ico {
  background: var(--tg-exito);
  border-color: var(--tg-exito);
  color: #fff;
}

html.theme-gotta .pasos-asistente li.done .tg-step-ico::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff url("/static/theme_gotta/icons/check.svg") center / 11px no-repeat;
  box-shadow: 0 0 0 1.5px var(--tg-exito);
}

html.theme-gotta .pasos-asistente li.act .tg-step-ico,
html.theme-gotta .pasos-asistente li.view:not(.done) .tg-step-ico {
  background: var(--tg-acento);
  border-color: var(--tg-acento);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(89, 128, 166, 0.28);
}

html.theme-gotta .pasos-asistente li.view.done .tg-step-ico {
  box-shadow: 0 0 0 4px rgba(47, 109, 79, 0.28);
}

html.theme-gotta .pasos-asistente li.future .tg-step-ico {
  background: #fff;
  border-color: #c4c5c8;
  color: #7a7c80;
}

html.theme-gotta .pasos-asistente li.locked .tg-step-ico {
  background: #f8eceb;
  border-color: var(--tg-alerta);
  color: var(--tg-alerta);
}

html.theme-gotta .pasos-asistente li .step-sep {
  position: absolute;
  top: 22px;
  left: calc(50% + 26px);
  width: calc(100% - 52px);
  height: 2px;
  margin: 0;
  flex: none;
  background: var(--tg-borde);
  z-index: 0;
}

html.theme-gotta .pasos-asistente li.done .step-sep {
  background: var(--tg-exito);
}

@media (max-width: 800px) {
  html.theme-gotta .pasos-asistente li {
    flex: 0 0 88px;
    min-width: 88px;
  }

  html.theme-gotta .pasos-asistente .tg-step-ico {
    width: 40px;
    height: 40px;
  }

  html.theme-gotta .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* La página real (app.js) deja el gris de --papel y el stepper de texto.
   Estas reglas van al final y pisan ese aspecto, con o sin icons.json. */
html.theme-gotta,
html.theme-gotta body,
html.theme-gotta .wrap,
html.theme-gotta .pantalla,
html.theme-gotta .pantalla.act,
html.theme-gotta .detalle-head,
html.theme-gotta .tabs,
html.theme-gotta .tabact,
html.theme-gotta .admin-masonry,
html.theme-gotta .estado-bar,
html.theme-gotta .toolbar {
  background-color: #fff !important;
}

html.theme-gotta .top,
html.theme-gotta .nav,
html.theme-gotta .cab,
html.theme-gotta .tabla,
html.theme-gotta table.tabla-fac thead th {
  background-color: #fff !important;
  color: var(--tg-oscuro);
}

html.theme-gotta .cab,
html.theme-gotta .fila {
  grid-template-columns: minmax(88px, 1.1fr) minmax(120px, 1.35fr) minmax(88px, 0.9fr) minmax(64px, 0.7fr) minmax(120px, 1.45fr) 208px 2.2rem;
}

html.theme-gotta #navMain > button > svg,
html.theme-gotta #navMain .nav-ico > svg {
  display: none;
}

html.theme-gotta #navMain > button::before,
html.theme-gotta #navMain .nav-ico::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--nav-mask) center / 18px 18px no-repeat;
  mask: var(--nav-mask) center / 18px 18px no-repeat;
}

html.theme-gotta #navMain [data-nav="nuevo"] { --nav-mask: url("/static/theme_gotta/icons/file-plus.svg"); }
/* La pestaña queda fuera de la navegación. El botón sigue en el DOM para que
   #tgNuevoExp pueda pulsarlo. Sin esta hoja (THEME_GOTTA=0) la pestaña vuelve. */
html.theme-gotta #navMain > button[data-nav="nuevo"] {
  display: none;
}
html.theme-gotta #navMain [data-nav="panel"] { --nav-mask: url("/static/theme_gotta/icons/folders.svg"); }
html.theme-gotta #navMain [data-nav="clientes"] { --nav-mask: url("/static/theme_gotta/icons/users.svg"); }
html.theme-gotta #navMain [data-nav="alertas"] { --nav-mask: url("/static/theme_gotta/icons/bell.svg"); }
html.theme-gotta #navMain [data-nav="admin"] { --nav-mask: url("/static/theme_gotta/icons/settings.svg"); }

html.theme-gotta #kpis .kpi::before {
  content: "";
  width: 36px;
  height: 36px;
  grid-row: 1 / span 2;
  grid-column: 1;
  align-self: center;
  background-color: var(--tg-acento);
  -webkit-mask: var(--kpi-mask) center / 18px 18px no-repeat;
  mask: var(--kpi-mask) center / 18px 18px no-repeat;
}

html.theme-gotta #kpis .kpi:nth-child(1) { --kpi-mask: url("/static/theme_gotta/icons/layout-list.svg"); }
html.theme-gotta #kpis .kpi:nth-child(2) { --kpi-mask: url("/static/theme_gotta/icons/heart-handshake.svg"); }
html.theme-gotta #kpis .kpi:nth-child(3) { --kpi-mask: url("/static/theme_gotta/icons/scale.svg"); }
html.theme-gotta #kpis .kpi:nth-child(4) { --kpi-mask: url("/static/theme_gotta/icons/certificate.svg"); }
html.theme-gotta #kpis .kpi:nth-child(5) { --kpi-mask: url("/static/theme_gotta/icons/alert-circle.svg"); }
html.theme-gotta #kpis .kpi:nth-child(6),
html.theme-gotta #kpis .tg-kpi-col .kpi { --kpi-mask: url("/static/theme_gotta/icons/bell.svg"); }

html.theme-gotta #tablaExp .fila > span:nth-child(6) {
  width: 208px;
  min-width: 208px;
  justify-content: stretch;
}

html.theme-gotta #tablaExp .chip {
  box-sizing: border-box;
  display: inline-flex;
  width: 208px;
  min-width: 208px;
  max-width: 208px;
  height: 28px;
  padding: 0 8px;
  justify-content: center;
  text-align: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

html.theme-gotta #tablaExp .chip::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: none;
  border-radius: 0;
  background-color: currentColor;
  -webkit-mask: var(--chip-mask, url("/static/theme_gotta/icons/point-filled.svg")) center / 14px 14px no-repeat;
  mask: var(--chip-mask, url("/static/theme_gotta/icons/point-filled.svg")) center / 14px 14px no-repeat;
}

html.theme-gotta #tablaExp .chip.NUEVO_CASO,
html.theme-gotta #tablaExp .chip.entrada { --chip-mask: url("/static/theme_gotta/icons/inbox.svg"); }
html.theme-gotta #tablaExp .chip.PENDIENTE_CUESTIONES_PREVIAS,
html.theme-gotta #tablaExp .chip.REVISION_ESTADO_EXCEL,
html.theme-gotta #tablaExp .chip.EJECUCION_PARALIZADA { --chip-mask: url("/static/theme_gotta/icons/alert-circle.svg"); }
html.theme-gotta #tablaExp .chip.MAS_REDACTADO,
html.theme-gotta #tablaExp .chip.MAS_ENVIADO,
html.theme-gotta #tablaExp .chip.MAS_RECIBIDO,
html.theme-gotta #tablaExp .chip.MAS_NO_ENTREGADO,
html.theme-gotta #tablaExp .chip.previa { --chip-mask: url("/static/theme_gotta/icons/heart-handshake.svg"); }
html.theme-gotta #tablaExp .chip.DEMANDA_EN_PREPARACION,
html.theme-gotta #tablaExp .chip.DEMANDA_FIRMADA,
html.theme-gotta #tablaExp .chip.montaje { --chip-mask: url("/static/theme_gotta/icons/file-text.svg"); }
html.theme-gotta #tablaExp .chip.PRESENTADA,
html.theme-gotta #tablaExp .chip.presentacion { --chip-mask: url("/static/theme_gotta/icons/send.svg"); }
html.theme-gotta #tablaExp .chip.REQUERIMIENTO,
html.theme-gotta #tablaExp .chip.ADMITIDA,
html.theme-gotta #tablaExp .chip.OPOSICION,
html.theme-gotta #tablaExp .chip.IMPUGNACION,
html.theme-gotta #tablaExp .chip.SENTENCIA_DECRETO,
html.theme-gotta #tablaExp .chip.seguimiento { --chip-mask: url("/static/theme_gotta/icons/scale.svg"); }
html.theme-gotta #tablaExp .chip.EJECUCION { --chip-mask: url("/static/theme_gotta/icons/gavel.svg"); }
html.theme-gotta #tablaExp .chip.PAGADO_O_ACUERDO,
html.theme-gotta #tablaExp .chip.FACTURA_ABONO,
html.theme-gotta #tablaExp .chip.ACUERDO_HOMOLOGADO,
html.theme-gotta #tablaExp .chip.COBRADO_FINALIZADO,
html.theme-gotta #tablaExp .chip.ARCHIVADO,
html.theme-gotta #tablaExp .chip.cierre { --chip-mask: url("/static/theme_gotta/icons/certificate.svg"); }

html.theme-gotta #stepperPasos {
  align-items: flex-start;
  overflow-x: auto;
  padding: 8px 2px 12px;
}

html.theme-gotta #stepperPasos li,
html.theme-gotta #stepperPasos li:last-child {
  position: relative;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  min-width: 96px;
  text-align: center;
}

html.theme-gotta #stepperPasos li > .step-hit,
html.theme-gotta #stepperPasos li > span:not(.step-sep) {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 52px 4px 0;
  border: 0;
  background: transparent !important;
  color: var(--tg-texto);
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

html.theme-gotta #stepperPasos li.future > span:not(.step-sep),
html.theme-gotta #stepperPasos li.locked > span:not(.step-sep) {
  cursor: default;
}

html.theme-gotta #stepperPasos .step-check,
html.theme-gotta #stepperPasos .tg-step-ico {
  display: none !important;
}

html.theme-gotta #stepperPasos .step-label {
  background: transparent !important;
  color: var(--tg-texto) !important;
  border-radius: 0 !important;
  padding: 0 !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

html.theme-gotta #stepperPasos li.future .step-label,
html.theme-gotta #stepperPasos li.locked .step-label {
  color: #7a7c80 !important;
  font-weight: 600;
}

html.theme-gotta #stepperPasos li > .step-hit::before,
html.theme-gotta #stepperPasos li > span:not(.step-sep)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 46px;
  height: 46px;
  margin-left: -23px;
  border-radius: 50%;
  border: 2px solid var(--tg-borde);
  background: #fff;
  box-sizing: border-box;
  z-index: 1;
}

html.theme-gotta #stepperPasos li > .step-hit::after,
html.theme-gotta #stepperPasos li > span:not(.step-sep)::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  background-color: #7a7c80;
  -webkit-mask: var(--step-mask) center / 22px 22px no-repeat;
  mask: var(--step-mask) center / 22px 22px no-repeat;
  z-index: 2;
  pointer-events: none;
}

html.theme-gotta #stepperPasos li[title="Documentación"] { --step-mask: url("/static/theme_gotta/icons/folder.svg"); }
html.theme-gotta #stepperPasos li[title="Ficha y facturas"] { --step-mask: url("/static/theme_gotta/icons/id.svg"); }
html.theme-gotta #stepperPasos li[title="MASC"] { --step-mask: url("/static/theme_gotta/icons/heart-handshake.svg"); }
html.theme-gotta #stepperPasos li[title="Plazo / CCN"] { --step-mask: url("/static/theme_gotta/icons/clock.svg"); }
html.theme-gotta #stepperPasos li[title="Demanda"] { --step-mask: url("/static/theme_gotta/icons/file-text.svg"); }
html.theme-gotta #stepperPasos li[title="Presentación"] { --step-mask: url("/static/theme_gotta/icons/send.svg"); }
html.theme-gotta #stepperPasos li[title="Procedimiento"] { --step-mask: url("/static/theme_gotta/icons/scale.svg"); }

html.theme-gotta #stepperPasos li.done > .step-hit::before,
html.theme-gotta #stepperPasos li.done > span:not(.step-sep)::before,
html.theme-gotta #stepperPasos li.view.done > .step-hit::before {
  background: var(--tg-exito);
  border-color: var(--tg-exito);
}

html.theme-gotta #stepperPasos li.done > .step-hit::after,
html.theme-gotta #stepperPasos li.done > span:not(.step-sep)::after,
html.theme-gotta #stepperPasos li.view.done > .step-hit::after {
  background-color: #fff;
}

html.theme-gotta #stepperPasos li.done::after {
  content: "";
  position: absolute;
  top: 30px;
  left: calc(50% + 10px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff url("/static/theme_gotta/icons/check.svg") center / 11px no-repeat;
  box-shadow: 0 0 0 1.5px var(--tg-exito);
  z-index: 3;
  pointer-events: none;
}

html.theme-gotta #stepperPasos li.act > .step-hit::before,
html.theme-gotta #stepperPasos li.view:not(.done) > .step-hit::before,
html.theme-gotta #stepperPasos li.act > span:not(.step-sep)::before,
html.theme-gotta #stepperPasos li.view:not(.done) > span:not(.step-sep)::before {
  background: var(--tg-acento);
  border-color: var(--tg-acento);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tg-acento) 28%, transparent);
}

html.theme-gotta #stepperPasos li.act > .step-hit::after,
html.theme-gotta #stepperPasos li.view:not(.done) > .step-hit::after,
html.theme-gotta #stepperPasos li.act > span:not(.step-sep)::after,
html.theme-gotta #stepperPasos li.view:not(.done) > span:not(.step-sep)::after {
  background-color: #fff;
}

html.theme-gotta #stepperPasos li.locked > .step-hit::before,
html.theme-gotta #stepperPasos li.locked > span:not(.step-sep)::before {
  background: #f8eceb;
  border-color: var(--tg-alerta);
}

html.theme-gotta #stepperPasos li.locked {
  --step-mask: url("/static/theme_gotta/icons/alert-circle.svg");
}

html.theme-gotta #stepperPasos li.locked > .step-hit::after,
html.theme-gotta #stepperPasos li.locked > span:not(.step-sep)::after {
  background-color: var(--tg-alerta);
}

html.theme-gotta #stepperPasos li .step-sep {
  position: absolute;
  top: 22px;
  left: calc(50% + 26px);
  width: calc(100% - 52px);
  height: 2px;
  margin: 0;
  flex: none;
  background: var(--tg-borde);
  z-index: 0;
}

html.theme-gotta #stepperPasos li.done .step-sep {
  background: var(--tg-exito);
}

html.theme-gotta #stepperPasos .step-fecha {
  color: #5c5e61;
  font-size: 11px;
  font-weight: 500;
}

html.theme-gotta .btn,
html.theme-gotta a.btn,
html.theme-gotta label.btn,
html.theme-gotta .tabs > button {
  --btn-ink: var(--tg-oscuro);
  background: #fff !important;
  color: var(--btn-ink) !important;
  border-color: var(--btn-ink) !important;
  box-shadow: none;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

html.theme-gotta .btn.prim,
html.theme-gotta .btn.primario,
html.theme-gotta .tabs > button {
  --btn-ink: var(--tg-acento);
}

html.theme-gotta .btn-peligro,
html.theme-gotta .menu-fila-item.peligro {
  --btn-ink: var(--tg-alerta);
}

html.theme-gotta .btn-exito {
  --btn-ink: var(--tg-exito);
}

html.theme-gotta .btn:hover:not(:disabled):not(.busy):not([aria-disabled="true"]),
html.theme-gotta a.btn:hover:not(.busy):not([aria-disabled="true"]),
html.theme-gotta label.btn:hover:not(.busy):not([aria-disabled="true"]),
html.theme-gotta .tabs > button:hover,
html.theme-gotta .btn:focus-visible:not(:disabled):not(.busy):not([aria-disabled="true"]),
html.theme-gotta a.btn:focus-visible:not(.busy):not([aria-disabled="true"]),
html.theme-gotta label.btn:focus-visible:not(.busy):not([aria-disabled="true"]),
html.theme-gotta .tabs > button:focus-visible,
html.theme-gotta .btn.act:not(:disabled):not(.prim):not(.primario),
html.theme-gotta .btn[aria-pressed="true"]:not(:disabled),
html.theme-gotta .tabs > button.act {
  background: var(--btn-ink) !important;
  background-color: var(--btn-ink) !important;
  border-color: var(--btn-ink) !important;
  color: #fff !important;
}

html.theme-gotta .btn:disabled,
html.theme-gotta .btn.busy,
html.theme-gotta .btn[aria-disabled="true"],
html.theme-gotta .btn:disabled:hover,
html.theme-gotta .btn.busy:hover,
html.theme-gotta .btn:disabled:focus-visible,
html.theme-gotta .btn.busy:focus-visible {
  background: #fff !important;
  background-color: #fff !important;
  color: var(--btn-ink) !important;
  border-color: var(--btn-ink) !important;
  cursor: not-allowed;
}

html.theme-gotta button.linkish,
html.theme-gotta button.linkish:hover,
html.theme-gotta button.linkish:focus-visible {
  background: transparent;
  border-color: transparent;
  color: var(--tg-acento);
  box-shadow: none;
}

/* Clientes: listado arriba y ficha solo al abrirla. THEME_GOTTA=0 no carga estas reglas. */
html.theme-gotta #view-clientes.pantalla.act {
  display: flex;
  flex-direction: column;
}

html.theme-gotta #view-clientes > h1 { order: 1; }
html.theme-gotta #view-clientes > .sub { order: 2; }
html.theme-gotta #view-clientes > .tg-cli-buscar { order: 3; }
html.theme-gotta #view-clientes > #listaClientes { order: 4; }
html.theme-gotta #view-clientes > #formCliente { order: 5; }

html.theme-gotta #view-clientes > #formCliente:not(.tg-cli-abierta) {
  display: none !important;
}

html.theme-gotta #formCliente.tg-cli-abierta {
  margin-top: 16px;
}

html.theme-gotta .tg-cli-buscar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 4px 0 12px;
}

html.theme-gotta .tg-cli-buscar label {
  flex: 1 1 280px;
  position: relative;
  margin: 0;
}

html.theme-gotta .tg-cli-buscar input {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px 6px 34px;
  border: 1px solid var(--tg-borde);
  border-radius: 0;
  background: #fff;
  color: var(--tg-texto);
  font: inherit;
}

html.theme-gotta .tg-cli-buscar input:focus {
  outline: 2px solid var(--tg-acento);
  outline-offset: 1px;
  border-color: var(--tg-acento);
}

html.theme-gotta .tg-cli-lupa {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  background: var(--tg-oscuro);
  -webkit-mask: url("/static/theme_gotta/icons/search.svg") center / 16px 16px no-repeat;
  mask: url("/static/theme_gotta/icons/search.svg") center / 16px 16px no-repeat;
  pointer-events: none;
}

html.theme-gotta .tg-cli-vacio {
  flex: 1 0 100%;
  margin: 0;
}

html.theme-gotta #listaClientes .fila-cliente.tg-cli-fuera {
  display: none !important;
}

html.theme-gotta #listaClientes .fila-cliente[data-cid]:hover {
  background: color-mix(in srgb, var(--tg-acento) 8%, #fff);
}

html.theme-gotta #listaClientes .fila-cliente.tg-cli-activa {
  background: color-mix(in srgb, var(--tg-acento) 14%, #fff);
  box-shadow: inset 3px 0 0 var(--tg-acento);
}

/* Botón de alta encima del KPI Alertas. THEME_GOTTA=0 no aplica este bloque. */
html.theme-gotta #kpis {
  align-items: end;
}

html.theme-gotta #kpis .tg-kpi-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

html.theme-gotta #tgNuevoExp {
  width: 100%;
  padding-left: 8px;
  padding-right: 8px;
  white-space: nowrap;
}

html.theme-gotta .tg-nuevo-bar {
  margin: 0 0 14px;
}
