/* ── sidebar.css — Akino Systems ── */
/* ══════════════════════════════════════
   APP SHELL
══════════════════════════════════════ */
#app { display: none; min-height: 100vh; }

/* ── SIDEBAR — largura minimalista ── */
:root { --sw: 56px; }

.sidebar {
  position: fixed;
  top: 0; left: 0; right: auto; bottom: 0;
  width: var(--sw);
  height: 100vh;           /* garante altura total sem depender do pai */
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 110;            /* acima da topbar (z-index:50) */
  overflow: visible;
  align-items: center;
}

/* ── WORKSPACE MARK ── */
.ws-switcher {
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  width: 100%;
  display: flex; justify-content: center;
  position: relative;
}
.ws-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  padding: 0; border: none;
  background: none; cursor: pointer;
  border-radius: 9px;
  transition: background .12s;
  text-align: left;
}
.ws-btn:hover { background: var(--s2); }
.ws-mark {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--s3); border: 1px solid var(--border2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text); font-weight: 700;
}
.ws-info, .ws-label, .ws-name, .ws-caret { display: none; }

/* Workspace dropdown — anchors to right of sidebar */
.ws-dropdown {
  position: fixed;
  top: 10px;
  left: calc(var(--sw) + 6px);
  width: 220px;
  background: var(--s1); border: 1px solid var(--border2);
  border-radius: var(--radius); z-index: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,.13);
  display: none; overflow: hidden;
  animation: fadeUp .18s cubic-bezier(.16,1,.3,1) both;
}
body.dark .ws-dropdown { box-shadow: 0 8px 32px rgba(0,0,0,.5); }
.ws-dropdown.open { display: block; }
.ws-dd-hd {
  padding: 10px 12px 6px; font-size: 10px; font-weight: 600;
  letter-spacing: .6px; text-transform: uppercase; color: var(--muted);
}
.ws-dd-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; cursor: pointer; transition: background .12s;
}
.ws-dd-item:hover { background: var(--s2); }
.ws-dd-item.active { background: var(--s2); }
.ws-dd-mark {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; letter-spacing: -.2px;
}
.ws-dd-info { flex: 1; min-width: 0; }
.ws-dd-name {
  font-size: 12.5px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-dd-role { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.ws-dd-check { color: var(--text); flex-shrink: 0; }
.ws-dd-sep { height: 1px; background: var(--border); margin: 3px 0; }
.ws-dd-action {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 12px; cursor: pointer; transition: background .12s;
  font-size: 12.5px; color: var(--muted);
}
.ws-dd-action:hover { background: var(--s2); color: var(--text); }
.ws-dd-action svg { flex-shrink: 0; }

/* ── NAV ── */
.sb-nav {
  flex: 1; padding: 6px 0;
  overflow-y: auto; overflow-x: visible;
  scrollbar-width: none;
  width: 100%;
  display: flex; flex-direction: column;
  align-items: center; gap: 1px;
}
.sb-nav::-webkit-scrollbar { display: none; }

.sb-group-body {
  display: flex; flex-direction: column;
  align-items: center; gap: 1px;
  width: 100%;
}

.sb-group-sep {
  width: 24px; height: 1px;
  background: var(--border);
  margin: 4px 0; flex-shrink: 0;
}

/* ── NAV ITEMS ── */
.sb-item {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s, transform .1s;
  user-select: none;
  margin: 0 auto;
  flex-shrink: 0;
}
.sb-item:hover {
  background: var(--s2);
  transform: scale(1.06);
}
.sb-item.active { background: var(--s2); }
.sb-item.active::before {
  content: '';
  position: absolute;
  left: -10px; top: 22%; bottom: 22%;
  width: 2.5px; border-radius: 2px;
  background: var(--text);
}

.sb-item svg {
  flex-shrink: 0; opacity: .4;
  transition: opacity .12s; color: var(--muted);
}
.sb-item:hover svg { opacity: .8; color: var(--text); }
.sb-item.active svg { opacity: 1; color: var(--text); }

/* Hide text labels */
.sb-item-label { display: none; }

/* ── TOOLTIP ── */
.sb-tooltip {
  pointer-events: none;
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-5px);
  background: var(--s3);
  color: var(--text);
  font-size: 12px; font-weight: 500;
  padding: 5px 10px;
  border-radius: 7px;
  white-space: nowrap;
  border: 1px solid var(--border2);
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  opacity: 0;
  transition: opacity .14s cubic-bezier(.16,1,.3,1),
              transform .14s cubic-bezier(.16,1,.3,1);
  z-index: 999;
}
body.dark .sb-tooltip { box-shadow: 0 4px 14px rgba(0,0,0,.4); }

.sb-item:hover .sb-tooltip,
.sb-user--mini:hover .sb-tooltip,
.sb-logout-mini:hover .sb-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Badge */
.sb-item-badge {
  position: absolute;
  top: 4px; right: 3px;
  font-size: 9px; font-weight: 700;
  min-width: 14px; height: 14px;
  border-radius: 7px;
  background: var(--text); color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--s1);
}
body.dark .sb-item-badge { background: #3A3A38; color: var(--text); }

/* ── USER FOOTER ── */
.sb-user--mini {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .12s;
  margin: 0 auto 2px;
  flex-shrink: 0;
}
.sb-user--mini:hover { background: var(--s2); }

.sb-logout-mini {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  cursor: pointer;
  margin: 0 auto 10px;
  color: var(--muted);
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.sb-logout-mini:hover { background: var(--red-bg); color: var(--red); }
.sb-logout-mini svg { opacity: .4; transition: opacity .12s; }
.sb-logout-mini:hover svg { opacity: 1; }

/* Avatar sidebar — radius padrão, cor injetada via JS, suporte foto */
.sb-av {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  background: #6366f1; border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  overflow: hidden;
}
.sb-av img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }

/* Legacy compat */
.sb-uname, .sb-urole, .sb-uinfo, .sb-out-btn { display: none; }
.sb-group, .sb-group-hd, .sb-menu-label, .sb-sep { display: none; }
.sb-brand { display: none; }

/* ── Bottom container ── */
.sb-bottom {
  display: flex; flex-direction: column;
  align-items: center;
  padding: 6px 0 10px;
  border-top: 1px solid var(--border);
  gap: 2px; width: 100%;
  flex-shrink: 0;
}
