/* E-Rechnung (/e-rechnung-erstellen): Formular links, mitlaufender Prüf- und Exportstreifen rechts.
   Übernommen aus dem PoC xr.42cloudz.com, auf .erech begrenzt und an die gewerbejobs24-Farben angepasst. */
.erech {
  --bg: #f7f8fa; --surface: #FFFFFF; --field: #FFFFFF; --ink: #17191f; --muted: #5c6470; --line: #d8d4cb;
  --accent: #c23f0e; --accent-ink: #FFFFFF; --accent-soft: #fef3ee;
  --err: #B3261E; --err-soft: #FBEAE8; --warn: #855700; --warn-soft: #FFF2D4; --ok: #1D7343; --ok-soft: #E3F3E9;
  --f-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 3px;
  color: var(--ink); font-size: 15px; line-height: 1.45;
}
.erech .toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.erech, .erech * { box-sizing: border-box; }
.erech [hidden] { display: none !important; }
.erech code, .erech .mono { font-family: var(--f-mono); }
.erech h1, .erech h2, .erech h3 { text-wrap: balance; margin: 0; }
.erech .btn { font: inherit; font-weight: 500; font-size: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; text-decoration: none; }
.erech .btn:hover { border-color: var(--muted); }
.erech .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.erech .btn.primary:hover { filter: brightness(1.08); }
.erech .btn.danger { color: var(--err); border-color: var(--err); }
.erech .btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.erech .btn.small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.erech :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.erech .banner { background: var(--warn-soft); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-bottom: 16px; font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.erech .grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.erech section.card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 20px 22px 22px; }
.erech .form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.erech .sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.erech .sec-h h2 { font-size: 17px; font-weight: 600; }
.erech .sec-h .hint { color: var(--muted); font-size: 13px; }
.erech .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 14px; }
.erech .span2 { grid-column: span 2; }
.erech .span-all { grid-column: 1 / -1; }
.erech .f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.erech .f > .l { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: baseline; justify-content: space-between; }
.erech .f > .l code { font-size: 10.5px; color: var(--muted); opacity: .8; letter-spacing: .02em; }
.erech .f input, .erech .f select, .erech .f textarea { font: inherit; font-size: 14.5px; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: var(--r);
  padding: 7px 10px; min-height: 38px; width: 100%; min-width: 0; }
.erech .f textarea { resize: vertical; min-height: 60px; }
.erech .f input:focus, .erech .f select:focus, .erech .f textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.erech .f input[aria-invalid="true"], .erech .f select[aria-invalid="true"], .erech .f textarea[aria-invalid="true"] { border-color: var(--err); background: var(--err-soft); }
.erech .num input { text-align: right; font-variant-numeric: tabular-nums; }
.erech .f .sub { font-size: 12px; color: var(--muted); }
.erech .f > .l .lt { display: inline-flex; align-items: center; gap: 6px; }
.erech .info { all: unset; box-sizing: border-box; cursor: pointer; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted);
  font: italic 600 11px/14px Georgia, "Times New Roman", serif; text-align: center; flex: none; }
.erech .info:hover, .erech .info[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-ink); background: var(--accent); }
.erech .info:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.erech .help { font-size: 13px; line-height: 1.45; color: var(--ink); background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 4px; padding: 8px 10px; }
.erech .help p { margin: 0; }
.erech .help p + p { margin-top: 6px; }
.erech details.seller > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.erech details.seller > summary h2 { font-size: 17px; font-weight: 600; }
.erech details.seller > summary::-webkit-details-marker { display: none; }
.erech details.seller > summary h2::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.erech details.seller[open] > summary h2::before { transform: rotate(90deg); }
.erech details.seller[open] > summary { margin-bottom: 14px; }
.erech .seller-sum { color: var(--muted); font-size: 13px; }
.erech .lines { display: flex; flex-direction: column; gap: 10px; }
.erech .line { display: grid; grid-template-columns: 26px minmax(0, 1fr) 34px; gap: 8px 10px; border: 1px solid var(--line); border-radius: 4px; padding: 12px 12px 12px 10px; background: var(--field); }
.erech .line .no { font-family: var(--f-mono); font-size: 13px; color: var(--muted); padding-top: 9px; text-align: right; }
.erech .line .body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.erech .line .nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }
.erech .line .amt { display: flex; flex-direction: column; gap: 4px; }
.erech .line .amt .l { font-size: 12.5px; color: var(--muted); text-align: right; }
.erech .line .amt .v { min-height: 38px; display: flex; align-items: center; justify-content: flex-end; font-weight: 600; font-variant-numeric: tabular-nums; font-family: var(--f-mono); font-size: 14px; }
.erech .line .f input, .erech .line .f select { background: var(--surface); }
.erech .line .del { align-self: start; width: 34px; height: 34px; border-radius: var(--r); border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.erech .line .del:hover { border-color: var(--err); color: var(--err); }
.erech .add-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.erech aside.panel { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.erech .stamp { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 18px 18px 16px; }
.erech .stamp h3 { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.erech .sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-variant-numeric: tabular-nums; }
.erech .sum .k { color: var(--muted); font-size: 13.5px; }
.erech .sum .v { text-align: right; font-family: var(--f-mono); font-size: 14px; }
.erech .sum .tot { border-top: 1px solid var(--ink); padding-top: 8px; margin-top: 4px; font-weight: 600; color: var(--ink); font-size: 15px; }
.erech .sum .tot.v { font-size: 18px; }
.erech .status { display: flex; flex-direction: column; gap: 8px; }
.erech .fmt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--line); }
.erech .fmt .name { font-weight: 600; font-size: 14px; }
.erech .fmt .what { color: var(--muted); font-size: 12.5px; grid-column: 1 / -1; }
.erech .pill { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.erech .pill.ok { background: var(--ok-soft); color: var(--ok); }
.erech .pill.bad { background: var(--err-soft); color: var(--err); }
.erech .fmt .btn { grid-column: 1 / -1; width: 100%; margin-top: 6px; }
.erech .issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow: auto; }
.erech .issues li button { all: unset; cursor: pointer; display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 6px 6px; border-radius: 6px; font-size: 13.5px; width: 100%; box-sizing: border-box; }
.erech .issues li button:hover, .erech .issues li button:focus-visible { background: var(--bg); }
.erech .issues .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--err); transform: translateY(-1px); }
.erech .issues .warn .dot { background: var(--warn); }
.erech .issues .meta { display: block; font-family: var(--f-mono); font-size: 11px; color: var(--muted); margin-top: 1px; }
.erech .issues .xr { font-family: var(--f-ui); font-weight: 500; }
.erech .allgood { color: var(--ok); font-size: 14px; margin: 0; }
.erech .draft { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.erech .draft .lbl { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.erech .msg.warn { color: var(--warn); }
.erech .note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.erech .msg { font-size: 13px; margin: 8px 0 0; min-height: 1em; }
.erech .msg.err { color: var(--err); }
.erech .msg.ok { color: var(--ok); }
.erech .toggle { align-self: flex-start; display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.erech .toggle button { font: inherit; font-size: 13px; border: 0; background: var(--field); color: var(--muted); padding: 6px 10px; cursor: pointer; }
.erech .toggle button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
@media (max-width: 980px) { .erech .grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .erech .span2 { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { .erech * { transition: none !important; scroll-behavior: auto !important; } }
