/* ==========================================================================
   Persistent sidebar — full nav surface (Tenders: Active /
   Saved / Closed, Reports, News, Packages, Contact) plus this app's own
   Categories / Calendar / Settings.

   Desktop (>=1024px): fixed left rail, page content is inset to clear it.
   Below that: off-canvas drawer opened from the topbar burger, with a
   scrim. The liquid dock stays the primary nav on small screens.
   ========================================================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 244px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-3) var(--space-4);
  background: var(--glass-fill-1);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  border-right: 1px solid var(--stage-border);
  box-shadow: 6px 0 26px -18px var(--glass-shadow);
  transform: translateX(-100%);
  transition: transform var(--dur-med) var(--ease-out);
  overflow-y: auto;
  scrollbar-width: thin;
}

.sidebar.is-open { transform: translateX(0); }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(34, 32, 29, 0.34);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out);
}

.sidebar-scrim.is-open { opacity: 1; pointer-events: auto; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px var(--space-5);
  font-weight: 750;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.sidebar-group { margin-bottom: var(--space-4); }

.sidebar-group-title {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 12px 7px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  position: relative;
}

.sidebar-link:hover {
  background: rgba(30, 64, 175, 0.07);
  color: var(--text-primary);
}

.sidebar-link svg {
  width: 17px;
  height: 17px;
  flex: none;
  opacity: 0.85;
}

.sidebar-link.is-active {
  background: linear-gradient(100deg, rgba(30, 64, 175, 0.14), rgba(30, 64, 175, 0.05));
  color: var(--ebid-primary-dark);
}

/* Brand-gold marker so the active row reads instantly without relying on
   the subtle blue wash alone. */
.sidebar-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--ebid-gold), var(--ebid-accent));
}

.sidebar-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 750;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: rgba(37, 99, 235, 0.22);
  color: #1e3a8a;
}

.sidebar-foot {
  margin-top: auto;
  padding: var(--space-3) 12px 0;
  border-top: 1px solid var(--stage-border);
  font-size: 12px;
  color: var(--text-tertiary);
}

.sidebar-foot-user {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 2px;
}

/* ---- burger (mobile / tablet only) ------------------------------------ */

.burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  border: 1px solid var(--stage-border);
  background: var(--surface-soft);
  cursor: pointer;
  color: var(--text-primary);
  flex: none;
}

.burger svg { width: 18px; height: 18px; }

/* ---- desktop: rail is permanent, content clears it -------------------- */

@media (min-width: 1024px) {
  .sidebar {
    transform: translateX(0);
    box-shadow: none;
  }
  .sidebar-scrim { display: none; }
  .burger { display: none; }
  .page { margin-left: 244px; }
  /* Dock is redundant next to a permanent rail, but it IS the liquid
     centrepiece - keep it, just pull it clear of the rail. */
  .liquid-nav { margin-left: 122px; }
}

@media (max-width: 1023px) {
  .sidebar { box-shadow: 10px 0 40px -20px rgba(34, 32, 29, 0.5); }
}
