:root { --primary: #001e40; --gold: #ffdea5; --bg: #f5f6f8; --card: #fff; --line: #d9dce3; --muted: #5a6070; --danger: #b3261e; }
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, -apple-system, "Segoe UI", sans-serif; font-size: 14px; color: #1a1c1e; background: var(--bg); }
header.top { background: var(--primary); color: #fff; display: flex; align-items: center; gap: 24px; padding: 10px 20px; flex-wrap: wrap; }
header .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
header .brand span { color: var(--gold); font-weight: 400; }
header nav a { color: #fff; text-decoration: none; margin-right: 16px; opacity: .9; }
header nav a:hover { color: var(--gold); }
header .who { margin-left: auto; font-size: 13px; opacity: .9; }
header .who a { color: var(--gold); }
.test { color: #ff8a65; }
main { max-width: 1240px; margin: 0 auto; padding: 20px; }
h1 { font-size: 22px; margin: 0 0 10px; color: var(--primary); }
h2 { font-size: 15px; margin: 0 0 10px; color: var(--primary); }
.count { display: inline-block; background: var(--gold); color: var(--primary); border-radius: 12px; padding: 1px 8px; font-size: 12px; font-weight: 600; vertical-align: middle; }
.muted { color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 0 0 16px; }
.card.narrow { max-width: 380px; margin: 60px auto; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.flash { background: #e8f3e8; border: 1px solid #9ccc9c; padding: 8px 12px; border-radius: 6px; margin-bottom: 14px; }
.note { background: #fff7e6; border-left: 4px solid var(--gold); padding: 8px 12px; margin-bottom: 10px; border-radius: 4px; }
.note.warn { background: #fdecea; border-left-color: var(--danger); }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.list tr:hover td { background: #fafbfd; }
label { display: block; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 3px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; color: #1a1c1e; background: #fff; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.45; }
button, .btn { display: inline-block; background: var(--primary); color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.small, .btn.small { padding: 4px 10px; font-size: 12px; }
button.danger { background: var(--danger); }
form.inline { display: inline; }
form.inline select, form.inline input { display: inline-block; width: auto; margin: 0; }
.inline-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.inline-row input { margin: 0; }
.filter { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filter select, .filter input { width: auto; margin: 0; min-width: 160px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
.stage { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #e8eaf0; color: var(--primary); vertical-align: middle; }
.stage.mail_a, .stage.mail_b { background: #e3ecfa; }
.stage.antwort, .stage.angebot { background: var(--gold); }
.stage.kunde { background: #cfead3; }
.stage.gesperrt, .stage.verloren { background: #f3d6d4; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 8px; background: #e8eaf0; text-transform: uppercase; letter-spacing: .03em; }
.tag.mail_out { background: #e3ecfa; } .tag.mail_in { background: var(--gold); } .tag.bounce, .tag.widerspruch { background: #f3d6d4; } .tag.abwesend { background: #eee; }
details.act { border-top: 1px solid var(--line); padding: 6px 0; }
details summary { cursor: pointer; }
pre { white-space: pre-wrap; background: #fafbfd; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 13px; }
code { background: #eef0f4; padding: 1px 4px; border-radius: 3px; }
/* Mobil: Tabellen scrollen innerhalb der Karte, Seite bleibt ohne horizontalen Ueberlauf */
@media (max-width: 700px) {
  main { padding: 12px; }
  header.top { gap: 10px 16px; padding: 10px 12px; }
  header .who { margin-left: 0; }
  .card { padding: 12px; overflow-x: auto; }
  table { display: block; overflow-x: auto; max-width: 100%; }
  .inline-row { flex-wrap: wrap; }
  .filter select, .filter input { min-width: 0; flex: 1 1 140px; }
}
