.app-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width); flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 20;
  transition: transform 0.2s ease;
}
.sidebar__brand {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5) var(--sp-5) var(--sp-4);
}
.sidebar__brand-mark {
  width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: linear-gradient(135deg, var(--stage-verification), var(--stage-verified), var(--stage-interview), var(--stage-offer), var(--stage-hired));
}
.sidebar__brand-text { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-md); }
.sidebar__brand-text span { color: var(--text-tertiary); font-weight: 600; font-size: var(--fs-2xs); display: block; letter-spacing: 0.06em; text-transform: uppercase; }

/* The pipeline rail: a thin strip under the brand mapping every
   stage color in fixed order. It's not a progress bar for any one
   thing — it's the product's constant visual signature, echoed in
   table rows and the applicant detail header. */
.pipeline-rail { display: flex; height: 4px; margin: 0 var(--sp-5) var(--sp-4); border-radius: var(--radius-full); overflow: hidden; }
.pipeline-rail span { flex: 1; }
.pipeline-rail .r1 { background: var(--stage-applied); }
.pipeline-rail .r2 { background: var(--stage-verification); }
.pipeline-rail .r3 { background: var(--stage-verified); }
.pipeline-rail .r4 { background: var(--stage-interview); }
.pipeline-rail .r5 { background: var(--stage-offer); }
.pipeline-rail .r6 { background: var(--stage-hired); }

.sidebar__nav { flex: 1; padding: 0 var(--sp-3); display: flex; flex-direction: column; gap: 2px; }
.sidebar__link {
  display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-3);
  border-radius: var(--radius-md); color: var(--text-secondary); font-size: var(--fs-sm); font-weight: 600;
}
.sidebar__link:hover { background: var(--surface-hover); color: var(--text-primary); text-decoration: none; }
.sidebar__link.is-active { background: var(--info-bg); color: var(--accent); }
.sidebar__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar__link .count {
  margin-left: auto; font-size: var(--fs-2xs); font-family: var(--font-mono); color: var(--text-tertiary);
  background: var(--surface-raised); padding: 2px 7px; border-radius: var(--radius-full);
}

.sidebar__footer { padding: var(--sp-4) var(--sp-3); border-top: 1px solid var(--border); }
.sidebar__staff { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3); }
.sidebar__avatar {
  position: relative;
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--fs-sm); flex-shrink: 0;
}
.sidebar__staff-info { min-width: 0; flex: 1; }
.sidebar__staff-name { font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__staff-role { font-size: var(--fs-2xs); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.03em; }
.sidebar__signout { width: 100%; margin-top: var(--sp-2); }

/* ---- Main area ---- */
.main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  height: 64px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-6); border-bottom: 1px solid var(--border); background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.topbar__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); }
.menu-toggle { display: none; background: none; border: none; color: var(--text-primary); padding: 8px; }
.content { flex: 1; padding: var(--sp-6); max-width: 1200px; width: 100%; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.is-open { transform: translateX(0); box-shadow: 20px 0 40px rgba(0,0,0,0.5); }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .content { padding: var(--sp-4); }
}

.sidebar-scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 15; display: none; }
.sidebar-scrim.is-visible { display: block; }

/* =========================================================
   Notification bell — staff-wide alerts (#topbar-actions)
   ========================================================= */
#topbar-actions { display: flex; align-items: center; gap: var(--sp-3); }
.notif-bell { position: relative; }
.notif-trigger {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--radius-full);
  background: transparent; border: 1px solid transparent; cursor: pointer;
  font-size: 1.1rem; color: var(--text-primary);
}
.notif-trigger:hover { background: var(--surface-hover); border-color: var(--border); }
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--radius-full); background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.notif-panel {
  display: none; position: absolute; top: calc(100% + 10px); right: 0; width: 340px; max-width: 88vw;
  max-height: 440px; overflow-y: auto; background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-card); z-index: 60;
}
.notif-panel.is-open { display: block; }
.notif-panel__head {
  display: flex; align-items: center; justify-content: space-between; padding: var(--sp-4);
  border-bottom: 1px solid var(--border); font-weight: 700; font-size: var(--fs-sm);
  position: sticky; top: 0; background: var(--surface-raised);
}
.notif-mark-all { background: none; border: none; color: var(--accent); font-size: var(--fs-xs); cursor: pointer; font-weight: 600; }
.notif-enable-push {
  display: block; width: calc(100% - var(--sp-8)); margin: var(--sp-3) var(--sp-4) 0;
  padding: var(--sp-3); border-radius: var(--radius-md); border: 1px dashed var(--border);
  background: var(--surface); color: var(--text-primary); font-size: var(--fs-xs); font-weight: 600; cursor: pointer;
}
.notif-enable-push:hover { background: var(--surface-hover); }
.notif-empty { padding: var(--sp-8) var(--sp-4); text-align: center; color: var(--text-tertiary); font-size: var(--fs-sm); }
.notif-item {
  display: flex; gap: var(--sp-3); padding: var(--sp-4); text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-hover); }
.notif-item__dot {
  width: 8px; height: 8px; border-radius: var(--radius-full); margin-top: 6px; flex-shrink: 0;
  background: transparent;
}
.notif-item.is-unread .notif-item__dot { background: var(--accent); }
.notif-item__body { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.notif-item__body strong { font-size: var(--fs-sm); color: var(--text-primary); }
.notif-item__body span { color: var(--text-secondary); }
.notif-item__body small { color: var(--text-tertiary); font-size: var(--fs-2xs); }
@media (max-width: 560px) {
  .notif-panel { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 70vh; }
}
