/* IBD Dashboard — App Shell, Sidebar, Layout, Tabs */
/* ─────────────────────────────────────────────
   8. SIDEBAR
   ───────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 10px; left: 10px;
  width: 220px; height: calc(100vh - 20px);
  background: linear-gradient(180deg, #0891b2 0%, #0369a1 100%);
  border-radius: 24px;
  border-right: none;
  box-shadow: 0 8px 32px rgba(6,182,212,0.25), 0 2px 8px rgba(0,0,0,0.16);
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  transition: width .25s cubic-bezier(.4,0,.2,1);
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-profile {
  padding: 14px 12px;
  border-bottom: none;
  display: flex; align-items: center; gap: 10px;
}
.sb-profile-info { flex: 1; min-width: 0; overflow: hidden; transition: opacity .2s, width .25s; }
.sb-toggle-btn {
  flex-shrink: 0; width: 26px; height: 26px;
  border-radius: 8px; border: none;
  background: rgba(255,255,255,0.12); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; transition: background .15s, transform .25s;
  margin-left: auto;
}
.sb-toggle-btn:hover { background: rgba(255,255,255,0.22); }

/* ── Collapsed sidebar state ── */
.sidebar.collapsed { width: 66px; }
.sidebar.collapsed .sb-profile-info { opacity: 0; width: 0; overflow: hidden; }
/* Stack avatar + toggle button vertically so neither gets clipped */
.sidebar.collapsed .sidebar-profile { flex-direction: column; align-items: center; gap: 6px; padding: 12px 0; }
.sidebar.collapsed .sb-toggle-btn   { margin-left: 0; }
.sidebar.collapsed #sbToggleIcon { transform: rotate(180deg); }
.sidebar.collapsed .sb-badge,
.sidebar.collapsed .nav-section,
.sidebar.collapsed .nav-item span:not(.nav-icon),
.sidebar.collapsed .nav-parent-left span:not(.nav-icon),
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .sem-badge,
.sidebar.collapsed .dot-menu-btn span,
.sidebar.collapsed .signout-btn span:last-child { display: none; }
.sidebar.collapsed .nav-sub { display: none !important; }
.sidebar.collapsed .nav-item,
.sidebar.collapsed .nav-parent { justify-content: center; padding: 9px; margin: 1px 4px; }
.sidebar.collapsed .nav-item.active { border-left: 2px solid #fff; border-radius: 0 8px 8px 0; margin-left: -2px; padding-left: 11px; justify-content: flex-start; }
.sidebar.collapsed .nav-icon { width: auto; }
.sidebar.collapsed .signout-btn { justify-content: center; padding: 8px; }
.sidebar.collapsed .dot-menu-btn { justify-content: center; }
.profile-avatar {
  width: 36px; height: 36px; border-radius: 11px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
  flex-shrink: 0; position: relative;
}
.profile-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #4caf50; border: 1.5px solid #0891b2;
  animation: dotPulse 2.5s ease-in-out infinite;
}
.profile-name { font-size: 14px; font-weight: 700; color: #fff; }
.profile-role { font-size: 12px; color: rgba(255,255,255,0.65); }

.sidebar-nav   { flex: 1; padding: 10px; }
.nav-section   { padding: 16px 10px 4px; font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; font-size: 13.5px; color: rgba(255,255,255,0.75);
  cursor: pointer; transition: all .12s; border-radius: 10px; margin-bottom: 2px;
  font-weight: 500;
}
.nav-item:hover         { background: rgba(255,255,255,0.12); color: #fff; }
.nav-item.active        { background: rgba(255,255,255,0.18); color: #fff; font-weight: 700; border-left: 2px solid #fff; border-radius: 0 10px 10px 0; margin-left: -2px; padding-left: 14px; }
.nav-icon               { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }

.nav-parent {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; font-size: 13.5px; color: rgba(255,255,255,0.75);
  cursor: pointer; transition: all .12s; border-radius: 10px; margin-bottom: 2px;
  justify-content: space-between; font-weight: 500;
}
.nav-parent:hover       { background: rgba(255,255,255,0.12); color: #fff; }
.nav-parent.active      { color: #fff; }
.nav-parent-left        { display: flex; align-items: center; gap: 8px; }
.nav-arrow              { font-size: 10px; transition: transform .2s; color: rgba(255,255,255,0.45); }
.nav-arrow.open         { transform: rotate(90deg); }

.nav-sub                { display: none; }
.nav-sub.open           { display: block; }
.nav-sub-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px 36px; font-size: 12.5px; color: rgba(255,255,255,0.6);
  cursor: pointer; transition: all .12s; border-radius: 8px; margin-bottom: 1px;
  font-weight: 500;
}
.nav-sub-item:hover     { color: #fff; background: rgba(255,255,255,0.1); }
.nav-sub-item.active    { color: #fff; background: rgba(255,255,255,0.18); font-weight: 600; }

.sidebar-bottom {
  padding: 8px;
  border-top: 0.5px solid rgba(255,255,255,0.1);
  margin-top: auto;
}
.signout-btn {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: rgba(255,255,255,0.55);
  cursor: pointer; padding: 8px 10px; border-radius: 8px; transition: all .12s; font-weight: 500;
}
.signout-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Semester badge in sidebar */
.sem-badge {
  background: rgba(255,255,255,0.15);
  border: 0.5px solid rgba(255,255,255,0.25);
  border-radius: 8px; padding: 5px 10px; margin: 0 8px 10px;
  font-size: 11px; color: #fff; text-align: center; font-weight: 600;
  letter-spacing: 0.01em;
}

/* Three-dot sidebar menu */
.dot-menu-wrap          { position: relative; padding: 4px 10px 8px; }
.dot-menu-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 3px;
  padding: 7px 10px; border: none;
  background: rgba(255,255,255,0.06); border-radius: 8px;
  cursor: pointer; font-size: 18px; color: rgba(255,255,255,0.5);
  letter-spacing: 2px; transition: all .15s;
  font-family: 'Inter', sans-serif; line-height: 1;
}
.dot-menu-btn:hover     { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.9); }
.dot-menu-popup {
  position: absolute; bottom: calc(100% + 6px); left: 10px; right: 10px;
  background: #1e1e30; border: 0.5px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  display: none; z-index: 500; min-width: 150px;
}
.dot-menu-popup.open    { display: block; animation: menuIn .15s ease; }
.dot-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; cursor: pointer;
  font-size: 12px; color: rgba(255,255,255,0.75); transition: background .12s;
}
.dot-menu-item:hover    { background: rgba(255,255,255,0.08); }
.dot-menu-item i        { font-size: 15px; width: 16px; text-align: center; flex-shrink: 0; }
.dot-menu-item .dm-track{ margin-left: auto; flex-shrink: 0; }


/* ─────────────────────────────────────────────
   9. MAIN CONTENT AREA
   ───────────────────────────────────────────── */
.main         { margin-left: 242px; min-height: 100vh; width: calc(100% - 242px); background: var(--bg-page); padding: 10px 10px 0 10px; transition: margin-left .25s cubic-bezier(.4,0,.2,1), width .25s cubic-bezier(.4,0,.2,1); }
.page-content { padding: 4px 0 80px; background: var(--bg-page); }


/* ─────────────────────────────────────────────
   10. PAGE HEADERS / TOPBAR
   ───────────────────────────────────────────── */
.page-topbar {
  background: var(--bg-card);
  padding: 14px 24px 0;
  border-radius: 16px;
  border: 0.5px solid var(--border-card);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin: 0 0 12px 0;
}
.page-topbar-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.page-header          { margin-bottom: 0; }
.page-header h1       { font-size: 15px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }
.page-header p        { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.ph-wrap {
  background: var(--bg-card);
  border: 0.5px solid var(--border-card);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.ph-wrap h1           { font-size: 15px; font-weight: 700; color: var(--text-primary); margin: 0; letter-spacing: -0.01em; }
.ph-wrap p            { font-size: 11px; color: var(--text-muted); margin: 3px 0 0; }
.ph-wrap .ph-actions  { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Page-fade transitions */
.page-fade-out { animation: pageFadeOut 0.15s ease forwards; }
.page-fade-in  { animation: pageFadeIn  0.20s ease forwards; }


/* ─────────────────────────────────────────────
   11. TABS
   ───────────────────────────────────────────── */
/* Year tabs — gliding pill */
.ytabs         { display: flex; gap: 2px; align-items: center; position: relative; }
.ytab {
  padding: 5px 14px; border-radius: var(--radius-pill);
  font-size: 12px; cursor: pointer; color: var(--text-secondary);
  border: none; background: none; font-weight: 400;
  transition: color .2s; position: relative; z-index: 1;
}
/* The glider (#yt-glider) provides the background — keep tab bg transparent */
.ytab.active           { background: transparent; color: #fff; font-weight: 600; }
.ytab:hover:not(.active) { color: var(--text-primary); }

/* Session tabs */
.session-tabs  { display: flex; }
.stab {
  padding: 8px 16px; font-size: 12px; cursor: pointer; color: var(--text-secondary);
  border-bottom: 2px solid transparent; transition: all .12s; font-weight: 500;
}
.stab.active           { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.stab:hover:not(.active) { color: var(--text-primary); }

/* Class-detail tabs */
.ctabs         { display: flex; border-bottom: 0.5px solid var(--border-card); overflow-x: auto; }
.ctab {
  padding: 8px 14px; font-size: 12px; cursor: pointer; color: var(--text-secondary);
  border-bottom: 2px solid transparent; white-space: nowrap; transition: all .15s; font-weight: 500;
}
.ctab.active           { color: var(--accent); font-weight: 600; border-bottom-color: var(--accent); }
.ctedit                { padding: 8px 14px; font-size: 12px; cursor: pointer; color: var(--accent); border-bottom: 2px solid transparent; white-space: nowrap; }

/* Room tracker tabs */
.rt-tabs       { display: flex; border-bottom: 0.5px solid var(--border-card); margin-bottom: 14px; }
.rt-tab {
  padding: 8px 16px; font-size: 12px; cursor: pointer; color: var(--text-secondary);
  border-bottom: 2px solid transparent;
}
.rt-tab.active         { color: var(--text-primary); font-weight: 600; border-bottom-color: var(--text-primary); }

