:root {
    --braun: #7a5a1e; --braun-hell: #f6efe3; --gelb: #f3d46a; --text: #1f1a14; --grau: #6b645a;
    --linie: #e2dccf; --flaeche: #ffffff; --grund: #faf7f2; --rot: #b3261e; --gruen: #2e7d32;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--grund); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--braun); }
main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; color: var(--braun); }

.kopfleiste { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 16px; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.marke { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; color: var(--text); }
.marke img { height: 36px; }
nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
nav a { text-decoration: none; font-weight: 500; }
nav form { margin: 0; }

.sprachen { display: inline-flex; gap: 6px; align-items: center; }
.sprachen a { display: inline-flex; padding: 3px; border: 2px solid transparent; border-radius: 5px; opacity: .45; }
.sprachen a img { display: block; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.sprachen a.aktiv { border-color: var(--braun); opacity: 1; }
.sprachen a:not(.aktiv):hover { opacity: 1; }
.sprachleiste { display: flex; justify-content: flex-end; max-width: 1100px; margin: 0 auto; padding: 12px 16px 0; }

.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.karte.schmal { max-width: 420px; margin: 40px auto; }
.login-logo { display: block; width: 110px; margin: 0 auto 12px; }
section { border-top: 1px solid var(--linie); padding-top: 16px; margin-top: 16px; }
section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--grau); margin-bottom: 12px; }
input, select, textarea { font: inherit; color: var(--text); padding: 8px 10px; border: 1px solid var(--linie); border-radius: 6px; background: #fff; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gelb); border-color: var(--braun); }
input[readonly] { background: var(--braun-hell); }
textarea { resize: vertical; }
.ungueltig { border-color: var(--rot); background: #fff4f3; }
.raster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 12px; }
.raster .breit { grid-column: span 2; }
.raster .ganz { grid-column: 1 / -1; }

button, .knopf { font: inherit; cursor: pointer; border: 1px solid var(--braun); background: #fff; color: var(--braun);
    padding: 8px 14px; border-radius: 6px; text-decoration: none; display: inline-block; }
button:hover, .knopf:hover { background: var(--braun-hell); }
.primaer { background: var(--braun); color: #fff; }
.primaer:hover { background: #5f4516; }
.gefahr { border-color: var(--rot); color: var(--rot); }
button.link { border: 0; background: none; padding: 0; color: var(--braun); font-weight: 500; }
button.klein { padding: 2px 8px; font-size: 0.85rem; }
.aktionen { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }
.leiste { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.leiste > form { display: flex; gap: 8px; flex: 1; max-width: 420px; }

.meldung { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.meldung.ok { background: #edf7ee; border-color: #b7dfba; color: var(--gruen); }
.meldung.fehler { background: #fdeceb; border-color: #f2b8b5; color: var(--rot); }

table.liste { width: 100%; border-collapse: collapse; background: var(--flaeche); }
table.liste th, table.liste td { text-align: left; padding: 10px; border-bottom: 1px solid var(--linie); }
table.liste th { font-size: 0.8rem; color: var(--grau); font-weight: 600; }
table.liste tr[data-link] { cursor: pointer; }
table.liste tr[data-link]:hover { background: var(--braun-hell); }
.r { text-align: right !important; }
.status { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; background: var(--braun-hell); white-space: nowrap; }
.status.entwurf { background: #fff4d1; }
.status.storniert { background: #fdeceb; color: var(--rot); }

table.positionen { width: 100%; border-collapse: collapse; }
table.positionen th { font-size: 0.8rem; color: var(--grau); text-align: left; padding: 4px; }
table.positionen td { padding: 4px; vertical-align: top; }
table.positionen .griff { white-space: nowrap; width: 64px; }
table.positionen .satz { width: 90px; }
table.positionen .preis-spalte { width: 130px; }
table.positionen .anzahl-spalte { width: 90px; }
table.positionen .gesamt { width: 110px; padding-top: 12px; text-align: right; white-space: nowrap; }
table.positionen textarea { min-height: 40px; }
.summen { margin-left: auto; max-width: 340px; margin-top: 12px; }
.summen div { display: flex; justify-content: space-between; padding: 3px 0; }
.summen .gesamt { border-top: 2px solid var(--braun); margin-top: 4px; padding-top: 6px; font-weight: 700; font-size: 1.1rem; }

.kunde-feld { position: relative; }
.vorschlaege { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; background: #fff; border: 1px solid var(--linie);
    border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); }
.vorschlag { display: block; width: 100%; text-align: left; border: 0; border-radius: 0; border-bottom: 1px solid var(--linie); color: var(--text); }
.kunde-status { font-size: 0.85rem; color: var(--grau); margin-bottom: 8px; }
iframe.pdf { width: 100%; height: 80vh; border: 1px solid var(--linie); border-radius: 8px; background: #fff; }

@media (max-width: 760px) {
    .raster { grid-template-columns: 1fr 1fr; }
    .raster .breit { grid-column: 1 / -1; }
    table.positionen thead { display: none; }
    table.positionen tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-bottom: 1px solid var(--linie); padding: 8px 0; }
    table.positionen td { width: auto !important; }
    table.positionen td.beschreibung { grid-column: 1 / -1; }
    table.liste .optional { display: none; }
    table.liste th, table.liste td { padding: 8px 6px; }
    table.liste .status { white-space: normal; }
}
