/* ========================================================================== 
   RANKHOUSE Navigation v14
   One isolated navigation system for Control Center, Tasks and all portals.
   No legacy sidebar groups, connector lines or inherited active markers.
   ========================================================================== */

:root {
  --rh-nav-width: 292px;
  --rh-sidebar-width: 292px;
  --rh10-sidebar-width: 292px;
  --rh-nav-bg: #0b0c11;
  --rh-nav-surface: #12131a;
  --rh-nav-surface-2: #171820;
  --rh-nav-border: rgba(255,255,255,.075);
  --rh-nav-border-strong: rgba(255,255,255,.115);
  --rh-nav-text: #f1f1f5;
  --rh-nav-copy: #c7c7d0;
  --rh-nav-muted: #7d7d8b;
  --rh-nav-row: 44px;
  --rh-nav-radius: 12px;
}

.rh-nav,
.rh-nav *,
.rh-nav *::before,
.rh-nav *::after {
  box-sizing: border-box;
}

/* Remove all legacy decorations from the new isolated navigation tree. */
.rh-nav::before,
.rh-nav::after,
.rh-nav [class^="rh-nav-"]::before,
.rh-nav [class^="rh-nav-"]::after {
  content: none;
}

.rh-nav.sidebar,
.rh-nav.task-sidebar {
  position: relative;
  z-index: 40;
  width: var(--rh-nav-width) !important;
  min-width: var(--rh-nav-width) !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  padding: 14px 12px 12px !important;
  overflow: hidden !important;
  border: 0 !important;
  border-right: 1px solid rgba(255,255,255,.055) !important;
  border-radius: 0 !important;
  background:
    radial-gradient(circle at 12% -2%, rgba(var(--rh-accent-rgb), .10), transparent 195px),
    linear-gradient(180deg, #111218 0%, var(--rh-nav-bg) 38%, #090a0f 100%) !important;
  box-shadow: 14px 0 38px rgba(0,0,0,.23) !important;
  transform: none;
}

.rh-nav-brand {
  position: relative;
  min-height: 62px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 10px;
  padding: 0 4px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.rh-nav-brand-link {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: inherit;
  text-decoration: none;
}

.rh-nav-brand-link img {
  display: block;
  width: 184px;
  max-width: 100%;
  max-height: 42px;
  object-fit: contain;
  object-position: left center;
}

.rh-nav-brand-link small {
  padding-left: 40px;
  overflow: hidden;
  color: #727280;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.rh-nav-brand-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(var(--rh-accent-rgb), .28);
  border-radius: 999px;
  background: rgba(var(--rh-accent-rgb), .10);
  color: #fff;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.rh-nav-close {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--rh-nav-border);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: var(--rh-nav-copy);
  cursor: pointer;
  font-size: 20px;
}

.rh-nav-dashboard {
  min-height: 54px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 18px;
  align-items: center;
  gap: 10px;
  margin: 0 2px 10px;
  padding: 8px 10px;
  overflow: hidden;
  border: 1px solid rgba(var(--rh-accent-rgb), .24);
  border-radius: 13px;
  background: linear-gradient(100deg, rgba(var(--rh-accent-rgb), .14), rgba(255,255,255,.025));
  color: var(--rh-nav-text);
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.rh-nav-dashboard:hover {
  border-color: rgba(var(--rh-accent-rgb), .44);
  background: linear-gradient(100deg, rgba(var(--rh-accent-rgb), .20), rgba(255,255,255,.035));
  transform: translateY(-1px);
}

.rh-nav-dashboard-icon,
.rh-nav-workspace-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--rh-accent-rgb), .22);
  border-radius: 10px;
  background: rgba(var(--rh-accent-rgb), .10);
  color: var(--rh-accent-bright, #ff3855);
  font-size: 14px;
  font-weight: 900;
}

.rh-nav-dashboard-copy,
.rh-nav-workspace-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.rh-nav-dashboard-copy strong,
.rh-nav-workspace-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 820;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-nav-dashboard-copy small,
.rh-nav-workspace-copy small {
  overflow: hidden;
  color: var(--rh-nav-muted);
  font-size: 9px;
  font-weight: 650;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-nav-dashboard-arrow {
  color: var(--rh-nav-muted);
  font-size: 13px;
  text-align: center;
}

.rh-nav-workspace {
  position: relative;
  flex: 0 0 auto;
  margin: 0 2px 10px;
}

.rh-nav-workspace-trigger {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--rh-nav-border);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.018));
  color: var(--rh-nav-text);
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, background .16s ease;
}

.rh-nav-workspace-trigger:hover,
.rh-nav-workspace.is-open .rh-nav-workspace-trigger {
  border-color: rgba(var(--rh-accent-rgb), .32);
  background: linear-gradient(180deg, rgba(var(--rh-accent-rgb), .085), rgba(255,255,255,.022));
}

