/*
 * style.css -- das Team-Portal.
 *
 * ---- Was gleich bleibt, und was nicht ------------------------
 *
 * Gleich: Inter, Playfair Display, Space Grotesk. Navy #0a0f1a,
 * Gold #b8944f, Rot #e74c3c, Radius 4px. Das kommt aus
 * /fonts.css und aus denselben Werten wie die Plattform -- die
 * Variablen unten sind eine Kopie der Palette, nicht eine neue.
 *
 * Anders: das Layout. Die Plattform ist eine Kartenwiese mit
 * umgebenden Rahmen und viel Weissraum, gedacht fuer Leute, die
 * unterwegs ein Haus bauen lassen. Das Team sitzt an einem
 * Bildschirm den ganzen Tag und arbeitet Vorgabe fuer Vorgabe ab.
 * Also: feste Seitenleiste, dichte Tabellen, Zahlen im Blickfeld,
 * kein Vue dazwischen. Eine Zahl, die man im Rueckgrat suchen muss,
 * ist keine Zahl, sondern eine Dekoration.
 *
 * Die Farbverteilung ist ebenfalls anders. Gold ist auf der
 * Plattform Zierde; hier ist es eine Handlungsanweisung -- was
 * markiert ist, muss angefasst werden.
 */

:root {
    /* Aus styles.css, unveraendert. Wer die Palette aendert,
       aendert sie dort. */
    --navy: #0a0f1a;
    --navy-light: #121a2a;
    --gold: #b8944f;
    --gold-light: #c9a462;
    --gold-muted: #a88442;
    --red: #e74c3c;
    --red-dark: #c0392b;
    --radius: 4px;
    --radius-sm: 8px;

    /* Nur fuer dieses Portal. */
    --grund: #0d1420;
    --flaeche: #141d2c;
    --flaeche-hoch: #1b2637;
    --linie: #24334a;
    --linie-hell: #2f4059;
    --text: #e6ebf2;
    --text-matt: #9aabc2;
    --text-leise: #6b7d94;

    --gruen: #4a9d7f;
    --bernstein: #d9a441;

    --leiste: 232px;
    --leiste-schmal: 64px;
}

/* ---------------------------------------------------------------
   Grundlagen
   --------------------------------------------------------------- */

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--grund);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    /* Kein Text waehlbar macht Zahlen schwer pruefbar -- deshalb
       bleibt er waehlbar. Nur Navigation wird nicht ausgewaehlt. */
    -webkit-font-smoothing: antialiased;
}

/* Die Navigation ist eine Bedienflaeche, kein Text zum Kopieren. */
nav, .leiste { user-select: none; }

h1, h2, h3 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.01em;
}

a { color: var(--gold-light); }
a:hover { color: #e0c48a; }

/* Sichtbarer Fokus. Tastaturbedienung muss auffallen, nicht nur
   funktionieren. */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

::selection { background: rgba(184, 148, 79, 0.3); }

/* ---------------------------------------------------------------
   Anmeldeschirm
   --------------------------------------------------------------- */

.anmelde-schirm {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    min-height: 100%;
    /* Ein Hauch Gold von oben links. Kaum sichtbar, aber es
       unterscheidet diesen Schirm sofort vom Marktplatz. */
    background:
        radial-gradient(ellipse 900px 500px at 15% -10%,
            rgba(184, 148, 79, 0.07), transparent 65%),
        var(--grund);
}

.anmelde-karte {
    width: 100%;
    max-width: 440px;
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius-sm);
    padding: 32px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.anmelde-marke {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--linie);
    margin-bottom: 24px;
}

.marke-ziffer {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--gold), var(--gold-muted));
    color: var(--navy);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.04em;
    border-radius: var(--radius);
}

.marke-name {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    letter-spacing: 0.01em;
}

.marke-bereich {
    margin: 0;
    font-size: 12px;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.anmelde-titel {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 500;
    margin-bottom: 10px;
}

.anmelde-hinweis {
    margin: 0 0 24px;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-matt);
    padding: 12px 14px;
    background: var(--flaeche-hoch);
    border-left: 2px solid var(--gold-muted);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.feld { margin-bottom: 18px; }

.feld label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-matt);
    letter-spacing: 0.02em;
}

