/* ═══════════════════════════════════════════════════════════════
   PURESTORA DASHBOARD  —  Dark Accordion Sidebar  v3
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ── */
:root {
  --sb-bg:          #15192a;
  --sb-surface:     #1e2438;
  --sb-border:      #2a3050;
  --sb-text-muted:  #6b7a90;
  --sb-text:        #a8b4c4;
  --sb-text-hi:     #f0f4ff;
  --sb-active-bg:   #996633;
  --sb-active-bg2:  #7d5429;
  --sb-hover-bg:    rgba(255,255,255,.07);
  --sb-icon:        #5a6680;
  --sb-icon-hi:     #c8d4e8;
  --sb-w-sm:        68px;
  --sb-w-lg:        252px;
  --sb-pill-mr:     12px;
  --sb-radius:      10px;
  --sb-transition:  .28s cubic-bezier(.4,0,.2,1);
}

/* ═══════════════════════════════════════════════
   LAYOUT WRAPPER
   ═══════════════════════════════════════════════ */
.dashboard-wrapper {
  display: flex !important;
  flex-wrap: nowrap !important;
  min-height: 100vh;
  overflow: hidden;
  margin: 0; padding: 0;
}

/* ═══════════════════════════════════════════════
   SIDEBAR SHELL  — styles live inside the include
   Scoped to .dashboard-wrapper to avoid bleeding
   into the store-page filter sidebar (.sidebar)
   ═══════════════════════════════════════════════ */
.dashboard-wrapper .sidebar {
  flex-shrink: 0 !important;
  height: 100vh !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 200 !important;
}

/* ═══════════════════════════════════════════════
   BRAND STRIP
   ═══════════════════════════════════════════════ */
.sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--sb-border);
  flex-shrink: 0;
  overflow: hidden;
}
.sb-brand-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #996633, #c4884d);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 19px; color: #fff;
  box-shadow: 0 2px 8px rgba(153,102,51,.4);
}
.sb-brand-name {
  font-size: 14px; font-weight: 700;
  color: var(--sb-text-hi);
  letter-spacing: .2px;
  opacity: 0; max-width: 0;
  overflow: hidden;
  transition: opacity .2s .05s, max-width .25s;
  white-space: nowrap;
}
.sidebar:hover .sb-brand-name,
.sidebar.sb-locked .sb-brand-name { opacity: 1; max-width: 160px; }

/* ═══════════════════════════════════════════════
   NAV BODY
   ═══════════════════════════════════════════════ */
.sb-nav { flex: 1; padding: 6px 0 4px; }

/* ── Divider ── */
.sb-divider {
  height: 1px;
  background: var(--sb-border);
  margin: 5px 14px;
  opacity: .5;
}

/* ── Section label ── */
.sb-section-lbl {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .9px;
  color: var(--sb-text-muted);
  padding: 10px 18px 3px;
  opacity: 0; max-width: 0; overflow: hidden;
  transition: opacity .2s .05s, max-width .25s;
  white-space: nowrap;
  pointer-events: none;
  display: block;
}
.sidebar:hover .sb-section-lbl,
.sidebar.sb-locked .sb-section-lbl { opacity: 1; max-width: 200px; }

/* ═══════════════════════════════════════════════
   SHARED ITEM BASE  (standalone + group header)
   ═══════════════════════════════════════════════ */
.sb-standalone,
.sb-group-hd {
  display: flex;
  align-items: center;
  padding: 9px 10px 9px 14px;
  text-decoration: none;
  color: var(--sb-text);
  cursor: pointer;
  border: none; background: none;
  width: 100%;
  transition: color .15s, background .15s;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}

.sb-standalone:hover,
.sb-group-hd:hover {
  color: var(--sb-text-hi);
  background: var(--sb-hover-bg);
  text-decoration: none;
}