.rh-nav-workspace-label {
  color: #777785;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.rh-nav-workspace-chevron {
  color: #777785;
  font-size: 13px;
  text-align: center;
  transition: transform .16s ease;
}

.rh-nav-workspace.is-open .rh-nav-workspace-chevron {
  transform: rotate(180deg);
}

.rh-nav-workspace-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: min(430px, calc(100dvh - 205px));
  padding: 9px;
  overflow-y: auto;
  border: 1px solid var(--rh-nav-border-strong);
  border-radius: 14px;
  background: rgba(14,15,21,.985);
  box-shadow: 0 22px 44px rgba(0,0,0,.42);
  backdrop-filter: blur(18px);
}

.rh-nav-workspace-menu[hidden] { display: none; }

.rh-nav-workspace-menu-title {
  padding: 4px 8px 8px;
  color: #777785;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.rh-nav-workspace-option {
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 2px 0;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255,255,255,.018);
  color: var(--rh-nav-copy);
  text-decoration: none;
}

.rh-nav-workspace-option:hover {
  border-color: rgba(var(--rh-accent-rgb), .22);
  background: rgba(var(--rh-accent-rgb), .075);
  color: #fff;
}

.rh-nav-workspace-option.is-current {
  border-color: rgba(var(--rh-accent-rgb), .25);
  background: rgba(var(--rh-accent-rgb), .11);
  color: #fff;
}

.rh-nav-workspace-option-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 8px;
  background: rgba(255,255,255,.03);
  font-size: 12px;
}