.feld input {
    width: 100%;
    padding: 11px 13px;
    background: var(--grund);
    border: 1px solid var(--linie-hell);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    /* 16px auf kleinen Schirmen, sonst zoomt der Browser. */
}

.feld input:focus {
    border-color: var(--gold);
    outline: none;
    box-shadow: 0 0 0 3px rgba(184, 148, 79, 0.16);
}

button {
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    border-radius: var(--radius);
}

#anmelde-knopf {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--gold), var(--gold-muted));
    color: var(--navy);
    font-weight: 600;
    margin-top: 6px;
    transition: filter 0.15s;
}

#anmelde-knopf:hover:not(:disabled) { filter: brightness(1.08); }
#anmelde-knopf:disabled { opacity: 0.55; cursor: progress; }

.fehler {
    margin: 0 0 18px;
    padding: 11px 13px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.35);
    border-radius: var(--radius);
    color: #f29185;
    font-size: 13.5px;
}

.datenschutz {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--linie);
}

.datenschutz h2 {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-leise);
    font-weight: 600;
    margin-bottom: 10px;
}

.datenschutz ul {
    margin: 0 0 12px;
    padding-left: 18px;
    color: var(--text-matt);
    font-size: 13px;
    line-height: 1.7;
}

.datenschutz-fuss {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-leise);
}

/* ---------------------------------------------------------------
   Rahmen der Arbeitsseiten
   --------------------------------------------------------------- */

.arbeitsflaeche {
    display: grid;
    grid-template-columns: var(--leiste) 1fr;
    min-height: 100vh;
}

/* Seitenspalte */
.leiste {
    background: var(--navy);
    border-right: 1px solid var(--linie);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.leiste-kopf {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 18px 20px;
    border-bottom: 1px solid var(--linie);
    margin-bottom: 14px;
}

.leiste-kopf .marke-ziffer {
    width: 34px;
    height: 34px;
    font-size: 12px;
}

.leiste-marke { line-height: 1.2; }
.leiste-marke .marke-name { font-size: 16px; }
.leiste-marke .marke-bereich { font-size: 10px; }

.leiste nav { flex: 1; }

.leiste-eintrag {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 18px;
    color: var(--text-matt);
    text-decoration: none;
    font-size: 14px;
    border-left: 2px solid transparent;
    transition: background 0.12s, color 0.12s;
}

.leiste-eintrag:hover {
    background: var(--flaeche);
    color: var(--text);
}

.leiste-eintrag.aktiv {
    background: var(--flaeche);
    color: var(--gold-light);
    border-left-color: var(--gold);
}

.leiste-eintrag .zahl {
    margin-left: auto;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    background: var(--red);
    color: #fff;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.leiste-fuss {
    padding: 14px 18px 0;
    border-top: 1px solid var(--linie);
    margin-top: 12px;
}

.wer-zeile { margin-bottom: 10px; }
.wer-name {
    font-size: 13.5px;
    font-weight: 500;
    margin: 0;
}
.wer-funktion {
    font-size: 11.5px;
    color: var(--gold);
    margin: 1px 0 0;
    letter-spacing: 0.04em;
}

.abmelde {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--linie-hell);
    color: var(--text-matt);
    font-size: 13px;
}

.abmelde:hover {
    border-color: var(--red);
    color: #f29185;
}

/* Inhaltsspalte */
.inhalt { padding: 24px 28px 48px; min-width: 0; }