/* ── Active standalone ── */
.sb-standalone.active {
  background: linear-gradient(90deg, var(--sb-active-bg) 0%, var(--sb-active-bg2) 100%) !important;
  color: #fff !important;
  font-weight: 700 !important;
  border-radius: 0 var(--sb-radius) var(--sb-radius) 0 !important;
  margin-right: var(--sb-pill-mr) !important;
  box-shadow: 0 3px 10px rgba(153,102,51,.35);
}
.sb-standalone.active:hover {
  background: linear-gradient(90deg, #b07a40 0%, #8c5f30 100%) !important;
}

/* ── Child-active group header ── */
.sb-group-hd.sb-child-active { color: var(--sb-text-hi); }
.sb-group-hd.sb-open { color: var(--sb-text-hi); }

/* ═══════════════════════════════════════════════
   ICONS
   ═══════════════════════════════════════════════ */
.sb-icon {
  font-size: 17px;
  width: 36px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--sb-icon);
  transition: color .15s;
  border-radius: 7px;
}
.sb-standalone:hover .sb-icon,
.sb-group-hd:hover   .sb-icon    { color: var(--sb-icon-hi); }
.sb-standalone.active .sb-icon   { color: #fff; }
.sb-group-hd.sb-child-active .sb-icon,
.sb-group-hd.sb-open .sb-icon    { color: var(--sb-text-hi); }

/* Subtle icon tint on hover */
.sb-standalone:hover .sb-icon,
.sb-group-hd:hover .sb-icon {
  background: rgba(255,255,255,.06);
}

/* ═══════════════════════════════════════════════
   LABELS  (hidden when rail is collapsed)
   ═══════════════════════════════════════════════ */
.sb-label {
  font-size: 13px; font-weight: 500;
  color: inherit;
  opacity: 0; max-width: 0; overflow: hidden;
  margin-left: 4px; flex: 1;
  transition: opacity .2s .05s, max-width .25s;
  white-space: nowrap;
  line-height: 1;
}
.sidebar:hover .sb-label,
.sidebar.sb-locked .sb-label { opacity: 1; max-width: 160px; }
.sb-standalone.active .sb-label { font-weight: 700; letter-spacing: .1px; }

/* ═══════════════════════════════════════════════
   CHEVRON
   ═══════════════════════════════════════════════ */
.sb-chev {
  font-size: 10px;
  color: var(--sb-text-muted);
  opacity: 0;
  margin-left: auto; flex-shrink: 0;
  transition: opacity .2s, transform .22s;
}
.sidebar:hover .sb-chev,
.sidebar.sb-locked .sb-chev { opacity: 1; }
.sb-group-hd.sb-open .sb-chev { transform: rotate(180deg); }
.sb-group-hd:hover .sb-chev { color: var(--sb-text); }

/* ═══════════════════════════════════════════════
   ACCORDION BODY
   ═══════════════════════════════════════════════ */
.sb-group-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .22s ease-out;
}
.sidebar:hover .sb-group-body.sb-open,
.sidebar.sb-locked .sb-group-body.sb-open { max-height: 600px; }

/* ═══════════════════════════════════════════════
   SUB-ITEMS
   ═══════════════════════════════════════════════ */
.sb-item {
  display: flex;
  align-items: center;
  padding: 8px 10px 8px 18px;
  text-decoration: none;
  color: var(--sb-text-muted);
  font-size: 13px;
  white-space: nowrap;
  transition: color .15s, background .15s;
  overflow: hidden;
  position: relative;
  gap: 10px;
}
/* Left dot indicator */
.sb-item::before {
  content: '';
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--sb-border);
  flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.sb-item:hover {
  color: var(--sb-text-hi);
  background: var(--sb-hover-bg);
  text-decoration: none;
}
.sb-item:hover::before { background: var(--sb-text); transform: scale(1.4); }

/* Active sub-item: brand pill */
.sb-item.active {
  color: #fff;
  background: linear-gradient(90deg, var(--sb-active-bg) 0%, var(--sb-active-bg2) 100%);
  font-weight: 600;
  border-radius: 0 var(--sb-radius) var(--sb-radius) 0;
  margin-right: var(--sb-pill-mr);
  box-shadow: 0 2px 8px rgba(153,102,51,.3);
}
.sb-item.active::before { background: rgba(255,255,255,.5); }
.sb-item.active:hover {
  background: linear-gradient(90deg, #b07a40 0%, #8c5f30 100%);
}

/* Item text (same opacity trick for consistency) */
.sb-item-text {
  opacity: 0; max-width: 0; overflow: hidden;
  transition: opacity .2s .05s, max-width .25s;
  white-space: nowrap;
}
.sidebar:hover .sb-item-text,
.sidebar.sb-locked .sb-item-text { opacity: 1; max-width: 160px; }

/* ═══════════════════════════════════════════════
   SIDEBAR FOOTER
   ═══════════════════════════════════════════════ */
.sb-footer {
  padding: 6px 0 10px;
  border-top: 1px solid var(--sb-border);
  flex-shrink: 0;
}

/* ── Pin button ── */
.sb-pin {
  display: flex; align-items: center;
  padding: 8px 10px 8px 14px;
  cursor: pointer;
  color: var(--sb-text-muted);
  background: none; border: none;
  width: 100%; overflow: hidden;
  transition: color .15s;
  gap: 0;
}
.sb-pin:hover { color: var(--sb-text); }
.sidebar.sb-locked .sb-pin { color: var(--sb-active-bg); }

/* ── Logout ── */
.sb-logout {
  display: flex; align-items: center;
  padding: 9px 10px 9px 14px;
  text-decoration: none;
  color: #e05252;
  cursor: pointer;
  background: none; border: none;
  width: 100%;
  transition: background .15s, color .15s;
  overflow: hidden;
  white-space: nowrap;
}
.sb-logout:hover { background: rgba(224,82,82,.1); color: #ff7070; text-decoration: none; }
.sb-logout .sb-icon { color: #e05252 !important; }
.sb-logout:hover .sb-icon { color: #ff7070 !important; background: none; }

/* ═══════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════ */
.main-content {
  padding: 20px;
  padding-top: 0;
  padding-left: 0;
  margin: 0;
  flex-grow: 1;
  width: 100%;
  overflow-x: auto;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .dashboard-wrapper .sidebar {
    position: fixed;
    height: 100vh;
    z-index: 1050;
  }
}
