[hidden] { display: none !important; }
:root {
  --bg: #f4f5f7; --karte: #fff; --text: #1f2328; --dim: #6b7280; --linie: #e3e5e8;
  --akzent: #3c4248; --primaer: #c8102e; --primaer-h: #a50d26; --ok: #1a7f37; --warn: #b26a00; --fehler: #c8102e;
  --info-bg: #eef4ff; --radius: 8px; --schatten: 0 1px 2px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #16181b; --karte: #1f2226; --text: #e6e8eb; --dim: #9aa1aa; --linie: #30343a; --akzent: #2a2e33;
          --info-bg: #1d2633; --schatten: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text);
       min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; }
.dim { color: var(--dim); }
.topbar { background: var(--akzent); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 20px; height: 52px;
          position: sticky; top: 0; z-index: 10; }
.brand { text-decoration: none; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.logo { background: var(--primaer); padding: 2px 6px; border-radius: 4px; margin-right: 2px; }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav a { text-decoration: none; padding: 6px 10px; border-radius: 6px; opacity: .85; white-space: nowrap; font-size: 14px; }
.nav a:hover, .nav a.aktiv { background: rgba(255,255,255,.13); opacity: 1; }
.konto { font-size: 13px; white-space: nowrap; }
.konto button { margin-left: 8px; }
.menu-knopf { display: none; background: none; border: 0; color: #fff; font-size: 22px; }
main { flex: 1; }
.seite { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
.fuss { text-align: center; color: var(--dim); font-size: 12px; padding: 14px; }
h1 { font-size: 22px; margin: 0 0 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 .rechts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 400; }
h2 { font-size: 17px; margin: 22px 0 10px; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--schatten);
         margin-bottom: 16px; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kachel { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--schatten);
          text-decoration: none; display: block; }
.kachel .wert { font-size: 24px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kachel .titel { color: var(--dim); font-size: 13px; }
button, .knopf { font: inherit; border: 1px solid var(--linie); background: var(--karte); color: var(--text); padding: 7px 14px;
                 border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:hover, .knopf:hover { border-color: var(--dim); }
button.primaer, .knopf.primaer { background: var(--primaer); color: #fff; border-color: var(--primaer); }
button.primaer:hover { background: var(--primaer-h); }
button.klein { padding: 3px 9px; font-size: 13px; }
button.gefahr { color: var(--fehler); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; color: var(--text); background: var(--karte); border: 1px solid var(--linie); border-radius: 6px;
                          padding: 7px 9px; width: 100%; }
textarea { min-height: 64px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #8ab4f8; outline-offset: -1px; }
label { display: block; font-size: 13px; color: var(--dim); }
label > input, label > select, label > textarea { margin-top: 3px; color: var(--text); }
label.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
label.check input { width: auto; }
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px 14px; }
.raster .breit { grid-column: 1 / -1; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-size: 12px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
td.zahl, th.zahl { text-align: right; white-space: nowrap; }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: rgba(127,127,127,.06); }
tr.summe td { font-weight: 650; border-top: 2px solid var(--text); }
.tabelle-rahmen { overflow-x: auto; }
.positionen input, .positionen select, .posten input, .posten select { padding: 5px 7px; }
.positionen td { padding: 4px; }
.status { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--linie); white-space: nowrap; }
.status.offen { background: #e7f0ff; color: #1d4ed8; } .status.bezahlt, .status.angenommen { background: #e6f4ea; color: var(--ok); }
.status.ueberfaellig, .status.abgelehnt { background: #fde8e8; color: var(--fehler); }
.status.teilbezahlt { background: #fff4e0; color: var(--warn); } .status.entwurf { background: #eee; color: #555; }
.status.storniert { background: #eee; color: #777; text-decoration: line-through; } .status.guthaben { background: #f3e8ff; color: #7c3aed; }
@media (prefers-color-scheme: dark) { .status { filter: brightness(.85) saturate(.9); } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--linie); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a, .tabs button { border: 0; background: none; padding: 8px 12px; border-bottom: 2px solid transparent; border-radius: 0;
                        text-decoration: none; color: var(--dim); }
.tabs .aktiv { color: var(--text); border-bottom-color: var(--primaer); }
.werkzeuge { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.werkzeuge input[type=search] { max-width: 300px; }
.werkzeuge select { width: auto; }
.hinweis { background: var(--info-bg); border-radius: var(--radius); padding: 10px 14px; margin: 10px 0; font-size: 14px; }
.hinweis.warn { background: #fff4e0; color: #6b4100; } .hinweis.fehler { background: #fde8e8; color: #7f1d1d; }
.hinweis.ok { background: #e6f4ea; color: #14532d; }
@media (prefers-color-scheme: dark) { .hinweis.warn, .hinweis.fehler, .hinweis.ok { filter: invert(.88) hue-rotate(180deg); } }
.meldung { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222; color: #fff; padding: 10px 18px;
           border-radius: 8px; z-index: 50; max-width: 90vw; box-shadow: 0 4px 20px rgba(0,0,0,.25); }
.meldung.fehler { background: var(--fehler); }
dialog { border: 0; border-radius: 10px; padding: 0; max-width: 560px; width: calc(100% - 32px); background: var(--karte); color: var(--text);
         box-shadow: 0 10px 40px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog form { padding: 20px 22px; }
dialog h3 { margin: 0 0 12px; }
.knoepfe { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.zwei { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; }
.vorschau { width: 100%; height: 70vh; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; }
.vorschau-bild { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--linie); }
.ablage { border: 2px dashed var(--linie); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--dim); cursor: pointer; }
.ablage.drueber { border-color: var(--primaer); background: rgba(200,16,46,.04); }
.summenblock { margin-left: auto; max-width: 360px; }
.summenblock div { display: flex; justify-content: space-between; padding: 3px 0; }
.summenblock .gesamt { font-weight: 700; border-top: 1px solid var(--text); margin-top: 4px; padding-top: 6px; }
.anmeldung { max-width: 420px; margin: 8vh auto; }
.trenner { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--dim, #888); font-size: 13px; }
.trenner::before, .trenner::after { content: ""; flex: 1; border-top: 1px solid currentColor; opacity: .35; }
.kette li { margin: 4px 0; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }
.pruef li { margin: 6px 0; }
.ok-text { color: var(--ok); } .fehler-text { color: var(--fehler); }
@media (max-width: 860px) {
  .menu-knopf { display: block; }
  .nav { display: none; position: absolute; top: 52px; left: 0; right: 0; background: var(--akzent); flex-direction: column; padding: 8px; }
  .nav.offen { display: flex; }
  .topbar { gap: 10px; }
  .konto { margin-left: auto; }
  .zwei { grid-template-columns: 1fr; }
  .seite { padding: 16px 12px 30px; }
  .positionen .breit-nur-desktop { display: none; }
}
@media print { .topbar, .fuss, .werkzeuge, button { display: none !important; } body { background: #fff; } }

/* ==========================================================================
   Animiertes Logo (tools/logo.py, Vorbild: Plattform-Logo der Website).
   Ablauf: .plogo-start zeigt „RH SOLUTION“; wird die Klasse entfernt, dreht sich
   „SOLUTION“ wie eine Walze nach oben weg und „TAX“ kommt von unten.
   „RH“ und das Symbol bleiben stehen. Bei „Bewegung reduzieren“ sofort RH TAX.
   ========================================================================== */
.brand { display: flex; align-items: center; }
.plogo {
  --k: 0.04px;                                       /* Maßstab: px je Logo-Einheit (Kopfzeile) */
  --h: calc(250 * var(--k));                         /* Höhe der Schriftzeile */
  --alt: 2190;                                       /* Breite „SOLUTION“ (Logo-Einheiten) */
  display: inline-flex; align-items: center; height: calc(945 * var(--k));
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.plogo-links { display: block; width: calc(530 * var(--k)); height: var(--h); flex-shrink: 0; }
.plogo-fest { display: block; width: 100%; height: 100%; }
.plogo-symbol { width: calc(826 * var(--k)); height: calc(945 * var(--k)); margin-left: calc(60 * var(--k)); flex-shrink: 0; }
.plogo-rechts {
  display: block; width: calc(var(--neu) * var(--k)); height: var(--h); margin-left: calc(34 * var(--k));
  perspective: calc(900 * var(--k)); flex-shrink: 0;
  transition: width .9s cubic-bezier(.6, 0, .3, 1);
}
.plogo-trommel {
  display: block; position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: translateZ(calc(var(--h) / -2)) rotateX(90deg);   /* Endzustand: TAX */
  transition: transform .9s cubic-bezier(.6, 0, .3, 1);
}
.plogo-flaeche { position: absolute; left: 0; top: 0; height: 100%; display: block; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.plogo-alt { width: calc(var(--alt) * var(--k)); }
.plogo-neu { width: calc(var(--neu) * var(--k)); }
.plogo-vorne { transform: translateZ(calc(var(--h) / 2)); }
.plogo-unten { transform: rotateX(-90deg) translateZ(calc(var(--h) / 2)); }
.plogo.plogo-start .plogo-trommel { transform: translateZ(calc(var(--h) / -2)) rotateX(0deg); transition: none; }
.plogo.plogo-start .plogo-rechts { width: calc(var(--alt) * var(--k)); transition: none; }
.anmeldung .plogo { --k: 0.085px; margin-bottom: 18px; }
@media (prefers-reduced-motion: reduce) {
  .plogo-trommel, .plogo-rechts { transition: none !important; }
  .plogo.plogo-start .plogo-trommel { transform: translateZ(calc(var(--h) / -2)) rotateX(90deg); }
  .plogo.plogo-start .plogo-rechts { width: calc(var(--neu) * var(--k)); }
}

/* Datumsfeld mit „Heute“-Knopf */
.datum-feld { display: flex; gap: 6px; align-items: center; margin-top: 3px; }
.datum-feld input { margin-top: 0 !important; flex: 1; min-width: 0; }
.datum-feld .heute { flex-shrink: 0; }
