/* ============================================================
   NC RECOVERY PORTAL — Sidebar + top header
   Sidebar: deliberately dark navy (the operational anchor)
   Header:  bright/light to match the page
   ============================================================ */

.nc-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  width: var(--nc-sidebar-w);
  background: linear-gradient(180deg, #0A1628 0%, #050B17 100%);
  color: #E2E8F0;
  display: flex;
  flex-direction: column;
  z-index: var(--nc-z-sidebar);
  transition: width var(--nc-dur-base) var(--nc-ease);
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(10, 22, 40, 0.08);
}

/* faint vertical accent line on the right edge */
.nc-sidebar::after {
  content: "";
  position: absolute;
  right: -1px; top: 80px; bottom: 80px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(0, 136, 221, 0.4) 30%,
    rgba(0, 136, 221, 0.4) 70%,
    transparent
  );
  pointer-events: none;
}

.nc-app[data-sidebar="collapsed"] .nc-sidebar { width: var(--nc-sidebar-w-collapsed); }

/* ---------- Header ---------- */

.nc-sidebar__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  height: var(--nc-header-h);
}

.nc-sidebar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  text-decoration: none;
}
.nc-sidebar__logo img {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.nc-sidebar__collapse {
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--nc-r-sm);
  color: #E2E8F0;
  cursor: pointer;
  transition: all var(--nc-dur-fast) var(--nc-ease);
  flex-shrink: 0;
  padding: 0;
}
.nc-sidebar__collapse:hover {
  background: var(--nc-blue);
  color: var(--nc-white);
  border-color: var(--nc-blue);
  box-shadow: 0 0 16px var(--nc-blue-glow-2);
}
.nc-sidebar__collapse svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  transition: transform var(--nc-dur-base) var(--nc-ease);
}

.nc-app[data-sidebar="collapsed"] .nc-sidebar__collapse svg { transform: rotate(180deg); }

/* In collapsed mode, hide the logo image to free up the row for centred chevron */
.nc-app[data-sidebar="collapsed"] .nc-sidebar__head {
  justify-content: center;
  padding: 18px 0;
}
.nc-app[data-sidebar="collapsed"] .nc-sidebar__logo { display: none; }

/* ---------- Primary CTA ---------- */

.nc-sidebar__cta { margin: 16px 14px 8px; }
.nc-sidebar__cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--nc-grad-blue);
  color: var(--nc-white);
  border-radius: var(--nc-r-sm);
  font-family: var(--nc-font-display);
  font-size: var(--nc-fs-sm);
  font-weight: var(--nc-fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--nc-tracking-wide);
  text-decoration: none;
  transition: all var(--nc-dur-base) var(--nc-ease);
  box-shadow: 0 6px 18px var(--nc-blue-glow-2), inset 0 1px 0 rgba(255,255,255,0.2);
  white-space: nowrap;
  overflow: hidden;
}
.nc-sidebar__cta a:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px var(--nc-blue-glow-2), inset 0 1px 0 rgba(255,255,255,0.25);
}
.nc-sidebar__cta a svg { width: 16px; height: 16px; flex-shrink: 0; }

.nc-app[data-sidebar="collapsed"] .nc-sidebar__cta a { padding: 12px 0; }
.nc-app[data-sidebar="collapsed"] .nc-sidebar__cta a span { display: none; }

/* ---------- Nav ---------- */

.nc-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 16px;
}

.nc-sidebar__section { padding: 18px 0 4px; }
.nc-sidebar__section-title {
  padding: 0 24px 8px;
  font-family: var(--nc-font-display);
  font-size: 10px;
  font-weight: var(--nc-fw-bold);
  letter-spacing: var(--nc-tracking-ultra);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  position: relative;
}
.nc-sidebar__section-title::after {
  content: "";
  position: absolute;
  left: 24px; right: 24px;
  bottom: 4px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.nc-app[data-sidebar="collapsed"] .nc-sidebar__section-title { font-size: 0; padding: 8px 0 0; }
.nc-app[data-sidebar="collapsed"] .nc-sidebar__section-title::after { left: 16px; right: 16px; }

.nc-sidebar__menu { list-style: none; padding: 0; margin: 0; }

.nc-sidebar__link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: rgba(226, 232, 240, 0.7);
  font-family: var(--nc-font-body);
  font-size: var(--nc-fs-sm);
  font-weight: var(--nc-fw-mid);
  text-decoration: none;
  transition: all var(--nc-dur-fast) var(--nc-ease);
  white-space: nowrap;
}