.kopfzeile {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.kopf-titel {
    font-family: 'Playfair Display', serif;
    font-size: 25px;
    font-weight: 500;
}

.kopf-unter { margin: 4px 0 0; font-size: 13.5px; color: var(--text-matt); }

/* ---------------------------------------------------------------
   Kennzahlen
   --------------------------------------------------------------- */

.werte {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.wert {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 14px 16px;
    /* Gold links, wenn die Zahl Handlung verlangt. */
    border-left: 2px solid var(--linie-hell);
}

.wert.achtung { border-left-color: var(--red); }
.wert.gold { border-left-color: var(--gold); }
.wert.gruen { border-left-color: var(--gruen); }

.wert-bezeichnung {
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--text-leise);
    margin-bottom: 6px;
    font-weight: 600;
}

.wert-zahl {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 27px;
    font-weight: 600;
    line-height: 1.1;
    /* Tabellarische Ziffern: eine Spalte aus Zahlen muss sich
       optisch als Spalte lesen, auch wenn die Ziffern wechseln. */
    font-variant-numeric: tabular-nums;
}

.wert.zahl-nicht-erfasst .wert-zahl {
    font-size: 15px;
    color: var(--text-leise);
    font-style: italic;
}

.wert-fuss { font-size: 11.5px; color: var(--text-leise); margin-top: 5px; }

/* ---------------------------------------------------------------
   Tabellen
   --------------------------------------------------------------- */

.blaettchen {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    overflow: hidden;
}

.blaettchen-kopf {
    padding: 13px 16px;
    border-bottom: 1px solid var(--linie);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.blaettchen-titel {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 9px 14px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-leise);
    font-weight: 600;
    background: var(--flaeche-hoch);
    border-bottom: 1px solid var(--linie);
    white-space: nowrap;
}

td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(36, 51, 74, 0.55);
    font-size: 14px;
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(184, 148, 79, 0.045); }

td.rechen, th.rechen { text-align: right; font-variant-numeric: tabular-nums; }

