/*
 * public/design/client/_shared/sidebar.css
 *
 * Styles for the shared client sidebar component (sibling: sidebar.js).
 * Owner / Manager facing — brand blue gradient (#1e40af → #3b82f6) instead
 * of the admin purple (#7c3aed → #c026d3) so the audience is obvious at a
 * glance.
 *
 * Layout strategy — mirrors the admin sidebar:
 *   • Desktop (>= 1024px): sticky `position: sticky` left column 240 px wide,
 *     inside the `.lz-client-layout` flex container. Page lives in the right
 *     `.lz-client-main` column, no body padding hack.
 *   • Mobile (< 1024px): off-canvas drawer + backdrop, opened by a hamburger
 *     button. Many client pages still ship a bottom `.mobile-nav` bar so the
 *     hamburger is anchored TOP-LEFT (well clear of the bottom bar).
 *
 * All class names are namespaced `lz-csb-` / `lz-client-` (Client SideBar)
 * so they never collide with the admin sidebar's `lz-sb-` / `lz-admin-`
 * classes — both sidebars can coexist in the DOM during a multi-page audit.
 */

:root {
  --lz-csb-width: 240px;
}

/* ──────────────────────────────────────────────────────────────────────────
 * Layout wrapper (slot + page-content row).
 * ─────────────────────────────────────────────────────────────────────────── */
.lz-client-layout {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
  width: 100%;
}

.lz-client-main {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
}

/* ──────────────────────────────────────────────────────────────────────────
 * Sidebar slot — fixed-width column on desktop, zero-width on mobile.
 * ─────────────────────────────────────────────────────────────────────────── */
#lz-client-sidebar {
  flex: 0 0 var(--lz-csb-width);
  width: var(--lz-csb-width);
  align-self: stretch;
}

/* ──────────────────────────────────────────────────────────────────────────
 * The sidebar itself (rendered inside #lz-client-sidebar by sidebar.js).
 * Brand-blue gradient on header + active link. Same dark slate body as the
 * page chrome (#0f172a).
 * ─────────────────────────────────────────────────────────────────────────── */
.lz-csb {
  width: var(--lz-csb-width);
  min-height: 100vh;
  max-height: 100vh;
  background: #0f172a;
  border-right: 1px solid #334155;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  font-family: 'Inter', -apple-system, sans-serif;
  color: #f1f5f9;
  padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  position: sticky;
  top: 0;
}

/* Hamburger — mobile-only. Pinned top-left, well above the bottom mobile-nav
   strip that several client pages ship (.mobile-nav). */
.lz-csb-hamburger {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  left: 14px;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  border-radius: 10px;
  color: #f1f5f9;
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.15s ease;
}
.lz-csb-hamburger:hover {
  background: rgba(30, 41, 59, 0.95);
}

/* Backdrop (mobile drawer overlay). */
.lz-csb-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.lz-csb-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ──────────────────────────────────────────────────────────────────────────
 * Mobile (< 1024px): sidebar collapses off-canvas.
 * ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  #lz-client-sidebar {
    flex: 0 0 0;
    width: 0;
    position: static;
  }
  .lz-csb {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    min-height: 100vh;
    max-height: 100vh;
  }
  .lz-csb.open {
    transform: translateX(0);
  }
  .lz-csb-hamburger {
    display: inline-flex;
  }
  body.lz-csb-no-scroll {
    overflow: hidden;
  }
}

/* ──────────────────────────────────────────────────────────────────────────
 * Desktop (>= 1024px): sidebar always visible. The page's own .top-back
 * ("← Index") link is redundant — the sidebar exposes navigation — and would
 * overlap the sidebar's top-left corner. Hide it on desktop only.
 *
 * NOTE: we deliberately leave the page's bottom .mobile-nav alone here —
 * the @media (min-width: 768px) rule inside each page already hides it on
 * desktop. The sidebar takes over from there.
 * ─────────────────────────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .lz-csb-backdrop {
    display: none;
  }
  .lz-csb-close {
    display: none;
  }
  .top-back {
    display: none !important;
  }
}

/* Header row inside sidebar: logo + label, plus close button on mobile. */
.lz-csb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
  margin-bottom: 14px;
}
.lz-csb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lz-csb-logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}
.lz-csb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.lz-csb-brand-title {
  font-weight: 700;
  font-size: 14px;
  color: #f1f5f9;
}
.lz-csb-brand-sub {
  font-size: 11px;
  color: #64748b;
}
.lz-csb-close {
  background: transparent;
  border: 1px solid #334155;
  color: #cbd5e1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.lz-csb-close:hover {
  background: #1e293b;
}

/* Scrollable nav region. */
.lz-csb-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 16px;
}

/* Section header (uppercase group label). */
.lz-csb-section {
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  padding: 14px 12px 4px;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Individual nav link. */
.lz-csb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  line-height: 1.3;
}
.lz-csb-link:hover {
  background: #1e293b;
  color: #f1f5f9;
}
.lz-csb-link.active {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.32), rgba(59, 130, 246, 0.18));
  color: white;
  border-left: 3px solid #3b82f6;
  padding-left: 9px;
}
.lz-csb-link-icon {
  font-size: 14px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.lz-csb-link-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Footer (lang switcher + profile). */
.lz-csb-footer {
  border-top: 1px solid #1e293b;
  padding-top: 12px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lz-csb-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
}
.lz-csb-lang-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
}
.lz-csb-lang-buttons {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}
.lz-csb-lang-btn {
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  background: transparent;
  color: #64748b;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lz-csb-lang-btn:hover {
  color: #cbd5e1;
}
.lz-csb-lang-btn.active {
  background: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

.lz-csb-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  color: #cbd5e1;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lz-csb-profile:hover {
  background: #1e293b;
}
.lz-csb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 11px;
  flex-shrink: 0;
}