.nc-sidebar__link svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  transition: transform var(--nc-dur-fast) var(--nc-ease);
}

.nc-sidebar__link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.05);
}
.nc-sidebar__link:hover svg { transform: translateX(2px); }

.nc-sidebar__link.is-active {
  color: var(--nc-blue-hot);
  background: linear-gradient(90deg, rgba(0, 136, 221, 0.18), transparent 80%);
}
.nc-sidebar__link.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--nc-blue-hot);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(0, 136, 221, 0.7);
}

.nc-sidebar__badge {
  margin-left: auto;
  font-family: var(--nc-font-mono);
  font-size: 10px;
  font-weight: var(--nc-fw-bold);
  background: rgba(0, 136, 221, 0.2);
  color: var(--nc-blue-hot);
  padding: 2px 7px;
  border-radius: var(--nc-r-pill);
  letter-spacing: 0.04em;
}

.nc-sidebar__badge--live {
  background: rgba(255, 31, 79, 0.2);
  color: #FF6B8A;
  position: relative;
  padding-left: 16px;
}
.nc-sidebar__badge--live::before {
  content: "";
  position: absolute;
  left: 5px; top: 50%;
  width: 5px; height: 5px;
  background: #FF6B8A;
  border-radius: 50%;
  transform: translateY(-50%);
  box-shadow: 0 0 0 0 var(--nc-live-glow);
  animation: nc-pulse 1.6s var(--nc-ease) infinite;
}

/* tooltip when collapsed */
.nc-sidebar__tip {
  display: none;
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  background: var(--nc-navy-700);
  border: 1px solid var(--nc-navy-400);
  border-radius: var(--nc-r-sm);
  font-size: var(--nc-fs-xs);
  font-weight: var(--nc-fw-semi);
  color: var(--nc-white);
  white-space: nowrap;
  box-shadow: var(--nc-shadow-lg);
  z-index: var(--nc-z-dropdown);
  pointer-events: none;
}

.nc-app[data-sidebar="collapsed"] .nc-sidebar__link {
  justify-content: center;
  padding: 12px 0;
}
.nc-app[data-sidebar="collapsed"] .nc-sidebar__link span:not(.nc-sidebar__tip) { display: none; }
.nc-app[data-sidebar="collapsed"] .nc-sidebar__badge:not(.nc-sidebar__tip) { display: none; }
.nc-app[data-sidebar="collapsed"] .nc-sidebar__link:hover .nc-sidebar__tip { display: block; }

/* ---------- Footer (user) ---------- */

.nc-sidebar__foot {
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}

.nc-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--nc-r-sm);
  transition: background var(--nc-dur-fast) var(--nc-ease);
}
.nc-sidebar__user:hover { background: rgba(255, 255, 255, 0.06); }

.nc-sidebar__avatar {
  width: 36px; height: 36px;
  border-radius: var(--nc-r-sm);
  background: var(--nc-grad-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--nc-font-display);
  font-weight: var(--nc-fw-bold);
  font-size: var(--nc-fs-sm);
  color: var(--nc-white);
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--nc-blue-glow-2);
  letter-spacing: 0;
}

.nc-sidebar__user-info { flex: 1; min-width: 0; overflow: hidden; }
.nc-sidebar__user-name {
  font-size: var(--nc-fs-sm);
  font-weight: var(--nc-fw-semi);
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nc-sidebar__user-role {
  font-family: var(--nc-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.nc-sidebar__logout {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--nc-r-sm);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--nc-dur-fast) var(--nc-ease);
  padding: 0;
}
.nc-sidebar__logout:hover { color: var(--nc-live); border-color: var(--nc-live); background: rgba(255, 31, 79, 0.08); }
.nc-sidebar__logout svg { width: 16px; height: 16px; stroke: currentColor; }

.nc-app[data-sidebar="collapsed"] .nc-sidebar__user-info { display: none; }
.nc-app[data-sidebar="collapsed"] .nc-sidebar__logout { display: none; }
.nc-app[data-sidebar="collapsed"] .nc-sidebar__user { justify-content: center; }

/* ============================================================
   TOP HEADER (right of sidebar) — light surface
   ============================================================ */

.nc-header {
  position: sticky;
  top: 0;
  z-index: var(--nc-z-header);
  height: var(--nc-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--nc-content-pad);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--nc-border);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}

