/* =========================================================
   SIDEBAR-PAGE — iframe sidebar (SGE Design System)
========================================================= */
@import url('../assets/sge/fonts/fonts.css');
@import url('../assets/sge/css/design-tokens.css');
@import url('../assets/sge/css/theme.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: transparent; }
body { font-family: var(--font-body); font-size: 14px; color: var(--text-1); }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }

.sidebar {
  height: 100vh;
  padding: 16px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: transparent;
  border-right: none;
  box-shadow: none;
}

.sidebar::before { display: none; }
.sidebar > * { position: relative; z-index: 1; }

.sidebar-label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  padding: 0 12px 8px;
}

.sidebar-menu {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  position: relative;
  height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: rgba(200, 232, 240, 0.82);
  font: 400 0.88rem var(--font-body);
  cursor: pointer;
  user-select: none;
  transition: transform 0.22s var(--ease-out), border-color 0.22s, color 0.2s, background 0.3s;
}

.sidebar-item:hover {
  transform: translateX(2px);
  color: rgba(240, 250, 252, 0.94);
  border-color: rgba(200, 230, 245, 0.10);
  background:
    radial-gradient(circle at 12% 50%, rgba(180, 230, 250, 0.08), transparent 65%),
    linear-gradient(135deg, rgba(18, 101, 128, 0.22), rgba(7, 52, 74, 0.32));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 4px 16px rgba(2, 12, 20, 0.18);
}

.sidebar-item.active {
  color: rgba(246, 255, 255, 0.96);
  border-color: rgba(200, 230, 245, 0.14);
  background:
    radial-gradient(circle at 14% 50%, rgba(200, 255, 248, 0.14), rgba(100, 180, 210, 0.05) 40%, transparent 72%),
    linear-gradient(135deg, rgba(18, 101, 128, 0.34), rgba(7, 52, 74, 0.46), rgba(4, 30, 44, 0.52));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 6px 20px rgba(2, 12, 20, 0.22);
}

.sidebar-item.active::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: rgba(155, 220, 255, 0.95);
  box-shadow: 0 0 12px rgba(155, 220, 255, 0.45);
}

.sidebar-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(200, 230, 245, 0.08);
  color: rgba(200, 232, 240, 0.72);
  transition: 0.2s ease;
}

.sidebar-item:hover .sidebar-icon,
.sidebar-item.active .sidebar-icon {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(200, 230, 245, 0.14);
  color: var(--text-1);
}

.sidebar-icon svg { display: block; }

.sidebar-badge {
  margin-left: auto;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 70, 109, 0.32);
  background: rgba(255, 70, 109, 0.22);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}

.sidebar-badge.zero {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-2);
  color: var(--text-3);
}

.sidebar-submenu {
  list-style: none;
  margin: -2px 0 4px 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.22s ease;
}

.sidebar-submenu.open { max-height: 300px; opacity: 1; }

.sidebar-subitem {
  height: 38px;
  margin-bottom: 4px;
  padding: 0 14px 0 46px;
  display: flex;
  align-items: center;
  border-radius: 12px;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  transition: 0.2s ease;
}

.sidebar-subitem::before {
  content: "";
  position: absolute;
  left: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(155, 210, 255, 0.30);
}

.sidebar-subitem:hover,
.sidebar-subitem.active {
  color: var(--text-1);
  background: rgba(18, 101, 128, 0.28);
  border-color: rgba(200, 230, 245, 0.08);
}

.sidebar-divider {
  height: 1px;
  margin: 4px 10px;
  background: linear-gradient(90deg, transparent, var(--border-1), transparent);
}

.sidebar-spacer { flex: 1; }

.sidebar-user {
  margin: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  border: 1px solid rgba(200, 230, 245, 0.10);
  background: linear-gradient(135deg, rgba(13, 83, 109, 0.28), rgba(7, 52, 74, 0.38));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(18, 101, 128, 0.65), rgba(7, 52, 74, 0.85));
  border: 1px solid rgba(200, 230, 245, 0.12);
}

.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--text-1); }
.sidebar-user-role { font-size: 10px; color: var(--text-3); margin-top: 1px; }

.sidebar-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--green-ok);
  box-shadow: 0 0 8px rgba(104, 226, 162, 0.70);
}

.sidebar-close { display: none; }
