/* SJR Rechnungsportal - keine Build-Kette, keine externen Abhängigkeiten. */
:root {
    --blau: #1d4e89;
    --blau-hell: #eaf1f9;
    --text: #1f2328;
    --grau: #5c6670;
    --linie: #dde2e8;
    --hintergrund: #f6f7f9;
    --gruen: #17683a;
    --gruen-hell: #e7f4ec;
    --rot: #a4262c;
    --rot-hell: #fdeceb;
    --gelb: #8a6100;
    --gelb-hell: #fdf5e3;
    --radius: 6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--hintergrund);
}

a { color: var(--blau); text-decoration: none; }
a:hover { text-decoration: underline; }

/* -- Kopfzeile ------------------------------------------------------- */
header.top {
    background: var(--blau);
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    min-height: 56px;
}
header.top .marke { font-weight: 600; font-size: 16px; letter-spacing: 0.2px; }
header.top .marke span { opacity: 0.75; font-weight: 400; }
header.top nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
header.top nav a {
    color: #fff; padding: 7px 12px; border-radius: var(--radius); font-size: 14px;
}
header.top nav a:hover { background: rgba(255,255,255,0.14); text-decoration: none; }
header.top nav a.aktiv { background: rgba(255,255,255,0.22); font-weight: 600; }

/* -- Einrichtungsleiste ---------------------------------------------- */
.einrichtungsleiste {
    background: #fff;
    border-bottom: 1px solid var(--linie);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.einrichtungsleiste .label { font-size: 13px; color: var(--grau); }
.einrichtungsleiste select {
    font-size: 14px; padding: 5px 8px; border: 1px solid var(--linie);
    border-radius: var(--radius); background: #fff; min-width: 240px;
}
.einrichtungsleiste .benutzer { margin-left: auto; font-size: 13px; color: var(--grau); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px 60px; }

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
.untertitel { color: var(--grau); font-size: 14px; margin: 0 0 20px; }

/* -- Karten ----------------------------------------------------------- */
.karte {
    background: #fff; border: 1px solid var(--linie);
    border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
}
.karte > h2:first-child { margin-top: 0; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kachel { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; }
.kachel .wert { font-size: 24px; font-weight: 600; color: var(--blau); }
.kachel .titel { font-size: 13px; color: var(--grau); }
.kachel.warn .wert { color: var(--rot); }

/* -- Tabellen --------------------------------------------------------- */
table.liste { width: 100%; border-collapse: collapse; background: #fff; }
table.liste th {
    text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--grau); padding: 9px 10px; border-bottom: 2px solid var(--linie); font-weight: 600;
}
table.liste td { padding: 9px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.liste tr:hover td { background: #fafbfc; }
table.liste td.r, table.liste th.r { text-align: right; }
table.liste td.c, table.liste th.c { text-align: center; }
.tabellenrahmen { border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; background: #fff; }

/* -- Status ----------------------------------------------------------- */
.status {
    display: inline-block; padding: 2px 8px; border-radius: 20px;
    font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status-entwurf { background: #eceff2; color: var(--grau); }
.status-freigegeben { background: var(--blau-hell); color: var(--blau); }
.status-versendet { background: var(--blau-hell); color: var(--blau); }
.status-teilbezahlt { background: var(--gelb-hell); color: var(--gelb); }
.status-bezahlt { background: var(--gruen-hell); color: var(--gruen); }
.status-storniert { background: var(--rot-hell); color: var(--rot); }
.status-ueberfaellig { background: var(--rot-hell); color: var(--rot); }

/* -- Formulare -------------------------------------------------------- */
.feld { margin-bottom: 14px; }
.feld label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #3a4149; }
.feld .hinweis { font-size: 12px; color: var(--grau); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=search], select, textarea {
    width: 100%; padding: 7px 9px; border: 1px solid #c8cfd6; border-radius: var(--radius);
    font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blau); outline-offset: -1px; border-color: var(--blau); }
textarea { min-height: 70px; resize: vertical; }
.reihe { display: grid; gap: 14px; }
.reihe-2 { grid-template-columns: 1fr 1fr; }
.reihe-3 { grid-template-columns: 1fr 1fr 1fr; }
.reihe-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
@media (max-width: 760px) { .reihe-2, .reihe-3, .reihe-4 { grid-template-columns: 1fr; } }
.checkzeile { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; }
.checkzeile input { width: auto; }

/* -- Schaltflächen ---------------------------------------------------- */
.knopf {
    display: inline-block; padding: 8px 15px; border-radius: var(--radius);
    border: 1px solid var(--blau); background: var(--blau); color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.knopf:hover { background: #17416f; text-decoration: none; color: #fff; }
.knopf.sekundaer { background: #fff; color: var(--blau); }
.knopf.sekundaer:hover { background: var(--blau-hell); color: var(--blau); }
.knopf.gefahr { background: #fff; border-color: var(--rot); color: var(--rot); }
.knopf.gefahr:hover { background: var(--rot-hell); color: var(--rot); }
.knopf.klein { padding: 4px 10px; font-size: 13px; }
.knopfleiste { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }

/* -- Meldungen -------------------------------------------------------- */
.meldung { padding: 12px 15px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14px; }
.meldung.erfolg { background: var(--gruen-hell); border: 1px solid #b6ddc5; color: #0f4f2c; }
.meldung.fehler { background: var(--rot-hell); border: 1px solid #f0bfbd; color: #7d1d21; white-space: pre-line; }
.meldung.info { background: var(--blau-hell); border: 1px solid #c3d7ec; color: #17416f; }
.meldung.warnung { background: var(--gelb-hell); border: 1px solid #e8d5a3; color: #6b4c00; }
.meldung ul { margin: 6px 0 0; padding-left: 20px; }
.meldung li { margin: 3px 0; }

/* -- Kleinkram -------------------------------------------------------- */
.werkzeugleiste { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.werkzeugleiste form { display: flex; gap: 8px; align-items: center; }
.werkzeugleiste input[type=search] { width: 260px; }
.rechts { margin-left: auto; }
.grau { color: var(--grau); }
.klein { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.nichts { padding: 40px 20px; text-align: center; color: var(--grau); }
.fehlerliste { color: var(--rot); font-size: 13px; margin-top: 4px; }
.trenner { border: 0; border-top: 1px solid var(--linie); margin: 22px 0; }
.zentraler-kunde { font-size: 11px; background: var(--blau-hell); color: var(--blau); padding: 1px 6px; border-radius: 10px; }
