/* ============================================================
   SIDEBAR — styles extracted from assignment_left_menu.php
   Loaded via assignment_header.php and common_code/header.php
============================================================ */

:root {
  --sb-bg:        #ffffff;
  --sb-border:    #e8edf3;
  --sb-text:      #1e293b;
  --sb-muted:     #64748b;
  --sb-primary:   #072946;
  --sb-accent:    #2e6da4;
  --sb-active-bg: #eef4fb;
  --sb-hover-bg:  #f6f8fb;
  --sb-width:     252px;
}

/* ── Sidebar shell ── */
.sidebar-header {
  position: fixed;
  top: var(--navbar-h, 60px);
  left: 0;
  width: var(--sb-width);
  height: calc(100vh - var(--navbar-h, 60px));
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.sidebar-header::-webkit-scrollbar { width: 4px; }
.sidebar-header::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

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

/* ── Home link ── */
.sidebar-header .sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sb-text) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  text-decoration: none !important;
  transition: background 0.15s;
  font-family: 'Nunito Sans', sans-serif !important;
}
.sidebar-header .sb-link:hover {
  background: var(--sb-hover-bg);
  text-decoration: none !important;
  color: var(--sb-primary) !important;
}
.sidebar-header .sb-link.sb-active {
  background: var(--sb-active-bg);
  color: var(--sb-accent) !important;
  font-weight: 700 !important;
}
.sidebar-header .sb-link-text { flex: 1; }

/* ── Icon wrapper ── */
.sb-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #eef4fb;
  color: var(--sb-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.sb-icon-sm {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 11px;
}

/* ── Group (details/summary) ── */
.sidebar-header .sb-group {
  border-radius: 8px;
}
.sidebar-header .sb-group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sb-muted) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  font-family: 'Nunito Sans', sans-serif !important;
}
.sidebar-header .sb-group > summary:hover {
  background: var(--sb-hover-bg);
  color: var(--sb-primary) !important;
}
.sidebar-header .sb-group > summary::-webkit-details-marker { display: none; }

.sidebar-header .sb-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Chevron rotation */
.chev { transition: transform 0.2s ease; color: var(--sb-muted); flex-shrink: 0; }
details[open] > summary .chev { transform: rotate(90deg); }

/* ── Child links ── */
.sidebar-header .sb-children {
  padding: 3px 0 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-header .sb-child {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px 8px 10px !important;
  border-radius: 7px;
  color: var(--sb-text) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
  font-family: 'Nunito Sans', sans-serif !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}
.sidebar-header .sb-child:hover {
  background: var(--sb-hover-bg);
  color: var(--sb-accent) !important;
  text-decoration: none !important;
  border-left-color: var(--sb-border);
}
.sidebar-header .sb-child.sb-active {
  background: var(--sb-active-bg);
  color: var(--sb-accent) !important;
  font-weight: 700 !important;
  border-left-color: var(--sb-accent);
}
.sidebar-header .sb-child-icon {
  width: 16px;
  text-align: center;
  color: var(--sb-muted) !important;
  font-size: 13px !important;
  flex-shrink: 0;
  transition: color 0.15s;
}
.sidebar-header .sb-child:hover .sb-child-icon,
.sidebar-header .sb-child.sb-active .sb-child-icon {
  color: var(--sb-accent) !important;
}

/* ── Sidebar footer ── */
.sidebar-header .sb-footer {
  margin-top: auto;
  padding: 14px 12px 4px;
  font-size: 11px !important;
  color: var(--sb-muted) !important;
  text-align: center;
  border-top: 1px solid var(--sb-border);
}

/* ── Reset Bootstrap/global overrides inside sidebar ── */
.sidebar-header ul,
.sidebar-header li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.sidebar-header a {
  color: inherit !important;
  text-decoration: none !important;
  font-size: inherit !important;
  margin: 0 !important;
  padding: 0 !important;
}
/* Override the aggressive .active a rule in assignment_header.css */
.sidebar-header .active a,
.sidebar-header a.active {
  color: var(--sb-accent) !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
}

/* ── Backdrop (mobile overlay) ── */
.backdrop {
  display: none;
  position: fixed;
  inset: 56px 0 0 0;
  background: rgba(2, 6, 23, 0.4);
  backdrop-filter: blur(2px);
  z-index: 499;
}
.backdrop.show { display: block; }

/* ── Responsive: sidebar off-canvas on mobile ── */
@media (max-width: 992px) {
  .sidebar-header {
    top: var(--navbar-h, 60px);
    height: calc(100vh - var(--navbar-h, 60px));
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12);
    z-index: 1200;
  }
  .sidebar-header.open {
    transform: translateX(0);
  }
}
