/* ==========================================================================
   Resale Partners — Design E (Partner / Dubline interface)
   Overlay op design-d.css. Partner-portals zien minder dan resellers, dus:
   - Slankere top-level menu (Beheer + 5 directe links)
   - Sub-items binnen Beheer (zoals huidige Dubline)
   - Partner-alert / accountmanager-card / compactere weergaves
   - Eigen brand-preset (Dubline = teal-green primary, zwart secondary)
   - Compact density default (density-compact-class)
   ========================================================================== */

/* ── Logo: teal phone-icon (matcht Dubline) ─────────────────────────────── */
.de-brand {
  /* override de-brand-mark from design-d met een phone-call glyph + lichte bg */
}
.de-brand .dd-brand-mark { display: none; }
.de-brand-logo {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand-primary, #1ab394) 14%, transparent);
  color: var(--brand-primary, #1ab394);
  position: relative;
}
.de-brand-logo i { font-size: 18px; }
.dd-brand .dd-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--brand-primary, #1ab394);
}
.dd-brand .dd-brand-tag { color: var(--dd-text-faint); }
body.design-e .dd-brand:hover { background: rgba(0,0,0,.04); }
body.design-e .dd-brand-chev { display: none; }

/* ── Compact density: maak sidebar nog dichter, paddings krapper ────────── */
body.density-compact.design-e {
  --dd-sidebar-w: 220px;
  --dd-context-w: 312px;
  --dd-header-h: 44px;
}
body.density-compact.design-e .dd-nav-item { padding: 5px 9px; font-size: 12.5px; }
body.density-compact.design-e .dd-nav-sub-item { padding: 4px 9px; font-size: 12px; }
body.density-compact.design-e .dd-search { height: 30px; margin-bottom: 10px; }
body.density-compact.design-e .dd-section { padding: 8px 0; }
body.density-compact.design-e .dd-table tbody td { padding: 8px 12px; }
body.density-compact.design-e .dd-table thead th { padding: 7px 12px; }
body.density-compact.design-e .dd-tab { padding: 10px 12px; font-size: 12.5px; }
body.density-compact.design-e .dd-tab-content { padding: 14px 24px 22px; }

