/* ===== Main area ===== */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-cream);
}

.topbar {
  height: 56px;
  background: var(--bg-cream);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.breadcrumb .crumb { color: var(--ink-mute); }
.breadcrumb .sep { color: var(--ink-mute); opacity: 0.5; }
.breadcrumb .crumb-active { color: var(--ink); font-weight: 600; }

.topbar-search {
  flex: 1;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}
.topbar-search input {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px 8px 36px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border 0.12s, box-shadow 0.12s;
}
.topbar-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
/* `>` zodat alleen het vergrootglas dit krijgt — niet de icoontjes
   in de resultaten-dropdown, die ook binnen .topbar-search leeft. */
.topbar-search > svg {
  position: absolute;
  left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--ink-mute);
  pointer-events: none;
}
.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-xl);
  z-index: 600;
  max-height: 480px;
  overflow-y: auto;
}
.gsr-group-label {
  padding: 10px 14px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.gsr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.1s;
}
.gsr-item:hover, .gsr-item.focused { background: var(--accent-soft); }
.gsr-icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  background: var(--bg-cream);
  color: var(--ink-soft);
}
.gsr-main { flex: 1; min-width: 0; }
.gsr-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gsr-title mark {
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}
.gsr-sub {
  font-size: 11.5px;
  color: var(--ink-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.gsr-type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-cream);
  color: var(--ink-mute);
  flex-shrink: 0;
  text-transform: capitalize;
}
.gsr-divider { height: 1px; background: var(--border-soft); margin: 4px 0; }
.gsr-empty { padding: 20px 14px; text-align: center; font-size: 13px; color: var(--ink-mute); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 7px;
  transition: background 0.12s, transform 0.06s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { transform: none; }
.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger:active { transform: translateY(1px); }
.btn-success { background: #059669; color: white; }
.btn-success:hover { background: #047857; }
.btn-success:active { transform: translateY(1px); }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--white); border-color: var(--ink-mute); color: var(--ink); }
.btn-text {
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 12px;
}
.btn-text:hover { color: var(--ink); }

.icon-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: background 0.12s, border 0.12s;
}
.icon-btn:hover { border-color: var(--ink-mute); color: var(--ink); }

/* ===== Notifications ===== */
.notif-badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger, #ef4444); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px;
  border-radius: 9px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg-cream);
}
.notif-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.12); z-index: 1400;
}
.notif-overlay.open { display: block; }
.notif-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 380px; max-width: 92vw;
  background: var(--white); border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(37,25,19,0.12);
  z-index: 1401; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.22s ease;
}
.notif-panel.open { transform: translateX(0); }
.notif-panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.notif-panel-title { font-size: 15px; font-weight: 700; color: var(--ink); flex: 1; }
.notif-markall {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--accent); font-family: inherit; padding: 4px 6px; border-radius: 6px;
}
.notif-markall:hover { background: var(--accent-soft); }
.notif-close { background: none; border: none; cursor: pointer; color: var(--ink-mute); padding: 4px; border-radius: 6px; display: inline-flex; }
.notif-close:hover { background: var(--bg-warm); color: var(--ink); }
.notif-list { flex: 1; overflow-y: auto; padding: 8px; }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--ink-mute); font-size: 13px; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border-radius: 10px; cursor: pointer;
  transition: background 0.12s;
}
.notif-item:hover { background: var(--bg-warm); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item.unread:hover { background: rgba(180, 83, 9, 0.14); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.notif-item.read .notif-dot { background: transparent; }
.notif-item-body { min-width: 0; flex: 1; }
.notif-item-title { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.notif-item-time { font-size: 11px; color: var(--ink-mute); margin-top: 3px; }

/* ===== Page content ===== */
.page {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.sub-nav {
  width: 200px;
  background: var(--bg-cream);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  flex-shrink: 0;
}
.sub-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 500;
  margin-bottom: 2px;
}
.sub-nav-item:hover { background: var(--bg-warm); color: var(--ink); }
.sub-nav-item.active { background: var(--accent-soft); color: var(--accent); }
.sub-nav-icon { width: 16px; height: 16px; }

.page-body {
  flex: 1;
  overflow-y: auto;
  /* Reserveer de scrollbar-ruimte altijd, zodat de inhoud niet smaller
     wordt (en verspringt) zodra er een scrollbar verschijnt. */
  scrollbar-gutter: stable;
  padding: 24px 32px 80px;
}

.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 20px;
  gap: 16px;
}
.page-title {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.page-sub { color: var(--ink-mute); font-size: 13px; margin-top: 2px; }

.toolbar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--white);
  cursor: pointer;
}
.filter-chip:hover { border-color: var(--ink-mute); }
.filter-chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }


/* Reserve the scrollbar gutter on views that scroll on the .page-view itself (inline overflow-y:auto),
   so expanding a section doesn't shift content left when the scrollbar appears. */
.page-view[data-view="api"], .page-view[data-view="settings"], .page-view[data-view="sequences"] { scrollbar-gutter: stable; }
