/* =============================================================
   LIMITED OS · base.css
   Design system canónico + layout global + sidebar + modal.
   Acento #FFC900 extraído del logo oficial en Figma (fuente de
   verdad de color según el diseñador). NO usar otros amarillos.
   ============================================================= */
/* -------------------------------------------------------------
   GLOBAL STYLES & VARIABLES
   ------------------------------------------------------------- */
:root {
  --bg-main: #060608;
  --bg-sidebar: #0b0b0e;
  --bg-secondary-sidebar: #0d0d11;
  --bg-hover: #16161c;
  --bg-active: #1f1f27;
  --border-divider: #3e3e4a; /* Required gray divider */
  --border-internal: #1d1d24;
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-dim: #52525b;
  /* Acento canónico (logo Figma). Derivados calculados a partir de él. */
  --accent-yellow: #FFC900;
  --accent-yellow-hover: #FFD933;
  --accent-yellow-dark: #D4A800;
  --accent-soft: rgba(255, 201, 0, 0.10);
  --accent-border: rgba(255, 201, 0, 0.22);
  --on-accent: #0a0a0a;
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition-speed: 0.25s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* -------------------------------------------------------------
   APP LAYOUT CONTAINER
   ------------------------------------------------------------- */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* -------------------------------------------------------------
   SIDEBAR WRAPPER (Houses both primary & secondary sidebars)
   ------------------------------------------------------------- */
.sidebar-wrapper {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

/* -------------------------------------------------------------
   PRIMARY MAIN SIDEBAR
   ------------------------------------------------------------- */
.main-sidebar {
  background-color: var(--bg-sidebar);
  height: 100%;
  border-right: 1px solid var(--border-divider);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: width var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

/* Width control based on states */
.main-sidebar.expanded {
  width: 260px;
}

.main-sidebar.collapsed {
  width: 56px;
}

/* -------------------------------------------------------------
   SIDEBAR HEADER (Logo & Collapse Toggle Button)
   ------------------------------------------------------------- */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  height: 64px;
  border-bottom: 1px solid var(--border-internal);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
  user-select: none;
  transition: opacity 0.15s ease;
  white-space: nowrap;
}

.logo-limited {
  color: var(--text-primary);
}

.logo-os {
  background-color: var(--accent-yellow);
  color: #000000;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 900;
  font-size: 13px;
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.toggle-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Header adjustments in collapsed state */
.main-sidebar.collapsed .logo-container {
  opacity: 0;
  pointer-events: none;
  width: 0;
}

.main-sidebar.collapsed .sidebar-header {
  justify-content: center;
  padding: 16px 0;
}

/* -------------------------------------------------------------
   SIDEBAR NAVIGATION SECTIONS
   ------------------------------------------------------------- */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Custom Scrollbar for premium dark appearance */
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-internal);
  border-radius: 2px;
}

/* Base Nav Item */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-label {
  transition: opacity 0.15s ease;
}

/* Adjustments for Collapsed Nav Items */
.main-sidebar.collapsed .nav-label {
  opacity: 0;
  pointer-events: none;
}
/* Con opacity:0 el label seguía OCUPANDO ancho y empujaba el icono fuera del
   strip (se veían iconos cortados o vacíos en colapsado). Fuera del flujo: */
.main-sidebar.collapsed .nav-item .nav-label { display: none; }

/* Etiquetas de sección AMARILLAS: fuera en modo colapsado (si no, el texto
   se monta encima del sidebar secundario de Embudos). */
.main-sidebar.collapsed .ysec { display: none; }

/* Grupos desplegables en modo colapsado: sin chevron ni sub-items (los
   sub-items no tienen icono y su texto se montaría sobre el contenido). */
.main-sidebar.collapsed .chevron-icon { display: none; }
.main-sidebar.collapsed .dropdown-content { display: none; }

/* Iconos de los grupos del sidebar de CLIENTE (Servicios/Operativa/Recursos/
   Bandejas): el Figma los muestra SOLO texto en expandido, pero en colapsado
   sin icono quedaban ranuras vacías. Icono solo en modo colapsado. */
.main-sidebar:not(.collapsed) .nav-icon.icon-collapsed-only { display: none; }

.main-sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px 0;
}

/* -------------------------------------------------------------
   GROUP HEADERS & ACCORDIONS (Agencia, Embudos, Apps)
   ------------------------------------------------------------- */
