.layout {
  display: flex;
  min-height: 100vh;
}

/* ---------- Afdrukken ---------- */
@media print {
  .no-print {
    display: none !important;
  }
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 20px 20px;
}

.logo {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 42px;
  width: auto;
  display: block;
}

.avatar-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e9e9ea;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chevron {
  width: 14px;
  height: 14px;
  color: #888;
}

.nav {
  display: flex;
  flex-direction: column;
  padding: 6px 10px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dark);
  text-decoration: none;
  font-size: 15px;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--hover);
}

.nav-item.active,
.nav-subitem.active {
  background: var(--hover);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-dark);
}

.nav-item .chevron-right {
  margin-left: auto;
  width: 14px;
  height: 14px;
  color: #999;
}

/* ---------- Expandable nav sections (Berichten, Financiën, ...) ---------- */
.nav-group {
  display: flex;
  flex-direction: column;
}

.nav-parent {
  user-select: none;
}

.chevron-toggle {
  margin-left: auto;
  width: 15px;
  height: 15px;
  color: #999;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.nav-parent.open .chevron-toggle {
  transform: rotate(180deg);
}

.nav-submenu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
  overflow: hidden;
}

.nav-submenu.open {
  grid-template-rows: 1fr;
}

.nav-submenu-inner {
  overflow: hidden;
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px 9px 30px;
  border-radius: 8px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 15px;
  cursor: pointer;
  white-space: normal;
  line-height: 1.3;
}

.nav-subitem:hover {
  background: var(--hover);
}

.nav-subitem.active {
  background: var(--hover);
  font-weight: 600;
}

.nav-subitem svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--text-dark);
}

.nav-divider {
  flex: 1;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--somebay-coral);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-footer {
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
  padding-top: 14px;
}

.collapse-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text-dark);
  font-size: 15px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.collapse-btn:hover {
  background: var(--hover);
}

.collapse-btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- Main content area ---------- */
.main {
  flex: 1;
  min-width: 0;
  padding: 36px 44px;
  max-width: 1800px;
}

.sparkle-btn {
  position: fixed;
  top: 24px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #f4f6f8;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

h1.page-title {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 34px 0;
}

h2.section-title {
  font-size: 21px;
  font-weight: 700;
  margin: 0 0 16px 0;
}

section {
  margin-bottom: 38px;
}

/* ---------- Responsive shell (sidebar becomes an off-canvas menu) ---------- */
.mobile-menu-btn {
  display: none;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 880px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    z-index: 220;
    cursor: pointer;
  }

  .mobile-menu-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-dark);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 210;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.18);
  }

  .sidebar-overlay.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 205;
  }

  .main {
    padding: 76px 20px 40px;
    max-width: 100%;
  }
}
