/* Identidad visual Blueorange — Hub Service
   Gradiente púrpura → coral, tipografías Baloo Bhaina (títulos) y Montserrat (texto). */

@import url('https://fonts.googleapis.com/css2?family=Baloo+Bhaina+2:wght@500;700&family=Montserrat:wght@400;500;700&display=swap');

:root {
  --bo-purple: #7B2F8A;
  --bo-coral: #E5314A;
  --bo-gradient: linear-gradient(135deg, #7B2F8A 0%, #E5314A 100%);
  --bo-ink: #2b2b33;
  --bo-muted: #6f6f7a;
  --bo-bg: #f5f4f7;
  --bo-card: #ffffff;
  --bo-border: #e7e5ec;
  --bo-radius: 14px;
  --bo-shadow: 0 6px 24px rgba(123, 47, 138, 0.10);
}

* { 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: 'Baloo Bhaina 2', 'Montserrat', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

/* ---------- 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; }
.bo-brand__sub { font-size: .78rem; opacity: .85; letter-spacing: 1.5px; text-transform: uppercase; }

.bo-nav { display: flex; align-items: center; gap: 18px; }
.bo-nav a { color: #fff; text-decoration: none; font-weight: 500; font-size: .95rem; opacity: .92; }
.bo-nav a:hover { opacity: 1; }

/* Sección activa del menú. */
.bo-nav > a,
.bo-dropdown:not(.bo-dropdown--user) > summary {
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}
.bo-nav > a[aria-current="page"],
.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: 500;
  font-size: .95rem;
  opacity: .92;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  user-select: none;
}
.bo-dropdown > summary::-webkit-details-marker { display: none; }
.bo-dropdown > summary:hover { opacity: 1; }
/* 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 {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bo-user-trigger:hover { background: rgba(255, 255, 255, 0.3); }
/* 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); word-break: break-all; }

/* ---------- 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); }
.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; }

/* ---------- 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); }
.bo-pager__btn--disabled { color: #b9b6c2; 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 14px; text-align: left; border-bottom: 1px solid var(--bo-border); 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; }

/* ---------- 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 {
  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 { outline: none; border-color: var(--bo-purple); box-shadow: 0 0 0 3px rgba(123,47,138,.12); }

/* 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;
}
/* Los botones no parten su texto en dos líneas (mantiene la altura pareja). */
.bo-btn { white-space: nowrap; line-height: 1.2; }
.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: 1; text-align: center; justify-content: center; }

.bo-auth { display: flex; justify-content: center; padding-top: 24px; }
.bo-muted { color: var(--bo-muted); font-size: .9rem; }

/* ---------- 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: #7B2F8A; }
.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;
}

/* ---------- 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; }
  /* La tabla mantiene un ancho mínimo legible y la card scrollea en horizontal. */
  .bo-table { min-width: 460px; }
  .bo-table th, .bo-table td { padding: 10px 12px; }

  .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 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: 'Baloo Bhaina 2', 'Montserrat', sans-serif;
  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 {
  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;
}
.bo-badge--queued       { background: #f0ecf6; color: #5b3a78; }
.bo-badge--provisioning { background: #fff3e0; color: #b5651d; }
.bo-badge--running      { background: #e9f7ee; color: #1d7a45; }
.bo-badge--stopped      { background: #eceaf0; color: #6f6f7a; }
.bo-badge--failed       { background: #fdecef; color: #b3243b; }
.bo-badge--destroyed    { background: #eceaf0; color: #9b98a4; }
.bo-badge--success      { background: #e9f7ee; color: #1d7a45; }
.bo-badge--building,
.bo-badge--testing      { background: #fff3e0; color: #b5651d; }

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

/* ---------- Pills de etapa ---------- */
.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);
}

/* ---------- 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; }
.bo-btn-row--nowrap { flex-wrap: nowrap; }
.bo-btn--sm { padding: 6px 11px; font-size: .78rem; }

/* 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);
}
.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: #fff;
}
.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;
  font-weight: 700;
  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; }
.bo-logchip.lvl-debug:has(input:checked)   { background: #eceaf0; color: #5b3a78; border-color: #d9cde8; }
.bo-logchip.lvl-info:has(input:checked)    { background: rgba(123,47,138,.10); color: var(--bo-purple); border-color: rgba(123,47,138,.30); }
.bo-logchip.lvl-warning:has(input:checked) { background: #fff3e0; color: #b5651d; border-color: #f0d2a8; }
.bo-logchip.lvl-error:has(input:checked)   { background: #fdecef; color: var(--bo-coral); border-color: #f5c3cd; }
.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); }

.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;
}

@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; }
