:root {
    --bg: #eef1f4;
    --karte: #ffffff;
    --text: #1f2933;
    --muted: #6b7280;
    --rand: #e2e6ea;
    --akzent: #0f766e;
    --akzent-dunkel: #0b5952;
    --auto: #1d4ed8;
    --auto-bg: #e6edff;
    --oepnv: #047857;
    --oepnv-bg: #e3f5ec;
    --fehler: #b91c1c;
    --fehler-bg: #fdecec;
    --erfolg: #065f46;
    --erfolg-bg: #e3f5ec;
    --schatten: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 1rem; }

.muted { color: var(--muted); }

/* ---------- Kopf ---------- */
.kopf {
    background: var(--akzent);
    color: #fff;
}
.kopf-inhalt {
    max-width: 860px;
    margin: 0 auto;
    padding: .9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.kopf-aktionen { display: flex; align-items: center; gap: .75rem; }
.kopf .von { font-size: .8rem; opacity: .85; }

/* ---------- Layout ---------- */
.inhalt {
    max-width: 860px;
    margin: 0 auto;
    padding: 1rem;
}
.karte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--schatten);
    margin-bottom: 1rem;
}

/* ---------- Hinweise ---------- */
.hinweis {
    padding: .65rem .9rem;
    border-radius: 8px;
    margin: 0 0 1rem;
    font-size: .92rem;
}
.erfolg { background: var(--erfolg-bg); color: var(--erfolg); }
.fehler { background: var(--fehler-bg); color: var(--fehler); }

/* ---------- Formular ---------- */
.fahrt-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.feld { display: flex; flex-direction: column; gap: .3rem; }
.feld-breit { grid-column: 1 / -1; }
.feld-checkbox { grid-column: 1 / -1; }
label { font-size: .85rem; font-weight: 600; color: #374151; }
.check { font-weight: 500; display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.check input { width: auto; }

input, select {
    font: inherit;
    padding: .55rem .65rem;
    border: 1px solid var(--rand);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    width: 100%;
}
input:focus, select:focus {
    outline: 2px solid var(--akzent);
    outline-offset: 1px;
    border-color: var(--akzent);
}

.aktionen-zeile { flex-direction: row; align-items: center; gap: .75rem; }

button {
    font: inherit;
    font-weight: 600;
    background: var(--akzent);
    color: #fff;
    border: none;
    padding: .6rem 1.1rem;
    border-radius: 8px;
    cursor: pointer;
}
button:hover { background: var(--akzent-dunkel); }

.knopf-sekundaer, .knopf-klein {
    font-size: .9rem;
    text-decoration: none;
    padding: .5rem .8rem;
    border-radius: 8px;
    border: 1px solid var(--rand);
    color: var(--text);
    background: #fff;
}
.knopf-klein:hover, .knopf-sekundaer:hover { background: #f3f4f6; }
.kopf .knopf-klein { background: rgba(255,255,255,.15); border-color: transparent; color: #fff; }
.kopf .knopf-klein:hover { background: rgba(255,255,255,.28); }

/* ---------- Summen ---------- */
.summen {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .75rem;
    margin-bottom: 1rem;
}
.summe-kachel {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: 12px;
    padding: .85rem;
    text-align: center;
    box-shadow: var(--schatten);
}
.summe-kachel.hervor { grid-column: 1 / -1; border-color: var(--akzent); }
.summe-wert { display: block; font-size: 1.3rem; font-weight: 700; color: var(--akzent); }
.summe-titel { display: block; font-size: .78rem; color: var(--muted); margin-top: .15rem; }

/* ---------- Leiste (Filter/Export) ---------- */
.leiste {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.monat-form { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.monat-form label { margin: 0; }
.monat-form input { width: auto; }
.export { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.export:hover { background: var(--akzent-dunkel); }

/* ---------- Tabelle ---------- */
.tabelle-karte { padding: .5rem; }
.tabelle-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .6rem .7rem; text-align: left; border-bottom: 1px solid var(--rand); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.rechts { text-align: right; }
.stark { font-weight: 700; }
.leer { padding: 1.5rem; text-align: center; }

.badge {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 999px;
}
.badge-auto { background: var(--auto-bg); color: var(--auto); }
.badge-oepnv { background: var(--oepnv-bg); color: var(--oepnv); }

.zeilen-aktionen { white-space: nowrap; }
.link {
    background: none;
    border: none;
    color: var(--akzent);
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    padding: 0 .2rem;
}
.link:hover { text-decoration: underline; }
.loeschen { color: var(--fehler); }
.inline { display: inline; }

.fuss { text-align: center; font-size: .82rem; padding: 1rem 0 2rem; }

/* ---------- Login ---------- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}
.login-karte {
    background: var(--karte);
    border: 1px solid var(--rand);
    border-radius: 12px;
    padding: 1.75rem;
    width: 100%;
    max-width: 340px;
    box-shadow: var(--schatten);
}
.login-karte h1 { color: var(--akzent); }
.login-karte form { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }

/* ---------- Mobil ---------- */
@media (max-width: 620px) {
    .fahrt-form { grid-template-columns: 1fr; }
    .summen { grid-template-columns: repeat(2, 1fr); }

    /* Tabelle als Karten stapeln */
    table thead { display: none; }
    table, tbody, tr, td { display: block; width: 100%; }
    tr {
        border: 1px solid var(--rand);
        border-radius: 10px;
        margin-bottom: .7rem;
        padding: .3rem .2rem;
    }
    td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        border-bottom: 1px dashed var(--rand);
        text-align: right;
    }
    tr td:last-child { border-bottom: none; }
    td::before {
        content: attr(data-label);
        font-size: .78rem;
        color: var(--muted);
        font-weight: 600;
        text-align: left;
    }
    .zeilen-aktionen { justify-content: flex-end; }
}