/* + knop in sub-item (Klanten toevoegen, zoals in Dubline-bron) */
.dd-nav-sub-item { position: relative; }
.dd-nav-sub-add {
  appearance: none;
  margin-left: auto;
  width: 20px; height: 20px;
  border: 0; background: transparent;
  border-radius: 4px;
  color: var(--dd-text-very-faint);
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.dd-nav-sub-add i { font-size: 13px; }
.dd-nav-sub-item:hover .dd-nav-sub-add { opacity: 1; }
.dd-nav-sub-add:hover { background: rgba(0,0,0,.08); color: var(--dd-text); }

/* Extra-items (Ideeënbus, X2status) */
.de-extras { padding-top: 8px; margin-top: 10px; }
.de-extras .dd-nav-item { padding: 5px 9px; font-size: 12.5px; }
.de-nav-item-extra > i:first-child { color: var(--brand-primary, #1ab394); }

/* Sidebar foot: branch + profile */
.de-branch {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--dd-surface);
  border: 1px solid var(--dd-border);
  font-family: var(--dd-font-mono);
  font-size: 10.5px;
  color: var(--dd-text-faint);
  margin: 0 0 10px;
  width: fit-content;
}
.de-branch i { font-size: 12px; }

/* ── Header (no AI button, partner-portal doesn't have that) ────────────── */
.de-header {
  /* No changes to the basic header, but make it lighter */
}

/* ── Klant memo's — RUSTIGE collapsible bar ─────────────────────────────
   Bewust subtiel: linkerrand-streep in brand-kleur, transparante achtergrond,
   géén card-bg/border zodat het niet concurreert met systeemnotificaties.
   Schaalt netjes naar 10+ memo's via counter + collapse. */
.de-memos {
  margin: 12px 28px -4px;
  border-left: 3px solid color-mix(in srgb, var(--brand-primary, #1ab394) 50%, transparent);
  background: transparent;
  border-radius: 0;
  overflow: hidden;
}
.de-memos > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  user-select: none;
  border-radius: 0;
}
.de-memos > summary::-webkit-details-marker { display: none; }
.de-memos > summary:hover { background: rgba(0,0,0,.02); }

.de-memos-icon {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 5px;
  background: transparent;
  color: color-mix(in srgb, var(--brand-primary, #1ab394) 80%, black);
  display: grid; place-items: center;
}
.de-memos-icon i { font-size: 14px; }

.de-memos-summary-text {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  line-height: 1.3;
  flex-wrap: wrap;
}
.de-memos-summary-text strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--dd-text-muted);
}
.de-memos-summary-text span {
  font-size: 11px;
  color: var(--dd-text-faint);
}
.de-memos-summary-text span::before {
  content: "·";
  margin-right: 6px;
  color: var(--dd-text-very-faint);
}

.de-memos-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--dd-surface-2);
  color: var(--dd-text-muted);
  border-radius: 999px;
  font-size: 10.5px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.de-memos-chev {
  color: var(--dd-text-very-faint);
  font-size: 14px;
  transition: transform .15s ease;
  flex-shrink: 0;
}
.de-memos[open] .de-memos-chev { transform: rotate(180deg); }

/* Memo list — chat-style */
.de-memos-list {
  list-style: none; margin: 0; padding: 4px 8px 8px;
  display: flex; flex-direction: column;
  gap: 2px;
}
.de-memo {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  position: relative;
}
.de-memo:hover { background: rgba(0,0,0,.025); }
.de-memo-avatar {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--dd-surface-2);
  color: var(--dd-text-muted);
  border: 1px solid var(--dd-border);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  letter-spacing: .03em;
  margin-top: 1px;
}
.de-memo-body { flex: 1; min-width: 0; }
.de-memo-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 1px;
}
.de-memo-head strong {
  font-size: 11.5px; font-weight: 600; color: var(--dd-text);
}
.de-memo-meta {
  font-size: 10.5px; color: var(--dd-text-faint);
}
.de-memo p {
  margin: 0;
  font-size: 12px; line-height: 1.45;
  color: var(--dd-text-muted);
}
.de-memo-x {
  appearance: none;
  width: 22px; height: 22px;
  border: 0; background: transparent;
  border-radius: 5px;
  color: var(--dd-text-very-faint);
  cursor: pointer;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
  flex-shrink: 0;
}
.de-memo-x i { font-size: 13px; }
.de-memo:hover .de-memo-x { opacity: 1; }
.de-memo-x:hover { background: rgba(0,0,0,.06); color: var(--dd-text); }

body.design-e.is-dark .de-memo:hover { background: rgba(255,255,255,.03); }

/* ── Systeemnotificaties — bell dropdown ──────────────────────────────── */
.de-notif { position: relative; }
.de-notif > summary { list-style: none; cursor: pointer; }
.de-notif > summary::-webkit-details-marker { display: none; }

