/* Belegportal, gemeinsames Stylesheet fuer Mandanten- und Kanzleibereich.
 *
 * Farben aus dem Logo der HPP Steuerberatung: vier Blaustufen von #005d95 bis
 * #84cde8. Schriften vom System, bewusst ohne Google Fonts: das Nachladen von
 * dort uebermittelt die IP jedes Besuchers an Google und ist ohne Einwilligung
 * datenschutzwidrig.
 *
 * Bausteine, die beide Bereiche verwenden duerfen: .seite .karte .knopf
 * .feld .chip .meldung .tabelle .leer .zweispaltig .leise
 */

:root {
  --blau-tief: #005d95;
  --blau: #007eaa;
  --blau-hell: #009bcc;
  --blau-zart: #84cde8;
  --blau-hauch: #e7f3fa;

  --grund: #f2f5f8;
  --flaeche: #ffffff;
  --flaeche-2: #f6f9fb;
  --linie: #d9e2e9;
  --linie-stark: #bcc9d3;

  --tinte: #15283a;
  --tinte-2: #47596a;
  --tinte-3: #788a99;

  --ok: #2b7a4b;
  --ok-hauch: #e4f3ea;
  --warn: #a8620d;
  --warn-hauch: #fbf0de;
  --fehler: #b3261e;
  --fehler-hauch: #fbe6e4;

  --schrift: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  --rund: 10px;
  --rund-klein: 7px;
  --schatten: 0 1px 2px rgba(21, 40, 58, .06), 0 4px 14px rgba(21, 40, 58, .05);

  color-scheme: light;
}

* { box-sizing: border-box; }

/* Ohne das gewinnt jede Klasse mit display gegen das hidden-Attribut, und
   versteckte Knoepfe bleiben sichtbar. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--blau); text-underline-offset: 2px; }
a:hover { color: var(--blau-tief); }

h1, h2, h3 { line-height: 1.2; text-wrap: balance; margin: 0 0 .5rem; color: var(--tinte); }
h1 { font-size: clamp(1.45rem, 3vw, 1.85rem); font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 650; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0 0 .8rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--flaeche-2); padding: .05em .35em; border-radius: 4px; }

:focus-visible { outline: 3px solid var(--blau-hell); outline-offset: 2px; border-radius: 4px; }

.leise { color: var(--tinte-2); font-size: .94rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- Kopf */

.kopf { background: var(--flaeche); }
.kopf-innen {
  max-width: 1120px; margin: 0 auto; padding: .85rem clamp(16px, 4vw, 32px);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.kopf-logo { display: inline-flex; }
.kopf-logo img { height: 36px; width: auto; max-width: 100%; display: block; }
.kopf-rechts { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; font-size: .94rem; color: var(--tinte-2); }
.kopf-rechts strong { color: var(--tinte); font-weight: 600; }
.kopf-band {
  height: 4px;
  background: linear-gradient(90deg, var(--blau-tief) 0%, var(--blau) 38%, var(--blau-hell) 70%, var(--blau-zart) 100%);
}

/* ---------------------------------------------------------------- Seite */

.seite {
  flex: 1;
  width: 100%; max-width: 1120px; margin: 0 auto;
  padding-block: 1.75rem 3rem; padding-inline: clamp(16px, 4vw, 32px);
}

.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--rund);
  box-shadow: var(--schatten); padding: clamp(1.1rem, 2.5vw, 1.6rem);
}
.karte + .karte { margin-top: 1.25rem; }
.karte-schmal { max-width: 560px; margin-inline: auto; }
.karte-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.karte-kopf h2 { margin: 0; }

