/* Identidad visual Blueorange — Hub Service
   Gradiente púrpura → coral. Tipografía Montserrat (self-hosted, sin CDN). */

/* Montserrat self-hosted (variable 100–900, subsets latin + latin-ext). No usa
   fonts.googleapis.com: no bloquea el render ni se cae a system-ui si la red
   externa está bloqueada. font-display:swap pinta ya con la fuente de respaldo. */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/montserrat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bo-purple: #7B2F8A;
  --bo-coral: #E5314A;
  /* Coral más oscuro para texto chico (AA): el #E5314A se reserva a títulos
     grandes, bordes y el gradiente. */
  --bo-coral-text: #c81e38;
  --bo-gradient: linear-gradient(135deg, var(--bo-purple) 0%, #B5325F 50%, var(--bo-coral) 100%);
  --bo-ink: #2b2b33;
  --bo-muted: #63626d;
  --bo-bg: #f5f4f7;
  --bo-card: #ffffff;
  --bo-border: #e7e5ec;
  --bo-radius: 14px;
  --bo-shadow: 0 6px 24px rgba(123, 47, 138, 0.10);
  /* Stack monoespaciado (lo referencian .bo-mono y textareas de código). */
  --bo-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  color: var(--bo-ink);
  background: var(--bo-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, .bo-brand__mark {
  font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

/* Foco visible global por teclado: faltaba en botones, links, nav, paginador,
   burger y dropdowns (solo los inputs lo tenían). WCAG 2.4.7. */
:focus-visible { outline: 2px solid var(--bo-purple); outline-offset: 2px; border-radius: 3px; }
/* Sobre el header con gradiente, el contorno púrpura no contrasta: va blanco. */
.bo-header :focus-visible { outline-color: #fff; }

/* ---------- Header ---------- */
.bo-header {
  background: var(--bo-gradient);
  color: #fff;
}
.bo-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.bo-brand { text-decoration: none; color: #fff; display: flex; flex-direction: column; }
.bo-brand__mark { font-size: 1.5rem; letter-spacing: .3px; }
.bo-brand__mark span { opacity: .9; }
/* Subtítulo de marca: vive sobre el gradiente (extremo coral). Sacamos la opacidad
   baja y sumamos sombra para que rinda contraste AA sobre el coral #E5314A. */
.bo-brand__sub { font-size: .78rem; letter-spacing: 1.5px; text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,.25); }

.bo-nav { display: flex; align-items: center; gap: 18px; }
/* Links de nav sobre el coral del gradiente: sin opacidad (empeoraba el contraste),
   peso 600 y una sombra sutil para superar el 4.5:1 sobre #E5314A (WCAG AA). */
.bo-nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.bo-nav a:hover { text-decoration: underline; }

/* Sección activa del menú. El botón de acción (.bo-nav__btn) se excluye: no es
   indicador de sección y el borde/padding del subrayado le descentraba el texto. */
.bo-nav > a:not(.bo-nav__btn),
.bo-dropdown:not(.bo-dropdown--user) > summary {
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.bo-nav > a[aria-current="page"]:not(.bo-nav__btn),
.bo-dropdown:not(.bo-dropdown--user).is-active > summary {
  opacity: 1;
  border-bottom-color: rgba(255, 255, 255, 0.85);
}
.bo-dropdown--user.is-active .bo-user-trigger { background: rgba(255, 255, 255, 0.32); }
.bo-dropdown__menu a[aria-current="page"] { background: rgba(123, 47, 138, 0.10); color: var(--bo-purple); }
.bo-nav__btn {
  background: rgba(255, 255, 255, 0.18);
  padding: 8px 16px;
  border-radius: 999px;
}
.bo-nav__btn:hover { background: rgba(255, 255, 255, 0.3); }

/* Botón hamburguesa: oculto en desktop, visible en mobile. */
.bo-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
}
.bo-burger:hover { background: rgba(255, 255, 255, 0.3); }
.bo-burger span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: #fff;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

/* ---------- Dropdown de Administración ---------- */
.bo-dropdown { position: relative; }
.bo-dropdown > summary {
  list-style: none;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  /* Mismo criterio de contraste que .bo-nav a: sin opacidad y con sombra sutil
     para rendir sobre el coral del gradiente. */
  text-shadow: 0 1px 2px rgba(0,0,0,.25);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  user-select: none;
}
.bo-dropdown > summary::-webkit-details-marker { display: none; }
.bo-dropdown > summary:hover { text-decoration: underline; }
/* Caret (chevron) que rota al abrir. */
.bo-dropdown > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .15s ease;
}
.bo-dropdown[open] > summary::after { transform: translateY(1px) rotate(-135deg); }

.bo-dropdown__menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  min-width: 210px;
  background: var(--bo-card);
  border: 1px solid var(--bo-border);
  border-radius: 12px;
  box-shadow: var(--bo-shadow);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}
.bo-dropdown__menu a {
  color: var(--bo-ink);
  opacity: 1;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 500;
  white-space: nowrap;
}
.bo-dropdown__menu a:hover { background: rgba(123, 47, 138, 0.08); color: var(--bo-purple); }

/* Menú de cuenta del usuario (ícono de persona). */
.bo-user-trigger {
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
/* Sin avatar (ícono SVG de fallback): círculo translúcido de tamaño fijo. */
.bo-user-trigger:not(:has(.bo-avatar)) {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, 0.18);
}
.bo-user-trigger:not(:has(.bo-avatar)):hover { background: rgba(255, 255, 255, 0.3); }
/* Con foto/iniciales el avatar ES el botón (círculo fijo de 38px, sin estirarse). */
.bo-user-trigger .bo-avatar { width: 38px; height: 38px; flex: none; font-size: .85rem; }
.bo-user-trigger:hover .bo-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6); }
/* El ícono no lleva caret. */
.bo-dropdown--user > summary::after { display: none; }
.bo-dropdown--user > summary { gap: 0; }
/* En desktop el trigger es solo el ícono; el email se ve dentro del menú. */
.bo-user-trigger__email { display: none; }

.bo-account {
  padding: 4px 12px 12px;
  border-bottom: 1px solid var(--bo-border);
  margin-bottom: 4px;
}
.bo-account__label {
  display: block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--bo-muted);
  margin-bottom: 2px;
}
.bo-account__email { display: block; font-size: .9rem; color: var(--bo-ink); white-space: nowrap; }
.bo-account__role {
  display: inline-block; margin-top: 6px;
  font-size: .72rem; font-weight: 700;
  color: var(--bo-purple); background: #f0ecf6;
  padding: 2px 9px; border-radius: 999px;
}

