/* Kundenportal NE - Kaatsch
   Hausfarbe #0a3d62 uebernommen aus der bestehenden Schulungs-App auf
   demselben Server, damit Kaatsch-Anwendungen einheitlich aussehen.
   Kein externes CSS, keine externen Schriften: es verlaesst nichts den Server. */

:root {
  --kaatsch: #0a3d62;
  --kaatsch-hell: #12557f;
  --kaatsch-tief: #072c48;
  --akzent: #c8551b;
  --grau: #f1f4f7;
  --rand: #d7dfe7;
  --text: #16212b;
  --gedaempft: #5d6b78;
  --gut: #0e7a4a;
  --mittel: #9a6400;
  --schlecht: #b3261e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--grau);
  font-size: 16px; line-height: 1.55;
}

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: .5rem; background: #fff; padding: .5rem 1rem; z-index: 10; }

/* ---------- Kopf ---------- */
body > header {
  background: var(--kaatsch); color: #fff; padding: .65rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .6rem;
}
.marke { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: #fff; }
.marke img { display: block; }
.marke span { font-size: .95rem; opacity: .8; border-left: 1px solid rgba(255,255,255,.35);
              padding-left: .7rem; }
body > header nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
body > header nav a { color: #fff; text-decoration: none; opacity: .85; font-size: .93rem;
               padding: .2rem 0; border-bottom: 2px solid transparent; }
body > header nav a:hover { opacity: 1; }
body > header nav a.an { opacity: 1; border-bottom-color: var(--akzent); }
.wer { font-size: .88rem; opacity: .8; display: flex; flex-direction: column; line-height: 1.2; }
.wer em { font-style: normal; opacity: .7; font-size: .78rem; }

main { max-width: 1240px; margin: 0 auto; padding: 1.6rem 1.25rem 3rem; }

/* ---------- Text ---------- */
h1 { font-size: 1.55rem; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin-bottom: .55rem; }
.unter { color: var(--gedaempft); margin: .2rem 0 1.2rem; font-size: .94rem; }
.brot { margin-bottom: .8rem; font-size: .9rem; }
a { color: var(--kaatsch-hell); }
.klein { font-size: .84rem; color: var(--gedaempft); margin-top: .55rem; }
.meta { font-size: .82rem; color: var(--gedaempft); }
.leer { background: #fff; border: 1px dashed var(--rand); border-radius: 10px;
        padding: 2.5rem; text-align: center; color: var(--gedaempft); }
.aufzaehlung { margin-left: 1.1rem; font-size: .93rem; }
.aufzaehlung li { margin-bottom: .3rem; }

.titelzeile { display: flex; justify-content: space-between; align-items: flex-start;
              gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.aktionen { display: flex; gap: .5rem; flex-wrap: wrap; }
.aktionsleiste { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem;
                 flex-wrap: wrap; }

/* ---------- Karten und Raster ---------- */
.karte { background: #fff; border: 1px solid var(--rand); border-radius: 10px;
         padding: 1.15rem; margin-bottom: 1rem; }
.karte.schmal { max-width: 430px; margin: 3rem auto; }
.karte.warnung { border-left: 4px solid var(--mittel); background: #fffbf2; }
.karte.erfolg { border-left: 4px solid var(--gut); background: #f2fbf6; }

.spalten { display: grid; grid-template-columns: 1fr 355px; gap: 1.3rem; align-items: start; }
@media (max-width: 950px) { .spalten { grid-template-columns: 1fr; } }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
           gap: .8rem; margin-bottom: 1.2rem; }
.kachel { background: #fff; border: 1px solid var(--rand); border-radius: 10px;
          padding: .9rem 1.1rem; }
.kachel strong { display: block; font-size: 1.8rem; line-height: 1.1; color: var(--kaatsch); }
.kachel span { font-size: .84rem; color: var(--gedaempft); }
.kachel.warn strong { color: var(--akzent); }

/* ---------- Vorgangsakte ---------- */
.vorgang { background: #fff; border: 1px solid var(--rand); border-radius: 10px;
           margin-bottom: .9rem; overflow: hidden; }
.vorgang > header { color: var(--text); background: #f7f9fb; border-bottom: 1px solid var(--rand);
                    padding: .8rem 1.1rem; display: flex; justify-content: space-between;
                    align-items: center; gap: .8rem; flex-wrap: wrap; }
.vorgang > header h2 { margin: 0; font-size: 1rem; }
.vorgang > header h2 a { text-decoration: none; }
.typ { background: var(--kaatsch); color: #fff; border-radius: 4px; font-size: .64rem;
       font-weight: 700; letter-spacing: .06em; padding: .18rem .35rem; min-width: 2.6rem;
       text-align: center; flex-shrink: 0; }

/* ---------- Tabellen: auf dem Handy scrollbar statt herausragend ---------- */
.tabellenrahmen { background: #fff; border: 1px solid var(--rand); border-radius: 10px;
                  overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 580px; }
th, td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--rand);
         vertical-align: middle; }
th { background: #eef2f6; font-weight: 600; font-size: .78rem; text-transform: uppercase;
     letter-spacing: .05em; color: var(--gedaempft); position: sticky; top: 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
td.r, th.r { text-align: right; }
tr.pruefen { background: #fff8f0; }
tr.pruefen:hover { background: #fff2e2; }
tr.abgelehnt { color: var(--gedaempft); background: #fafafa; }

/* ---------- Formulare ---------- */
label { display: block; margin-bottom: .85rem; font-size: .89rem; font-weight: 600; }
label.inline { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500;
               margin-bottom: 0; font-size: .86rem; color: var(--gedaempft); }
label.inline input { margin-top: 0; width: auto; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem;
  border: 1px solid var(--rand); border-radius: 7px; font-size: 1rem;
  font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--kaatsch-hell); outline-offset: 1px; border-color: var(--kaatsch-hell); }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem;
           resize: vertical; }

/* Ablagefeld fuer Dateien: gross genug, um wirklich hineinzuziehen. */
label.ablage { border: 2px dashed var(--rand); border-radius: 10px; padding: 1.1rem;
               text-align: center; background: #fafcfe; cursor: pointer; }
label.ablage:hover, label.ablage:focus-within { border-color: var(--kaatsch-hell); background: #f2f8fd; }
label.ablage span { display: block; font-weight: 500; font-size: .86rem;
                    color: var(--gedaempft); margin-top: .5rem; }

.suchleiste { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
              background: #fff; border: 1px solid var(--rand); border-radius: 10px;
              padding: .7rem .9rem; margin-bottom: 1rem; }
.suchleiste input[type=search] { flex: 1 1 240px; margin-top: 0; }
.suchleiste button { padding: .5rem .9rem; min-height: 40px; }
.zuruecksetzen { font-size: .85rem; }

button, .knopf {
  display: inline-block; background: var(--kaatsch); color: #fff; border: 0;
  border-radius: 7px; padding: .6rem 1.1rem; font-size: .97rem; font-weight: 600;
  cursor: pointer; text-decoration: none; min-height: 44px; line-height: 1.7;
  text-align: center;
}
button:hover, .knopf:hover { background: var(--kaatsch-hell); color: #fff; }
.knopf.hell { background: #fff; color: var(--kaatsch); border: 1px solid var(--rand); }
.knopf.hell:hover { background: #eef4f9; color: var(--kaatsch); }
.knopf.klein, button.klein { padding: .35rem .75rem; font-size: .85rem; min-height: 36px;
                             line-height: 1.5; }
button.breit { width: 100%; }
button.mini { background: transparent; color: var(--schlecht); padding: .15rem .35rem;
              font-size: .8rem; font-weight: 500; min-height: 0;
              text-decoration: underline; width: auto; }
button.mini:hover { background: transparent; color: var(--schlecht); }

/* ---------- Zustaende ---------- */
.fehler { background: #fdeceb; border-left: 4px solid var(--schlecht); color: #8c1d18;
          padding: .65rem .85rem; border-radius: 6px; margin-bottom: .9rem; font-size: .9rem; }
.hinweis { background: #eaf3fb; border-left: 4px solid var(--kaatsch-hell);
           padding: .65rem .85rem; border-radius: 6px; margin-bottom: .9rem; font-size: .9rem; }

.neu { background: var(--akzent); color: #fff; border-radius: 11px; padding: .08rem .5rem;
       font-size: .73rem; font-weight: 700; letter-spacing: .02em; }
.gesperrt { color: var(--schlecht); font-weight: 600; font-size: .84rem; }
.warnzahl { background: var(--akzent); color: #fff; border-radius: 11px; padding: .08rem .5rem;
            font-size: .8rem; font-weight: 700; }
.stufe { display: inline-block; border-radius: 4px; padding: .1rem .45rem; font-size: .76rem;
         font-weight: 700; margin-right: .4rem; }
.stufe.gut { background: #dff3e8; color: var(--gut); }
.stufe.mittel { background: #fdf0d5; color: var(--mittel); }
.stufe.schlecht { background: #fde3e1; color: var(--schlecht); }
.tag { background: #eef2f6; border-radius: 4px; padding: .1rem .45rem; font-size: .79rem;
       font-family: ui-monospace, Menlo, monospace; }
.tag.alarm { background: #fde3e1; color: var(--schlecht); font-weight: 600; }
code { background: #eef2f6; border-radius: 4px; padding: .1rem .35rem;
       font-family: ui-monospace, Menlo, monospace; font-size: .87rem; }

.liste { list-style: none; }
.liste li { padding: .4rem 0; border-bottom: 1px solid var(--rand); font-size: .89rem;
            display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.liste li:last-child { border-bottom: 0; }
.liste li form { margin-left: auto; }
.liste.gut li { color: var(--gut); }
.liste.schlecht li { color: var(--schlecht); }

footer { max-width: 1240px; margin: 0 auto; padding: 1.4rem 1.25rem 2.5rem;
         color: var(--gedaempft); font-size: .82rem; border-top: 1px solid var(--rand);
         display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 600px) {
  main { padding: 1.1rem .9rem 2.5rem; }
  h1 { font-size: 1.3rem; }
  .titelzeile { flex-direction: column; }
  .aktionen { width: 100%; }
  .aktionen .knopf { flex: 1; }
}

/* ---------- Belegzeile als grosse Klickflaeche ----------
   Bewusst ein <a>, kein <button>: ein Download ist Navigation, kein
   Zustandswechsel. Als Button waeren Mittelklick, Ctrl-Klick und
   'in neuem Tab oeffnen' kaputt. Was fehlte, war die Flaeche, nicht
   die Semantik. Mindesthoehe 48 px fuer den Daumen. */
.belege li { display: flex; align-items: stretch; padding: 0;
             border-bottom: 1px solid #eef2f6; }
.belege li:last-child { border-bottom: 0; }
.belege li:hover { background: transparent; }
a.beleg {
  flex: 1; display: flex; align-items: center; gap: .7rem;
  min-height: 48px; padding: .55rem 1.1rem; text-decoration: none;
  color: var(--text); border-left: 3px solid transparent;
}
a.beleg:hover, a.beleg:focus-visible {
  background: #f2f8fd; border-left-color: var(--kaatsch-hell); outline: none;
}
a.beleg:focus-visible { box-shadow: inset 0 0 0 2px var(--kaatsch-hell); }
.bname { display: flex; flex-direction: column; line-height: 1.35;
         font-weight: 500; min-width: 0; word-break: break-word; }
.bname .meta { font-weight: 400; }
a.beleg .lade {
  margin-left: auto; flex-shrink: 0; font-size: .82rem; font-weight: 600;
  color: var(--kaatsch-hell); border: 1px solid var(--rand); border-radius: 6px;
  padding: .3rem .7rem; background: #fff; white-space: nowrap;
}
a.beleg:hover .lade, a.beleg:focus-visible .lade {
  background: var(--kaatsch); border-color: var(--kaatsch); color: #fff;
}
.belege li > form { display: flex; align-items: center; padding-right: 1rem; }

/* Logo auf der Anmeldeseite */
.logo-gross { display: block; width: 190px; max-width: 70%; height: auto;
              margin: 0 auto 1.4rem; }

@media (max-width: 600px) {
  a.beleg { flex-wrap: wrap; gap: .5rem; }
  a.beleg .lade { margin-left: 0; width: 100%; text-align: center; }
}
.belege { list-style: none; }

/* ---------- V4: Ansprechpartner ---------- */
.ansprechpartner { background: #fff; border: 1px solid var(--rand); border-left: 4px solid var(--kaatsch);
                   border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem;
                   display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .92rem; }
.ap-titel { text-transform: uppercase; letter-spacing: .06em; font-size: .72rem;
            font-weight: 700; color: var(--gedaempft); }

/* ---------- V4: Anfrage-Rueckkanal ---------- */
details.anfrage { margin-bottom: 1rem; }
details.anfrage summary { background: #fff; border: 1px solid var(--rand); border-radius: 10px;
                          padding: .8rem 1.1rem; cursor: pointer; font-weight: 600;
                          color: var(--kaatsch); list-style-position: inside; }
details.anfrage summary:hover { background: #f2f8fd; border-color: var(--kaatsch-hell); }
details.anfrage[open] summary { border-radius: 10px 10px 0 0; border-bottom: 0; }
details.anfrage .karte { border-radius: 0 0 10px 10px; margin-bottom: 0; }
.anfrage-zeile { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 600px) { .anfrage-zeile { grid-template-columns: 1fr; } }
.anfr-liste { margin-top: 1rem; }
.anfr-liste li { display: block; }
.anfr-text { display: block; color: var(--gedaempft); font-size: .85rem; }

/* ---------- V4: Warenbilder-Galerie ---------- */
.abschnitt { margin: 1.2rem 0 .6rem; }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
           gap: .8rem; margin-bottom: 1rem; }
.warenbild { display: block; background: #fff; border: 1px solid var(--rand);
             border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--text); }
.warenbild img { display: block; width: 100%; height: 140px; object-fit: cover; }
.warenbild span { display: block; padding: .45rem .6rem; font-size: .78rem;
                  color: var(--gedaempft); word-break: break-word; }
.warenbild:hover { border-color: var(--kaatsch-hell); box-shadow: 0 2px 8px rgba(10,61,98,.15); }

/* ---------- V4: klickbare Kachel ---------- */
a.kachel.verweis { text-decoration: none; color: inherit; display: block; }
a.kachel.verweis:hover { border-color: var(--kaatsch-hell); }