.group-container {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.group-header {
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  user-select: none;
  display: flex;
  align-items: center;
}

/* Hidden elements toggle */
.group-collapsed-icon {
  display: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.group-collapsed-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.active-collapsed-group {
  background-color: var(--bg-active) !important;
  color: var(--accent-yellow) !important;
}

/* When collapsed, swap header text with the representative icon */
.main-sidebar.collapsed .group-label {
  display: none;
}

.main-sidebar.collapsed .group-header {
  padding: 4px 0;
  justify-content: center;
}

.main-sidebar.collapsed .group-collapsed-icon {
  display: flex;
}

.main-sidebar.collapsed .group-content {
  display: none; /* Hide submenu items inline inside main sidebar when collapsed */
}

/* Badge styling for collapsed "Agencia" ("LA") */
.la-badge {
  font-size: 10px;
  font-weight: 800;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  padding: 1px 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: 18px;
  height: 18px;
}

/* Dropdown controls in expanded state */
.dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.chevron-icon {
  display: flex;
  align-items: center;
  transition: transform var(--transition-speed) ease;
}

.chevron-icon.rotated {
  transform: rotate(180deg);
}

.dropdown-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-speed) ease-out;
  display: flex;
  flex-direction: column;
  flex-shrink: 0; /* dentro del nav (flex con scroll) el desplegable se encogía a 0 al desbordar */
  gap: 2px;
  padding-left: 12px;
}

.dropdown-content.expanded {
  max-height: 900px; /* High boundary (el grupo Operativa del panel de agencia llega a ~14 ítems) */
  transition: max-height var(--transition-speed) ease-in;
}

.sub-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sub-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.sub-item.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.sub-item .sub-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 9px;
  flex-shrink: 0;
  color: var(--accent-yellow);
}

/* Sub-sub dropdown (for B2B) */
.sub-sub-content {
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-speed) ease-out;
}

.sub-sub-content.expanded {
  max-height: 200px;
}

.sub-sub-item {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}

.sub-sub-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.sub-sub-item.active {
  background-color: #2e2e38;
  color: var(--text-primary);
  font-weight: 600;
}

/* -------------------------------------------------------------
   COLLAPSED GROUP FLYOUTS
   ------------------------------------------------------------- */
.collapsed-flyout {
  position: absolute;
  left: 62px;
  background-color: var(--bg-secondary-sidebar);
  border: 1px solid var(--border-internal);
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7);
  padding: 6px;
  min-width: 200px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
}

.collapsed-flyout-header {
  padding: 6px 10px;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-internal);
  margin-bottom: 4px;
}

.flyout-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.flyout-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* -------------------------------------------------------------
   SIDEBAR FOOTER / PROFILE
   ------------------------------------------------------------- */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-internal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
  height: 64px;
}

.sidebar-footer:hover {
  background-color: var(--bg-hover);
}

.user-profile-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #1c1917;
  font-size: 11px;
  font-weight: bold;
  color: var(--accent-yellow);
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.sidebar-footer:hover .user-avatar {
  border-color: #ffffff;
}

