/* ---------------------------------------------------------------
   DEL Solar - Administrationsbereich
   Bewusst neutral gehalten. Farben und Schriften werden ersetzt,
   sobald die Corporate Identity freigegeben ist.
   --------------------------------------------------------------- */

:root {
    --flaeche:        #ffffff;
    --hintergrund:    #f4f5f6;
    --linie:          #d8dbde;
    --text:           #1f2325;
    --text-leise:     #6b7276;
    --akzent:         #2f5d7c;
    --akzent-hell:    #eaf0f4;
    --warnung:        #9a3324;
    --radius:         6px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--hintergrund);
}

a { color: var(--akzent); }

/* --- Kopfzeile ------------------------------------------------- */
.kopf {
    background: var(--flaeche);
    border-bottom: 1px solid var(--linie);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 32px;
    height: 56px;
}

.kopf .marke {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.kopf nav {
    display: flex;
    gap: 4px;
    margin-right: auto;
}

.kopf nav a {
    padding: 6px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-leise);
}

.kopf nav a:hover { background: var(--hintergrund); }

.kopf nav a.aktiv {
    background: var(--akzent-hell);
    color: var(--akzent);
}

.kopf .abmelden {
    color: var(--text-leise);
    text-decoration: none;
    font-size: 14px;
}

.kopf .abmelden:hover { color: var(--text); }

/* --- Seiteninhalt ---------------------------------------------- */
.inhalt {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 24px;
}

h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 4px;
}

.untertitel {
    color: var(--text-leise);
    margin: 0 0 24px;
}

/* --- Karten ---------------------------------------------------- */
.karten {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.karte {
    display: block;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: inherit;
}

.karte:hover { border-color: var(--akzent); }

.karte .zahl {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

.karte .beschriftung { color: var(--text-leise); }

/* --- Login ----------------------------------------------------- */
.anmeldung {
    max-width: 340px;
    margin: 96px auto;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 32px;
}

.anmeldung h1 { margin-bottom: 24px; }

/* --- Formulare ------------------------------------------------- */
label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--text-leise);
}

input[type=text],
input[type=password],
input[type=email],
input[type=number],
input[type=date],
select,
textarea {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 16px;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    font: inherit;
    background: var(--flaeche);
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--akzent);
    outline-offset: -1px;
    border-color: var(--akzent);
}

button {
    padding: 9px 18px;
    border: 1px solid var(--akzent);
    border-radius: var(--radius);
    background: var(--akzent);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

button:hover { background: #26495f; }

/* --- Meldungen ------------------------------------------------- */
.fehler {
    background: #fdf0ee;
    border: 1px solid #e8c4bd;
    color: var(--warnung);
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.hinweis {
    color: var(--text-leise);
    font-size: 14px;
    margin-top: 20px;
}

/* --- Titelzeile mit Aktionsknopf -------------------------------- */
.titelzeile {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.schaltflaeche {
    flex-shrink: 0;
    padding: 9px 18px;
    border: 1px solid var(--akzent);
    border-radius: var(--radius);
    background: var(--akzent);
    color: #fff;
    text-decoration: none;
}

.schaltflaeche:hover { background: #26495f; }

/* --- Tabellen --------------------------------------------------- */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    overflow: hidden;
}

th {
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-leise);
    padding: 10px 14px;
    border-bottom: 1px solid var(--linie);
    background: #fafbfb;
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--linie);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfb; }

td.rechts, th.rechts { text-align: right; }

.aktionen {
    display: flex;
    gap: 14px;
    align-items: center;
}

.aktionen form { margin: 0; }

/* Knopf, der wie ein Link aussieht (fuer Loeschen per POST) */
.verweis-knopf {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--warnung);
    cursor: pointer;
    text-decoration: underline;
}

/* --- Formularseiten --------------------------------------------- */
.inhalt.schmal { max-width: 560px; }

.zurueck {
    margin: 0 0 12px;
    font-size: 14px;
}

.zurueck a {
    text-decoration: none;
    color: var(--text-leise);
}

.zurueck a:hover { color: var(--akzent); }

.formular {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 24px;
}

input.ungueltig,
select.ungueltig,
textarea.ungueltig { border-color: var(--warnung); }

.feldfehler {
    margin: -12px 0 16px;
    font-size: 13px;
    color: var(--warnung);
}

.knopfzeile {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.abbrechen {
    color: var(--text-leise);
    text-decoration: none;
}

.abbrechen:hover { color: var(--text); }

/* --- Meldungen -------------------------------------------------- */
.erfolg {
    background: #eef5ef;
    border: 1px solid #c3ddc8;
    color: #2c5c39;
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.leer {
    background: var(--flaeche);
    border: 1px dashed var(--linie);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    color: var(--text-leise);
}

/* --- Such- und Filterzeile -------------------------------------- */
.filterzeile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.filterzeile input,
.filterzeile select {
    margin-bottom: 0;
    width: auto;
}

.filterzeile input[type=text] { min-width: 260px; }

/* --- Zwei Felder nebeneinander ---------------------------------- */
.feldpaar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* --- Kleine Hinweise unter Feldern ------------------------------- */
.feldhinweis {
    margin: -12px 0 16px;
    font-size: 13px;
    color: var(--text-leise);
}

.tabellenfuss {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-leise);
}

input:disabled {
    background: var(--hintergrund);
    color: var(--text-leise);
}

/* --- Breitere Formularseite (Kundenmaske) ----------------------- */
.inhalt.mittel { max-width: 760px; }

/* Abschnittsueberschriften im Formular */
.formular h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-leise);
    margin: 28px 0 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--linie);
}

