/* Tools: Lovable desktop layout mapped onto the existing employee APIs. */
.tools-uebersicht { min-width: 0; }
.tools-uebersicht-kopf { margin: 0 0 1.5rem; }
.tools-uebersicht-kopf h1 { margin: 0; color: var(--shell-ink); font-size: var(--schrift-h1); font-weight: 500; letter-spacing: -0.02em; }
.tools-uebersicht-kopf p { margin: 0.35rem 0 0; color: var(--shell-muted); font-size: var(--schrift-klein); }
.tools-uebersicht-raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
@media (max-width: 1279.98px) { .tools-uebersicht-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tools-kachel { display: flex; min-width: 0; min-height: 14rem; flex-direction: column; padding: 1.5rem; border: 1px solid var(--shell-border); border-radius: var(--shell-radius); background: var(--shell-card); }
.tools-kachel-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.tools-kachel-icon { display: inline-flex; width: 3.5rem; height: 3.5rem; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 0.5rem; background: var(--marke-dunkel); color: var(--text-auf-dunkel); }
.tools-kachel-sinnbild { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Originalmarken stehen auf neutralem Grund; nicht in den AB-TAX-Iconfarben umfärben. */
.tools-kachel-icon--marke { background: #fff; border: 1px solid var(--shell-border); overflow: hidden; }
.tools-kachel-markenlogo { display: block; width: 100%; height: 100%; object-fit: cover; }
.tools-kachel-extern { width: 0.95rem; height: 0.95rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--shell-muted); }
.tools-kachel h2 { margin: 1.25rem 0 0; color: var(--shell-ink); font-size: var(--schrift-abschnitt); font-weight: 500; }
.tools-kachel-beschreibung { flex: 1; margin: 0.5rem 0 1.25rem; color: var(--shell-muted); font-size: var(--schrift-klein); line-height: 1.7; }
.tools-kachel-fuss { padding-top: 0.9rem; border-top: 1px solid var(--shell-border); }
.tools-kachel-aktion { display: flex; width: 100%; min-height: 2.25rem; align-items: center; justify-content: space-between; padding: 0.45rem 0.8rem; border: 1px solid var(--shell-border); border-radius: var(--rund-klein); background: var(--shell-card); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); color: var(--shell-ink); font-size: var(--schrift-klein); font-weight: 500; text-decoration: none; }
.tools-kachel-aktion:hover { background: var(--marke-flaeche); }
.tools-kachel-aktion:focus-visible { outline: 2px solid var(--marke-dunkel); outline-offset: 3px; }
.tools-kachel-aktion-pfeil { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tools-kachel-badge { padding: 0.25rem 0.625rem; border-radius: 999px; background: var(--marke-flaeche); color: var(--shell-muted); font-size: 10px; line-height: 1rem; }
button.tools-kachel-aktion { font-family: inherit; cursor: pointer; }
.tools-hinweis { width: min(32rem, calc(100vw - 2rem)); padding: 1.5rem; border: 1px solid var(--shell-border); border-radius: var(--shell-radius); background: var(--shell-card); color: var(--shell-ink); }
.tools-hinweis h2 { margin: 0; font-size: 1.125rem; font-weight: 500; }
.tools-hinweis p { margin: 0.5rem 0 1.5rem; color: var(--shell-muted); font-size: var(--schrift-klein); }
.tools-hinweis button { display: block; margin-left: auto; }

.belegbot-kopf { margin: 0 0 0.2rem; }
.belegbot-kopf h1, .dokumentanalyse-kopf h1 { margin: 0; color: var(--shell-ink); font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; }
.belegbot-kopf p, .dokumentanalyse-kopf p { margin: 0.35rem 0 0; color: var(--shell-muted); font-size: 0.75rem; }

/* BelegeBot: status cards, compact filters and a contained tenant table. */
.belegbot { gap: 0.9rem; }
.belegbot-statuskarten { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem; }
.belegbot-statuskarte { display: flex; min-width: 0; min-height: 4.5rem; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0.15rem; padding: 0.7rem 0.9rem; border: 1px solid var(--shell-border); border-radius: var(--shell-radius); background: var(--shell-card); color: var(--shell-ink); text-align: left; cursor: pointer; }
.belegbot-statuskarte:hover { background: var(--marke-flaeche); }
.belegbot-statuskarte[aria-pressed='true'] { border-color: var(--marke-dunkel); box-shadow: inset 0 0 0 1px var(--marke-dunkel); }
.belegbot-statuskarte-wert { font-size: 1.25rem; font-weight: 500; line-height: 1.2; }
.belegbot-statuskarte-label { color: var(--shell-muted); font-size: 0.7rem; }
.belegbot-filter { grid-template-columns: 18rem 9.5rem; max-width: max-content; gap: 0.75rem; }
.belegbot-filter .feld-gruppe { position: relative; }
.belegbot-suchfeld input { padding-left: 2rem !important; }
.belegbot-suche-symbol { position: absolute; top: 50%; left: 10px; width: 14px; height: 14px; transform: translateY(-50%); fill: none; stroke: var(--marke-gedaempft); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.belegbot-filter .feld-marke { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.belegbot-liste { overflow: hidden; border: 1px solid var(--shell-border); border-radius: var(--shell-radius); background: var(--shell-card); }
.belegbot-tabelle th, .belegbot-tabelle td { padding: 0.85rem 1rem; }
.belegbot-tabelle thead th { background: var(--marke-flaeche); }
.belegbot-tabelle tbody > .belegbot-mandant:hover { background: #f8f9fa; }
.belegbot-accordion { color: var(--shell-ink); font-weight: 500; text-decoration: none; }
.belegbot-mandantennummer, .belegbot-weiterleitung-einstellung { display: block; margin-top: 0.2rem; color: var(--shell-muted); font-size: 0.72rem; font-weight: 400; }
.belegbot-weiterleitung { min-width: 10.5rem; }
.belegbot-status { font-weight: 500; }
.belegbot-detailseite { margin-top: -2rem; }
.belegbot-zurueck { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--shell-muted); font-size: var(--schrift-klein); text-decoration: none; }
.belegbot-zurueck::before { content: '←'; font-size: 1rem; }
.belegbot-detailkopf { margin: 0.7rem 0 1.2rem; }
.belegbot-detailkopf h1 { margin: 0; color: var(--shell-ink); font-size: 1.25rem; font-weight: 500; }
.belegbot-schritte { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 1rem 0 1.75rem; counter-reset: belegbot-schritt; }
.belegbot-schritt { display: flex; min-width: 0; min-height: 3.5rem; align-items: center; gap: 0.6rem; padding: 0.65rem 0.8rem; border: 1px solid var(--shell-border); border-radius: var(--rund-klein); background: var(--shell-card); color: var(--shell-ink); text-decoration: none; }
.belegbot-schritt:hover { background: var(--marke-flaeche); }
.belegbot-schritt[aria-current='step'] { border-color: var(--marke-dunkel); box-shadow: inset 0 0 0 1px var(--marke-dunkel); }
.belegbot-schritt strong, .belegbot-schritt span { display: block; min-width: 0; overflow-wrap: anywhere; }
.belegbot-schritt strong { font-size: var(--schrift-klein); font-weight: 500; }
.belegbot-schritt span { color: var(--shell-muted); font-size: 0.65rem; }
.belegbot-detail { gap: 1rem; padding: 0; }
.belegbot-historie { margin-top: 1rem; border-top: 1px solid var(--shell-border); padding-top: 0.85rem; }
.belegbot-historie summary { color: var(--shell-ink); font-weight: 500; cursor: pointer; }
.belegbot-historieneintrag { margin-top: 0.9rem; padding: 0.9rem; border: 1px solid var(--shell-border); border-radius: var(--rund-klein); }
.belegbot-historieneintrag h4 { margin: 0; }
.belegbot-nachweis { display: inline-flex; margin-top: 0.75rem; color: var(--marke-dunkel); font-size: var(--schrift-klein); }
.belegbot-fachbereich { padding: 1.2rem; border: 1px solid var(--shell-border); border-radius: var(--shell-radius); background: var(--shell-card); }
.belegbot-fachbereich[hidden] { display: none !important; }
.belegbot-fachbereich + .belegbot-fachbereich { padding-top: 1.2rem; border-top: 1px solid var(--shell-border); }
.belegbot-fachbereich h3 { font-size: 0.95rem; }


/* Document analysis uses the synthetic-only job API, with the Lovable list/detail split. */
.dokumentanalyse { min-width: 0; }
.dokumentanalyse-kopf { margin: 0 0 1.1rem; }
.dokumentanalyse-startbereich { margin-bottom: 1.25rem; }
.dokumentanalyse-hinweis { padding: 0.85rem 1rem; border: 1px solid var(--shell-border); border-radius: var(--shell-radius); background: var(--shell-card); }
.dokumentanalyse-start { min-height: var(--aktionshoehe); margin-top: 0.75rem; border-radius: var(--rund-klein); background: var(--marke-dunkel); color: var(--text-auf-dunkel); font-weight: 500; }
.dokumentanalyse-start:hover { background: var(--aktion-hover); }
.dokumentanalyse-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1rem; }
.dokumentanalyse-filter button { min-height: 36px; padding: 0.35rem 0.8rem; border: 1px solid var(--shell-border); border-radius: 999px; background: var(--shell-card); color: var(--shell-muted); font-size: var(--schrift-klein); cursor: pointer; }
.dokumentanalyse-filter button[aria-pressed='true'] { border-color: var(--marke-dunkel); background: var(--marke-dunkel); color: var(--text-auf-dunkel); }
.dokumentanalyse-auftragsuebersicht { min-width: 0; margin: 0 0 1rem; padding: 1rem; overflow: hidden; border: 1px solid var(--shell-border); border-radius: var(--shell-radius); background: var(--shell-card); }
.dokumentanalyse-auftragsdetail { min-width: 0; }
.dokumentanalyse-arbeitsbereich { display: grid; grid-template-columns: minmax(0, 1fr) minmax(20rem, 22rem); gap: 1.25rem; align-items: start; }
.dokumentanalyse-auftragsliste, .dokumentanalyse-ergebnis { min-width: 0; overflow: hidden; border: 1px solid var(--shell-border); border-radius: var(--shell-radius); background: var(--shell-card); }
.dokumentanalyse-dokumentliste { padding: 1rem; }
.dokumentanalyse-dokumentliste h3 { margin: 0 0 0.9rem; color: var(--shell-ink); font-size: 0.95rem; font-weight: 500; }
.dokumentanalyse-tabelle { font-size: var(--schrift-klein); }
.dokumentanalyse-tabelle th, .dokumentanalyse-tabelle td { padding: 0.8rem 0.9rem; }
.dokumentanalyse-tabelle thead th { background: var(--marke-flaeche); }
.dokumentanalyse-tabelle tbody tr[aria-selected='true'] { background: var(--marke-flaeche); }
.dokumentanalyse-auftrag-link, .dokumentanalyse-dokument-link { padding: 0; border: 0; background: transparent; color: var(--shell-ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.dokumentanalyse-auftrag-link:hover, .dokumentanalyse-dokument-link:hover { color: var(--marke-dunkel); text-decoration: underline; }
.dokumentanalyse-ergebnis { padding: 1.2rem; }
.dokumentanalyse-ergebnis h3 { margin: 0 0 0.9rem; color: var(--shell-ink); font-size: 0.95rem; font-weight: 500; }
.dokumentanalyse-statusliste { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem; margin: 1rem 0; }
.dokumentanalyse-statusblock { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.65rem 0.75rem; border: 1px solid var(--shell-border); border-radius: var(--rund-klein); background: var(--shell-card); color: var(--shell-ink); cursor: pointer; }
.dokumentanalyse-statusblock[aria-pressed='true'] { border-color: var(--marke-dunkel); box-shadow: inset 0 0 0 1px var(--marke-dunkel); }
.dokumentanalyse-statusblock .dokumentanalyse-status { font-size: var(--schrift-klein); }
.dokumentanalyse-meta { grid-template-columns: max-content minmax(0, 1fr); gap: 0.3rem 0.75rem; font-size: var(--schrift-klein); }
.dokumentanalyse-positionen { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 0.7rem; margin: 0; font-size: var(--schrift-klein); }
.dokumentanalyse-positionen dt, .dokumentanalyse-meta dt { color: var(--shell-muted); }
.dokumentanalyse-positionen dd, .dokumentanalyse-meta dd { margin: 0; color: var(--shell-ink); text-align: right; }
.dokumentanalyse-ergebnis h4 { margin: 1.1rem 0 0.5rem; color: var(--shell-ink); font-size: var(--schrift-klein); font-weight: 500; }
.dokumentanalyse-hinweise { margin: 0; padding-left: 1.1rem; color: var(--shell-ink); font-size: var(--schrift-klein); }
.dokumentanalyse-dokumenttabelle { min-width: 48rem; }

@media (max-width: 1100px) {
  .tools-uebersicht-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .belegbot-statuskarten { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .belegbot-schritte { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dokumentanalyse-arbeitsbereich { grid-template-columns: minmax(0, 1fr); }
  .dokumentanalyse-statusliste { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .tools-uebersicht-raster { grid-template-columns: minmax(0, 1fr); }
  .belegbot-statuskarten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .belegbot-filter { grid-template-columns: minmax(0, 1fr); }
  .dokumentanalyse-filter { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.25rem; }
  .dokumentanalyse-filter button { flex: 0 0 auto; }
  .dokumentanalyse-statusliste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Geometrie 1:1 zum Lovable-Codefreeze (dort rem = 13px, hier 16px): daher feste px-Werte. */
main:has(.tools-uebersicht) .seitenkopf { margin-bottom: 0; }
.tools-uebersicht-kopf { margin: 0 0 30px; }
.tools-uebersicht-kopf h1 { font-size: 30px; line-height: 42px; letter-spacing: -0.02em; }
.tools-uebersicht-kopf p { margin-top: 7px; font-size: 13px; line-height: 19.5px; }
.tools-kachel { min-height: 0; }
.tools-kachel h2 { margin-top: 20px; font-size: 16px; line-height: 24px; }
.tools-kachel-beschreibung { margin: 8px 0 24px; font-size: 12px; line-height: 24px; }
.tools-kachel-titelzeile { display: flex; min-width: 0; align-items: center; gap: 12px; }
.tools-kachel-titelzeile h2 { min-width: 0; margin: 0; overflow-wrap: normal; hyphens: none; }
.tools-kachel-kopf .tools-kachel-badge, .tools-kachel-kopf .tools-kachel-extern { flex: 0 0 auto; white-space: nowrap; }
.tools-kachel-kopf + .tools-kachel-beschreibung { margin-top: 16px; }
.tools-kachel-fuss { padding-top: 16px; }
.tools-kachel-aktion { box-sizing: border-box; min-height: var(--aktionshoehe); padding: 0 12px; font-size: 12px; line-height: 16px; }

/* BelegeBot-Übersicht: Maße aus dem Lovable-Codefreeze (1440x900 gemessen), px statt rem. */
.belegbot { gap: 0; }
.belegbot > .belegbot-zurueck { align-self: flex-start; height: 16px; font-size: 12px; line-height: 16px; }
.belegbot-kopf { margin: 20px 0 24px; }
.belegbot-kopf h1 { font-size: 18px; line-height: 28px; letter-spacing: 0; }
.belegbot-kopf p { margin: 4px 0 0; font-size: 12px; line-height: 16px; }
.belegbot-statuskarten { gap: 12px; margin-bottom: 24px; }
.belegbot-statuskarte { box-sizing: border-box; width: 100%; min-height: 74px; padding: 12px 16px; gap: 0; justify-content: flex-start; }
.belegbot-statuskarte-wert { font-size: 20px; line-height: 28px; }
.belegbot-statuskarte-label { font-size: 10px; line-height: 15px; }
.belegbot-filter { margin-bottom: 16px; gap: 12px; grid-template-columns: 288px 167px; }
.belegbot .belegbot-filter input, .belegbot .belegbot-filter select { box-sizing: border-box; height: 36px !important; min-height: 0 !important; border-radius: 6px; font-size: 12px; }
.belegbot-tabelle { width: 100%; table-layout: fixed; font-size: 12px; line-height: 18px; }
.belegbot-tabelle th, .belegbot-tabelle td { padding: 0 20px; vertical-align: middle; }
.belegbot-tabelle tbody tr:last-child > * { border-bottom: 0; }
.belegbot-tabelle thead th { height: 45px; color: var(--marke-gedaempft); font-size: 12px; font-weight: 400; text-align: left; }
.belegbot-tabelle tbody tr { height: 73px; border-top: 1px solid var(--marke-linie); }
.belegbot-tabelle thead th:nth-child(1) { width: 19%; }
.belegbot-tabelle thead th:nth-child(2) { width: 15.6%; }
.belegbot-tabelle thead th:nth-child(3) { width: 13.4%; }
.belegbot-tabelle thead th:nth-child(4) { width: 22.7%; }
.belegbot-tabelle thead th:nth-child(5) { width: 12.2%; }
.belegbot-tabelle thead th:nth-child(6) { width: 12.3%; }
.belegbot-tabelle thead th:nth-child(7) { width: 4.9%; }
.belegbot-status::before { width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; content: ''; }
.belegbot-status { min-height: 0; border: 0; padding: 4px 8px; font-size: 10px; font-weight: 500; line-height: 15px; border-radius: 6px; }
.belegbot-zelle-leer { color: var(--marke-gedaempft); }
.belegbot-pfeil { text-align: right; color: var(--marke-gedaempft); }
.belegbot-pfeil-symbol { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
main:has(.belegbot) .seitenkopf { margin-bottom: 0; }
.belegbot-tabelle thead th { white-space: nowrap; }
@media (min-width: 1024px) {
  table.belegbot-tabelle:not(.belegbot-benutzer-tabelle) th,
  table.belegbot-tabelle:not(.belegbot-benutzer-tabelle) td { padding-inline: 12px; }
  table.belegbot-tabelle:not(.belegbot-benutzer-tabelle) thead th:nth-child(4) { width: 20.7%; }
  table.belegbot-tabelle:not(.belegbot-benutzer-tabelle) thead th:nth-child(5) { width: 14.5%; }
  table.belegbot-tabelle:not(.belegbot-benutzer-tabelle) thead th:nth-child(6) { width: 11.8%; }
}

/* BelegeBot-Mandantendetail: Maße aus dem Lovable-Codefreeze. */
.belegbot-status { border-radius: 4px; }
.belegbot-detailseite { margin-top: 0; }
.belegbot-detailseite > .belegbot-zurueck { height: 16px; font-size: 12px; line-height: 16px; }
.belegbot-detailkopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 20px 0 24px; }
.belegbot-detailkopf h1 { font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: 0; }
.belegbot-detailkopf-sub { margin: 4px 0 0; color: var(--marke-gedaempft); font-size: 12px; line-height: 16px; }
.belegbot-detailkopf-nutzung { display: flex; align-items: center; gap: 8px; color: var(--marke-gedaempft); font-size: 10px; line-height: 15px; }
.belegbot-schritte { gap: 8px; margin: 0 0 24px; }
.belegbot-schritt { min-height: 55px; padding: 12px 16px; gap: 8px; border-radius: 6px; }
.belegbot-schritt-text { display: flex; flex-direction: column; min-width: 0; }
.belegbot-schritt strong { font-size: 12px; line-height: 16px; }
.belegbot-schritt-text span { font-size: 12px; line-height: 16px; }
.belegbot-detail > .belegbot-fachbereich { padding: 24px; border: 1px solid var(--marke-linie); border-radius: 8px; background: var(--flaeche-inhalt); }
.belegbot-karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.belegbot-karte-kopf h3 { margin: 0; font-size: 12px; font-weight: 500; line-height: 16px; }
.belegbot-daten { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.belegbot-daten-feld { min-width: 0; }
.belegbot-daten dt { margin: 0; color: var(--marke-gedaempft); font-size: 10px; line-height: 15px; }
.belegbot-daten dd { margin: 4px 0 0; font-size: 12px; line-height: 16px; overflow-wrap: anywhere; }
.belegbot-fachbereich .belegbot-ruhig { margin: 16px 0 0; font-size: 10px; line-height: 15px; }
.belegbot-nachweis { display: inline-flex; align-items: center; gap: 8px; height: 32px; margin-top: 16px; padding: 0 12px; border: 1px solid var(--marke-linie); border-radius: 6px; color: var(--marke-dunkel); font-size: 12px; font-weight: 500; text-decoration: none; }
.belegbot-nachweis-symbol { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.belegbot-historie { margin-top: 16px; padding-top: 16px; }
.belegbot-historie summary { font-size: 12px; line-height: 16px; font-weight: 400; }
.belegbot-nachweis { align-self: flex-start; width: fit-content; }

/* BelegeBot-Modale: Lovable-Dialog (512 px, Padding 24, Abstand 16). Felder, Pflichtangaben und Verträge bleiben. */
dialog.belegbot-modal { width: min(512px, calc(100vw - 2rem)); max-width: none; height: fit-content; max-height: 90vh; padding: 24px; gap: 16px; overflow: auto; border: 1px solid var(--marke-linie); border-radius: 8px; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
dialog.belegbot-modal > .modal-kopf { position: relative; display: block; padding: 0; border: 0; }
dialog.belegbot-modal .modal-kopftext { display: flex; flex-direction: column; gap: 16px; padding-right: 24px; }
dialog.belegbot-modal .modal-titel { font-size: 18px; font-weight: 600; line-height: 18px; letter-spacing: -0.01em; }
dialog.belegbot-modal .modal-beschreibung { margin: 0; color: var(--marke-gedaempft); font-size: 14px; line-height: 20px; }
dialog.belegbot-modal .modal-schliessen { position: absolute; top: -8px; right: -8px; width: 32px; height: 32px; }
dialog.belegbot-modal > .modal-inhalt { flex: 0 0 auto; gap: 16px; padding: 0; overflow: visible; }
dialog.belegbot-modal .belegbot-formular { gap: 16px; }
dialog.belegbot-modal .feld-gruppe { gap: 8px; }
dialog.belegbot-modal .feld-marke, dialog.belegbot-modal .belegbot-gruppe legend { font-size: 12px; font-weight: 500; line-height: 18px; }
dialog.belegbot-modal .belegbot-gruppe { gap: 16px; }
dialog.belegbot-modal .belegbot-gruppe legend { margin-bottom: 8px; padding: 0; }
dialog.belegbot-modal input:not([type='checkbox']):not([type='radio']), dialog.belegbot-modal select { box-sizing: border-box; height: 40px; min-height: 0; padding: 9px 12px; border-radius: 6px; font-size: 12px; }
dialog.belegbot-modal > .modal-fuss { justify-content: flex-end; gap: 8px; padding: 0; border: 0; background: transparent; }
dialog.belegbot-modal > .modal-fuss button { box-sizing: border-box; height: auto; min-height: var(--aktionshoehe); padding: 0 16px; border-radius: 6px; font-size: 14px; line-height: 20px; }
dialog.belegbot-modal .belegbot-gruppe legend { text-transform: none; letter-spacing: 0; }
dialog.belegbot-modal .belegbot-radiogruppe { gap: 16px; font-size: 12px; }
dialog.belegbot-modal .belegbot-empfaenger-daten p { margin: 0; font-size: 12px; line-height: 18px; }
dialog.belegbot-modal .belegbot-empfaenger { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12px; line-height: 18px; }
dialog.belegbot-modal .belegbot-empfaenger-label { font-weight: 500; }
dialog.belegbot-modal .belegbot-empfaenger .belegbot-radiogruppe { gap: 16px; }
dialog.belegbot-modal .belegbot-empfaenger label { min-height: 0; }
dialog.belegbot-modal .belegbot-empfaenger-daten { flex: 0 0 100%; display: grid; gap: 16px; padding: 0; }
dialog.belegbot-modal .belegbot-empfaenger-daten:empty { display: none; }
dialog.belegbot-modal .modal-kopftext { padding-right: 0; }
dialog.belegbot-modal .modal-titel { padding-right: 24px; }
dialog.belegbot-modal .belegbot-formular { margin: 0; }
dialog.belegbot-modal .modal-kopftext { gap: 8px; }
/* Versandempfänger-Wahl ist ein fachlich nötiges Zusatzfeld (Lovable hat es nicht): bewusst enger gesetzt, damit die Dialoghöhe in Toleranz bleibt. */
dialog.belegbot-modal .belegbot-empfaenger { margin-top: -8px; line-height: 16px; }
dialog.belegbot-modal .belegbot-empfaenger .belegbot-radio { height: 16px; line-height: 16px; }

/* Mandantendetail nach Lovable-Codefreeze (px, bei 1440x900 gemessen): Schritte, Bereichskarten, Tabellen, Belegweiterleitung. */
.belegbot-icon { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.belegbot-schritt { gap: 12px; }
.belegbot-schritt strong { font-weight: 400; }
.belegbot-schritt[aria-current='step'] strong { font-weight: 500; }
.belegbot-schritt .belegbot-schritt-marke { display: inline-flex; width: 24px; height: 24px; flex: 0 0 auto; align-items: center; justify-content: center; border-radius: 50%; background: var(--marke-flaeche); color: var(--marke-gedaempft); font-size: 10px; line-height: 13.3px; }
.belegbot-schritt-marke .belegbot-icon { width: 12px; height: 12px; }
.belegbot-schritt--erledigt .belegbot-schritt-marke { background: var(--status-erfolg-flaeche); color: var(--status-erfolg); }
.belegbot-schritt--problem .belegbot-schritt-marke { background: var(--status-fehler-flaeche); color: var(--status-fehler); }
.belegbot-schritt--optional .belegbot-schritt-marke { border: 1px dashed var(--marke-gedaempft); background: transparent; }
.belegbot-schritt .belegbot-schritt-text { display: flex; flex-direction: column; min-width: 0; font-size: 12px; }
.belegbot-schritt .belegbot-schritt-text strong { font-size: 12px; line-height: 16px; overflow-wrap: normal; }
.belegbot-schritt .belegbot-schritt-text > span { overflow: hidden; color: var(--marke-gedaempft); font-size: 10px; line-height: 13.3px; overflow-wrap: normal; text-overflow: ellipsis; white-space: nowrap; }

.belegbot-detail { gap: 24px; }
.belegbot-detail > .belegbot-fachbereich { gap: 0; }
.belegbot-sektion-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.belegbot-sektion-kopf h3 { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 14px; font-weight: 500; line-height: 20px; }
.belegbot-sektion-nr { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--marke-flaeche); font-size: 11px; font-weight: 500; line-height: 16px; }
.belegbot-sektion-anzahl { color: var(--marke-gedaempft); font-size: 12px; line-height: 16px; }
.belegbot-sektion-status { display: flex; align-items: center; gap: 8px; }
.belegbot-sektion-status .belegbot-sektion-anzahl { font-size: 10px; line-height: 15px; }
.belegbot-fachbereich .btn { box-sizing: border-box; height: auto; min-height: var(--aktionshoehe); gap: 8px; padding: 0 12px; border-radius: 6px; font-size: 12px; font-weight: 500; line-height: 16px; }
.belegbot-fachbereich .btn .belegbot-icon { width: 16px; height: 16px; }
.belegbot-fachbereich .btn--icon, .belegbot-fachbereich .belegbot-iconknopf { width: var(--aktionshoehe); height: var(--aktionshoehe); padding: 0; }
.belegbot-fachbereich .btn--tertiary { color: var(--marke-dunkel); }
.belegbot-fachbereich .btn--tertiary:hover { text-decoration: none; }
.belegbot-fachbereich .btn--tertiary.belegbot-textgefahr { color: var(--status-fehler); }
.belegbot-fachbereich .btn--primary:disabled { opacity: 0.5; }
.belegbot-fehlerbox, .belegbot-warnbox { margin: 0 0 16px; padding: 12px 16px; border-radius: 6px; font-size: 12px; line-height: 16px; }
.belegbot-fehlerbox { background: var(--status-fehler-hauch); color: var(--status-fehler); }
.belegbot-warnbox { background: var(--status-warnung-flaeche); color: var(--status-warnung); }
.belegbot-fachbereich .belegbot-ruhig--lead { margin: 0; font-size: 12px; line-height: 16px; }
.belegbot-aktionen { justify-content: flex-start; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--marke-linie); }
.belegbot-aktionen .belegbot-ruhig { margin: 0; }
.belegbot-fusszeile { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; color: var(--marke-gedaempft); font-size: 10px; line-height: 15px; }
.belegbot-fusszeile .belegbot-icon { width: 13px; height: 13px; }
.belegbot-zwischentitel { margin: 0; font-size: 12px; font-weight: 500; line-height: 16px; }
.belegbot-statusdatum { margin-left: 8px; color: var(--marke-gedaempft); font-size: 10px; line-height: 15px; }
.belegbot-hinzufuegen { align-self: flex-start; margin-top: 16px; }
.belegbot-fachbereich .belegbot-hinweis, .belegbot-fachbereich .belegbot-hinweis-zeile { margin: 0 0 12px; }

/* Bot-Benutzer und Registrierungsvorschläge als Tabellen (Lovable). */
.belegbot-fachbereich-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 12px; }
.belegbot-benutzer-tabelle-box { overflow-x: auto; }
.belegbot-benutzer-tabelle { width: 100%; border-collapse: collapse; border-spacing: 0; table-layout: auto; font-size: 12px; line-height: 18px; }
.belegbot-benutzer-tabelle thead th:nth-child(n) { width: auto; }
.belegbot-benutzer-tabelle thead th { height: 45px; padding: 0 20px; border: 0; background: var(--marke-flaeche); color: var(--marke-gedaempft); font-weight: 400; text-align: left; white-space: nowrap; }
.belegbot-benutzer-tabelle tbody tr { height: auto; border: 0; }
.belegbot-benutzer-tabelle tbody th, .belegbot-benutzer-tabelle tbody td { padding: 18px 20px; border: 0; border-top: 1px solid var(--marke-linie); font-weight: 400; text-align: left; white-space: nowrap; vertical-align: middle; }
.belegbot-benutzer-tabelle tbody th { font-weight: 500; }
.belegbot-benutzer-tabelle .belegbot-zelle-datum { font-size: 10px; line-height: 15px; }
.belegbot-benutzer-tabelle .belegbot-benutzer-aktionen { display: table-cell; padding: 18px 12px; text-align: right; white-space: nowrap; }
.belegbot-benutzer-tabelle thead th.belegbot-auswahl, .belegbot-benutzer-tabelle .belegbot-auswahl { width: 13px; }
.belegbot-benutzer-tabelle input[type='checkbox'] { width: 13px; height: 13px; margin: 0; }

/* Belegweiterleitung. */
.belegbot-versand { display: flex; flex-direction: column; gap: 24px; }
.belegbot-versand-karten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.belegbot-versand-karte { padding: 12px 16px; border: 1px solid var(--marke-linie); border-radius: 6px; font-size: 12px; line-height: 16px; }
.belegbot-versand-karte-titel { margin: 0; color: var(--marke-gedaempft); font-size: 10px; line-height: 13.3px; }
.belegbot-versand-karte .belegbot-status { line-height: 13.3px; }
.belegbot-versand-label { margin: 0; color: var(--marke-gedaempft); font-size: 10px; line-height: 15px; }
.belegbot-versand-karte-zeile { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.belegbot-versand-label { margin-bottom: 8px; }
.belegbot-versand-modi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.belegbot-versand-modus-karte { position: relative; display: flex; box-sizing: border-box; width: 100%; height: auto; min-height: 0; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--marke-linie); border-radius: 6px; background: var(--flaeche-inhalt); color: var(--marke-dunkel); font: inherit; font-size: 12px; line-height: 16px; letter-spacing: 0; text-align: left; text-transform: none; cursor: pointer; }
.belegbot-versand-modus-karte:hover:not(:disabled) { background: var(--marke-flaeche); }
.belegbot-versand-modus-karte:disabled { opacity: 1; cursor: default; }
.belegbot-versand-modus-karte[aria-pressed='true'] { border-color: var(--marke-dunkel); background: var(--flaeche-inhalt); box-shadow: 0 0 0 1px var(--marke-dunkel); }
.belegbot-versand-modus-karte:focus-visible { outline: 2px solid var(--marke-dunkel); outline-offset: 2px; }
.belegbot-versand-modus-titel { font-weight: 500; }
.belegbot-versand-modus-text { color: var(--marke-gedaempft); font-size: 10px; line-height: 13.3px; }
.belegbot-versand-modus-karte--gespeichert::after { position: absolute; top: 8px; right: 12px; color: var(--marke-gedaempft); font-size: 10px; line-height: 15px; content: 'Aktuell gespeichert'; }
.belegbot-versand-adresse { display: flex; width: calc(100% - 16px); flex-direction: column; gap: 8px; margin: 0; }
.belegbot-versand-adresse[hidden] { display: none; }
.belegbot-versand-adresse .feld-marke { font-size: 12px; font-weight: 500; line-height: 16px; }
.belegbot-versand-adresse input:not([type='checkbox']):not([type='radio']) { box-sizing: border-box; width: 100%; height: 40px; min-height: 0; padding: 9px 12px; border-radius: 6px; font-size: 12px; }
.belegbot-versand-adresse .belegbot-feldfehler { margin: 0; font-size: 10px; line-height: 15px; }
.belegbot-versand-leiste, .belegbot-formularlink { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 0; border-radius: 6px; background: var(--marke-flaeche); font-size: 12px; line-height: 16px; }
.belegbot-versand-leistentext { min-width: 0; }

@media (max-width: 1100px) {
  .belegbot-versand-modi { grid-template-columns: minmax(0, 1fr); }
  .belegbot-versand-karten { grid-template-columns: minmax(0, 1fr); }
}
.belegbot-daten { gap: 20px; }
.belegbot-historie { margin-top: 20px; }
.belegbot-historieneintrag { margin-top: 16px; padding: 0; border: 0; border-radius: 0; }
.belegbot-historieneintrag-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.belegbot-historieneintrag h4 { font-size: 12px; font-weight: 500; line-height: 16px; }
.belegbot-historie-daten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; margin: 12px 0 0; }

@media (max-width: 1100px) {
  .belegbot-historie-daten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .belegbot-historie-daten { grid-template-columns: minmax(0, 1fr); }
}

/* Dialoge nach Lovable-Codefreeze: Titel-/Beschreibungsabstand 16, Feldlabels 16 px hoch, kleiner Schließen-Knopf, kompakte Empfängerwahl. */
dialog.belegbot-modal .modal-kopftext { gap: 16px; }
dialog.belegbot-modal .feld-marke, dialog.belegbot-modal .belegbot-gruppe legend { line-height: 16px; }
dialog.belegbot-modal .modal-schliessen { box-sizing: border-box; width: 16px; height: 16px; min-width: 0; min-height: 0; padding: 0; }
dialog.belegbot-modal .modal-schliessen svg { width: 16px; height: 16px; }
dialog.belegbot-modal textarea { box-sizing: border-box; height: 68px; min-height: 0; padding: 9px 12px; border-radius: 6px; font-size: 12px; line-height: 16px; }
dialog.belegbot-modal .belegbot-empfaenger { margin-top: 0; }
dialog.belegbot-modal .belegbot-empfaenger .belegbot-radio { display: inline-flex; align-items: center; gap: 6px; padding: 0; }
dialog.belegbot-modal .belegbot-empfaenger .belegbot-radio input { margin: 0; }
dialog.belegbot-modal .belegbot-empfaenger .belegbot-radiogruppe { gap: 8px 12px; }
dialog.belegbot-modal .belegbot-btn-icon { width: 16px; height: 16px; }
dialog.belegbot-modal .belegbot-ruhig { margin: 0; font-size: 10px; line-height: 15px; }

/* P3: lokale Aktionshoehen, Fokus und responsive Korrekturen ohne globale Kaskaden-Aenderung. */
.wissen .miro-wahl .btn, .wissen .hb-sortierknopf { box-sizing: border-box; min-height: var(--aktionshoehe); }
.wissen .miro-wahl-feld, .wissen .hb-filter { box-sizing: border-box; height: 36px; min-height: 36px; }
.wissen .miro-wahl-feld:focus-visible, .wissen .hb-filter:focus-visible, .wissen .btn:focus-visible,
.dokumentanalyse .btn:focus-visible, .belegbot .btn:focus-visible, .tools-uebersicht .btn:focus-visible,
.belegbot :is(.belegbot-statuskarte, .belegbot-schritt):focus-visible { outline: 2px solid var(--marke-dunkel); outline-offset: 2px; }
.wissen .btn--tertiary, .dokumentanalyse .btn--tertiary { color: var(--marke-dunkel); }
@media (max-width: 640px) {
  .belegbot-filter { grid-template-columns: minmax(0, 1fr); }
  .belegbot-filter > * { min-width: 0; }
  .wissen .miro-wahl-feld { flex-basis: 100%; }
}

/* P3: Miro-Merkliste und Dialog, isoliert auf den Wissensbereich. */
.wissen .miro-merk-eintrag.aktiv { border-color: var(--marke-dunkel); }
.wissen .miro-merk-eintrag.aktiv .miro-merk-name { color: var(--marke-dunkel); }
.wissen .miro-merk-weg { box-sizing: border-box; min-width: var(--aktionshoehe); min-height: var(--aktionshoehe); padding-inline: 0.5rem; }
.wissen .hb-nav-klapp { box-sizing: border-box; width: var(--aktionshoehe); height: var(--aktionshoehe); }
dialog.miro-merken-modal { width: min(32rem, calc(100vw - 2rem)); }
dialog.miro-merken-modal .miro-merken-form { display: grid; gap: 0.4rem; }
dialog.miro-merken-modal .miro-merken-name { box-sizing: border-box; width: 100%; min-height: var(--aktionshoehe); padding: 0.5rem 0.75rem; border: 1px solid var(--kontur); border-radius: var(--rund-klein); font: inherit; }
dialog.miro-merken-modal .miro-merken-name:focus-visible { outline: 2px solid var(--marke-dunkel); outline-offset: 2px; }
/* Die breite Mandantentabelle bleibt auf kleinen Viewports innerhalb ihrer eigenen Scrollflaeche. */
.belegbot-liste { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
@media (max-width: 767.98px) {
  .belegbot-liste > .belegbot-tabelle { min-width: 48rem; }
}

/* P3: Fokuszustand bleibt in Wissen und in Body-Portaldialogen dunkel. */
.wissen .tab:focus-visible, .wissen .tabs__panel:focus-visible,
dialog.miro-merken-modal .btn:focus-visible, dialog.belegbot-modal .btn:focus-visible { outline-color: var(--marke-dunkel); }