.user-details {
  display: flex;
  flex-direction: column;
  transition: opacity 0.15s ease;
  overflow: hidden;
  white-space: nowrap;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.user-menu-icon {
  color: var(--text-secondary);
  transition: opacity 0.15s ease;
}

/* Footer adjustments in collapsed state */
.main-sidebar.collapsed .sidebar-footer {
  justify-content: center;
  padding: 12px 0;
}

.main-sidebar.collapsed .user-details,
.main-sidebar.collapsed .user-menu-icon {
  opacity: 0;
  pointer-events: none;
  width: 0;
  display: none;
}

/* -------------------------------------------------------------
   SECONDARY NAV BAR (Embudos conceptual nav)
   ------------------------------------------------------------- */
.secondary-sidebar {
  width: 260px;
  background-color: var(--bg-secondary-sidebar);
  height: 100vh;
  border-right: 1px solid var(--border-divider);
  display: none; /* Controlled via active logic */
  flex-direction: column;
  animation: slideIn var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow-y: auto;
}

.secondary-sidebar.visible {
  display: flex;
}

@keyframes slideIn {
  from {
    transform: translateX(-15px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Back button */
.back-to-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 1px solid var(--border-internal);
  transition: color 0.15s ease;
}

.back-to-main:hover {
  color: var(--text-primary);
}

.back-to-main .arrow-left {
  transition: transform 0.15s ease;
}

.back-to-main:hover .arrow-left {
  transform: translateX(-3px);
}

/* Secondary Nav Groupings */
.sec-group {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sec-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
}

.sec-group-header.clickable-header {
  transition: background-color 0.15s ease;
}

.sec-group-header.clickable-header:hover {
  background-color: var(--bg-hover);
}

.sec-group-badge {
  background-color: var(--bg-hover);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sec-group-header.active .sec-group-badge {
  background-color: var(--bg-active);
  color: var(--accent-yellow);
}

.sec-group-content {
  padding-left: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.sec-sub-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sec-sub-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.sec-sub-item.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.sec-divider {
  border: none;
  border-top: 1px solid var(--border-internal);
  margin: 8px 24px;
}

/* -------------------------------------------------------------
   CONTENT AREA (Main container, supporting scroll)
   ------------------------------------------------------------- */

/* ---- Área de contenido genérica (todas las páginas) ---- */
.content-area {
  flex: 1;
  height: 100vh;
  background-color: var(--bg-main);
  position: relative;
  overflow-y: auto;
}

/* Tech-grid styling overlay for a modern dashboard feel */
.content-area::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 1px 1px, #1c1c24 1px, transparent 0);
  background-size: 24px 24px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 1;
}

.screen-container {
  max-width: 800px;
  width: 90%;
  text-align: center;
  z-index: 2;
  margin: 100px auto;
}

/* Key indicator title based on user specs */
.nav-bar-indicator {
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 24px;
  text-shadow: 0 10px 30px rgba(0,0,0,0.5);
  user-select: none;
  transition: opacity 0.2s ease;
}

.screen-details-box {
  background-color: rgba(11, 11, 14, 0.7);
  border: 1px solid var(--border-internal);
  border-radius: 12px;
  padding: 24px;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 40px -15px rgba(0,0,0,0.5);
}

.screen-details-box h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.screen-details-box p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.active-tag {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 12px;
  background-color: var(--bg-active);
  border: 1px solid var(--border-internal);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-yellow);
  text-transform: uppercase;
}

/* ---- Modal de configuración (compartido) ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.settings-modal {
  width: min(640px, calc(100vw - 32px));
  max-height: 90vh;
  background-color: var(--bg-secondary-sidebar);
  border: 1px solid var(--border-internal);
  border-radius: 14px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Móvil: el modal de ajustes (2 paneles) apila en columna y no se corta. */
@media (max-width: 640px) {
  .modal-content-tabs { flex-direction: column; height: auto !important; }
  .modal-sidebar { width: 100% !important; flex-direction: row; overflow-x: auto; }
}
/* iOS no hace zoom al enfocar si el input es >=16px (evita el salto molesto). */
@media (max-width: 900px) {
  input, select, textarea, .form-input { font-size: 16px !important; }
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-internal);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.close-modal-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 4px;
  transition: background-color 0.15s, color 0.15s;
}

.close-modal-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.modal-content-tabs {
  display: flex;
  height: 380px;
}

.modal-sidebar {
  width: 180px;
  border-right: 1px solid var(--border-internal);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background-color: var(--bg-sidebar);
}

.tab-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.tab-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.tab-btn.active {
  background-color: var(--bg-active);
  color: var(--text-primary);
  font-weight: 600;
}

.modal-pane-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: none;
}

.modal-pane-content.active {
  display: block;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  background-color: var(--bg-sidebar);
  border: 1px solid var(--border-internal);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--accent-yellow);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-internal);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  border: none;
}

.btn:hover {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-primary {
  background-color: var(--accent-yellow);
  color: #000000;
}

/* =============================================================
   ENLACES DE NAVEGACIÓN (el sidebar usa <a> reales para que
   funcionen abrir-en-pestaña, historial y SEO interno)
   ============================================================= */
a.nav-item, a.sub-item, a.sec-sub-item, a.flyout-item,
a.sec-group-header, a.back-to-main {
  text-decoration: none;
  color: inherit;
  display: flex;
}

/* =============================================================
   RESPONSIVE · móvil y tablet (≤900px)
   El sidebar pasa a off-canvas y aparece una topbar con
   botón hamburguesa. En desktop la topbar no existe.
   ============================================================= */
.mobile-topbar { display: none; }

@media (max-width: 900px) {
  body { flex-direction: column; overflow: auto; height: auto; min-height: 100vh; }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 60;
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-internal);
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
  }
  .tk-mini, .dr-mini, .bv-mini, .vp-mini, .cf-mini, .btn-reset, .btn-borrar, .tt-pill, .tt-coment, .tt-chk { min-height: 38px; }
  .mobile-topbar .logo-container { display: flex; align-items: center; gap: 6px; }
  .mobile-topbar .hamburger-btn {
    background: none;
    border: 1px solid var(--border-internal);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 8px 10px;
    cursor: pointer;
  }

  .sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-110%);
    transition: transform var(--transition-speed) ease;
    z-index: 80;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  }
  body.mobile-nav-open .sidebar-wrapper { transform: translateX(0); }

  /* Velo oscuro tras el sidebar móvil */
  .mobile-scrim {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 70;
  }
  body.mobile-nav-open .mobile-scrim { display: block; }

  .content-area { height: auto; min-height: calc(100vh - 57px); }
  .main-sidebar.expanded { width: 280px; }
}