.formular h2:first-child { margin-top: 0; }

/* PLZ schmal, Ort breit */
.feldpaar.plz-ort { grid-template-columns: 120px 1fr; }

/* Zweitname unter dem Hauptnamen in der Liste */
.nebentext {
    display: block;
    font-size: 13px;
    color: var(--text-leise);
}

/* --- Kalkulation: Positionstabelle ------------------------------ */
h2.abschnitt {
    font-size: 16px;
    font-weight: 600;
    margin: 28px 0 12px;
}

table.positionen input,
table.positionen select {
    margin-bottom: 0;
    padding: 6px 8px;
    font-size: 14px;
}

table.positionen td { padding: 8px 10px; vertical-align: middle; }

table.positionen input.rechts { text-align: right; }

table.positionen .lfd {
    color: var(--text-leise);
    font-size: 13px;
}

table.positionen input[readonly] {
    background: var(--hintergrund);
    color: var(--text-leise);
}

.nettowert { white-space: nowrap; }

.betrag { font-variant-numeric: tabular-nums; }

table.positionen tfoot td {
    border-top: 2px solid var(--linie);
    border-bottom: none;
    padding-top: 12px;
    padding-bottom: 12px;
    background: #fafbfb;
}

.summe-text { color: var(--text-leise); }

.summe {
    font-size: 17px;
    font-weight: 600;
}

.zeile-weg {
    background: none;
    border: none;
    padding: 0 4px;
    font-size: 20px;
    line-height: 1;
    color: var(--text-leise);
    cursor: pointer;
}

.zeile-weg:hover { color: var(--warnung); background: none; }

.nebenknopf {
    background: var(--flaeche);
    color: var(--akzent);
    border: 1px solid var(--linie);
}

.nebenknopf:hover {
    background: var(--akzent-hell);
    border-color: var(--akzent);
}

#kalkulation .formular + .formular { margin-top: 0; }

/* --- Anmerkung je Position -------------------------------------- */
table.positionen .bezeichnung { margin-bottom: 4px; }

table.positionen .pos-anmerkung {
    font-size: 13px;
    padding: 4px 8px;
    color: var(--text-leise);
    border-color: transparent;
    background: transparent;
}

table.positionen .pos-anmerkung:hover { border-color: var(--linie); }

table.positionen .pos-anmerkung:focus {
    background: var(--flaeche);
    color: var(--text);
}

/* --- Nicht moegliche Aktion (z. B. Loeschen gesperrt) ----------- */
.nicht-moeglich {
    color: #b6bbbe;
    cursor: not-allowed;
}

/* --- Positionszaehler unter der Tabelle ------------------------- */
.positionen-zeile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.positionen-info {
    font-size: 13px;
    color: var(--text-leise);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:disabled:hover { background: var(--flaeche); }

/* --- Deaktivierte Datensaetze ----------------------------------- */
tr.inaktiv td { color: var(--text-leise); }

tr.inaktiv:hover { background: #fafbfb; }

.kennzeichen {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border: 1px solid var(--linie);
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-leise);
    background: var(--hintergrund);
    vertical-align: 1px;
}

.verweis-knopf.leise { color: var(--text-leise); }
.verweis-knopf.leise:hover { color: var(--warnung); }

.verweis-knopf.gruen { color: #2c5c39; }

/* Verweis auf der Zahl in der Spalte "Kalk." */
.zahl-verweis {
    text-decoration: none;
    padding: 2px 8px;
    border-radius: 10px;
}

.zahl-verweis:hover {
    background: var(--akzent-hell);
    text-decoration: underline;
}

/* --- Hinweis auf einen aktiven Filter --------------------------- */
.filterhinweis {
    background: var(--akzent-hell);
    border: 1px solid #cfdde6;
    border-radius: var(--radius);
    padding: 9px 12px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--akzent);
}

.filterhinweis a { margin-left: 8px; }

.nebentext-inline {
    font-size: 13px;
    color: var(--text-leise);
}

/* --- Abgeschlossene (gesperrte) Kalkulation --------------------- */
.sperrhinweis {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: #f7f4ec;
    border: 1px solid #ddd2b6;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #6b5b2e;
}

.sperr-aktionen {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sperr-aktionen form { margin: 0; }

.nur-lesen input,
.nur-lesen select,
.nur-lesen textarea {
    background: var(--hintergrund);
    color: var(--text-leise);
    cursor: default;
}

.nur-lesen input:focus,
.nur-lesen select:focus,
.nur-lesen textarea:focus { outline: none; }

/* --- Verweis, der wie eine zweite Schaltflaeche aussieht -------- */
.nebenknopf-verweis {
    padding: 9px 16px;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    background: var(--flaeche);
    color: var(--akzent);
    text-decoration: none;
}

.nebenknopf-verweis:hover {
    background: var(--akzent-hell);
    border-color: var(--akzent);
}

.nebenknopf-verweis.warnend { color: #8a5a1a; }

.nebenknopf-verweis.warnend:hover {
    background: #fdf6ea;
    border-color: #c9a227;
}

.abschlusshinweis {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-leise);
}
