/* ── subpanel.css — Akino Systems ── */

:root {
  --sp-w:   220px;
  --sp-gap: 8px;
  --sw-open: calc(var(--sw) + var(--sp-w) + var(--sp-gap) * 2);
}

/* ── PAINEL ── */
.sub-panel {
  position: fixed;
  top: 0; bottom: 0;
  left: var(--sw);
  width: 0;
  overflow: hidden;
  z-index: 105;
  transition: width .2s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}
.sub-panel.open {
  width: calc(var(--sp-w) + var(--sp-gap) * 2);
  pointer-events: all;
}

/* ── INNER CARD ── */
.sub-panel-inner {
  position: absolute;
  top: var(--sp-gap);
  bottom: var(--sp-gap);
  left: var(--sp-gap);
  right: var(--sp-gap);
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,.10);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .18s cubic-bezier(.16,1,.3,1),
              transform .18s cubic-bezier(.16,1,.3,1);
}
body.dark .sub-panel-inner {
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  background: var(--s1);
  border-color: rgba(255,255,255,0.05);
}
.sub-panel.open .sub-panel-inner {
  opacity: 1;
  transform: translateX(0);
}

/* ── HEADER ── */
.sp-header {
  padding: 16px 16px 13px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sp-header-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .2px;
  text-transform: uppercase;
  opacity: .5;
}

/* ── SCROLL AREA ── */
.sp-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  padding: 8px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sp-body::-webkit-scrollbar { display: none; }

/* ── ITEM ── */
.sp-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: background .1s, color .1s;
  user-select: none;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}
.sp-item:hover {
  background: var(--s2);
  color: var(--text);
}
.sp-item.active {
  background: var(--s2);
  color: var(--text);
  font-weight: 500;
}
.sp-item.active .sp-item-dot {
  background: var(--text);
  width: 4px; height: 4px;
}

.sp-item-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--border2);
  flex-shrink: 0;
  transition: background .1s, width .1s, height .1s;
}

/* ── ADD BTN inline ── */
.sp-item-add {
  margin-left: auto;
  width: 16px; height: 16px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  opacity: 0;
  transition: opacity .1s, background .1s, color .1s;
  flex-shrink: 0;
}
.sp-item:hover .sp-item-add { opacity: 1; }
.sp-item-add:hover { background: var(--s3); color: var(--text); }

/* ── PUSH MAIN quando painel aberto ── */
body.sp-open .main {
  margin-left: var(--sw-open);
  width: calc(100vw - var(--sw-open));
  transition: margin-left .2s cubic-bezier(.16,1,.3,1),
              width .2s cubic-bezier(.16,1,.3,1);
}
body:not(.sp-open) .main {
  transition: margin-left .2s cubic-bezier(.16,1,.3,1),
              width .2s cubic-bezier(.16,1,.3,1);
}

/* ── BOTÃO FECHAR ── */
.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sp-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.sp-close-btn:hover {
  background: var(--s3);
  color: var(--text);
}

/* ── GRUPOS ── */
.sp-group {
  padding: 8px 8px 4px;
}
.sp-group-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 8px 4px;
  opacity: .6;
}
.sp-group-sep {
  height: 1px;
  background: var(--border);
  margin: 6px 12px;
}

/* ── ITEM COM ÍCONE ── */
.sp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: background .1s, color .1s;
  user-select: none;
  font-size: 13.5px;
  color: var(--text);
  font-weight: 400;
  line-height: 1.3;
}
.sp-item:hover {
  background: var(--s2);
}
.sp-item.active {
  background: var(--s2);
  font-weight: 500;
}
.sp-item-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--muted);
  transition: color .1s;
}
.sp-item-icon svg {
  width: 15px;
  height: 15px;
}
.sp-item:hover .sp-item-icon { color: var(--text); }
.sp-item.active .sp-item-icon { color: var(--text); }
.sp-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── AÇÃO RÁPIDA — cor mais suave ── */
.sp-item-action .sp-item-text {
  color: var(--muted);
}
.sp-item-action:hover .sp-item-text {
  color: var(--text);
}
.sp-item-action .sp-item-icon {
  opacity: .7;
}

/* ── v1.1.68 — Escala tipográfica ── */
.sp-item       { font-size: var(--text-base); }
.sp-group-label{ font-size: var(--text-xs); }
.sp-header-title { font-size: var(--text-xs); letter-spacing: .5px; }