.nc-header__left {
  display: flex; align-items: center; gap: 16px;
  flex: 1;
  min-width: 0;
}

.nc-header__mobile {
  display: none;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  background: var(--nc-white);
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-r-sm);
  color: var(--nc-text);
  cursor: pointer;
  padding: 0;
}
.nc-header__mobile svg { width: 18px; height: 18px; stroke: currentColor; }

.nc-header__crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--nc-font-mono);
  font-size: var(--nc-fs-xs);
  color: var(--nc-text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nc-header__crumbs strong {
  color: var(--nc-text);
  font-weight: var(--nc-fw-bold);
}
.nc-header__crumbs .sep { opacity: 0.45; color: var(--nc-blue); }

.nc-header__right {
  display: flex; align-items: center; gap: 10px;
}

/* clock — adds to the live-ops feel */
.nc-header__clock {
  font-family: var(--nc-font-mono);
  font-size: var(--nc-fs-sm);
  font-weight: var(--nc-fw-bold);
  color: var(--nc-text);
  padding: 7px 14px;
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-r-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.04em;
  background: var(--nc-white);
  box-shadow: var(--nc-shadow-xs);
}
.nc-header__clock::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--nc-blue);
  border-radius: 50%;
  box-shadow: 0 0 0 0 var(--nc-blue-glow-2);
  animation: nc-pulse-blue 2s var(--nc-ease) infinite;
}

/* ---------- Notifications bell ---------- */

.nc-bell {
  position: relative;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nc-white);
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-r-sm);
  color: var(--nc-text);
  cursor: pointer;
  transition: all var(--nc-dur-fast) var(--nc-ease);
  box-shadow: var(--nc-shadow-xs);
  padding: 0;
}
.nc-bell:hover { color: var(--nc-blue); border-color: var(--nc-blue); }
.nc-bell svg { width: 16px; height: 16px; stroke: currentColor; }
.nc-bell__count {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--nc-live);
  color: var(--nc-white);
  border: 2px solid var(--nc-white);
  border-radius: var(--nc-r-pill);
  font-family: var(--nc-font-mono);
  font-size: 10px;
  font-weight: var(--nc-fw-bold);
  display: none;
  align-items: center;
  justify-content: center;
}
.nc-bell--has-unread .nc-bell__count { display: inline-flex; }
.nc-bell--has-unread::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: var(--nc-r-sm);
  box-shadow: 0 0 0 0 var(--nc-live-glow);
  animation: nc-pulse 2.4s var(--nc-ease) infinite;
  pointer-events: none;
}

.nc-notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--nc-white);
  border: 1px solid var(--nc-border);
  border-radius: var(--nc-r-md);
  box-shadow: var(--nc-shadow-lg);
  z-index: var(--nc-z-dropdown);
  display: none;
  overflow: hidden;
}
.nc-notif-panel.is-open { display: block; animation: nc-fade-in-up var(--nc-dur-base) var(--nc-ease); }

.nc-notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--nc-border);
  background: var(--nc-cream);
}
.nc-notif-head h3 {
  font-size: var(--nc-fs-sm);
  font-weight: var(--nc-fw-bold);
  letter-spacing: var(--nc-tracking-wide);
  text-transform: uppercase;
}
.nc-notif-mark {
  background: none; border: none;
  font-size: var(--nc-fs-xs);
  color: var(--nc-blue);
  cursor: pointer;
  font-weight: var(--nc-fw-semi);
  letter-spacing: 0.02em;
  padding: 0;
}
.nc-notif-mark:hover { color: var(--nc-blue-bright); }

.nc-notif-list { max-height: 420px; overflow-y: auto; }
.nc-notif-empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--nc-text-dim);
  font-size: var(--nc-fs-sm);
}
.nc-notif-empty svg { width: 36px; height: 36px; opacity: 0.35; margin-bottom: 8px; stroke: currentColor; }

/* ---------- Mobile ---------- */

@media (max-width: 1024px) {
  .nc-sidebar {
    position: fixed;
    transform: translateX(-100%);
    transition: transform var(--nc-dur-base) var(--nc-ease);
    box-shadow: var(--nc-shadow-xl);
  }
  .nc-app[data-mobile-open="true"] .nc-sidebar { transform: translateX(0); }
  .nc-app[data-mobile-open="true"]::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 40, 0.5);
    z-index: calc(var(--nc-z-sidebar) - 1);
  }
  .nc-header__mobile { display: inline-flex; }
}
