/* Rechnungsprüfung und Rechnungsablage – alle Klassen mit Präfix rx- */
.rx-root { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #F7F8FA; font-size: .86rem; color: var(--text-primary); position: relative; }
.rx-root.rx-drop::after { content: 'Dateien hier ablegen'; position: absolute; inset: 10px; z-index: 5; display: flex; align-items: center; justify-content: center;
  background: rgba(211,217,77,.22); border: 2.5px dashed var(--brand-deep); border-radius: 16px; font-size: 1.2rem; font-weight: 700; color: var(--brand-deep); pointer-events: none; }

/* Kopf mit Reitern */
.rx-kopf { display: flex; align-items: center; gap: 18px; padding: 12px 22px 0; background: #fff; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rx-titel { font-size: 1.05rem; font-weight: 700; padding-bottom: 12px; }
.rx-kopf-rechts { margin-left: auto; padding-bottom: 10px; display: flex; gap: 8px; }
.rx-reiter { display: flex; gap: 2px; align-self: flex-end; flex-wrap: wrap; }
.rx-reiter-btn { border: none; background: none; font: inherit; font-weight: 600; color: var(--text-muted); padding: 9px 13px 11px; cursor: pointer; border-bottom: 3px solid transparent; display: flex; align-items: center; gap: 6px; }
.rx-reiter-btn:hover { color: var(--text-primary); }
.rx-reiter-btn.aktiv { color: var(--text-primary); border-bottom-color: var(--brand); }
.rx-zahl { background: var(--accent-light); color: var(--text-primary); border-radius: 10px; padding: 1px 7px; font-size: .72rem; font-weight: 700; }
.rx-zahl-rot { background: #FBE3E0; color: #B03A2E; }
.nav-subitem[data-panel="rechnungspruefung"] { position: relative; }
.rx-nav-zahl { position: absolute; right: 1px; top: 50%; transform: translateY(-50%); background: var(--brand); color: var(--brand-text); border-radius: 9px; padding: 0 5px; font-size: .64rem; line-height: 16px; font-weight: 700; }

.rx-inhalt { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.rx-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px 22px 90px; }
.rx-filter { display: flex; gap: 10px; align-items: center; padding: 12px 22px 0; flex-wrap: wrap; }
.rx-filter input[type=search] { flex: 1; min-width: 220px; max-width: 420px; }
.rx-luecke { flex: 1; }
.rx-root input:not([type=checkbox]), .rx-root select, .rx-root textarea, .rx-dlg input:not([type=checkbox]), .rx-dlg select, .rx-dlg textarea {
  font: inherit; padding: 7px 9px; border: 1.5px solid var(--border); border-radius: 8px; background: #fff; color: inherit; min-width: 0; }
.rx-root input:focus, .rx-root select:focus, .rx-root textarea:focus, .rx-dlg input:focus, .rx-dlg select:focus, .rx-dlg textarea:focus { outline: none; border-color: var(--brand-strong); box-shadow: 0 0 0 3px var(--brand-soft); }
.rx-root input:disabled, .rx-root select:disabled, .rx-root textarea:disabled { background: #F4F4F4; color: #555; }
.rx-root textarea, .rx-dlg textarea { resize: vertical; width: 100%; }
.rx-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Knöpfe */
.rx-btn { font: inherit; font-weight: 600; font-size: .82rem; padding: 7px 13px; border-radius: 8px; border: 1.5px solid var(--btn-border); background: #fff; color: var(--btn-text); cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.rx-btn:hover { background: var(--accent-light); }
.rx-btn-haupt { background: var(--brand); border-color: var(--brand-strong); color: var(--brand-text); }
.rx-btn-haupt:hover { background: var(--brand-strong); }
.rx-btn-gefahr { background: #C0392B; border-color: #A93226; color: #fff; }
.rx-btn-gefahr:hover { background: #A93226; }
.rx-btn-gefahr-rand { color: #B03A2E; }
.rx-btn:disabled { opacity: .55; cursor: default; }
.rx-link { border: none; background: none; font: inherit; color: var(--brand-deep); font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.rx-x { border: none; background: none; font-size: 1.15rem; line-height: 1; color: #999; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.rx-x:hover { background: #FBE3E0; color: #B03A2E; }

/* Tabellen */
.rx-tab { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rx-tab th { text-align: left; font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; padding: 9px 10px; background: #FAFAFA; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
.rx-tab td { padding: 9px 10px; border-bottom: 1px solid #F0F0F0; vertical-align: middle; }
.rx-tab tbody tr:last-child td { border-bottom: none; }
.rx-tab tbody tr[data-auf], .rx-tab tbody tr[data-dok], .rx-tab tbody tr[data-kred] { cursor: pointer; }
.rx-tab tbody tr[data-auf]:hover, .rx-tab tbody tr[data-dok]:hover, .rx-tab tbody tr[data-kred]:hover { background: #FAFBEA; }
.rx-tab-klein td, .rx-tab-klein th { padding: 6px 9px; font-size: .8rem; }
.rx-r { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rx-nr { font-weight: 700; white-space: nowrap; }
.rx-datei { color: var(--text-muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rx-rot { color: #B03A2E !important; font-weight: 600; }
.rx-gruen { color: #2E7D32 !important; font-weight: 600; }
.rx-klein { font-size: .76rem; color: var(--text-muted); margin-top: 8px; }

/* Statusmarken */
.rx-marke { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: .72rem; font-weight: 700; white-space: nowrap; margin-right: 4px; background: #ECECEC; color: #404040; }
.rx-m-erfassung { background: #E6F0FB; color: #2563A8; }
.rx-m-sachlich, .rx-m-rechnerisch { background: #FFF3D6; color: #8A5A00; }
.rx-m-freigabe, .rx-m-freigabe2 { background: #EFE7FB; color: #5B3FA8; }
.rx-m-zahlung { background: #EAF4C8; color: #4A6A00; }
.rx-m-abgeschlossen { background: #DDF2DF; color: #2E7D32; }
.rx-m-abgelehnt, .rx-m-storniert, .rx-m-spaet { background: #FBE3E0; color: #B03A2E; }
.rx-m-frage { background: #FFE9C7; color: #9A5B00; }
.rx-m-ruht { background: #ECECEC; color: #555; }

.rx-leer { padding: 44px 20px; text-align: center; color: var(--text-muted); line-height: 1.6; }
.rx-leer span { font-size: .8rem; }
.rx-ablage-zone { border: 2px dashed #D5D5D5; border-radius: 14px; background: #fff; }
.rx-zone-klein { padding: 16px; margin-bottom: 14px; }

/* Übersicht der Rechnungsprüfung: je Schritt eine Bahn, untereinander */
.rx-kopf-rechts input[type=search] { width: 300px; max-width: 100%; }
.rx-bahnen { display: flex; flex-direction: column; gap: 14px; }
.rx-bahn { background: #fff; border: 1px solid var(--border); border-radius: 12px; flex-shrink: 0; overflow: hidden; }
.rx-bahn > header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #F0F0F0; font-size: .92rem; }
.rx-bahn > header em { font-style: normal; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rx-bahn-leer { padding: 22px 14px; text-align: center; color: var(--text-muted); font-size: .8rem; }
.rx-bahn .rx-tab { border: none; border-radius: 0; table-layout: fixed; }
.rx-bahn .rx-tab th { position: static; }
.rx-bahn .rx-tab th:first-child, .rx-bahn .rx-tab td:first-child { padding-left: 14px; }
.rx-eng { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Vorgang / Dokument: Beleg links, Maske rechts */
.rx-detail { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; }
.rx-d-kopf { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rx-d-titel { font-size: .98rem; }
.rx-d-info { color: var(--text-muted); font-size: .8rem; margin-left: auto; }
.rx-d-koerper { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(430px, 560px); }
.rx-d-beleg { min-height: 0; background: #5F6368; position: relative; }
.rx-d-rechts { min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.rx-d-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }
.rx-d-aktionen { display: flex; gap: 7px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--border); background: #FAFAFA; align-items: center; }
.rx-unterreiter { display: flex; border-bottom: 1px solid var(--border); padding: 0 10px; flex-wrap: wrap; }
.rx-unterreiter button { border: none; background: none; font: inherit; font-weight: 600; font-size: .8rem; color: var(--text-muted); padding: 9px 10px; cursor: pointer; border-bottom: 2.5px solid transparent; }
.rx-unterreiter button.aktiv { color: var(--text-primary); border-bottom-color: var(--brand); }
.rx-beleg { position: absolute; inset: 0; display: flex; }
.rx-beleg-pdf { flex: 1; border: none; background: #5F6368; }
.rx-beleg-bild { flex: 1; overflow: auto; padding: 16px; text-align: center; }
.rx-beleg-bild img { max-width: 100%; box-shadow: 0 2px 14px rgba(0,0,0,.4); background: #fff; }
.rx-beleg .rx-leer { flex: 1; align-self: center; color: #eee; }
.rx-beleg .rx-leer .rx-btn { margin-top: 12px; }
.rx-stempel-feld { position: absolute; right: 26px; bottom: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.rx-stempel { border: 2.5px solid; border-radius: 6px; padding: 4px 10px; background: rgba(255,255,255,.9); transform: rotate(-3deg); text-align: center; text-transform: uppercase; font-size: .76rem; letter-spacing: .05em; box-shadow: 0 1px 6px rgba(0,0,0,.25); }
.rx-stempel b { display: block; font-size: .86rem; }
.rx-stempel span { display: block; text-transform: none; letter-spacing: 0; font-size: .68rem; }
.rx-st-klein { display: inline-block; border: 1.5px solid; border-radius: 4px; padding: 0 5px; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin: 1px 3px 1px 0; white-space: nowrap; }

/* Ablauf-Stufen */
.rx-stufen { display: flex; gap: 0; padding: 10px 18px; border-bottom: 1px solid var(--border); background: #FAFAFA; overflow-x: auto; }
.rx-stufe { display: flex; align-items: center; gap: 7px; color: #999; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.rx-stufe + .rx-stufe::before { content: ''; width: 26px; height: 2px; background: #DDD; margin: 0 8px; }
.rx-stufe i { width: 22px; height: 22px; border-radius: 50%; background: #E3E3E3; color: #777; font-style: normal; font-size: .72rem; display: flex; align-items: center; justify-content: center; }
.rx-stufe.fertig { color: #2E7D32; } .rx-stufe.fertig i { background: #2E7D32; color: #fff; }
.rx-stufe.aktuell { color: var(--text-primary); } .rx-stufe.aktuell i { background: var(--brand); color: var(--brand-text); box-shadow: 0 0 0 3px var(--brand-soft); }
.rx-stufe.ende { color: #B03A2E; } .rx-stufe.ende i { background: #C0392B; color: #fff; }

/* Formulare */
.rx-abschnitt { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px 12px; margin: 0 0 12px; min-width: 0; }
.rx-abschnitt legend { font-weight: 700; font-size: .8rem; padding: 0 6px; color: var(--text-primary); }
.rx-form { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; }
.rx-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rx-f > span { font-size: .72rem; font-weight: 600; color: var(--text-muted); }
.rx-f-breit { grid-column: 1 / -1; }
.rx-f-check { flex-direction: row; align-items: center; gap: 7px; align-self: end; padding-bottom: 7px; }
.rx-f-check > span { font-size: .8rem; color: var(--text-primary); font-weight: 500; }
.rx-liste { gap: 5px; }
.rx-zeile { display: grid; gap: 6px; align-items: center; }
.rx-zeile-kopf span { font-size: .68rem; color: var(--text-muted); font-weight: 600; }
.rx-liste-fuss { display: flex; gap: 16px; }

.rx-summe { width: 100%; border-collapse: collapse; margin: 4px 0 14px; font-size: .84rem; }
.rx-summe caption { text-align: left; font-weight: 700; font-size: .8rem; padding: 6px 0; }
.rx-summe td { padding: 4px 2px; border-bottom: 1px dotted #E3E3E3; }
.rx-summe .rx-s-zw td { border-bottom: 1px solid #BBB; font-weight: 600; }
.rx-summe .rx-s-end td { border-top: 2px solid #404040; border-bottom: none; font-weight: 700; font-size: .95rem; padding-top: 7px; }
.rx-hinweis { border-radius: 10px; padding: 9px 12px; margin-bottom: 9px; line-height: 1.45; border: 1px solid; }
.rx-h-info { background: #EEF4FB; border-color: #C9DCF1; color: #1F4E82; }
.rx-h-warn { background: #FFF6DD; border-color: #EBD48A; color: #7A5200; }
.rx-h-fehler { background: #FCEBE9; border-color: #EDB7B0; color: #8E2A20; }
.rx-h-frage { background: #FFF1DC; border-color: #F1C98A; color: #7A4A00; }
.rx-hinweis .rx-btn { margin-top: 7px; }
.rx-h-check { display: block; margin-top: 6px; font-weight: 600; }

.rx-verlauf { display: flex; flex-direction: column; }
.rx-v { border-left: 2.5px solid var(--brand); padding: 2px 0 12px 12px; margin-left: 5px; position: relative; }
.rx-v::before { content: ''; position: absolute; left: -6.5px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-strong); }
.rx-v-kopf { display: flex; align-items: center; gap: 6px; }
.rx-v-wer { font-size: .74rem; color: var(--text-muted); }
.rx-v-text { margin-top: 4px; background: #F6F6F6; border-radius: 8px; padding: 6px 9px; white-space: pre-wrap; }

/* Karten */
.rx-karte { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; min-width: 0; }
.rx-karte h4, .rx-a-suche h4 { font-size: .86rem; margin-bottom: 8px; }
.rx-karte p { color: var(--text-muted); font-size: .8rem; margin-bottom: 10px; line-height: 1.45; }
.rx-zahl-leiste { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.rx-zahl-leiste label { display: flex; align-items: center; gap: 6px; }
.rx-zahl-leiste input[type=text], .rx-zahl-leiste input:not([type]) { flex: 1; min-width: 120px; }

/* Ablage: Suche links, Treffer rechts */
.rx-a-archiv { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px 1fr; }
.rx-a-suche { background: #fff; border-right: 1px solid var(--border); padding: 14px 16px 90px; overflow: auto; }
.rx-a-suche h4 { margin-top: 4px; }
.rx-a-suche-fuss { display: flex; gap: 8px; margin: 12px 0 18px; flex-wrap: wrap; }
.rx-a-gespeichert > div { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; }
.rx-a-gespeichert p { color: var(--text-muted); font-size: .8rem; margin-bottom: 6px; }
.rx-a-treffer { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.rx-link-treffer { max-height: 320px; overflow: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.rx-link-treffer button { text-align: left; border: 1px solid var(--border); border-radius: 8px; background: #fff; padding: 7px 10px; font: inherit; cursor: pointer; }
.rx-link-treffer button:hover { background: #FAFBEA; }
.rx-link-treffer small { display: block; color: var(--text-muted); }

/* Dialoge */
.rx-ov { position: fixed; inset: 0; z-index: 100000; background: rgba(0,0,0,.42); display: flex; align-items: center; justify-content: center; padding: 20px; font-family: 'Inter', system-ui, sans-serif; font-size: .86rem; }
.rx-dlg { background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow: auto; padding: 20px 22px; color: var(--text-primary); }
.rx-dlg-breit { max-width: 680px; }
.rx-dlg-kopf { font-size: 1.02rem; font-weight: 700; margin-bottom: 10px; }
.rx-dlg-text { color: #555; line-height: 1.5; margin-bottom: 12px; }
.rx-dlg-fehler { color: #B03A2E; font-weight: 600; margin-top: 10px; min-height: 1em; }
.rx-dlg-fehler:empty { display: none; }
.rx-dlg-fuss { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

@media (max-width: 1100px) {
  .rx-d-koerper { grid-template-columns: 1fr; grid-template-rows: 45% 55%; }
  .rx-d-rechts { border-left: none; border-top: 1px solid var(--border); }
  .rx-a-archiv { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .rx-a-suche { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 14px; max-height: 40vh; }
}