.de-notif-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0; left: auto;
  width: 360px;
  background: var(--dd-surface);
  border: 1px solid var(--dd-border);
  border-radius: var(--dd-radius);
  box-shadow: 0 12px 32px rgba(20,14,35,.12), 0 2px 6px rgba(20,14,35,.06);
  padding: 6px;
  z-index: 100;
}
.de-notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 4px;
}
.de-notif-head strong {
  font-size: 12px; font-weight: 700;
  color: var(--dd-text);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.de-notif-mark {
  appearance: none; border: 0; background: transparent;
  color: var(--brand-primary, #1ab394);
  font-size: 11.5px; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.de-notif-mark:hover { text-decoration: underline; }

.de-notif-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
.de-notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.de-notif-item:hover { background: rgba(0,0,0,.04); }
.de-notif-item.is-new {
  background: color-mix(in srgb, var(--brand-primary) 5%, transparent);
}
.de-notif-item.is-new:hover {
  background: color-mix(in srgb, var(--brand-primary) 9%, transparent);
}
.de-notif-icon {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--dd-surface-2);
  color: var(--dd-text-muted);
  display: grid; place-items: center;
}
.de-notif-icon i { font-size: 15px; }
.de-notif-icon-info {
  background: color-mix(in srgb, var(--brand-primary, #1ab394) 14%, transparent);
  color: color-mix(in srgb, var(--brand-primary, #1ab394) 85%, black);
}
.de-notif-icon-warn {
  background: rgba(196,122,4,.14);
  color: #b86c00;
}
.de-notif-item div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.de-notif-item strong {
  font-size: 12.5px; font-weight: 600; color: var(--dd-text);
}
.de-notif-item p {
  margin: 0;
  font-size: 12px; line-height: 1.4;
  color: var(--dd-text-muted);
}
.de-notif-item small {
  font-size: 10.5px; color: var(--dd-text-faint);
}
.de-notif-all {
  display: block;
  text-align: center;
  padding: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--dd-border);
  font-size: 12px; font-weight: 600;
  color: var(--brand-primary, #1ab394);
  text-decoration: none;
}
.de-notif-all:hover { background: rgba(0,0,0,.02); }

/* ── Customer title — "(WS)" muted suffix ───────────────────────────────── */
.de-ws {
  font-weight: 500;
  color: var(--dd-text-faint);
  font-size: 16px;
}
.de-avatar {
  /* Slightly different avatar color so it pops on teal brand */
  background:
    linear-gradient(135deg,
      var(--brand-primary, #1ab394),
      color-mix(in srgb, var(--brand-primary) 50%, white));
}

/* ── Accountmanager card ────────────────────────────────────────────────── */
.de-am {
  margin-top: 14px;
  background: var(--dd-surface);
  border: 1px solid var(--dd-border);
  border-radius: var(--dd-radius);
  padding: 10px 12px;
  display: flex; flex-direction: column;
  gap: 6px;
}
.de-am-head {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--dd-text-faint);
}
.de-am-body {
  display: flex; align-items: center; gap: 10px;
}
.de-am-avatar {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand-primary, #1ab394) 18%, transparent);
  color: color-mix(in srgb, var(--brand-primary, #1ab394) 85%, black);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  letter-spacing: .03em;
}
.de-am-info {
  flex: 1;
  display: flex; flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.de-am-info strong {
  font-size: 13px; color: var(--dd-text); font-weight: 600;
}
.de-am-info small a {
  font-size: 11.5px;
  color: var(--dd-text-muted);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.de-am-info small a:hover { color: var(--brand-primary); }
.de-am-info i { font-size: 12px; color: var(--dd-text-faint); }

/* ── Property tweaks: dot-warn + secret ─────────────────────────────────── */
.de-dot-warn {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 999px;
  background: #c47a04;
  margin-left: 4px;
  box-shadow: 0 0 0 2.5px color-mix(in srgb, #c47a04 22%, transparent);
}
.de-secret {
  font-family: var(--dd-font-mono);
  font-size: 11.5px;
  background: var(--dd-surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--dd-border);
  color: var(--dd-text-muted);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

/* ── Toolbar — title + check ────────────────────────────────────────────── */
.de-toolbar-title {
  font-size: 14px; font-weight: 600;
  color: var(--dd-text);
  margin: 0;
}
.de-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--dd-text-muted);
  cursor: pointer;
  user-select: none;
}
.de-check input {
  width: 14px; height: 14px;
  accent-color: var(--brand-primary, #1ab394);
}

/* ── User-mark avatar in user-table ─────────────────────────────────────── */
.de-user-mark {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--dd-surface-2);
  color: var(--dd-text);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  border: 1px solid var(--dd-border);
}

/* Service-cell (titel + sub) in Dubline diensten-tabel */
.dd-cell-svc { display: flex; flex-direction: column; line-height: 1.3; }
.dd-cell-svc-title {
  font-size: 12.5px; font-weight: 600;
  color: var(--dd-text);
  text-decoration: none;
}
.dd-cell-svc-title:hover { color: var(--brand-primary); text-decoration: underline; }
.dd-cell-svc small { font-size: 11px; color: var(--dd-text-faint); }

/* Diensten-tabel type-chip alignment */
.de-table-services .dd-type-chip { width: 28px; height: 28px; }

/* Make link cells inline */
.de-table-users a.dd-link { white-space: nowrap; }
.de-table-users th i { font-size: 14px; color: var(--dd-text-faint); }

/* Dark mode for E extras */
body.design-e.is-dark .de-alert {
  background: rgba(68,136,221,.08);
  border-color: rgba(68,136,221,.22);
}
body.design-e.is-dark .de-am { background: var(--dd-surface); }
body.design-e.is-dark .de-user-mark { background: var(--dd-surface-2); }
