/* =========================
   Sidebar – Eading desktop
   Visible en ≥992px, oculto en mobile (usa navbott)
   ========================= */

:root {
  --sidebar-w:      240px;
  --sidebar-bg:     #004a9c;
  --sidebar-hover:  rgba(255,255,255,0.10);
  --sidebar-active: rgba(255,255,255,0.18);
  --sidebar-text:   rgba(255,255,255,0.88);
  --sidebar-muted:  rgba(255,255,255,0.52);
}

/* ── Ocultar header en desktop ────────────────────────────── */
@media (min-width: 992px) {
  #app-header { display: none !important; }

  body {
    padding-bottom: 0 !important;
    padding-left: var(--sidebar-w);
  }

  .bottom-nav { display: none !important; }

  .mb-safe {
    padding-bottom: 1.5rem !important;
  }
}

/* ── Sidebar ──────────────────────────────────────────────── */
.igm-sidebar {
  display: none;
}

@media (min-width: 992px) {
  .igm-sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
  }
  .igm-sidebar::-webkit-scrollbar { display: none; }
}

/* Brand */
.igm-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  text-decoration: none;
  flex-shrink: 0;
}
.igm-sidebar-brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255,255,255,0.92);
  padding: 4px;
  flex-shrink: 0;
}

.igm-sidebar-brand-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.15;
  letter-spacing: 0.1px;
}
.igm-sidebar-brand-sub {
  font-size: 0.68rem;
  color: var(--sidebar-muted);
  font-weight: 500;
  display: block;
  margin-top: 1px;
}

/* Usuario */
.igm-sidebar-user {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  flex-shrink: 0;
}
.igm-sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.igm-sidebar-user-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.igm-sidebar-user-role {
  font-size: 0.68rem;
  color: var(--sidebar-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav */
.igm-sidebar-nav {
  flex: 1;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.igm-sidebar-section {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--sidebar-muted);
  padding: 10px 8px 4px;
}

.igm-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.14s ease, color 0.14s ease;
  white-space: nowrap;
  overflow: hidden;
}
.igm-sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  opacity: 0.85;
}
.igm-sidebar-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.igm-sidebar-link:hover i { opacity: 1; }

.igm-sidebar-link.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 700;
}
.igm-sidebar-link.active i { opacity: 1; }

.igm-sidebar-link--sub {
  padding-left: 22px;
  font-size: 0.825rem;
  color: var(--sidebar-text);
}
.igm-sidebar-link--sub i {
  font-size: 0.82rem;
  opacity: 0.85;
}
.igm-sidebar-link--sub:hover,
.igm-sidebar-link--sub.active {
  color: #fff;
}
.igm-sidebar-link--sub.active {
  background: var(--sidebar-active);
  font-weight: 700;
}
.igm-sidebar-link--sub.disabled {
  color: var(--sidebar-muted);
}
.igm-sidebar-link--sub.disabled i {
  opacity: 0.5;
}

/* Footer */
.igm-sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.10);
  flex-shrink: 0;
}
.igm-sidebar-footer .igm-sidebar-link {
  color: var(--sidebar-muted);
}
.igm-sidebar-footer .igm-sidebar-link:hover {
  color: #fff;
  background: var(--sidebar-hover);
}

.igm-sidebar-version {
  font-size: 0.65rem;
  color: var(--sidebar-muted);
  text-align: center;
  padding: 6px 0 8px;
}

/* ── Header móvil (chip de usuario) ──────────────────────── */
.app-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 520px) {
  .app-user-chip { display: none; }
}