/* Marken */
.marke {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.marke-finanzierung { background: rgba(184, 148, 79, 0.16); color: var(--gold-light); }
.marke-sanierung { background: rgba(74, 157, 127, 0.16); color: #6fc0a0; }
.marke-neu { background: rgba(217, 164, 65, 0.16); color: var(--bernstein); }
.marke-in_arbeit { background: rgba(74, 157, 127, 0.16); color: #6fc0a0; }
.marke-anfrage_offen { background: rgba(184, 148, 79, 0.2); color: var(--gold-light); }
.marke-abgeschlossen { background: rgba(107, 125, 148, 0.2); color: var(--text-matt); }
.marke-abgelehnt { background: rgba(231, 76, 60, 0.16); color: #f29185; }

.leer-hinweis {
    padding: 22px 16px;
    color: var(--text-leise);
    font-size: 13.5px;
    text-align: center;
    margin: 0;
    font-style: italic;
}

/* ---------------------------------------------------------------
   Werkzeuge
   --------------------------------------------------------------- */

.werkzeuge { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }

.knopf {
    padding: 7px 13px;
    background: var(--flaeche-hoch);
    border: 1px solid var(--linie-hell);
    color: var(--text);
    font-size: 13.5px;
}

.knopf:hover { border-color: var(--gold-muted); color: var(--gold-light); }
.knopf.haupt {
    background: linear-gradient(135deg, var(--gold), var(--gold-muted));
    border-color: transparent;
    color: var(--navy);
    font-weight: 600;
}
.knopf.gefahr { border-color: rgba(231, 76, 60, 0.4); color: #f29185; }
.knopf.gefahr:hover { border-color: var(--red); background: rgba(231, 76, 60, 0.1); }
.knopf.klein { padding: 4px 9px; font-size: 12.5px; }

select, input[type="search"], input[type="text"], input[type="number"],
input[type="email"], textarea {
    padding: 7px 10px;
    background: var(--grund);
    border: 1px solid var(--linie-hell);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--gold);
    outline: none;
}

/* ---------------------------------------------------------------
   Kontaktpanel
   --------------------------------------------------------------- */

.panel {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px);
    min-height: 420px;
}

.panel-kopf {
    padding: 13px 16px;
    border-bottom: 1px solid var(--linie);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.panel-verlauf {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blase {
    max-width: 74%;
    padding: 10px 13px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.55;
    /* Die Quelle ist ein fremder Text. Er wird als Text gesetzt,
       nie als HTML. */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.blase.team {
    align-self: flex-end;
    background: rgba(184, 148, 79, 0.14);
    border: 1px solid rgba(184, 148, 79, 0.3);
}

.blase.kunde {
    align-self: flex-start;
    background: var(--flaeche-hoch);
    border: 1px solid var(--linie-hell);
}

.blase-absender {
    display: block;
    font-size: 11px;
    color: var(--text-leise);
    margin-top: 5px;
    letter-spacing: 0.03em;
}

.panel-antwort {
    display: flex;
    gap: 9px;
    padding: 13px;
    border-top: 1px solid var(--linie);
}

.panel-antwort textarea {
    flex: 1;
    resize: vertical;
    min-height: 42px;
    max-height: 140px;
    font-size: 14px;
}

/* ---------------------------------------------------------------
   Dialog
   --------------------------------------------------------------- */

.dialog {
    border: 1px solid var(--linie-hell);
    border-radius: var(--radius-sm);
    background: var(--flaeche);
    color: var(--text);
    padding: 0;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.dialog::backdrop { background: rgba(6, 10, 18, 0.72); }

.dialog-kopf {
    padding: 16px 20px;
    border-bottom: 1px solid var(--linie);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-titel { font-size: 16px; font-family: 'Space Grotesk', sans-serif; }

.dialog-rumpf { padding: 20px; display: grid; gap: 15px; }

.dialog-fuss {
    padding: 14px 20px;
    border-top: 1px solid var(--linie);
    display: flex;
    justify-content: flex-end;
    gap: 9px;
}

.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ueber-all { grid-column: 1 / -1; }

.feld-klein label {
    display: block;
    font-size: 11.5px;
    color: var(--text-matt);
    margin-bottom: 5px;
    letter-spacing: 0.02em;
}

.feld-klein input, .feld-klein select, .feld-klein textarea {
    width: 100%;
    font-size: 16px;
}

.feld-klein textarea { resize: vertical; min-height: 72px; }

/* ---------------------------------------------------------------
   Schmale Fenster
   --------------------------------------------------------------- */

@media (max-width: 900px) {
    .arbeitsflaeche { grid-template-columns: 1fr; }

    .leiste {
        position: static;
        height: auto;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        padding: 10px 14px;
        border-right: none;
        border-bottom: 1px solid var(--linie);
        gap: 6px;
    }

    .leiste-kopf {
        padding: 0 14px 0 0;
        margin: 0 8px 0 0;
        border-bottom: none;
        border-right: 1px solid var(--linie);
        flex: none;
    }

    .leiste-marke .marke-bereich { display: none; }

    .leiste nav { display: flex; gap: 4px; flex: none; }

    .leiste-eintrag {
        padding: 7px 12px;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: var(--radius);
        white-space: nowrap;
    }

    .leiste-eintrag.aktiv { border-bottom-color: var(--gold); }

    .leiste-fuss {
        margin: 0 0 0 auto;
        padding: 0 0 0 14px;
        border-top: none;
        border-left: 1px solid var(--linie);
        flex: none;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .wer-zeile { display: none; }
    .abmelde { width: auto; padding: 6px 11px; }

    .inhalt { padding: 16px 14px 40px; }
    .zwei-spalten { grid-template-columns: 1fr; }
    .panel { height: calc(100vh - 200px); }
}

/* Tabelle auf dem Telefon: statt Scrollen bekommt jede Zeile eine
   Karte. Waagerechtes Scrollen mit einer Hand ist unmoeglich. */
@media (max-width: 700px) {
    .tabellen-huelle { padding: 10px; }

    table.zeilen, table.zeilen tbody, table.zeilen tr, table.zeilen td {
        display: block;
        width: 100%;
    }

    table.zeilen thead { display: none; }

    table.zeilen tr {
        background: var(--grund);
        border: 1px solid var(--linie);
        border-radius: var(--radius);
        margin-bottom: 9px;
        padding: 4px 0;
    }

    table.zeilen td {
        border: none;
        padding: 6px 13px;
        display: grid;
        grid-template-columns: 104px 1fr;
        gap: 10px;
        align-items: baseline;
    }

    table.zeilen td::before {
        content: attr(data-beschriftung);
        font-size: 10.5px;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        color: var(--text-leise);
        font-weight: 600;
    }

    table.zeilen td.rechen { text-align: left; }

    .blase { max-width: 90%; }
}

/* Sehr schmale Fenster: die Wortmarke verschwindet, das Kuerzel
   reicht. Sonst schiebt sie die Navigation aus dem Bild. */
@media (max-width: 420px) {
    .leiste-marke { display: none; }
    .leiste-kopf { padding-right: 10px; margin-right: 4px; }
    .anmelde-karte { padding: 22px 18px; }
    .kopf-titel { font-size: 21px; }
}

/* Wer den Kontrast nicht braucht, aber die Bewegung auch nicht. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Dunkel ist hier Standard. Wer es anders will, bekommt es. */
@media (prefers-color-scheme: light) {
    :root {
        --grund: #f2f4f7;
        --flaeche: #ffffff;
        --flaeche-hoch: #f7f9fb;
        --linie: #d8dee7;
        --linie-hell: #c2ccd8;
        --text: #131a26;
        --text-matt: #4a5768;
        --text-leise: #7c8899;
    }
    .anmelde-marke .marke-name { color: var(--navy); }
}

@media print {
    .leiste, .werkzeuge, .panel-antwort { display: none; }
    body { background: #fff; color: #000; }
}
/* ==================================================================
   Die Anfrageseite.

   Ein Arbeitstisch, kein Dashboard. Wer hier arbeitet, hat eine
   Liste vor sich und arbeitet sie ab. Also: feste Spalten, die
   nicht springen, ein Detail, das daneben aufgeht statt zu
   verschwinden, und Zahlen, die man auf einen Blick sieht.
   ================================================================== */

.team-shell {
    display: grid;
    grid-template-columns: var(--leiste) 1fr;
    min-height: 100vh;
}

/* ---- Die Leiste -------------------------------------------------- */

.rail-marke {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--linie);
}

.rail-stern {
    font-size: 22px;
    color: var(--gold);
    line-height: 1;
}

.rail-titel {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.rail-titel span { color: var(--gold); }

.rail-zugang {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-leise);
    margin-top: 2px;
}

.rail-nav {
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
    gap: 2px;
    flex: 1;
}

.rail-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-matt);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.12s, color 0.12s;
}

.rail-link:hover {
    background: var(--flaeche);
    color: var(--text);
}

.rail-link.ist-hier {
    background: var(--flaeche-hoch);
    color: var(--gold-light);
    font-weight: 600;
    /* Gold links, wie auf der Plattform -- hier ist es die
       Position, nicht die Dekoration. */
    box-shadow: inset 2px 0 0 var(--gold);
}

.rail-symbol {
    width: 18px;
    text-align: center;
    opacity: 0.75;
}

.rail-fuss {
    padding: 14px;
    border-top: 1px solid var(--linie);
    display: grid;
    gap: 10px;
}

.rail-wer { display: grid; gap: 2px; }

.rail-wer-name {
    font-size: 13.5px;
    font-weight: 600;
}

.rail-wer-funktion {
    font-size: 11px;
    color: var(--text-leise);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.rail-abmelden {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid var(--linie-hell);
    border-radius: var(--radius);
    color: var(--text-matt);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

.rail-abmelden:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ---- Die Arbeit -------------------------------------------------- */

.team-arbeit {
    padding: 28px 32px 56px;
    min-width: 0;   /* ohne das schiebt eine breite Tabelle
                       das ganze Gitter auseinander */
}

.arbeit-kopf {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.arbeit-titel {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    font-weight: 500;
    margin: 0 0 4px;
}

.arbeit-unter {
    margin: 0;
    font-size: 14px;
    color: var(--text-matt);
}

.werkzeug {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: var(--flaeche-hoch);
    border: 1px solid var(--linie-hell);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
    transition: border-color 0.12s;
}

.werkzeug:hover { border-color: var(--gold); }

.werkzeug-voll { width: 100%; justify-content: center; margin-top: 10px; }

.werkzeug:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Filter ------------------------------------------------------ */

.filter-bank {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 16px 18px;
    margin-bottom: 20px;
}

.filter-reihe {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-feld {
    display: grid;
    gap: 5px;
    min-width: 170px;
}

.filter-feld label {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-leise);
}

.filter-feld select,
.filter-feld input {
    padding: 8px 11px;
    background: var(--grund);
    border: 1px solid var(--linie-hell);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.filter-schalter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-matt);
    cursor: pointer;
    padding-bottom: 9px;
}

.filter-zahl {
    margin: 12px 0 0;
    font-size: 12.5px;
    color: var(--text-leise);
    font-variant-numeric: tabular-nums;
}

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

.team-meldung,
.team-fehler {
    padding: 11px 15px;
    border-radius: var(--radius);
    font-size: 14px;
    margin: 0 0 18px;
}

.team-meldung {
    background: rgba(74, 157, 127, 0.12);
    border: 1px solid rgba(74, 157, 127, 0.4);
    color: #7fd0b1;
}

.team-fehler {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.45);
    color: #f0938a;
}

/* ---- Die Liste ---------------------------------------------------
   Spalten als Grid, nicht als Tabelle: die Liste ist eine
   Arbeitsansicht, kein Bericht. Eine Tabelle waere hier eine
   zumute Form, die es nicht gibt -- zumal es beim Bearbeiten
   wegfaellt.
   ------------------------------------------------------------------ */

.liste-huelle {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    overflow: hidden;
}

.liste-kopf,
.liste-zeile {
    display: grid;
    grid-template-columns:
        72px 130px minmax(140px, 1.4fr) 104px 150px minmax(110px, 0.9fr);
    gap: 14px;
    align-items: center;
    padding: 11px 18px;
}

.liste-kopf {
    background: var(--flaeche-hoch);
    border-bottom: 1px solid var(--linie);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-leise);
    font-weight: 600;
}

.liste-zeile {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--linie);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s;
}

.liste-zeile:last-child { border-bottom: none; }

.liste-zeile:hover { background: var(--flaeche-hoch); }

.liste-zeile:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

.liste-stark {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--gold-light);
}

.spalte-alter,
.spalte-geber {
    color: var(--text-matt);
    font-size: 13px;
}

.ist-unvollstaendig {
    /* Nicht rot -- ein Kunde, der eine Frage nicht beantwortet
       hat, ist kein Fehler. Aber sichtbar muss es sein. */
    box-shadow: inset 3px 0 0 var(--bernstein);
}

.unvollstaendig-marke {
    grid-column: 6;
    font-size: 11px;
    color: var(--bernstein);
    white-space: nowrap;
}

/* Status als Kerbe, nicht als Farbklecks. */
.status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--linie-hell);
    background: var(--flaeche-hoch);
}

.status-neu { border-color: var(--gold); color: var(--gold-light); }
.status-in_bearbeitung { border-color: var(--bernstein); color: var(--bernstein); }
.status-warte_auf_kunde { border-color: var(--linie-hell); color: var(--text-matt); }
.status-beraten { border-color: rgba(74,157,127,0.6); color: #7fd0b1; }
.status-erledigt { border-color: rgba(74,157,127,0.4); color: #6ba38c; }
.status-abgelehnt { border-color: rgba(231,76,60,0.5); color: #d98d84; }

/* ---- Leerzustand -------------------------------------------------- */

.leer-zustand {
    padding: 56px 24px;
    text-align: center;
}

.leer-titel {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    margin: 0 0 8px;
    color: var(--text-matt);
}

.leer-text {
    margin: 0;
    font-size: 14px;
    color: var(--text-leise);
    max-width: 42ch;
    margin-inline: auto;
}

/* ---- Das Detail --------------------------------------------------- */

.detail { margin-top: 6px; }

.detail-kopf { margin-bottom: 22px; }

.detail-zurueck {
    background: none;
    border: none;
    color: var(--gold-light);
    font-family: inherit;
    font-size: 13.5px;
    cursor: pointer;
    padding: 0 0 14px;
}

.detail-zurueck:hover { text-decoration: underline; }

.detail-zeile {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}

.detail-nummer {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.02em;
}

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

.detail-bereich {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-matt);
}

.detail-spalten {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 20px;
    align-items: start;
}

.detail-haupt,
.detail-seite {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.karte {
    background: var(--flaeche);
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    padding: 20px 22px;
}

.karte-hell { background: var(--flaeche-hoch); }

.karte-titel {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-leise);
    margin: 0 0 16px;
}

.karte-menge {
    font-size: 11px;
    color: var(--text-leise);
    text-transform: none;
    letter-spacing: 0;
}

.karte-hinweis {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-leise);
    margin: 10px 0 0;
}

.karte-fehler {
    margin: 10px 0 0;
    font-size: 13px;
    color: #f0938a;
}

.kontakt-raster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 0;
}

.kontakt-raster dt {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-leise);
    margin-bottom: 3px;
}

.kontakt-raster dd {
    margin: 0;
    font-size: 14.5px;
    word-break: break-word;
}

.nachricht-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    /* Der Nachrichtenteil kommt von aussen. Er darf umbrechen,
       aber nicht das Layout sprengen. */
    overflow-wrap: anywhere;
}

.frage-raster { margin: 0; display: grid; gap: 12px; }

.frage-zeile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--linie);
}