/* Inputs deshabilitados del modal: mismo tema, atenuados */
.form-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Selector de subcuenta (sidebar secundario) — mismo lenguaje visual */
.selector-subcuenta {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: var(--bg-active) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23FFC900' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text-primary);
  border: 1px solid var(--border-divider);
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 30px 8px 10px;
  cursor: pointer;
}
.selector-subcuenta:hover, .selector-subcuenta:focus { border-color: var(--accent-yellow); outline: none; }
.selector-subcuenta option { background: #16161c; color: #f4f4f5; }

/* Badge "Pronto" para items del sidebar en preview (ej. Integraciones) */
.badge-pronto {
  margin-left: auto;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 201, 0, .15);
  color: var(--accent-yellow);
  border: 1px solid rgba(255, 201, 0, .35);
}
.main-sidebar.collapsed .badge-pronto { display: none; }

/* -------------------------------------------------------------
   FLYOUTS AL PASAR EL CURSOR (modo colapsado) — nombre + accesos rápidos
   ------------------------------------------------------------- */
.nav-cell { position: relative; }
.main-sidebar.collapsed .group-container { position: relative; }
/* En colapsado, el flyout se ancla a la derecha del icono */
.main-sidebar.collapsed .collapsed-flyout { left: calc(100% + 8px); top: -6px; right: auto; }
/* Puente invisible para cruzar el hueco icono→flyout sin perder el hover */
.main-sidebar.collapsed .collapsed-flyout::before {
  content: ""; position: absolute; left: -12px; top: 0; width: 12px; height: 100%;
}
/* Mostrar al pasar el cursor (solo colapsado) */
.main-sidebar.collapsed .nav-cell:hover > .collapsed-flyout,
.main-sidebar.collapsed .group-container:hover .collapsed-flyout { display: flex; }

/* El flyout debe ESCAPAR del sidebar (si no, overflow-x:hidden lo recorta y no
   se ve). En colapsado hay pocos iconos → no hace falta scroll vertical. */
.main-sidebar.collapsed { overflow: visible; }
.main-sidebar.collapsed .sidebar-nav { overflow: visible; }
.main-sidebar.collapsed .collapsed-flyout { z-index: 300; }

/* El rail colapsado debe pintar POR ENCIMA de la sidebar secundaria, si no el
   flyout (que sale hacia la derecha, sobre la secundaria) queda tapado. */
.main-sidebar.collapsed { z-index: 40; }
.secondary-sidebar { position: relative; z-index: 5; }

/* FIX: en colapsado el nav-item dentro de .nav-cell perdía la restricción de
   ancho del rail y el icono quedaba centrado FUERA de la vista (invisible).
   Centramos el cell y ocultamos la etiqueta por completo (no solo opacity). */
.main-sidebar.collapsed .nav-cell { display: flex; justify-content: center; width: 100%; }
.main-sidebar.collapsed .nav-cell > .nav-item { width: auto; padding: 10px; }
.main-sidebar.collapsed .nav-cell .nav-label { display: none; }

/* Punto verde "en vivo" del item Comunicaciones (llama la atención) */
.cm-live-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #20c46b; flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(32, 196, 107, .6);
  animation: cmLivePulse 1.6s ease-out infinite;
}
@keyframes cmLivePulse {
  0%   { box-shadow: 0 0 0 0 rgba(32, 196, 107, .55); transform: scale(1); }
  70%  { box-shadow: 0 0 0 7px rgba(32, 196, 107, 0); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 0 rgba(32, 196, 107, 0); transform: scale(1); }
}
