/* ══════════════════════════════════════════════
   SIDEBAR — Inteligência de Mercado
   ══════════════════════════════════════════════ */

/* ── Container ──────────────────────────────── */
#sidebar-col {
  width: 248px;
  min-width: 248px;
  background: #0c3f52;
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
  transition: width 0.26s ease, min-width 0.26s ease;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 200;
  flex-shrink: 0;
}

#sidebar-col.collapsed {
  width: 66px;
  min-width: 66px;
}

/* ── Header (logo + hambúrguer) ─────────────── */
#sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 12px 14px;
  background: #07303f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
  min-height: 66px;
}

#sidebar-col.collapsed #sidebar-header {
  justify-content: center;
  padding: 14px 0;
}

#sidebar-logo {
  height: 34px;
  object-fit: contain;
  transition: opacity 0.18s, width 0.22s;
  flex-shrink: 0;
}

#sidebar-col.collapsed #sidebar-logo {
  opacity: 0;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* ── Hambúrguer ─────────────────────────────── */
#btn-sidebar-toggle {
  background: transparent !important;
  border: none !important;
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 1.45rem !important;
  padding: 4px 6px !important;
  line-height: 1 !important;
  box-shadow: none !important;
  border-radius: 6px !important;
  cursor: pointer;
  flex-shrink: 0;
  outline: none !important;
}

#btn-sidebar-toggle:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.12) !important;
}

/* ── Nav wrapper ────────────────────────────── */
#sidebar-nav-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 8px 8px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) transparent;
}

#sidebar-nav-wrapper::-webkit-scrollbar {
  width: 4px;
}
#sidebar-nav-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}

/* ── Group headers ──────────────────────────── */
.sidebar-group-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  padding: 14px 10px 4px 10px;
  white-space: nowrap;
  overflow: hidden;
  height: auto;
  transition: opacity 0.18s, height 0.22s, padding 0.22s;
}

#sidebar-col.collapsed .sidebar-group-label {
  opacity: 0;
  height: 0;
  padding: 0;
}

/* ── Nav divider ────────────────────────────── */
.sidebar-divider {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin: 6px 4px;
  transition: opacity 0.18s;
}

#sidebar-col.collapsed .sidebar-divider {
  opacity: 0;
  margin: 2px 4px;
}

/* ── Nav links ──────────────────────────────── */
.nav-pills .nav-link {
  color: rgba(255, 255, 255, 0.68) !important;
  border-radius: 8px !important;
  padding: 8px 10px 8px 13px !important;
  margin-bottom: 1px !important;
  font-size: 0.865rem !important;
  display: flex !important;
  align-items: center !important;
  transition: background 0.14s, color 0.14s, padding 0.2s !important;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
}

.nav-pills .nav-link:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #ffffff !important;
}

.nav-pills .nav-link.active {
  background: rgba(255, 255, 255, 0.13) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  padding-left: 10px !important;
  border-left: 3px solid #f5c842 !important;
  border-radius: 0 8px 8px 0 !important;
}

.nav-pills .nav-link .bi {
  font-size: 1.1rem !important;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

/* ── Collapsed nav centering ────────────────── */
#sidebar-col.collapsed .nav-pills .nav-link {
  justify-content: center !important;
  padding: 9px 0 !important;
  border-left: none !important;
  border-radius: 8px !important;
}

#sidebar-col.collapsed .nav-pills .nav-link.active {
  border-left: none !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.18) !important;
}

/* ── Text labels ────────────────────────────── */
.sidebar-label {
  margin-left: 10px;
  overflow: hidden;
  max-width: 180px;
  transition: opacity 0.16s, max-width 0.22s, margin 0.22s;
}

#sidebar-col.collapsed .sidebar-label {
  opacity: 0;
  max-width: 0;
  margin-left: 0;
}

/* ── Footer (logout) ────────────────────────── */
#sidebar-footer {
  padding: 10px 8px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

#btn-logout {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: rgba(255, 255, 255, 0.60) !important;
  width: 100% !important;
  border-radius: 8px !important;
  padding: 7px 12px !important;
  font-size: 0.865rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  transition: background 0.14s, color 0.14s, border-color 0.14s !important;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: none !important;
}

#btn-logout:hover {
  background: rgba(220, 53, 69, 0.22) !important;
  border-color: rgba(220, 53, 69, 0.45) !important;
  color: #ff9494 !important;
}

#sidebar-col.collapsed #btn-logout {
  justify-content: center !important;
  padding: 7px 0 !important;
}

/* ── Main content area ──────────────────────── */
#main-content {
  flex: 1;
  overflow: auto;
  min-width: 0;
}