.frage-zeile:last-child { border-bottom: none; padding-bottom: 0; }

.frage-text {
    font-size: 13.5px;
    color: var(--text-matt);
}

.ist-pflicht .frage-text::after {
    content: ' *';
    color: var(--gold);
}

.frage-wert {
    margin: 0;
    font-size: 14.5px;
    overflow-wrap: anywhere;
}

/* Eine fehlende Antwort sieht anders aus als eine kurze. */
.ist-leer .frage-wert {
    color: var(--text-leise);
    font-style: italic;
}

.fehlend {
    margin: 14px 0 0;
    padding: 10px 13px;
    background: rgba(217, 164, 65, 0.1);
    border: 1px solid rgba(217, 164, 65, 0.35);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--bernstein);
}

.verlauf { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }

.verlauf-eintrag {
    border-left: 2px solid var(--linie-hell);
    padding-left: 14px;
    font-size: 13.5px;
    line-height: 1.6;
}

.verlauf-kopf {
    font-size: 11.5px;
    color: var(--text-leise);
    margin-bottom: 3px;
}

.verlauf-leer {
    font-size: 13.5px;
    color: var(--text-leise);
    font-style: italic;
}

.status-aktuell {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 600;
}

.status-wahl { display: grid; gap: 8px; }

.status-knopf {
    padding: 9px 14px;
    background: var(--grund);
    border: 1px solid var(--linie-hell);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s, color 0.12s;
}