.zweispaltig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.zweispaltig > .karte + .karte { margin-top: 0; }
@media (max-width: 900px) { .zweispaltig { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Knoepfe */

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2;
  padding: .62rem 1.05rem; border-radius: var(--rund-klein); cursor: pointer;
  border: 1px solid var(--blau-tief); background: var(--blau-tief); color: #fff; text-decoration: none;
}
.knopf:hover { background: #004d7c; color: #fff; }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.knopf-zweit { background: var(--flaeche); color: var(--blau-tief); border-color: var(--linie-stark); }
.knopf-zweit:hover { background: var(--blau-hauch); color: var(--blau-tief); border-color: var(--blau); }
.knopf-gefahr { background: var(--flaeche); color: var(--fehler); border-color: #e3b6b2; }
.knopf-gefahr:hover { background: var(--fehler-hauch); color: var(--fehler); }
.knopf-klein { padding: .34rem .65rem; font-size: .86rem; font-weight: 550; }
.knopf-text { background: none; border: none; color: var(--blau); padding: .2rem .3rem; font-weight: 550; }
.knopf-text:hover { background: none; color: var(--blau-tief); text-decoration: underline; }
.knopf-breit { width: 100%; }

/* ---------------------------------------------------------------- Felder */

.feld { display: grid; gap: .3rem; margin-bottom: 1rem; }
.feld label, .feld .bezeichnung { font-weight: 600; font-size: .93rem; }
.feld .hilfe { font-size: .86rem; color: var(--tinte-3); }
input[type="text"], input[type="password"], input[type="search"], select, textarea {
  font: inherit; font-size: .97rem; color: var(--tinte);
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--linie-stark); border-radius: var(--rund-klein);
  background: var(--flaeche);
}
textarea { min-height: 2.6rem; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blau); box-shadow: 0 0 0 3px rgba(0, 126, 170, .18); }

/* ---------------------------------------------------------------- Chips */

.chip {
  display: inline-block; font-size: .76rem; font-weight: 650; letter-spacing: .02em;
  padding: .14rem .55rem; border-radius: 999px; white-space: nowrap; vertical-align: middle;
  background: var(--flaeche-2); color: var(--tinte-2); border: 1px solid var(--linie);
}
.chip-eingegangen { background: var(--blau-hauch); color: var(--blau-tief); border-color: #c4e3f3; }
.chip-in_bearbeitung { background: var(--warn-hauch); color: var(--warn); border-color: #f0d7ad; }
.chip-erledigt { background: var(--ok-hauch); color: var(--ok); border-color: #bfe0cc; }
.chip-zurueckgezogen { background: var(--flaeche-2); color: var(--tinte-3); border-color: var(--linie); text-decoration: line-through; }
.chip-nachreichung { background: #fff4e5; color: #8a4c00; border-color: #f2d3a4; }
.chip-ok { background: var(--ok-hauch); color: var(--ok); border-color: #bfe0cc; }
.chip-warn { background: var(--warn-hauch); color: var(--warn); border-color: #f0d7ad; }
.chip-fehler { background: var(--fehler-hauch); color: var(--fehler); border-color: #efc3bf; }

/* ---------------------------------------------------------------- Meldungen */

.meldungen { display: grid; gap: .5rem; margin-bottom: 1.25rem; }
.meldung { margin: 0; padding: .7rem .95rem; border-radius: var(--rund-klein); border: 1px solid; font-size: .95rem; }
.meldung-ok { background: var(--ok-hauch); border-color: #bfe0cc; color: #1f5c38; }
.meldung-hinweis { background: var(--blau-hauch); border-color: #c4e3f3; color: var(--blau-tief); }
.meldung-fehler { background: var(--fehler-hauch); border-color: #efc3bf; color: #8c1d17; }

/* ---------------------------------------------------------------- Tabelle */

.tabellenrahmen { overflow-x: auto; border: 1px solid var(--linie); border-radius: var(--rund-klein); }
.tabelle { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--flaeche); }
.tabelle th, .tabelle td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle th { font-size: .76rem; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--tinte-3); background: var(--flaeche-2); white-space: nowrap; }
.tabelle tr:last-child td { border-bottom: none; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.leer { padding: 1.5rem 1rem; text-align: center; color: var(--tinte-3); font-size: .95rem; }

/* ---------------------------------------------------------------- Anmeldung */

.anmeldung { max-width: 440px; margin: clamp(1rem, 6vh, 4rem) auto 0; }
.anmeldung h1 { margin-bottom: .25rem; }
.anmeldung .wer { color: var(--tinte-2); margin-bottom: 1.25rem; }

/* ---------------------------------------------------------------- Mandant: Monatsleiste */

.monatswahl { margin-bottom: 1.25rem; }
.monatswahl-titel { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.monatswahl-titel h1 { margin: 0; }
.monatsleiste { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem .1rem .55rem; scrollbar-width: thin; }
.monat {
  flex: none; display: grid; gap: .1rem; min-width: 7.2rem; text-decoration: none;
  padding: .55rem .8rem; border-radius: var(--rund-klein); border: 1px solid var(--linie);
  background: var(--flaeche); color: var(--tinte);
}
.monat:hover { border-color: var(--blau); color: var(--tinte); }
.monat-name { font-weight: 650; font-size: .93rem; }
.monat-stand { font-size: .8rem; color: var(--tinte-3); }
.monat-gewaehlt { background: var(--blau-tief); border-color: var(--blau-tief); color: #fff; }
.monat-gewaehlt:hover { color: #fff; }
.monat-gewaehlt .monat-stand { color: rgba(255, 255, 255, .82); }
.monat-fertig .monat-stand::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.monat-gewaehlt.monat-fertig .monat-stand::before { color: #b9f0cf; }
.monat-aelter { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--tinte-2); }
.monat-aelter select { width: auto; padding: .35rem .5rem; font-size: .9rem; }

/* ---------------------------------------------------------------- Mandant: Ablage */

.ablage {
  display: grid; justify-items: center; gap: .55rem; text-align: center;
  padding: 2.1rem 1.25rem; border: 2px dashed var(--blau-zart); border-radius: var(--rund);
  background: linear-gradient(180deg, #f7fbfe 0%, var(--blau-hauch) 100%); cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.ablage:hover, .ablage.ablage-aktiv { border-color: var(--blau); background: var(--blau-hauch); }
.ablage-symbol { width: 46px; height: 46px; color: var(--blau); }
.ablage-titel { font-weight: 650; font-size: 1.05rem; color: var(--blau-tief); }
.ablage-hilfe { font-size: .88rem; color: var(--tinte-2); max-width: 36ch; }
.ablage-klein { font-size: .8rem; color: var(--tinte-3); }
/* Am Telefon zieht niemand Dateien. Dort fordert die Ablage zum Fotografieren auf. */
.nur-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .nur-zeiger { display: none; }
  .nur-touch { display: inline; }
}
.ablage:focus-within { outline: 3px solid var(--blau-hell); outline-offset: 3px; }
/* Ohne Skript bleibt die Dateiauswahl sichtbar und das Formular schickt
   normal ab. Mit Skript uebernimmt die Ablage, das Feld bleibt fokussierbar. */
.ablage input[type="file"] { max-width: 100%; margin-top: .4rem; font-size: .88rem; }
.js .ablage input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.js .nur-ohne-js { display: none; }
.nur-ohne-js { margin-top: 1rem; }
.stapel-summe { margin: .9rem 0 0; font-size: .93rem; font-weight: 600; color: var(--ok); }
.stapel-summe.mit-fehlern { color: var(--warn); }

.hinweis-nachreichung {
  margin-bottom: 1rem; padding: .7rem .9rem; border-radius: var(--rund-klein);
  background: #fff4e5; border: 1px solid #f2d3a4; color: #6b3b00; font-size: .93rem;
}

.stapel { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .6rem; }
.stapel:empty { display: none; }
.stapel-eintrag {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .35rem .75rem; align-items: start;
  padding: .7rem .8rem; border: 1px solid var(--linie); border-radius: var(--rund-klein); background: var(--flaeche);
}
.stapel-typ {
  grid-row: span 2; width: 2.4rem; height: 2.4rem; border-radius: 6px; display: grid; place-items: center;
  font-size: .68rem; font-weight: 750; letter-spacing: .03em; color: var(--blau-tief); background: var(--blau-hauch);
}
.stapel-name { font-weight: 600; font-size: .93rem; overflow-wrap: anywhere; }
.stapel-groesse { font-size: .8rem; color: var(--tinte-3); font-weight: 400; margin-left: .35rem; }
.stapel-anmerkung { grid-column: 2 / 4; }
.stapel-anmerkung textarea { min-height: 2.3rem; font-size: .9rem; }
.stapel-zustand { font-size: .84rem; color: var(--tinte-2); }
.stapel-zustand progress { width: 100%; height: .5rem; margin-top: .3rem; accent-color: var(--blau); }
.stapel-eintrag.ist-fertig { border-color: #bfe0cc; background: #f8fcf9; }
.stapel-eintrag.ist-fertig .stapel-zustand { color: var(--ok); font-weight: 600; }
.stapel-eintrag.ist-fehler { border-color: #efc3bf; background: #fffafa; }
.stapel-eintrag.ist-fehler .stapel-zustand { color: var(--fehler); font-weight: 600; }
.stapel-eintrag.ist-fehler .stapel-anmerkung { display: none; }

.ablage-aktion { margin-top: 1rem; display: flex; gap: .6rem; flex-wrap: wrap; }
.ablage-aktion[hidden], .stapel-summe[hidden] { display: none; }

/* ---------------------------------------------------------------- Mandant: Belegliste */

.belegliste { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.beleg {
  padding: .75rem .85rem; border: 1px solid var(--linie); border-radius: var(--rund-klein); background: var(--flaeche);
}
.beleg-kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.beleg-name { font-weight: 600; font-size: .94rem; overflow-wrap: anywhere; }
.beleg-meta { font-size: .8rem; color: var(--tinte-3); margin-top: .1rem; }
.beleg-chips { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.beleg-anmerkung { margin-top: .55rem; }
.beleg-anmerkung textarea { font-size: .9rem; min-height: 2.2rem; }
.beleg-anmerkung-zeile { display: flex; gap: .5rem; align-items: center; margin-top: .35rem; }
/* Mit Skript erscheint der Speichern-Knopf erst, wenn sich etwas aendert. */
.js .beleg-anmerkung:not(.geaendert) .knopf { display: none; }
.js .beleg-anmerkung:not(.geaendert) .beleg-anmerkung-zeile:has(.beleg-gespeichert:empty) { display: none; }
.anmeldung-hilfe { margin-top: 1.1rem; margin-bottom: 0; }
.beleg-gespeichert { font-size: .82rem; color: var(--ok); }
.beleg-aktionen { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid var(--linie); }
.beleg-aktionen select { width: auto; padding: .3rem .45rem; font-size: .86rem; }

.monatsabschluss { margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--linie); }
.monatsabschluss .feld { margin-bottom: .7rem; }
.monat-erledigt-hinweis {
  display: flex; gap: .6rem; align-items: center; padding: .65rem .85rem; border-radius: var(--rund-klein);
  background: var(--ok-hauch); border: 1px solid #bfe0cc; color: #1f5c38; font-size: .93rem; margin-bottom: .8rem;
}

/* ---------------------------------------------------------------- Fuss */

.fuss { background: var(--flaeche); border-top: 1px solid var(--linie); margin-top: auto; }
.fuss-innen {
  max-width: 1120px; margin: 0 auto; padding: 1.25rem clamp(16px, 4vw, 32px);
  display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; font-size: .86rem; color: var(--tinte-2);
}
.fuss-innen strong { color: var(--tinte); }
.fuss-rechts { max-width: 46ch; }
.fuss-rechts p { margin: 0 0 .3rem; }

@media (max-width: 560px) {
  .kopf-logo img { height: 30px; }
  .beleg-kopf { flex-direction: column; }
  .beleg-chips { justify-content: flex-start; }
  .stapel-eintrag { grid-template-columns: auto minmax(0, 1fr); }
  .stapel-eintrag > .knopf-text { grid-column: 2; justify-self: start; }
  .stapel-anmerkung { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
