/* ============================================================
   ArenaCRM — Sidebar Layout
   Premium two-column grid layout with polished sidebar.
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --sidebar-bg: #0C4DA2;
  --sidebar-bg-dark: #0a3e84;
  --sidebar-hover: rgba(255,255,255,0.10);
  --sidebar-active-bg: rgba(255,255,255,0.16);
  --sidebar-text: rgba(255,255,255,0.82);
  --sidebar-text-muted: rgba(255,255,255,0.48);
  --brand-500: #1d6ed6;
  --brand-600: #0C4DA2;
  --brand-700: #0a3e84;
  --surface-1: #F5F7FB;
}

/* ── GRID SHELL ─────────────────────────────────────────────── */
.layout-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--topbar-height));
  background: var(--surface-1);
}

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidenav {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-right: 1px solid rgba(0,0,0,0.12);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.sidenav::-webkit-scrollbar { width: 4px; }
.sidenav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 999px; }

.sidenav-header {
  padding: 10px 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 6px;
}
.sidenav-header .title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.2px;
  color: #fff;
}

/* ── MENU ───────────────────────────────────────────────────── */
.menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  flex: 1;
}

/* Section label */
.menu-label {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--sidebar-text-muted);
  padding: 14px 12px 4px;
  margin: 0;
}

/* Menu link */
.menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  transition: background 120ms ease, color 120ms ease;
  position: relative;
}
.menu-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.menu-link.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  font-weight: 600;
}
/* Active pill indicator */
.menu-link.active::before {
  content: "";
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: #fff;
  border-radius: 0 3px 3px 0;
  opacity: 0.9;
}

.menu-icon {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 15px;
  opacity: 0.9;
}
.menu-link.active .menu-icon { opacity: 1; }
.menu-text { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* ── CONTENT AREA ───────────────────────────────────────────── */
.content {
  padding: 24px;
  min-width: 0; /* prevent grid blowout */
}

/* ── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 1px solid #E4E8EF;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  height: var(--topbar-height);
}
.navbar-brand {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--brand-600) !important;
}

/* Hide duplicate top nav */
.navbar .navbar-nav { display: none !important; }
.navbar .navbar-collapse .navbar-nav { display: none !important; }

/* ── MOBILE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .layout-shell {
    grid-template-columns: 1fr;
  }
  .sidenav {
    position: fixed;
    top: var(--topbar-height);
    bottom: 0; left: 0;
    width: var(--sidebar-width);
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.4,0,0.2,1);
    border-right: none;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }
  .sidenav.open { transform: translateX(0); }
  .content { padding: 16px; }
}