.status-knopf:hover {
    border-color: var(--gold);
    color: var(--gold-light);
}

.detail-seite select,
.detail-seite textarea {
    width: 100%;
    padding: 9px 11px;
    background: var(--grund);
    border: 1px solid var(--linie-hell);
    border-radius: var(--radius);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
}

.detail-seite textarea { resize: vertical; }

/* ---- Schmal ------------------------------------------------------
   Unter 1000px wird die Leiste zu einer Zeile oben. Wer auf dem
   Telefon eine Anfrage liest, braucht die Liste, nicht die
   Navigation.
   ------------------------------------------------------------------ */

@media (max-width: 1100px) {
    .detail-spalten { grid-template-columns: 1fr; }
}

@media (max-width: 1000px) {
    .team-shell { grid-template-columns: 1fr; }

    .team-shell > .rail {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
        padding: 10px 16px;
        border-bottom: 1px solid var(--linie);
        border-right: none;
    }

    .rail-nav {
        flex-direction: row;
        flex: 1 1 100%;
        overflow-x: auto;
        padding: 0;
    }

    .rail-link { white-space: nowrap; }
    .rail-fuss { border-top: none; padding: 0; }

    .team-arbeit { padding: 20px 16px 44px; }

    /* Die feste Spaltenbreite taugt auf dem Telefon nicht mehr.
       Zwei Zeilen je Anfrage: was ist es, wer, und dann Status
       und Alter. */
    .liste-kopf { display: none; }

    .liste-zeile {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            'nummer status'
            'bereich bereich'
            'wer alter'
            'geber geber';
        gap: 4px 12px;
        padding: 14px 16px;
    }

    .spalte-nummer { grid-area: nummer; }
    .spalte-status { grid-area: status; justify-self: end; }
    .spalte-bereich { grid-area: bereich; font-weight: 600; }
    .spalte-wer { grid-area: wer; }
    .spalte-alter { grid-area: alter; justify-self: end; }
    .spalte-geber { grid-area: geber; }

    .unvollstaendig-marke { grid-area: geber; justify-self: end; }
}

@media (prefers-reduced-motion: reduce) {
    .liste-zeile, .werkzeug, .status-knopf, .rail-link { transition: none; }
}