/* ---------- Main ---------- */
.bo-main {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

.bo-hero { text-align: center; margin-bottom: 28px; }
.bo-hero h1 {
  font-size: 2rem;
  margin: 0 0 8px;
  background: var(--bo-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bo-hero p { color: var(--bo-muted); margin: 0 auto 22px; max-width: 560px; }
/* Antes alineaba el hero a la izquierda; ahora todos los h1 quedan centrados
   como el de la consulta. Se conserva la clase por compatibilidad. */

/* ---------- Buscador CUIT ---------- */
.bo-search {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto;
}
.bo-search input {
  flex: 1;
  padding: 14px 18px;
  font-size: 1rem;
  border: 1px solid var(--bo-border);
  border-radius: 999px;
  outline: none;
  font-family: inherit;
}
.bo-search input:focus { border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
/* El select del toolbar comparte el pill del input y suma la flecha de la casa. */
.bo-search select {
  padding: 14px 40px 14px 18px;
  font-size: 1rem;
  border: 1px solid var(--bo-border);
  border-radius: 999px;
  outline: none;
  font-family: inherit;
  cursor: pointer;
  color: var(--bo-ink);
  background-color: #fff;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237B2F8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}
.bo-search select:focus { border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
.bo-search button {
  border: none;
  cursor: pointer;
  padding: 0 26px;
  border-radius: 999px;
  background: var(--bo-gradient);
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  font-size: 1rem;
}
.bo-search button:hover { filter: brightness(1.05); }

.bo-search--inline { margin: 0 0 20px; max-width: 480px; }
/* Dentro de un section-head (flex centrado), el filtro no lleva margen propio:
   si no, queda desalineado respecto de los botones de acción de la derecha. */
.bo-section-head .bo-search--inline { margin: 0; }

/* ---------- Jurisdicciones disponibles (consulta) ---------- */
.bo-available { max-width: 640px; margin: 0 auto 28px; text-align: center; }
.bo-available .bo-muted { margin: 0 0 12px; }
.bo-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bo-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: rgba(123, 47, 138, 0.07);
  color: var(--bo-purple);
  border: 1px solid var(--bo-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .88rem;
  font-weight: 600;
}
.bo-chip small { color: var(--bo-muted); font-weight: 400; font-size: .72rem; }

/* ---------- Paginador ---------- */
.bo-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--bo-border);
}
.bo-pager__info { color: var(--bo-muted); font-size: .9rem; }
.bo-pager__btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--bo-purple);
  color: var(--bo-purple);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
}
.bo-pager__btn:hover { background: rgba(123, 47, 138, 0.08); }
/* Antes #b9b6c2 (~2:1, ilegible). Se oscurece a #8b8894: sigue leyéndose como
   disabled pero es visible. */
.bo-pager__btn--disabled { color: #8b8894; border-color: var(--bo-border); cursor: default; }
.bo-pager__btn--disabled:hover { background: transparent; }

/* ---------- Cards ---------- */
.bo-card {
  background: var(--bo-card);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-shadow);
  padding: 24px;
}
.bo-card h2 { margin-top: 0; color: var(--bo-purple); }
.bo-card--narrow { max-width: 420px; margin: 0 auto; }
.bo-card--province { display: flex; flex-direction: column; }
.bo-card--province h2 { font-size: 1.15rem; }
.bo-card--province .bo-form { flex: 1; }
/* Empuja las acciones al fondo para alinearlas entre cards de distinta altura. */
.bo-card--province .bo-actions { margin-top: auto; }

.bo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ---------- Estado del padrón cargado ---------- */
.bo-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .85rem;
  color: var(--bo-ink);
  background: rgba(123, 47, 138, 0.05);
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 6px;
}
.bo-status strong { color: var(--bo-purple); font-weight: 700; }
.bo-status__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #1d7a45;
  margin-top: 4px;
  flex-shrink: 0;
}
.bo-status__count { display: block; color: var(--bo-muted); margin-top: 2px; }
.bo-status--empty { color: var(--bo-muted); background: transparent; }
.bo-status--empty .bo-status__dot { background: #c9c6d1; }

/* ---------- Tabla ---------- */
.bo-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bo-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.bo-table th, .bo-table td { padding: 12px 11px; text-align: left; border-bottom: 1px solid var(--bo-border); }
/* Las celdas pueden cortar línea (un email o nombre largo no debe ensanchar toda la tabla);
   encabezados, fechas y números quedan compactos. */
.bo-table th { white-space: nowrap; }
/* break-word (not anywhere): cells wrap at spaces/hyphens only, emails and tool names stay whole. */
.bo-table td { overflow-wrap: break-word; }
.bo-table td.bo-nowrap, .bo-table td.bo-num { white-space: nowrap; }
.bo-table thead th {
  background: rgba(123, 47, 138, 0.06);
  color: var(--bo-purple);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.bo-table tbody tr:hover { background: rgba(229, 49, 74, 0.04); }
.bo-num { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Lista editable (filas desplegables a todo el ancho) ---------- */
.bo-editlist { display: flex; flex-direction: column; margin-top: 8px; }
.bo-editrow { border-top: 1px solid var(--bo-border); }
.bo-editrow:last-child { border-bottom: 1px solid var(--bo-border); }
.bo-editrow > summary {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 6px; cursor: pointer; list-style: none;
}
.bo-editrow > summary::-webkit-details-marker { display: none; }
.bo-editrow > summary:hover { background: rgba(123, 47, 138, 0.04); }
.bo-editrow > summary::after {
  content: ""; flex: none; margin-left: 4px;
  width: 7px; height: 7px;
  border-right: 2px solid var(--bo-muted); border-bottom: 2px solid var(--bo-muted);
  transform: translateY(-2px) rotate(45deg); transition: transform .15s ease;
}
.bo-editrow[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.bo-editrow__main { min-width: 0; flex: 1; }
.bo-editrow__title { font-weight: 600; color: var(--bo-ink); overflow-wrap: anywhere; }
.bo-editrow__meta { font-size: .82rem; color: var(--bo-muted); margin-top: 2px; overflow-wrap: anywhere; }
/* Detalle del error de sync: texto que ajusta (no rompe el layout como sí lo haría
   dentro del badge, que es nowrap). Vive en la columna de contenido. */
.bo-sync-error {
  display: block; margin-top: 4px;
  font-size: .8rem; color: var(--bo-coral-text);
  overflow-wrap: anywhere; white-space: normal;
}
/* Misma caja, tono neutro: para un aviso que no es una falla (p. ej. un clon sin
   índice todavía, que igual se resuelve en la primera consulta). */
.bo-sync-note { display: block; margin-top: 4px; font-size: .8rem; color: var(--bo-muted); }

/* Log en vivo de una sincronización (salida de git, línea a línea). */
.bo-synclog { margin-top: 16px; border-top: 1px solid var(--bo-border); padding-top: 14px; }
.bo-synclog__head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: .85rem; margin-bottom: 8px;
}
.bo-synclog__body {
  margin: 0; max-height: 260px; overflow: auto;
  background: var(--bo-bg); border: 1px solid var(--bo-border);
  border-radius: 8px; padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem; line-height: 1.5; color: var(--bo-ink);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.bo-editrow__aside { flex: none; margin-left: auto; display: flex; align-items: center; gap: 12px; }
.bo-editrow__static { display: flex; align-items: center; gap: 14px; padding: 14px 6px; }
.bo-editrow__body { padding: 2px 6px 20px; }
.bo-editrow__body .bo-form { margin-top: 4px; }
.bo-editrow__danger {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--bo-border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.bo-editrow__danger p { font-size: .85rem; color: var(--bo-muted); margin: 0; }
.bo-repo-add { margin-top: 20px; border-top: 1px solid var(--bo-border); padding-top: 18px; }

/* ---------- Formularios ---------- */
.bo-form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.bo-form label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 500; }
.bo-form input,
.bo-form select,
.bo-form textarea {
  padding: 11px 14px;
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: .95rem;
  background-color: #fff;
  color: var(--bo-ink);
  width: 100%;
}
.bo-form input:focus,
.bo-form select:focus,
.bo-form textarea:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }

/* Textarea: redimensionable en vertical y, con .bo-mono, monospace para claves/PEM. */
.bo-form textarea { resize: vertical; min-height: 132px; line-height: 1.5; }

/* Input compacto para acciones inline en filas de tabla (p.ej. el commit
   Enterprise opcional del rebuild de bo-odoo): fuera de un .bo-form no hereda el
   estilo de arriba, así que replicamos borde/foco en versión chica. */
.bo-input-sm {
  padding: 7px 10px;
  border: 1px solid var(--bo-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .85rem;
  background-color: #fff;
  color: var(--bo-ink);
  width: 13em;
}
.bo-input-sm:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }

/* Campos de recursos: número con sufijo de unidad (workers/MiB/GiB). */
.bo-resgrid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
@media (max-width: 560px) { .bo-resgrid { grid-template-columns: 1fr; } }
.bo-resfield { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--bo-ink); }
.bo-resfield .unitwrap { position: relative; display: block; }
.bo-resfield input {
  width: 100%; padding: 11px 46px 11px 12px;
  border: 1px solid var(--bo-border); border-radius: 10px;
  font-family: inherit; font-size: .95rem; font-variant-numeric: tabular-nums;
  background-color: #fff; color: var(--bo-ink);
}
/* Sin flechas nativas del number: liberan ancho y el sufijo de unidad ya orienta. */
.bo-resfield input::-webkit-outer-spin-button,
.bo-resfield input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bo-resfield input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.bo-resfield input:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
.bo-resfield .unit {
  position: absolute; right: 1px; top: 1px; bottom: 1px;
  display: flex; align-items: center; padding: 0 9px;
  background: #f4eef6; color: var(--bo-purple); font-size: .72rem; font-weight: 700;
  border-radius: 0 9px 9px 0; pointer-events: none;
}
.bo-form textarea.bo-mono { font-family: var(--bo-mono, ui-monospace, "SFMono-Regular", Menlo, monospace); font-size: .82rem; }

/* Auto-sleep: toggle y campo de minutos en una sola línea. */
/* Auto-sleep como una frase en una línea: «[✓] Dormir por inactividad tras
   [30] min». Los selectores llevan `.bo-sleep-row` para GANARLE en especificidad
   a `.bo-form label` (0,1,1), que si no apila cada label en columna (el checkbox
   sobre su texto y el nº sobre su input). Apila solo en pantallas muy chicas. */
.bo-sleep-row { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.bo-sleep-row .bo-sleep-toggle {
  flex-direction: row; align-items: center; gap: 8px;
  font-size: .9rem; font-weight: 600; color: var(--bo-ink);
  cursor: pointer; white-space: nowrap;
}
.bo-sleep-row .bo-sleep-toggle input {
  width: 16px; height: 16px; accent-color: var(--bo-purple); margin: 0; flex: none;
}
.bo-sleep-row .bo-sleep-mins { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bo-sleep-row .bo-sleep-mins input { width: 66px; padding: 8px 10px; text-align: center; font-size: .9rem; }
.bo-sleep-unit { color: var(--bo-muted); font-size: .85rem; font-weight: 600; }

/* Caption de un grupo de opciones dentro de un formulario (sobre .bo-seed-opts). */
.bo-form .bo-field-cap { font-size: .9rem; font-weight: 600; color: var(--bo-ink); margin-bottom: -4px; }

/* Select con apariencia propia (saca el estilo nativo y agrega una flecha). */
.bo-form select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237B2F8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}

/* Input de archivo: el campo queda como los demás y el botón interno toma el
   estilo Blueorange (secundario, para no competir con el botón Procesar). */
.bo-form input[type="file"] {
  padding: 8px 12px;
  color: var(--bo-muted);
  font-size: .9rem;
  cursor: pointer;
}
.bo-form input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--bo-purple);
  border-radius: 8px;
  background: rgba(123, 47, 138, 0.06);
  color: var(--bo-purple);
  font-family: inherit;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
}
.bo-form input[type="file"]::file-selector-button:hover {
  background: rgba(123, 47, 138, 0.12);
}
/* Prefijo para Safari/Chrome antiguos (regla aparte: no se puede agrupar). */
.bo-form input[type="file"]::-webkit-file-upload-button {
  margin-right: 12px;
  padding: 8px 14px;
  border: 1px solid var(--bo-purple);
  border-radius: 8px;
  background: rgba(123, 47, 138, 0.06);
  color: var(--bo-purple);
  font-family: inherit;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
}

.bo-btn {
  border: none;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-family: inherit;
  font-size: .95rem;
  /* inline-flex centrado: todas las variantes (primary/outline/…) comparten la
     misma caja y quedan alineadas verticalmente entre sí en una fila. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Los botones no parten su texto en dos líneas (mantiene la altura pareja). */
/* text-decoration:none: los botones-enlace (<a class="bo-btn">) no deben subrayarse. */
.bo-btn { white-space: nowrap; line-height: 1.2; text-decoration: none; }
.bo-btn:hover { text-decoration: none; }
.bo-btn--primary { background: var(--bo-gradient); color: #fff; }
.bo-btn--primary:hover { filter: brightness(1.05); }
/* Estado "enviando": el botón queda deshabilitado mientras procesa. */
.bo-btn[disabled], .bo-search button[disabled] { opacity: .65; cursor: progress; filter: none; }
.bo-btn--outline {
  background: transparent;
  color: var(--bo-purple);
  border: 1px solid var(--bo-purple);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.bo-btn--outline:hover { background: rgba(123, 47, 138, 0.08); }

/* Fila de acciones (botones lado a lado, se adaptan al ancho). */
.bo-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.bo-actions .bo-btn { flex: 0 0 auto; text-align: center; justify-content: center; }

.bo-auth { display: flex; justify-content: center; padding-top: 24px; }
.bo-auth-sep { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--bo-muted); font-size: .82rem; }
.bo-auth-sep::before, .bo-auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--bo-border); }
.bo-muted { color: var(--bo-muted); font-size: .9rem; }

/* Botón "Ingresar con Google" y separador del login. */
.bo-btn--google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; background: #fff; color: var(--bo-ink);
  border: 1px solid var(--bo-border); font-weight: 600;
}
.bo-btn--google:hover { background: #f7f5fa; border-color: #d8d4e0; }
.bo-auth__divider {
  display: flex; align-items: center; text-align: center;
  color: var(--bo-muted); font-size: .8rem; margin: 18px 0; gap: 10px;
}
.bo-auth__divider::before, .bo-auth__divider::after {
  content: ""; flex: 1; height: 1px; background: var(--bo-border);
}

/* ---------- Alertas ---------- */
.bo-alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: .95rem; }
.bo-alert--error { background: #fdecef; color: #b3243b; border: 1px solid #f5c3cd; }
.bo-alert--success { background: #e9f7ee; color: #1d7a45; border: 1px solid #bfe6cd; }
.bo-alert--info { background: #f0ecf6; color: #5b3a78; border: 1px solid #d9cde8; }

/* ---------- Documentación API ---------- */
.bo-doc h3 { color: var(--bo-ink); margin: 26px 0 8px; font-size: 1.05rem; }
.bo-doc p { color: var(--bo-ink); }
.bo-doc ul { color: var(--bo-ink); margin: 8px 0; padding-left: 20px; }
.bo-doc li { margin: 4px 0; }
.bo-doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: rgba(123, 47, 138, 0.07);
  color: var(--bo-purple);
  padding: 2px 6px;
  border-radius: 6px;
}
.bo-endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.bo-endpoint code { font-size: 1rem; background: transparent; color: var(--bo-ink); padding: 0; }
.bo-method {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .5px;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
}
.bo-method--get { background: #1d7a45; }
.bo-method--post { background: var(--bo-purple); }
.bo-code {
  background: #2b2b33;
  color: #f5f4f7;
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: .88rem;
  line-height: 1.5;
}
.bo-code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

/* ---------- Footer ---------- */
.bo-footer {
  text-align: center;
  padding: 22px 24px;
  color: var(--bo-muted);
  font-size: .82rem;
}

/* Solo visible en modo tarjeta (mobile); en desktop, oculto (default). */
.show-in-cards { display: none; }

/* ---------- Responsive / mobile ---------- */
@media (max-width: 760px) {
  .bo-header__inner { padding: 14px 18px; gap: 10px; }
  /* Solo la marca + botón de menú; la navegación se despliega al tocarlo. */
  .bo-burger { display: flex; margin-left: auto; }
  .bo-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-top: 8px;
  }
  .bo-header.is-menu-open .bo-nav { display: flex; }
  .bo-nav > a { padding: 8px 4px; }

  /* Animación del ícono a una "X" cuando el menú está abierto. */
  .bo-header.is-menu-open .bo-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .bo-header.is-menu-open .bo-burger span:nth-child(2) { opacity: 0; }
  .bo-header.is-menu-open .bo-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Dropdowns: se expanden inline (no flotante) para no desbordar. */
  .bo-dropdown { width: 100%; }
  .bo-dropdown > summary { padding: 8px 4px; justify-content: space-between; }
  .bo-dropdown__menu {
    position: static;
    width: 100%;
    min-width: 0;
    margin: 4px 0 6px 12px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.10);
    border: none;
    box-shadow: none;
  }
  .bo-dropdown__menu a { color: #fff; }
  .bo-dropdown__menu a:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
  .bo-dropdown__menu a[aria-current="page"] { background: rgba(255, 255, 255, 0.22); color: #fff; }

  /* Menú de usuario: el trigger se muestra como fila con ícono + email. */
  .bo-dropdown--user > summary {
    width: 100%;
    height: auto;
    border-radius: 10px;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }
  .bo-user-trigger__email { display: inline; font-size: .85rem; word-break: break-all; }
  /* El email ya aparece en el trigger; evitamos repetirlo en el menú. */
  .bo-dropdown--user .bo-account { display: none; }

  .bo-main { padding: 22px 16px; }
  .bo-hero h1 { font-size: 1.6rem; }

  .bo-card { padding: 18px; }
  /* Tablas genéricas: mínimo legible + scroll horizontal dentro de su wrap. */
  .bo-table { min-width: 460px; }
  .bo-table th, .bo-table td { padding: 10px 12px; }

  /* Listados operables en mobile: cada fila es una tarjeta apilada. Opt-in con
     .bo-cards; cada td muestra su etiqueta desde data-label. */
  .bo-cards { min-width: 0; width: 100%; }
  .bo-cards thead { display: none; }
  .bo-cards, .bo-cards tbody, .bo-cards tr, .bo-cards td { display: block; width: auto; }
  .bo-cards tr {
    border: 1px solid var(--bo-border); border-radius: 12px;
    padding: 6px 6px; margin-bottom: 12px; background: #fff;
  }
  .bo-cards td {
    display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap;
    padding: 8px 12px; border: none; white-space: normal; min-width: 0;
    overflow: visible; text-overflow: clip; text-align: left;
  }
  .bo-cards td > * { min-width: 0; max-width: 100%; }
  .bo-cards .repo-url { white-space: normal; word-break: break-all; }
  .bo-cards tr td + td { border-top: 1px solid var(--bo-border); }
  .bo-cards td::before {
    content: attr(data-label); flex: 0 0 40%;
    font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
    color: var(--bo-muted); font-weight: 700;
  }
  /* Celdas sin etiqueta (acciones): contenido a la derecha; los botones envuelven. */
  .bo-cards td[data-label=""]::before { content: none; }
  .bo-cards td[data-label=""] { justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
  /* El valor ocupa el resto y se alinea a la derecha para lectura rápida. */
  .bo-cards td > * { margin-left: auto; }
  .bo-cards td::before { margin-left: 0; }
  /* Título de la tarjeta (ej. nombre del repo): full-width, sin etiqueta. */
  .bo-cards td.card-title { display: block; padding-bottom: 4px; }
  .bo-cards td.card-title::before { content: none; }
  .bo-cards td.card-title > * { margin-left: 0; }
  /* Inputs/controles a lo ancho de la parte de valor. */
  .bo-cards td input[type="text"], .bo-cards td select, .bo-cards td textarea { width: 100%; }

  /* Variante "grilla": los campos de datos se reparten en columnas (etiqueta
     arriba, valor abajo) y las acciones ocupan todo el ancho en partes iguales. */
  .bo-cards--grid tr { display: flex; flex-wrap: wrap; align-items: stretch; }
  /* Base 30% para que ~3 columnas llenen la fila y las acciones bajen a la suya. */
  .bo-cards--grid td {
    flex: 1 1 30%; min-width: 0; flex-direction: column; align-items: flex-start;
    gap: 3px; border-top: none; justify-content: flex-start;
  }
  .bo-cards--grid td::before { flex: none; }
  .bo-cards--grid td > * { margin-left: 0; max-width: 100%; }
  .bo-cards--grid td.card-title, .bo-cards--grid td.grid-full { flex: 1 1 100%; }
  /* URLs/valores monoespaciados largos deben cortar en cualquier punto para no
     desbordar la tarjeta en pantallas angostas. */
  .bo-cards td.bo-mono, .bo-cards td .bo-mono { white-space: normal; word-break: break-all; }
  /* Acciones: ocupan el ancho; varias celdas de acción comparten la misma fila y
     reparten el espacio en partes iguales. Las vacías se ocultan. */
  .bo-cards--grid td[data-label=""] {
    flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--bo-border);
  }
  .bo-cards--grid td[data-label=""]:empty { display: none; }
  .bo-cards--grid td[data-label=""] > * { flex: 1 1 0; margin-left: 0; }
  .bo-cards--grid td[data-label=""] .bo-btn { width: 100%; }
  /* Variante 4 columnas de datos. */
  .bo-cards--cols4.bo-cards--grid td:not(.card-title):not([data-label=""]) { flex-basis: 22%; }
  /* Celdas/elementos que solo aplican en modo tarjeta (mobile). */
  .bo-cards td.hide-in-cards { display: none !important; }
  .show-in-cards { display: inline; }

  .bo-pager { flex-wrap: wrap; justify-content: center; }
  .bo-pager__info { order: -1; width: 100%; text-align: center; }
}

@media (max-width: 560px) {
  .bo-search { flex-direction: column; }
  .bo-search input, .bo-search select, .bo-search button, .bo-search .bo-btn { width: 100%; }
  .bo-search button { padding: 12px; }
  .bo-search--inline { margin-bottom: 16px; }

  /* Botones de acción apilados a lo ancho. */
  .bo-actions { flex-direction: column; }
  .bo-actions .bo-btn { width: 100%; }

  .bo-brand__mark { font-size: 1.3rem; }
}

/* =========================================================================
   Componentes propios de Hub Service
   ========================================================================= */

/* ---------- Métricas del panel ---------- */
.bo-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.bo-stat {
  background: var(--bo-card);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-shadow);
  padding: 18px 20px;
}
.bo-stat__num {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 2.1rem;
  line-height: 1;
  background: var(--bo-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bo-stat__label {
  display: block;
  margin-top: 6px;
  color: var(--bo-muted);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* ---------- Badges de estado ---------- */
.bo-badge {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}
.bo-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
/* Cada estado usa una familia de color DISTINTA (fondo claro + texto oscuro del
   mismo tono), con contraste AA. Ningún par comparte fondo+texto, así se
   distinguen sin depender solo del matiz. */
.bo-badge--queued       { background: #f0ecf6; color: #5b3a78; } /* espera: lila/púrpura */
.bo-badge--sleeping     { background: #e6eefb; color: #2f4b8a; } /* reposo: azul/celeste */
.bo-badge--provisioning { background: #fff3e0; color: #8a4a12; } /* trabajando: ámbar/naranja */
.bo-badge--building     { background: #fbf3cf; color: #6f5b00; } /* construyendo: dorado cálido */
.bo-badge--running      { background: #e9f7ee; color: #1d7a45; } /* verde */
.bo-badge--success      { background: #e9f7ee; color: #1d7a45; } /* verde (mismo que running) */
.bo-badge--stopped      { background: #eceaf0; color: #57555f; } /* gris neutro */
.bo-badge--aborted      { background: #efe9e6; color: #63504a; } /* topo: gris cálido */
.bo-badge--destroyed    { background: #e2e0e6; color: #4a4852; } /* gris apagado/oscuro */
.bo-badge--failed       { background: #fdecef; color: #b3243b; } /* rojo */

/* Pulso para los estados "en progreso". */
.bo-badge--provisioning::before,
.bo-badge--building::before { animation: bo-pulse 1.2s ease-in-out infinite; }
@keyframes bo-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Pills de etapa ---------- */
/* Avatar de actor (grillas): foto redonda o iniciales de color. El email/nombre
   completo va en el title (hover). */
.bo-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; flex: none; vertical-align: middle;
  overflow: hidden;
}
.bo-avatar--img { object-fit: cover; }
.bo-avatar--initials {
  color: #fff; font-size: .68rem; font-weight: 700; line-height: 1;
  letter-spacing: .02em; text-transform: uppercase;
}
/* Avatar + etiqueta (p. ej. la lista de Usuarios, donde el email es el dato). */
.bo-actor { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.bo-actor__label { overflow: hidden; text-overflow: ellipsis; }
/* Avatar clickeable (Usuarios, admin): al pasar el mouse se marca que se puede
   cambiar la foto. El input file va oculto adentro del label. */
.bo-avatar-upload { cursor: pointer; display: inline-flex; border-radius: 50%; }
.bo-avatar-upload:hover .bo-avatar { box-shadow: 0 0 0 2px var(--bo-purple); opacity: .85; }
/* Botón chico "quitar foto" (✕), discreto. */
.bo-iconbtn {
  border: none; background: none; cursor: pointer; color: var(--bo-muted);
  font-size: 1rem; line-height: 1; padding: 2px 4px; border-radius: 6px;
}
.bo-iconbtn:hover { color: var(--bo-coral-text); background: #fdf2f4; }

/* Edición inline (nombre / rama en el detalle del repo): el valor se muestra como
   texto con un lápiz discreto; al tocarlo aparece el input con Guardar/Cancelar. */
.bo-inline-edit__view { display: inline-flex; align-items: center; gap: 8px; }
.bo-inline-edit__form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* El atributo hidden debe ganarle a los display de arriba (más específicos). */
.bo-inline-edit__view[hidden], .bo-inline-edit__form[hidden] { display: none; }
.bo-inline-edit__pencil { color: var(--bo-muted); line-height: 0; }
.bo-inline-edit__pencil:hover { color: var(--bo-purple); background: rgba(123, 47, 138, 0.08); }
.bo-inline-edit__pencil svg { display: block; }
.bo-inline-edit__pencil[disabled] { opacity: .45; cursor: default; }
.bo-inline-edit__pencil[disabled]:hover { color: var(--bo-muted); background: none; }

/* Campo de solo lectura con el texto embebido y un botón de copiar arriba a la
   derecha (p. ej. la URL del webhook). */
.bo-copyfield {
  position: relative;
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  background: #f7f6fa;
  padding: 11px 44px 11px 13px;
  max-width: 100%;
}
.bo-copyfield__text {
  display: block;
  font-family: var(--bo-mono);
  font-size: .82rem;
  color: var(--bo-ink);
  word-break: break-all;
  line-height: 1.5;
}
.bo-copyfield__btn {
  position: absolute; top: 7px; right: 7px;
  border: none; background: #fff; cursor: pointer;
  color: var(--bo-muted); padding: 6px; border-radius: 7px; line-height: 0;
  border: 1px solid var(--bo-border);
}
.bo-copyfield__btn:hover { color: var(--bo-purple); border-color: var(--bo-purple); }
.bo-copyfield__btn svg { display: block; }

/* Avatar grande (Mi cuenta) + acciones de foto. */
.bo-avatar--lg { width: 72px; height: 72px; font-size: 1.6rem; }
.bo-avatar-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bo-avatar-edit__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.bo-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 600;
  border: 1px solid var(--bo-border);
  color: var(--bo-purple);
  background: rgba(123, 47, 138, 0.06);
}

.bo-pill--muted {
  color: var(--bo-muted);
  background: rgba(107, 114, 128, 0.08);
}

/* Build en curso (ámbar, con puntito latiendo) y build fallido (rojo). */
.bo-pill--busy {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}
.bo-pill--busy::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: 6px;
  border-radius: 999px;
  background: #d97706;
  vertical-align: middle;
  animation: bo-pulse 1s ease-in-out infinite;
}
@keyframes bo-pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.bo-pill--error {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.10);
  border-color: rgba(220, 38, 38, 0.35);
}

/* ---------- Lista de definición (detalle) ---------- */
.bo-dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  margin: 0;
}
.bo-dl dt { color: var(--bo-muted); font-size: .85rem; }
.bo-dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.bo-dl dd a { color: var(--bo-purple); }
@media (max-width: 560px) { .bo-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .bo-dl dd { margin-bottom: 8px; } }

/* ---------- Header de sección con acción ---------- */
.bo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.bo-section-head h2 { margin: 0; color: var(--bo-purple); }
.bo-status-title { display: flex; align-items: center; gap: 12px; }

/* Barra de botones de acción: ancho natural, misma altura, sin estirarse. */
.bo-btn-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bo-btn-row form { margin: 0; }
/* En una sola fila: si no entran en pantallas chicas, scrollea en horizontal
   dentro de la card en vez de desbordar el viewport. */
.bo-btn-row--nowrap { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bo-btn--sm { padding: 6px 11px; font-size: .78rem; }
/* Grupos de acciones (detalle de instancia): apila filas rotuladas por tipo.
   margin-bottom separa la barra del bloque de datos (URL pública) que sigue. */
.bo-btn-groups { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.bo-btn-group-label {
  flex: 0 0 100%;
  margin: 0 0 -2px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
/* Zona destructiva: línea divisoria centrada en el MISMO espacio que separa los
   demás grupos (el margin-top negativo cancela medio gap, así no queda más aire
   que entre Acceso y Ciclo de vida). */
.bo-btn-group--sensitive {
  margin-top: -8px;
  padding-top: 8px;
  border-top: 1px dashed var(--bo-border);
}

/* Opciones de siembra (neutralizar / filestore) en el alta clon/restore. */
.bo-seed-opts {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: rgba(123, 47, 138, 0.05);
  border: 1px solid var(--bo-border);
  border-radius: 10px;
}
/* Mayor especificidad que `.bo-form label` (que apilaría en columna): cada
   opción queda como una fila tilde + texto, alineada a la izquierda. */
.bo-seed-opts label.bo-logtoggle {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
}
.bo-seed-opts label.bo-logtoggle:hover { background: rgba(123, 47, 138, 0.07); }
.bo-seed-opts input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--bo-purple);
  cursor: pointer;
}
.bo-btn-row .bo-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Botón de acción destructiva (outline coral). */
.bo-btn--danger-outline {
  background: transparent;
  border: 1px solid var(--bo-coral);
  color: var(--bo-coral-text);
}
.bo-btn--danger-outline:hover { background: rgba(229, 49, 74, 0.08); }

/* ---------- Toolbar de filtros ---------- */
.bo-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}
.bo-toolbar input, .bo-toolbar select {
  padding: 10px 14px;
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: .9rem;
  background-color: #fff;
}
.bo-toolbar select {
  padding-right: 36px;
  appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237B2F8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
}
.bo-toolbar select:focus, .bo-toolbar input:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
.bo-toolbar input { flex: 1; min-width: 180px; }

/* ---------- Log de build (terminal) ---------- */
.bo-log {
  background: #1e1e26;
  color: #e8e6ef;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}

/* ---------- Card como link (grilla de proyectos/instancias) ---------- */
.bo-card--link { text-decoration: none; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.bo-card--link:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(123, 47, 138, 0.16); }
.bo-card__meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.bo-card__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bo-card__title h2, .bo-card__title h3 { margin: 0; }

/* Slug/código monoespaciado inline. */
.bo-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em;
  background: rgba(123, 47, 138, 0.07);
  color: var(--bo-purple);
  padding: 1px 6px;
  border-radius: 5px;
}

/* Estado vacío. */
.bo-empty { text-align: center; padding: 36px 20px; color: var(--bo-muted); }
.bo-empty p { margin: 0 0 16px; }

/* ---------- Web shell (terminal) ---------- */
.bo-term-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.bo-term-toolbar .bo-btn { padding: 8px 14px; font-size: .85rem; }
.bo-term {
  height: 60vh;
  min-height: 360px;
  background: #1e1e26;
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-shadow);
  padding: 10px;
  overflow: hidden;
}
.bo-term .xterm,
.bo-term .xterm-viewport { height: 100% !important; }

/* ---------- Monitor (Grafana embebido) ---------- */
.bo-monitor-frame {
  width: 100%;
  height: 78vh;
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-shadow);
  background: #fff;
}
/* La barra de scroll del viewport vive dentro del contenedor redondeado. */
.bo-term .xterm-viewport { border-radius: var(--bo-radius); }

/* ---------- Visor de logs ---------- */
/* Páginas que aprovechan más ancho de pantalla. */
.bo-main--wide { max-width: 1600px; }

.bo-log-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.bo-log-title {
  margin: 0;
  font-size: 1.7rem;
  background: var(--bo-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Barra de controles: tarjeta con tres grupos (fuente+niveles / búsqueda / acciones). */
.bo-logbar {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  background: var(--bo-card);
  border: 1px solid var(--bo-border);
  border-radius: 12px;
  box-shadow: var(--bo-shadow);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.bo-logbar__group { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo-logbar__actions { margin-left: auto; }
.bo-logbar .bo-btn { padding: 8px 14px; font-size: .85rem; }

.bo-logselect {
  padding: 9px 34px 9px 14px;
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 600;
  color: var(--bo-ink);
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237B2F8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* Chips de nivel: el checkbox queda oculto, el label es la pastilla. */
.bo-logchips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.bo-logchip {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--bo-border);
  font-size: .8rem;
  /* Estado NO seleccionado: peso normal, texto atenuado y sin subrayado. El
     estado activo se distingue por algo más que el color (WCAG 1.4.1). */
  font-weight: 500;
  color: var(--bo-muted);
  background: #fff;
  cursor: pointer;
  user-select: none;
  transition: background .12s, color .12s, border-color .12s;
}
.bo-logchip input { position: absolute; opacity: 0; width: 0; height: 0; }
/* Indicador no-cromático del chip activo: negrita + subrayado + borde más marcado,
   para que se note cuál está seleccionado sin depender del color. */
.bo-logchip:has(input:checked) { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.bo-logchip.lvl-debug:has(input:checked)   { background: #eceaf0; color: #5b3a78; border-color: #b9a8cc; }
.bo-logchip.lvl-info:has(input:checked)    { background: rgba(123,47,138,.10); color: var(--bo-purple); border-color: rgba(123,47,138,.45); }
.bo-logchip.lvl-warning:has(input:checked) { background: #fff3e0; color: #8a4a12; border-color: #e0b676; }
.bo-logchip.lvl-error:has(input:checked)   { background: #fdecef; color: var(--bo-coral-text); border-color: #eaa6b3; }
.bo-logchip:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(123,47,138,.15); }

/* Buscador de filtro (crece para ocupar el ancho). */
.bo-logsearch { position: relative; flex: 1; min-width: 220px; display: flex; }
.bo-logsearch input {
  width: 100%;
  padding: 9px 34px 9px 14px;
  border: 1px solid var(--bo-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: .88rem;
  background: #fff;
}
.bo-logsearch input:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
.bo-logsearch__x {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px;
  border: none; background: transparent;
  color: var(--bo-muted);
  font-size: 1.2rem; line-height: 1;
  cursor: pointer; border-radius: 50%;
}
.bo-logsearch__x:hover { background: rgba(123,47,138,.08); color: var(--bo-purple); }

.bo-logtoggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .85rem; font-weight: 600; cursor: pointer; user-select: none;
}
.bo-logtoggle input { accent-color: var(--bo-purple); width: 16px; height: 16px; }

.bo-status-line { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bo-conn { font-size: .82rem; font-weight: 700; color: var(--bo-muted); }
.bo-conn--live { color: #1d7a45; }
.bo-conn--off { color: var(--bo-coral-text); }

.bo-log-viewer {
  height: 72vh;
  min-height: 420px;
  overflow: auto;
  background: #11131a;
  color: #d6d3e0;
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  padding: 10px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 760px) {
  .bo-logbar__actions { margin-left: 0; }
  .bo-logbar__group, .bo-logbar__actions { width: 100%; }
}
.logline { white-space: pre-wrap; word-break: break-word; border-left: 3px solid transparent; padding-left: 8px; }
.logline.lvl-info { border-left-color: transparent; }
.logline.lvl-debug { color: #8b88a0; }
.logline.lvl-warning { color: #f0b86e; border-left-color: #b5651d; }
.logline.lvl-error { color: #ff8089; border-left-color: var(--bo-coral); }
.logline .logsrc {
  display: inline-block;
  min-width: 42px;
  margin-right: 8px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(123, 47, 138, 0.35);
  color: #e8e6ef;
}
.logline.src-db .logsrc { background: rgba(29, 122, 69, 0.4); }

/* ---------- Zona de riesgo / acciones destructivas ---------- */
.bo-card.bo-danger { border-color: #f5c3cd; }
.bo-card.bo-danger h2 { color: var(--bo-coral); margin-top: 0; }
.bo-card.bo-danger details { margin-top: 8px; }
.bo-btn--danger { background: var(--bo-coral); color: #fff; }
.bo-btn--danger:hover { filter: brightness(1.05); }
.bo-btn--danger[disabled] { opacity: .5; cursor: not-allowed; filter: none; }

/* =========================================================================
   Utilidades — reemplazan estilos inline repetidos en los templates
   ========================================================================= */
/* Separación vertical estándar entre cards apiladas (antes: style="margin-bottom:22px"). */
.bo-card--stacked { margin-bottom: 22px; }
/* Acento lateral izquierdo con el gradiente de marca (igual que las tarjetas de
   capacity). El overflow recorta la barra a las esquinas redondeadas de la card. */
.bo-card--accent { position: relative; overflow: hidden; }
.bo-card--accent::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--bo-gradient);
}
/* Link en color de marca dentro de tablas/celdas (antes inline purple+600). */
.bo-link { color: var(--bo-purple); font-weight: 600; text-decoration: none; }
.bo-link:hover { text-decoration: underline; }
/* Variante sólida del pill (estado "con permiso" de claves SSH, etc.). */
.bo-pill--solid { background: var(--bo-purple); color: #fff; border-color: var(--bo-purple); }
/* Micro-utilidades de alineación. */
.bo-tr { text-align: right; }
.bo-tc { text-align: center; }
.bo-nowrap { white-space: nowrap; }
/* Input que crece en una fila flex y cae a 100% en mobile (confirmaciones). */
.bo-input--grow { flex: 1; min-width: 220px; max-width: 100%; }
/* Disparador de <summary> con apariencia de título púrpura (cards desplegables). */
.bo-disclosure { cursor: pointer; font-weight: 700; color: var(--bo-purple); }
.bo-disclosure--sm { font-weight: 600; }
.bo-disclosure--danger { color: var(--bo-coral-text); }
/* Asterisco de campo obligatorio (los templates lo usan como
   <span class="bo-req" aria-hidden="true">*</span> junto al label). */
/* Campos obligatorios sin completar: fondo y borde rojo MUY claro, hasta que se
   llenan (en vez de un asterisco). :invalid cubre el estado vacío; :not(:focus)
   deja ver el foco púrpura normal mientras se escribe y vuelve al rojo si se
   sale sin completar. */
.bo-form input:required:invalid:not(:focus),
.bo-form select:required:invalid:not(:focus),
.bo-form textarea:required:invalid:not(:focus) {
  background-color: #fdf2f4;
  border-color: #eeacb8;
}

/* Respeto de prefers-reduced-motion: corta el pulso de los badges en progreso,
   las transiciones de hover y la rotación del caret para usuarios sensibles. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Texto de un label + su tooltip en una sola fila (el label es flex-column,
   así que sin esto el "?" caería a una línea aparte). */
.bo-label-inline { display: inline-flex; align-items: center; }

/* Tooltip de ayuda (?) para campos de formulario. Es un <details>: se abre con
   clic y queda fijo, así el popover es interactivo (se puede seleccionar/copiar
   el código). Se cierra con otro clic en el "?". */
.bo-tip { position: relative; display: inline-block; margin-left: 6px; vertical-align: middle; }
.bo-tip > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: #7B2F8A; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
  user-select: none;
}
.bo-tip > summary::-webkit-details-marker { display: none; }
.bo-tip[open] > summary { outline: 2px solid rgba(123, 47, 138, .35); outline-offset: 2px; }
.bo-tip__pop {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 40;
  width: 360px; max-width: 78vw; padding: 12px 14px;
  background: #fff; color: #333; border: 1px solid #e6dcec; border-radius: 10px;
  box-shadow: 0 10px 28px rgba(45, 20, 55, .16);
  font-size: .82rem; font-weight: 400; line-height: 1.45; text-align: left;
}
.bo-tip__pop strong { display: block; margin-bottom: 6px; color: #7B2F8A; }
.bo-tip__pop p { margin: 6px 0; }
.bo-tip__pop pre {
  margin: 8px 0 0; padding: 8px 10px; background: #f5f2f7;
  border-radius: 6px; overflow-x: auto; white-space: pre; font-size: .74rem;
}
.bo-tip__pop code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.bo-tip__pop .bo-btn { margin-top: 10px; }

/* ---------- Ficha de usuario: encabezado + filas de ajustes ----------
   Cada ajuste es una fila de dos columnas (etiqueta | control) separada por una línea
   fina. Los botones mantienen su ancho natural; solo el campo de contraseña y los
   controles segmentados definen su propio ancho. */
.bo-profile { display: flex; align-items: center; gap: 20px; margin: 0 0 22px; }
.bo-profile .bo-avatar--lg { flex: none; }
.bo-profile__body { min-width: 0; }
.bo-profile__name { margin: 0; font-size: 1.8rem; line-height: 1.1; color: var(--bo-ink); overflow-wrap: anywhere; }
.bo-profile__email { margin: 4px 0 0; color: var(--bo-muted); overflow-wrap: anywhere; }
.bo-profile__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.bo-profile__last { color: var(--bo-muted); font-size: .85rem; margin-left: 4px; }

.bo-settings { padding: 0 28px; margin-bottom: 18px; }
.bo-setting {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  gap: 12px 40px;
  padding: 24px 0;
  border-top: 1px solid var(--bo-border);
}
.bo-setting:first-child { border-top: 0; }
.bo-setting__label { margin: 0; font-size: 1rem; color: var(--bo-ink); }
.bo-setting__hint { margin: 4px 0 0; color: var(--bo-muted); font-size: .85rem; line-height: 1.5; }
.bo-setting__control { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; min-width: 0; }
.bo-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; width: 100%; }

/* Control segmentado: una sola pieza, la opción activa se rellena. */
.bo-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--bo-purple); border-radius: 10px; overflow: hidden; }
.bo-seg__opt {
  border: 0; background: transparent; color: var(--bo-purple);
  font: inherit; font-weight: 600; font-size: .92rem; padding: 10px 18px; cursor: pointer;
}
.bo-seg__opt + .bo-seg__opt { border-left: 1px solid rgba(123, 47, 138, .35); }
.bo-seg__opt:hover:not(.is-active) { background: rgba(123, 47, 138, .08); }
.bo-seg__opt:focus-visible { outline: 2px solid var(--bo-purple); outline-offset: -3px; }
.bo-seg__opt.is-active { background: var(--bo-gradient); color: #fff; cursor: default; }
.bo-seg__opt--danger { color: #b3243b; }
.bo-seg__opt--danger:hover:not(.is-active) { background: rgba(179, 36, 59, .08); }
.bo-seg__opt--danger.is-active { background: #b3243b; }

/* Instancias asignables: casillas en grilla, la marcada se resalta. */
.bo-checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; width: 100%; }
.bo-check {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--bo-border); border-radius: 8px; font-size: .9rem;
}
.bo-check:hover { background: rgba(123, 47, 138, .05); }
.bo-check:has(input:checked) { border-color: var(--bo-purple); background: rgba(123, 47, 138, .07); }
.bo-check input { accent-color: var(--bo-purple); }

/* Sub-acciones de una fila: texto a la izquierda, botón a la derecha. */
.bo-subaction { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; }
.bo-subaction + .bo-subaction { padding-top: 18px; border-top: 1px dashed var(--bo-border); }
.bo-subaction p { margin: 2px 0 0; }
.bo-subaction .bo-btn { flex: none; min-height: 44px; }
.bo-inline-form { display: flex; align-items: stretch; gap: 10px; flex: none; }
.bo-inline-form input {
  width: 230px; padding: 10px 14px; border: 1px solid var(--bo-border); border-radius: 10px;
  font: inherit; font-size: .95rem; background: #fff; color: var(--bo-ink);
}
.bo-inline-form input:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }

@media (max-width: 760px) {
  .bo-profile { align-items: flex-start; gap: 14px; }
  .bo-profile__name { font-size: 1.45rem; }
  .bo-settings { padding: 0 18px; }
  .bo-setting { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px 0; }
  .bo-seg { display: flex; width: 100%; }
  .bo-seg__opt { flex: 1 1 auto; padding: 10px 12px; }
  .bo-subaction { flex-direction: column; align-items: stretch; gap: 12px; }
  .bo-inline-form { flex-direction: column; }
  .bo-inline-form input { width: 100%; }
  .bo-subaction .bo-btn { width: 100%; }
}

/* Alta de usuario: mismo patrón de filas que la ficha. */
.bo-newuser > summary { padding: 20px 0; }
.bo-newuser[open] > summary { border-bottom: 1px solid var(--bo-border); }
.bo-newuser > .bo-alert { margin: 16px 0 0; }
.bo-setting--actions { padding: 20px 0 24px; }
.bo-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; width: 100%; }
.bo-field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 500; min-width: 0; }
.bo-field--narrow { width: min(100%, 300px); }
.bo-field input {
  padding: 10px 14px; border: 1px solid var(--bo-border); border-radius: 10px;
  font: inherit; font-size: .95rem; background: #fff; color: var(--bo-ink); width: 100%;
}
.bo-field input:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }

/* Control segmentado basado en radios (formularios): el input queda invisible encima. */
.bo-seg--radio .bo-seg__opt { position: relative; padding: 0; cursor: pointer; }
.bo-seg--radio .bo-seg__opt input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.bo-seg--radio .bo-seg__opt span { display: block; padding: 10px 18px; }
.bo-seg--radio .bo-seg__opt:has(input:checked) { background: var(--bo-gradient); color: #fff; }
.bo-seg--radio .bo-seg__opt:has(input:focus-visible) { outline: 2px solid var(--bo-purple); outline-offset: -3px; }

@media (max-width: 760px) {
  .bo-fields { grid-template-columns: minmax(0, 1fr); }
  .bo-seg--radio .bo-seg__opt { flex: 1 1 auto; text-align: center; }
  .bo-seg--radio .bo-seg__opt span { padding: 10px 12px; }
  .bo-setting--actions > span { display: none; }
  .bo-setting--actions .bo-btn { width: 100%; }
}

/* Configuración: tarjetas de integración con el patrón de filas. */
.bo-settings__head { padding: 24px 0 18px; }
.bo-settings__head h2 { margin: 0 0 8px; }
.bo-settings__head .bo-muted { margin: 0; }
.bo-settings__head .bo-copyfield { margin-top: 14px; }
.bo-settings > form > .bo-setting:first-child { border-top: 1px solid var(--bo-border); }
.bo-setting__label { font-family: inherit; }
h3.bo-setting__label { font-size: 1rem; }
.bo-setting--actions { border-top: 1px solid var(--bo-border); }
.bo-actionrow { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
.bo-actionrow form { margin: 0; }
.bo-actionrow__note { grid-column: 2; margin: -10px 0 0; }
.bo-fields--host { grid-template-columns: minmax(0, 1fr) 140px; }
.bo-check { width: fit-content; max-width: 100%; }
@media (max-width: 760px) {
  .bo-fields--host { grid-template-columns: minmax(0, 1fr) 110px; }
  .bo-actionrow { flex-direction: column; align-items: stretch; }
  .bo-actionrow .bo-btn { width: 100%; }
  .bo-actionrow__note { grid-column: 1; margin: 0; }
}

/* Selector de instancias para el rol usuario: búsqueda, contador y lista con scroll. */
.bo-picker { gap: 10px; }
.bo-picker__search {
  flex: 1 1 260px; min-width: 0; padding: 10px 14px; border: 1px solid var(--bo-border); border-radius: 10px;
  font: inherit; font-size: .95rem; background: #fff; color: var(--bo-ink);
}
.bo-picker__search:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
.bo-picker__meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; width: 100%; font-size: .88rem; color: var(--bo-muted); }
.bo-picker__bulk { display: inline-flex; gap: 14px; }
.bo-linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--bo-purple); cursor: pointer; }
.bo-linkbtn:hover { text-decoration: underline; }
.bo-picker__item { width: auto; max-width: none; }
.bo-picker__item[hidden] { display: none; }
.bo-picker__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.bo-picker__tags { display: inline-flex; gap: 6px; flex: none; }
.bo-picker__empty { margin: 8px; text-align: center; }
@media (max-width: 760px) {
  .bo-picker__item { flex-wrap: wrap; }
  .bo-picker__tags { margin-left: 26px; }
}

/* Campos de formularios con filas: select y textarea como los inputs. */
.bo-fields--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bo-field select, .bo-field textarea {
  padding: 10px 14px; border: 1px solid var(--bo-border); border-radius: 10px;
  font: inherit; font-size: .95rem; background-color: #fff; color: var(--bo-ink); width: 100%;
}
.bo-field select:focus, .bo-field textarea:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
.bo-field select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237B2F8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
}
.bo-field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.bo-field--narrow select { max-width: 100%; }
.bo-setting__control .bo-check { width: fit-content; }
.bo-checks { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
@media (max-width: 760px) { .bo-fields--3 { grid-template-columns: minmax(0, 1fr); } }

/* Instancias asignadas (lista compacta) + diálogo para agregar desde el catálogo. */
.bo-assigned { list-style: none; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.bo-assigned:empty { display: none; }
.bo-assigned__row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border: 1px solid var(--bo-border); border-radius: 8px; background: #fff; font-size: .9rem;
}
.bo-assigned__name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.bo-assigned__empty { margin: 0; }
.bo-linkbtn--danger { color: #b3243b; }
.bo-picker__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bo-picker__dirty { font-size: .85rem; font-weight: 600; color: #8a4a12; }
.bo-picker__dirty[hidden], .bo-assigned__empty[hidden] { display: none; }

.bo-modal {
  border: 0; border-radius: var(--bo-radius); padding: 0; color: var(--bo-ink);
  width: min(720px, calc(100vw - 32px)); max-height: min(86vh, 760px);
  box-shadow: 0 24px 64px rgba(33, 29, 38, .35);
}
.bo-modal[open] { display: flex; flex-direction: column; }
.bo-modal::backdrop { background: rgba(33, 29, 38, .5); }
.bo-modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 8px; }
.bo-modal__head h3 { margin: 0; font-size: 1.15rem; }
.bo-modal__close { border: 0; background: none; font-size: 1.1rem; line-height: 1; color: var(--bo-muted); cursor: pointer; padding: 6px; border-radius: 6px; }
.bo-modal__close:hover { color: var(--bo-purple); background: rgba(123, 47, 138, .08); }
.bo-modal__bar { padding: 8px 22px 12px; display: flex; flex-direction: column; gap: 10px; }
.bo-modal__bar .bo-picker__search { width: 100%; flex: none; }
.bo-modal__list { flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 4px 22px 12px; display: flex; flex-direction: column; gap: 6px; }
.bo-modal__foot { padding: 14px 22px; border-top: 1px solid var(--bo-border); display: flex; justify-content: flex-end; }
@media (max-width: 760px) {
  .bo-assigned__row { flex-wrap: wrap; }
  .bo-modal { width: calc(100vw - 16px); max-height: 92vh; }
  .bo-modal__head, .bo-modal__bar, .bo-modal__list, .bo-modal__foot { padding-left: 14px; padding-right: 14px; }
}

/* Un campo suelto dentro de una fila ocupa toda la columna de controles (salvo los angostos). */
.bo-setting__control > .bo-field:not(.bo-field--narrow) { align-self: stretch; }

/* Filas dentro de contenedores compactos (edición en línea de listas y alta de repo). */
.bo-editrow__body .bo-setting, .bo-repo-add .bo-setting {
  grid-template-columns: minmax(140px, 200px) minmax(0, 1fr); gap: 10px 28px; padding: 18px 0;
}
.bo-editrow__body .bo-setting__label, .bo-repo-add .bo-setting__label { font-size: .95rem; }
.bo-editrow__body .bo-setting:first-child, .bo-repo-add form > .bo-setting:first-child { border-top: 0; }
.bo-repo-add form { margin-top: 4px; }
h4.bo-setting__label { font-family: inherit; margin: 0; }
@media (max-width: 760px) {
  .bo-editrow__body .bo-setting, .bo-repo-add .bo-setting { grid-template-columns: minmax(0, 1fr); }
}

/* Diálogo de instancias: filas a todo el ancho, el ambiente alineado a la derecha. */
.bo-modal .bo-check { width: 100%; max-width: none; }
.bo-modal .bo-picker__tags { margin-left: auto; }

@media (max-width: 760px) {
  .bo-assigned__row .bo-picker__tags { margin-left: 0; }
  .bo-picker__actions { flex-direction: column; align-items: stretch; width: 100%; }
  .bo-picker__actions .bo-btn { width: 100%; }
}

/* ---------- Dashboard ---------- */
.bo-stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
a.bo-stat--link { display: block; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.bo-stat--link:hover { box-shadow: 0 8px 28px rgba(123, 47, 138, .18); transform: translateY(-1px); }
a.bo-stat--link:focus-visible { outline: 2px solid var(--bo-purple); outline-offset: 2px; }
.bo-stat--alert .bo-stat__num { background: none; -webkit-text-fill-color: #b3243b; color: #b3243b; }

.dash-attn { margin-bottom: 22px; }
.dash-attn h2 { margin-bottom: 8px; }
.dash-attn__list { list-style: none; margin: 0; padding: 0; }
.dash-attn__item + .dash-attn__item { border-top: 1px solid var(--bo-border); }
.dash-attn__item a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--bo-ink); text-decoration: none; border-radius: 8px; }
.dash-attn__item a:hover { background: rgba(123, 47, 138, .05); }
.dash-attn__item a:focus-visible { outline: 2px solid var(--bo-purple); outline-offset: -2px; }
.dash-attn__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--bo-purple); }
.dash-attn__item--error .dash-attn__dot { background: #b3243b; }
.dash-attn__item--warn .dash-attn__dot { background: #d98a00; }
.dash-attn__item--info .dash-attn__dot { background: #9a93a6; }
.dash-attn__text { flex: 1 1 auto; min-width: 0; font-weight: 500; }
.dash-attn__go { flex: none; font-size: .85rem; font-weight: 700; color: var(--bo-purple); }
.dash-ok { margin: 6px 0 0; color: #1d7a45; font-weight: 600; }
.dash-ok span { margin-right: 6px; }
.dash-empty, .dash-more { margin: 14px 0 0; }

.dash-bars { display: flex; align-items: stretch; gap: 8px; height: 190px; margin: 8px 0 22px; }
.dash-bars__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* The plot reserves headroom so the value label that sits on top of the tallest bar never clips. */
.dash-bars__plot { flex: 1 1 auto; width: 100%; display: flex; align-items: flex-end; justify-content: center; padding-top: 22px; }
.dash-bars__bar { position: relative; width: 100%; max-width: 44px; min-height: 3px; border-radius: 6px 6px 2px 2px; background: rgba(123, 47, 138, .30); }
.dash-bars__val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 3px; font-size: .78rem; font-weight: 700; color: var(--bo-muted); }
.dash-bars__col--today .dash-bars__bar { background: var(--bo-gradient); }
.dash-bars__col--today .dash-bars__val { color: var(--bo-purple); }
.dash-bars__day { flex: none; font-size: .7rem; line-height: 1.25; text-align: center; color: var(--bo-muted); }
.dash-tops { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-tops h3 { margin: 0 0 8px; font-size: .9rem; color: var(--bo-ink); }
.dash-rank { list-style: none; margin: 0; padding: 0; }
.dash-rank li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; font-size: .86rem; overflow: hidden; border-radius: 6px; }
.dash-rank__name { position: relative; z-index: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-rank__n { position: relative; z-index: 1; font-weight: 700; }
.dash-rank__bar { position: absolute; inset: 0 auto 0 0; background: rgba(123, 47, 138, .10); border-radius: 6px; }
.dash-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.dash-wide { grid-column: 1 / -1; }
.dash-more-link { font-size: .85rem; font-weight: 600; }
@media (max-width: 720px) { .dash-tops { grid-template-columns: 1fr; } .dash-bars { height: 160px; } .dash-bars__day { font-size: .62rem; } }

/* Listas del dashboard (antes inline en la plantilla) y grilla de tarjetas. */
.bo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 720px) { .bo-grid { grid-template-columns: 1fr; } }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--bo-border); }
.dash-list li:last-child { border-bottom: 0; }
.dash-list__main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-list__main a, .dash-list__main strong { font-weight: 600; }
.dash-list__sub { font-size: .8rem; color: var(--bo-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dash-list__meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dash-list__meta small { color: var(--bo-muted); font-size: .74rem; white-space: nowrap; }

.bo-grid > * { min-width: 0; }
@media (max-width: 520px) { .bo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .bo-stat { padding: 14px 16px; } }

/* Opciones de un control segmentado que no se pueden usar (p. ej. cambiarse el propio rol). */
.bo-seg__opt:disabled { cursor: not-allowed; opacity: .55; }
.bo-seg__opt:disabled:hover { background: transparent; }
.bo-seg__opt.is-active:disabled { opacity: 1; }

/* Credencial elegida por ambiente asignado (ficha del usuario). */
.bo-assigned__cred { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.bo-assigned__cred select {
  padding: 9px 36px 9px 14px; border: 1px solid var(--bo-border); border-radius: 10px; background-color: #fff;
  font: inherit; font-size: .88rem; font-weight: 500; color: var(--bo-ink); max-width: 210px;
  appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237B2F8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
}
.bo-assigned__cred select:hover { border-color: #cdb7d3; }
.bo-assigned__cred select:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
.bo-assigned__cred select:invalid { border-color: #eeacb8; background-color: #fdf2f4; }
.bo-pill[hidden] { display: none; }
@media (max-width: 760px) { .bo-assigned__cred { width: 100%; } .bo-assigned__cred select { flex: 1; max-width: none; } }

/* Fila de acciones de una credencial: eliminar queda a la derecha, separado del resto. */
.bo-actionrow .cred-actions__danger { margin-left: auto; }  /* beats `.bo-actionrow form { margin: 0 }` */
@media (max-width: 760px) { .bo-actionrow .cred-actions__danger { margin-left: 0; } }
.bo-actionrow .bo-btn { min-height: 44px; }  /* filled and outlined buttons share one height */

/* En pantallas chicas el popover de ayuda no cabe junto al ícono: hoja a ancho completo abajo. */
@media (max-width: 760px) {
  .bo-tip__pop {
    position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px;
    width: auto; max-width: none; max-height: 70vh; overflow-y: auto;
  }
}

/* ---------- Desplegable propio (static/js/bo-select.js) ----------
   La lista nativa de un <select> la dibuja el navegador y no admite estilo; el script
   deja el select real oculto (valida y viaja con el form) y dibuja este botón + lista. */
.bo-select { position: relative; display: inline-block; max-width: 100%; vertical-align: middle; }
.bo-form .bo-select, .bo-field .bo-select { display: block; width: 100%; }
.bo-select .bo-select__native {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
  opacity: 0; pointer-events: none;
}
.bo-select__btn {
  display: flex; align-items: center; width: 100%; text-align: left; cursor: pointer;
  padding: 11px 40px 11px 14px; border: 1px solid var(--bo-border); border-radius: 10px;
  background-color: #fff; color: var(--bo-ink); font: inherit; font-size: .95rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237B2F8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px;
  transition: border-color .15s, box-shadow .15s;
}
.bo-select__btn:hover { border-color: #cdb7d3; }
.bo-select__btn:focus { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
.bo-select__btn[aria-expanded="true"] { border-color: var(--bo-purple); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 7l5-5 5 5' fill='none' stroke='%237B2F8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.bo-select__btn:disabled { cursor: not-allowed; opacity: .6; }
.bo-select__btn.is-invalid:not(:focus):not([aria-expanded="true"]) { background-color: #fdf2f4; border-color: #eeacb8; }
.bo-select__btn.is-placeholder { color: var(--bo-muted); }
.bo-select__label { display: grid; min-width: 0; flex: 1; }
.bo-select__label > span { grid-area: 1 / 1; visibility: hidden; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo-select__label > .is-current { visibility: visible; }

.bo-select__menu {
  position: fixed; z-index: 1000; overflow: hidden; padding: 6px; display: flex; flex-direction: column;
  background: var(--bo-card); border: 1px solid var(--bo-border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(43, 43, 51, .16), 0 2px 8px rgba(123, 47, 138, .08);
  font-size: .92rem;
}
.bo-select__menu[hidden] { display: none; }
.bo-select__opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--bo-ink);
}
.bo-select__opt.is-placeholder { color: var(--bo-muted); }
.bo-select__opt.is-active { background: rgba(123, 47, 138, .08); color: var(--bo-purple); }
.bo-select__opt.is-selected { font-weight: 600; color: var(--bo-purple); }
.bo-select__opt.is-selected::after {
  content: ""; flex: none; width: 12px; height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='9' viewBox='0 0 12 9'%3E%3Cpath d='M1 4.5l3.2 3.2L11 1' fill='none' stroke='%237B2F8A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
}
.bo-select__opt.is-disabled { opacity: .45; cursor: not-allowed; }

/* Variantes por contexto: mismas medidas que el select nativo que reemplazan. */
.bo-search .bo-select__btn { padding: 14px 40px 14px 18px; font-size: 1rem; border-radius: 999px; background-position: right 16px center; }
.bo-toolbar .bo-select__btn { padding: 10px 36px 10px 14px; font-size: .9rem; background-position: right 12px center; }
.bo-assigned__cred .bo-select { max-width: 210px; }
.bo-assigned__cred .bo-select__btn { padding: 9px 36px 9px 14px; font-size: .88rem; font-weight: 500; background-position: right 12px center; }
.bo-assigned__cred .bo-select__btn.is-invalid:not(:focus) { background-color: #fdf2f4; border-color: #eeacb8; }
/* Selects compactos que ya existían como select.bo-logselect / .bo-input-sm: el wrapper no hereda
   la clase del select, por eso se enlazan con :has() y quedan con las mismas medidas. */
.bo-select:has(> .bo-logselect) .bo-select__btn { padding: 9px 34px 9px 14px; font-size: .88rem; font-weight: 600; background-position: right 12px center; }
.bo-select:has(> .bo-input-sm) .bo-select__btn { padding: 7px 32px 7px 10px; font-size: .85rem; border-radius: 8px; background-position: right 10px center; }
@media (max-width: 760px) {
  .bo-search .bo-select, .bo-cards td .bo-select { width: 100%; }
  .bo-assigned__cred .bo-select { flex: 1; max-width: none; }
}

/* ---------- Editor de tags (static/js/bo-tags.js) ---------- */
.bo-tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; cursor: text;
  padding: 6px 8px; min-height: 46px; border: 1px solid var(--bo-border); border-radius: 10px;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.bo-tags:hover { border-color: #cdb7d3; }
.bo-tags:focus-within { border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }
.bo-tags .bo-tags__input {
  flex: 1 1 140px; width: auto; min-width: 120px; padding: 6px 4px; border: 0; border-radius: 0;
  box-shadow: none; background: transparent; font: inherit; font-size: .95rem; outline: none;
}
.bo-tags .bo-tags__input:focus { border: 0; box-shadow: none; }
.bo-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 11px; border-radius: 999px;
  background: rgba(123, 47, 138, .10); color: var(--bo-purple); font-size: .85rem; font-weight: 600;
  font-family: var(--bo-mono); max-width: 100%; overflow-wrap: anywhere;
}
.bo-tag--invalid { background: #fdf2f4; color: var(--bo-coral-text); box-shadow: inset 0 0 0 1px #eeacb8; }
.bo-tag__x {
  border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1;
  width: 20px; height: 20px; border-radius: 50%; padding: 0; opacity: .7;
}
.bo-tag__x:hover { opacity: 1; background: rgba(123, 47, 138, .16); }
.bo-tag--invalid .bo-tag__x:hover { background: rgba(200, 30, 56, .14); }
.bo-tag--static { padding: 3px 11px; }

.bo-select__list { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.bo-select .bo-select__search {
  position: absolute; top: 1px; bottom: 1px; width: auto; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; color: var(--bo-ink); outline: none;
}
.bo-select .bo-select__search[hidden] { display: none; }
.bo-select .bo-select__search:focus { border: 0; box-shadow: none; }
.bo-select .bo-select__search::placeholder { color: var(--bo-muted); opacity: 1; }
.bo-select__btn.is-searching .bo-select__label > span { visibility: hidden; }
.bo-select__none { padding: 10px 12px; color: var(--bo-muted); font-size: .9rem; }
.bo-tag--method { background: rgba(43, 43, 51, .07); color: var(--bo-ink); }
.bo-form [data-wg-methods]:not([hidden]) { display: flex; flex-direction: column; gap: 14px; }