.rh-nav-workspace-option span:nth-child(2) {
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-nav-workspace-option small {
  color: var(--rh-accent-bright, #ff3855);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.rh-nav-search {
  min-height: 42px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 20px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 2px 10px;
  padding: 0 9px;
  border: 1px solid var(--rh-nav-border);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
}

.rh-nav-search:focus-within {
  border-color: rgba(var(--rh-accent-rgb), .36);
  box-shadow: 0 0 0 3px rgba(var(--rh-accent-rgb), .075);
}

.rh-nav-search-icon {
  color: #777785;
  font-size: 14px;
  text-align: center;
}

.rh-nav-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #ededf2;
  font: inherit;
  font-size: 10.5px;
}

.rh-nav-search input::placeholder { color: #70707d; }

.rh-nav-search kbd {
  padding: 3px 6px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 6px;
  background: rgba(255,255,255,.025);
  color: #70707d;
  font-size: 7px;
  font-weight: 800;
}

.rh-nav-empty {
  flex: 0 0 auto;
  margin: -4px 4px 8px;
  padding: 8px 10px;
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: 10px;
  color: #777785;
  font-size: 9px;
  text-align: center;
}

.rh-nav-scroll {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: block;
  padding: 0 4px 12px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.rh-nav-scroll::-webkit-scrollbar,
.rh-nav-workspace-menu::-webkit-scrollbar { width: 7px; }
.rh-nav-scroll::-webkit-scrollbar-thumb,
.rh-nav-workspace-menu::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(255,255,255,.20);
  background-clip: padding-box;
}

.rh-nav-section {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.rh-nav-section[hidden],
.rh-nav-item[hidden] { display: none !important; }

.rh-nav-section-heading {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  color: #777785;
  font-size: 8.5px;
  font-weight: 850;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.rh-nav-section-heading b {
  min-width: 20px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(255,255,255,.035);
  color: #777785;
  font-size: 8px;
  letter-spacing: 0;
}

.rh-nav-items {
  display: grid;
  gap: 3px;
}

.rh-nav-item {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: var(--rh-nav-row);
  display: grid;
  grid-template-columns: 30px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: var(--rh-nav-radius);
  background: transparent;
  color: var(--rh-nav-copy);
  text-decoration: none;
  transition: border-color .14s ease, background .14s ease, color .14s ease, transform .14s ease;
}

.rh-nav-item:hover {
  border-color: rgba(255,255,255,.06);
  background: rgba(255,255,255,.035);
  color: #fff;
  transform: translateX(1px);
}

.rh-nav-item.is-active,
.rh-nav-item.active {
  border-color: rgba(var(--rh-accent-rgb), .28);
  background: linear-gradient(90deg, rgba(var(--rh-accent-rgb), .16), rgba(var(--rh-accent-rgb), .045));
  color: #fff;
}

.rh-nav-item.is-active::before,
.rh-nav-item.active::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  display: block;
  border-radius: 0 999px 999px 0;
  background: var(--rh-accent, #ef233c);
  box-shadow: 0 0 12px rgba(var(--rh-accent-rgb), .42);
  content: '';
}

.rh-nav-item-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
  color: #92929e;
  font-size: 12px;
  font-style: normal;
  line-height: 1;
}

.rh-nav-item.is-active .rh-nav-item-icon,
.rh-nav-item.active .rh-nav-item-icon {
  border-color: rgba(var(--rh-accent-rgb), .25);
  background: rgba(var(--rh-accent-rgb), .12);
  color: var(--rh-accent-bright, #ff3855);
}

.rh-nav-item-label {
  min-width: 0;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 720;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-nav-item-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 7px;
  background: rgba(255,255,255,.045);
  color: #8a8a96;
  font-size: 8px;
  font-weight: 850;
}

.rh-nav-item.is-active .rh-nav-item-badge,
.rh-nav-item.active .rh-nav-item-badge {
  background: rgba(var(--rh-accent-rgb), .14);
  color: #fff;
}

.rh-nav-footer {
  min-height: 42px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 7px 2px 0;
  padding: 8px 9px 0;
  border-top: 1px solid rgba(255,255,255,.06);
  color: #747481;
}

.rh-nav-footer-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #42d392;
  box-shadow: 0 0 10px rgba(66,211,146,.35);
}

.rh-nav-footer-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.rh-nav-footer strong {
  color: #cfcfd7;
  font-size: 9px;
}

.rh-nav-footer small {
  overflow: hidden;
  color: #6f6f7c;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tasks shares exactly the same navigation geometry. */
body.rankhouse-tasks .task-main {
  margin-left: var(--rh-nav-width) !important;
}
body.rankhouse-tasks .task-main::before {
  left: var(--rh-nav-width) !important;
}

/* Keep legacy navigation elements out of the layout if an old template is cached. */
.rh-nav .sidebar-group,
.rh-nav .sidebar-group-title,
.rh-nav .sidebar-group-content,
.rh-nav .sidebar-nav-section-label,
.rh-nav .nav-link,
.rh-nav .workspace-switcher,
.rh-nav .sidebar-search,
.rh-nav .sidebar-dashboard-button,
.rh-nav .task-nav,
.rh-nav .sidebar-projects,
.rh-nav .sidebar-theme-picker {
  display: none !important;
}

.rh-nav-mobile-toggle {
  display: none;
}

.rh-nav-backdrop {
  display: none;
}

@media (max-height: 700px) {
  .rh-nav-brand { min-height: 52px; margin-bottom: 7px; padding-bottom: 7px; }
  .rh-nav-brand-link img { max-height: 36px; }
  .rh-nav-dashboard { min-height: 50px; margin-bottom: 7px; }
  .rh-nav-workspace { margin-bottom: 7px; }
  .rh-nav-workspace-trigger { min-height: 52px; }
  .rh-nav-search { margin-bottom: 7px; }
  .rh-nav-footer { display: none; }
}

@media (max-width: 980px) {
  .rh-nav.sidebar,
  .rh-nav.task-sidebar {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(296px, calc(100vw - 28px)) !important;
    min-width: 0 !important;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }

  body.sidebar-mobile-open .rh-nav.sidebar,
  .rh-nav.task-sidebar.open {
    transform: translateX(0);
  }

  .rh-nav-close { display: grid; place-items: center; }

  .rh-nav-mobile-toggle,
  .sidebar-mobile-toggle {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 70;
  }

  .rh-nav-backdrop,
  .sidebar-backdrop,
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0,0,0,.66);
    backdrop-filter: blur(4px);
  }

  body.sidebar-mobile-open .rh-nav-backdrop,
  body.sidebar-mobile-open .sidebar-backdrop,
  .sidebar-overlay.open {
    display: block;
  }

  body.rankhouse-tasks .task-main {
    margin-left: 0 !important;
  }
  body.rankhouse-tasks .task-main::before {
    left: 0 !important;
  }
}

.rh-nav-theme {
  min-height: 34px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 5px 2px 0;
  padding: 7px 9px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.rh-nav-theme > span {
  color: #747481;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rh-nav-theme form { display: flex; align-items: center; gap: 5px; }
.rh-nav-theme button {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--swatch-color);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
  cursor: pointer;
}
.rh-nav-theme button.is-active { border-color: #fff; }

.rh-nav-profile {
  min-height: 48px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) 32px;
  align-items: center;
  gap: 9px;
  margin: 0 2px;
  padding: 8px 8px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.rh-nav-profile img,
.rh-nav-profile-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  object-fit: cover;
  background: rgba(var(--rh-accent-rgb), .12);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}
.rh-nav-profile-copy { min-width: 0; display: grid; gap: 1px; }
.rh-nav-profile-copy strong,
.rh-nav-profile-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-nav-profile-copy strong { color: #d8d8e0; font-size: 9.5px; }
.rh-nav-profile-copy small { color: #6f6f7c; font-size: 8px; }
.rh-nav-profile button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--rh-nav-border);
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  color: #8b8b97;
  cursor: pointer;
}
.rh-nav-profile button:hover { border-color: rgba(var(--rh-accent-rgb), .28); color: #fff; }

/* Tasks is a fixed sidebar layout; classic portals use the app-shell column. */
.rh-nav.task-sidebar {
  position: fixed !important;
  inset: 0 auto 0 0 !important;
  z-index: 50 !important;
}
