/* OXIRA Admin — estilos exclusivos del panel administrativo BESTV. */

body.oxira-admin { background: #EEF2F5; }

/* Móvil/tablet: el menú vive como offcanvas de Bootstrap (oculto, sale con la
   hamburguesa). Escritorio (lg+): columna fija de siempre.
   REGLA: el elemento con clases responsivas de Bootstrap NO lleva estilos que
   Bootstrap fuerza con !important (.offcanvas-lg pone fondo transparente en lg+).
   El fondo va por SU variable (--bs-offcanvas-bg, móvil) y por un wrapper
   interno nuestro (.bc-adm-sidebar-int, escritorio). Convivir, no contradecir. */
.bc-adm-sidebar {
  width: 260px;
  --bs-offcanvas-width: 260px;
  --bs-offcanvas-bg: var(--bc-navy);
}
/* El interior solo PINTA; alto y flex son utilidades Bootstrap en el HTML:
   d-flex flex-column h-100 (interior) + flex-grow-1 overflow-y-auto (.menu-scroll).
   Así el logo queda siempre visible y solo los enlaces hacen scroll. */
.bc-adm-sidebar-int { background: var(--bc-navy); }
@media (min-width: 992px) {
  .bc-adm-sidebar {
    height: 100vh; position: sticky; top: 0;
  }
}
.bc-adm-sidebar .marca { padding: 1.2rem 1.4rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.bc-adm-sidebar .marca img { width: auto; height: 54px; }
.bc-adm-sidebar .seccion {
  color: #6E8496; font-size: .72rem; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; padding: 1.1rem 1.4rem .4rem;
}
.bc-adm-sidebar a {
  display: flex; align-items: center; gap: .7rem; padding: .6rem 1.4rem;
  color: #C2CFD9; text-decoration: none; font-weight: 600; font-size: .95rem;
  border-left: 4px solid transparent;
}
.bc-adm-sidebar a:hover { background: rgba(255,255,255,.06); color: #fff; }
.bc-adm-sidebar a.activo { border-left-color: var(--bc-lima); background: rgba(188,210,0,.12); color: #fff; }

.bc-adm-main { min-width: 0; }
/* Toolbar pegado arriba al deslizar (sticky-top de Bootstrap + ajuste fino).
   Patrón app: se esconde al bajar y reaparece al subir para no robar espacio. */
.bc-adm-topbar.sticky-top {
  top: .5rem; z-index: 1019; /* debajo del offcanvas (1045) y su fondo (1040) */
  box-shadow: 0 6px 18px rgba(13, 34, 51, .10);
  transition: transform .22s ease, box-shadow .22s ease;
}
.bc-adm-topbar.topbar-oculto { transform: translateY(calc(-100% - 1rem)); box-shadow: none; }

/* Compositor del chat: lo que Bootstrap no sabe — el respiro inferior suma el
   safe-area (home indicator del iPhone / barra de gestos Android). */
.sop-composer { padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); }

/* Chat en móvil: la conversación manda (más alto) y la bandeja vive en offcanvas.
   dvh = viewport DINÁMICO: descuenta la barra del navegador del celular
   (con vh el hilo salía más alto que lo visible y tapaba los botones). */
@media (max-width: 767px) {
  #hiloChat { height: 56vh !important; height: 56dvh !important; } /* gana al height inline de escritorio */
  #bandejaTickets { background: var(--bc-gris); }
  #bandejaTickets .bc-adm-card { border: 0; border-radius: 0; }
}
.bc-adm-card { background: #fff; border: 1px solid #E3E9ED; border-radius: .8rem; padding: 1.4rem; }
.bc-adm-kpi .valor { font-size: 2rem; font-weight: 900; color: var(--bc-navy); }
.bc-adm-kpi .icono {
  width: 48px; height: 48px; border-radius: .7rem; display: flex; align-items: center;
  justify-content: center; font-size: 1.4rem; color: #fff;
}

@media (max-width: 991px) {
  .bc-adm-main { width: 100%; }
}

/* ---------- Centro de soporte ---------- */
.sop-kpi { background: #fff; border: 1px solid #E3E9ED; border-radius: .8rem; padding: 1rem 1.2rem; display: flex; align-items: center; gap: .9rem; }
.sop-kpi .num { font-size: 1.6rem; font-weight: 900; color: var(--bc-navy); line-height: 1; }
.sop-kpi .ic { width: 42px; height: 42px; border-radius: .6rem; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff; }
.sop-item { display: block; border-left: 4px solid transparent; border-bottom: 1px solid #EDF1F4; padding: .7rem .9rem; text-decoration: none; color: var(--bc-texto); }
.sop-item:hover { background: var(--bc-gris); color: var(--bc-texto); }
.sop-item.sel { background: #F2F7EA; border-left-color: var(--bc-lima); }
.sop-item.p-urgente { border-left-color: #D33; }
.sop-item.p-alta { border-left-color: #E8871E; }
.sop-burbuja { max-width: 78%; border-radius: .8rem; padding: .6rem .9rem; font-size: .92rem; }
.sop-burbuja.cliente { background: #fff; border: 1px solid #E3E9ED; }
.sop-burbuja.staff { background: #EAF3DE; }
.sop-burbuja.nota { background: #FFF7DB; border: 1px dashed #E0C860; max-width: 100%; }
.sop-sla { height: .5rem; border-radius: 1rem; background: #E3E9ED; overflow: hidden; }
.sop-sla > div { height: 100%; background: var(--bc-lima); }
.sop-sla.pasado > div { background: #D33; }

/* ---------- Sidebar plegable (acordeón por grupo + minimizar) ---------- */
.bc-adm-sidebar { transition: width .18s ease; }
.bc-adm-sidebar .menu-scroll { padding-bottom: 1rem; } /* scroll y alto: flex-grow-1 overflow-y-auto (Bootstrap) */
.bc-adm-sidebar .marca { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.bc-adm-sidebar .btn-min {
  border: 1px solid rgba(255,255,255,.25); background: transparent; color: #C2CFD9;
  border-radius: .45rem; width: 30px; height: 30px; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.bc-adm-sidebar .btn-min:hover { background: rgba(255,255,255,.1); color: #fff; }
.bc-adm-sidebar .seccion {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  user-select: none; border: 0; background: transparent; width: 100%; text-align: left;
}
.bc-adm-sidebar .seccion .flecha { transition: transform .15s ease; font-size: .7rem; }
.bc-adm-sidebar .grupo.cerrado .flecha { transform: rotate(-90deg); }
/* Tope holgado: Configuración ya suma 672px de enlaces; 600px la recortaba */
.bc-adm-sidebar .grupo .enlaces { overflow: hidden; max-height: 1000px; transition: max-height .18s ease; }
.bc-adm-sidebar .grupo.cerrado .enlaces { max-height: 0; }

/* Modo minimizado: solo íconos (SOLO escritorio; en móvil manda el offcanvas) */
@media (min-width: 992px) {
  body.menu-min .bc-adm-sidebar { width: 64px; }
  body.menu-min .bc-adm-sidebar .marca img { display: none; }
  body.menu-min .bc-adm-sidebar .seccion { display: none; }
  body.menu-min .bc-adm-sidebar .grupo .enlaces,
  body.menu-min .bc-adm-sidebar .grupo.cerrado .enlaces { max-height: none; }
  body.menu-min .bc-adm-sidebar a { justify-content: center; padding: .6rem .4rem; }
  body.menu-min .bc-adm-sidebar a span.texto { display: none; }
  body.menu-min .bc-adm-sidebar a i { font-size: 1.15rem; }
}

/* KPIs compactos del centro de soporte */
.sop-kpis-mini { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; }
.sop-kpis-mini .kpi { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 700; color: var(--bc-texto); }
.sop-kpis-mini .kpi .n { font-weight: 900; color: var(--bc-navy); }
.sop-kpis-mini .kpi i { font-size: 1rem; }

/* Hub de ajustes del conector (/panel/ajustes): tarjetas con ícono y estado */
.bc-hub-icono { display: inline-grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  background: rgba(21, 87, 126, .1); color: var(--bc-azul, #15577E); font-size: 1.3rem; }
.bc-hub-tarjeta { transition: transform .15s ease, box-shadow .15s ease; }
.bc-hub-tarjeta:hover { transform: translateY(-2px); box-shadow: 0 .75rem 1.5rem rgba(13, 34, 51, .12) !important; }
.bc-hub-tarjeta:focus-visible { outline: 3px solid rgba(21, 87, 126, .35); outline-offset: 2px; }
