/* Notizblock (Menü Beratung, 27.11.2026) - Liste links, Blatt rechts, wie die Notizen-App von Apple.
 * Eigener Akzent (Bernstein) nur für diese Seite; sonst die Farben von mVOS. */
#page-notizblock, .nb-modal, #detail-nb-card {
  --nb-akzent: #C98A00;
  --nb-akzent-weich: #FCF1D2;
  --nb-papier: #FFFEFB;
  --nb-linie: #EFE9DA;
}

#page-notizblock .nb-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nb-rahmen {
  display: grid; grid-template-columns: minmax(260px, 320px) 1fr;
  height: calc(100vh - 170px); min-height: 480px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}

/* Liste */
.nb-spalte { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: #FAFAF7; }
.nb-werkzeug { display: flex; gap: 8px; align-items: center; padding: 12px; border-bottom: 1px solid var(--border); }
.nb-werkzeug input[type="search"] {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); font: inherit; font-size: 13px; color: var(--text);
}
.nb-neu-knopf {
  flex: none; width: 34px; height: 34px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--nb-akzent); color: #fff; display: grid; place-items: center;
}
.nb-neu-knopf:hover { filter: brightness(1.06); }
.nb-neu-knopf:focus-visible, .nb-eintrag:focus-visible, .nb-akte-eintrag:focus-visible { outline: 2px solid var(--nb-akzent); outline-offset: 2px; }
.nb-neu-knopf svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#nb-liste { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
#nb-liste ul, #detail-nb-liste { list-style: none; margin: 0; padding: 0; }
.nb-gruppe { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 14px 8px 4px; }
.nb-eintrag, .nb-akte-eintrag {
  display: grid; gap: 2px; width: 100%; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 9px 10px; border-radius: 8px; font: inherit; color: var(--text);
}
.nb-eintrag + .nb-eintrag { border-top: 1px solid var(--nb-linie); }
#nb-liste li + li .nb-eintrag { box-shadow: 0 -1px 0 var(--nb-linie); }
.nb-eintrag:hover, .nb-akte-eintrag:hover { background: #F2EFE6; }
.nb-eintrag.aktiv { background: var(--nb-akzent-weich); box-shadow: none; }
.nb-eintrag-titel { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-eintrag-zeile { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-eintrag-zeile time { color: var(--text); margin-right: 4px; font-variant-numeric: tabular-nums; }
.nb-eintrag-kunde {
  justify-self: start; margin-top: 3px; font-size: 11.5px; padding: 1px 8px; border-radius: 999px;
  background: #EAF1FE; color: #1D4ED8;
}
.nb-fuss-leiste { padding: 8px 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); }
.nb-leer { color: var(--text-muted); font-size: 13px; padding: 18px 12px; margin: 0; }
.nb-leer-blatt { padding: 60px 24px; text-align: center; }

/* Blatt */
#nb-blatt { display: flex; flex-direction: column; min-height: 0; background: var(--nb-papier); }
.nb-blatt-leiste { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--nb-linie); min-height: 52px; flex-wrap: wrap; }
.nb-leiste-rechts { margin-left: auto; display: flex; gap: 4px; }
.nb-zurueck { display: none; }
.nb-status { font-size: 12px; color: var(--text-light); }
.nb-status[data-art="ok"] { color: #15803D; }
.nb-status[data-art="fehler"] { color: #B91C1C; }
.nb-kunde { display: flex; align-items: center; position: relative; }
.nb-kunde-chip { display: inline-flex; align-items: center; border-radius: 999px; background: #EAF1FE; color: #1D4ED8; font-size: 12.5px; }
.nb-kunde-chip button { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 4px 10px; }
.nb-kunde-chip .nb-kunde-weg { padding: 4px 9px 4px 2px; opacity: .7; }
.nb-kunde-chip .nb-kunde-weg:hover { opacity: 1; }
.nb-kunde-oeffnen:hover { text-decoration: underline; }
.nb-kundenwahl {
  position: absolute; z-index: 30; top: 100%; left: 0; margin-top: 6px; width: 300px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .14); padding: 8px;
}
.nb-kundenwahl input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; font: inherit; font-size: 13px; }
.nb-kundenwahl ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.nb-kundenwahl li button { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; font: inherit; font-size: 13px; text-align: left; color: var(--text); }
.nb-kundenwahl li button span { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.nb-kundenwahl li button:hover, .nb-kundenwahl li button:focus-visible { background: var(--nb-akzent-weich); }
.nb-leer-zeile { padding: 7px 8px; font-size: 13px; color: var(--text-muted); }
.nb-konflikt { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; background: #FEF3C7; color: #78350F; font-size: 13px; border-bottom: 1px solid #FCD34D; }
.nb-konflikt[hidden] { display: none; }
.nb-papier { flex: 1; overflow-y: auto; padding: 18px clamp(18px, 5vw, 56px) 40px; }
.nb-datum { text-align: center; font-size: 12px; color: var(--text-light); margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.nb-text {
  min-height: 60vh; outline: none; white-space: pre-wrap; word-wrap: break-word;
  font-size: 15.5px; line-height: 1.6; color: var(--text); caret-color: var(--nb-akzent);
}
.nb-text::first-line { font-size: 24px; font-weight: 700; line-height: 1.45; letter-spacing: -.01em; }
.nb-text:empty::before { content: 'Titel'; color: var(--text-light); font-size: 24px; font-weight: 700; }
.nb-fuss { margin-top: 24px; font-size: 12px; color: var(--text-light); }
.nb-korb-blatt { padding: 60px 24px; text-align: center; color: var(--text-muted); }

/* Verlauf */
.nb-verlauf-hinweis { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
.nb-verlauf { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.nb-verlauf > li { padding: 10px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.nb-verlauf-kopf { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.nb-verlauf-kopf time { margin-left: auto; color: var(--text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.nb-verlauf details { margin-top: 6px; }
.nb-verlauf summary { cursor: pointer; color: var(--primary); font-size: 12.5px; }
.nb-verlauf-text { margin-top: 4px; color: var(--text-muted); font-size: 12.5px; }
.nb-diff { margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 12.5px; line-height: 1.5; }
.nb-diff > div { padding: 1px 10px 1px 26px; position: relative; white-space: pre-wrap; word-break: break-word; }
.nb-diff > div > span { position: absolute; left: 9px; color: var(--text-light); }
.nb-diff-neu { background: #ECFDF3; color: #14532D; }
.nb-diff-weg { background: #FEF2F2; color: #7F1D1D; text-decoration: line-through; text-decoration-color: rgba(127, 29, 29, .4); }
.nb-diff-gleich { color: var(--text-muted); }
.nb-diff-luecke { color: var(--text-light); text-align: center; padding: 2px 0 !important; }

/* Kundenakte */
#detail-nb-card[hidden] { display: none !important; }
#detail-nb-liste { padding: 4px 8px 8px; }
#detail-nb-liste li + li { border-top: 1px solid var(--nb-linie); }
.nb-akte-meta { font-size: 12px; color: var(--text-light); font-variant-numeric: tabular-nums; }
.nb-modal { margin: -4px -4px 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--nb-papier); display: flex; flex-direction: column; }
.nb-modal .nb-papier { max-height: 62vh; }
.nb-modal .nb-text { min-height: 36vh; }

/* Schmal: erst die Liste, nach Auswahl das Blatt */
@media (max-width: 899px) {
  .nb-rahmen { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  #page-notizblock #nb-blatt { display: none; }
  #page-notizblock.nb-blatt-offen #nb-blatt { display: flex; }
  #page-notizblock.nb-blatt-offen .nb-spalte { display: none; }
  #page-notizblock .nb-zurueck { display: inline-flex; }
}

/* Leads (27.11.2026): Notizen im Lead-Dialog */
.nb-lead-chip { display: inline-flex; align-items: center; margin-right: 6px; padding: 4px 10px; border-radius: 999px; background: #F3E8FF; color: #6D28D9; font-size: 12.5px; }
.nb-eintrag-lead { background: #F3E8FF; color: #6D28D9; }
#lead-notizen { margin-top: 16px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
#lead-notizen[hidden] { display: none; }
.nb-lead-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.nb-lead-kopf .btn { text-transform: none; letter-spacing: 0; }
.nb-lead-liste { list-style: none; margin: 6px 0 0; padding: 0; }
.nb-lead-liste li + li { border-top: 1px solid var(--border); }
