:root {
  --asb-red: #E2001A;
  --asb-red-dark: #B30015;
  --asb-red-soft: #FCE8EA;
  --asb-grey: #6F6F6E;
  --asb-grey-dark: #3C3C3B;
  --ink: #1A1A18;
  --muted: #6F6F6E;
  --line: #DEDEDC;
  --bg: #F4F4F2;
  --card: #FFFFFF;
  --radius: 3px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a { color: var(--asb-red); }
h1, h2, h3 { margin: 0 0 .6rem; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; }

/* ------------------------------------------------------------- Kopfzeile */

header.top {
  background: #fff;
  color: var(--ink);
  border-bottom: 4px solid var(--asb-red);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.top-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .8rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  text-decoration: none;
  white-space: nowrap;
}
.brand .logo { height: 52px; width: auto; display: block; }
.brand .brand-app {
  font-weight: 700;
  font-size: 1rem;
  color: var(--asb-grey-dark);
  letter-spacing: .02em;
  padding-left: .85rem;
  border-left: 1px solid var(--line);
}

nav.main { display: flex; gap: .15rem; flex-wrap: wrap; flex: 1; }
nav.main a {
  color: var(--asb-grey-dark);
  text-decoration: none;
  padding: .35rem .7rem;
  border-radius: var(--radius);
  font-size: .92rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
nav.main a:hover { background: var(--bg); color: var(--asb-red); }
nav.main a.active { color: var(--asb-red); border-bottom-color: var(--asb-red); }

.who { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .6rem; }
.who a { color: var(--asb-grey-dark); text-decoration: none; font-weight: 500; }
.who a:hover { color: var(--asb-red); }
.who form { display: inline; }
.who button {
  background: none; border: 1px solid var(--line); color: var(--asb-grey-dark);
  padding: .25rem .6rem; border-radius: var(--radius); cursor: pointer;
  font-size: .85rem; font-family: inherit;
}
.who button:hover { border-color: var(--asb-red); color: var(--asb-red); }

/* ---------------------------------------------------------------- Layout */

main { max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }

.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.page-head .sub { color: var(--muted); font-size: .9rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
}
.card > h2 {
  padding: .8rem 1rem;
  margin: 0;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.card > h2 .h-extra { font-weight: 400; font-size: .85rem; color: var(--muted); }
.card-body { padding: 1rem; }

.grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stats { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.2rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--asb-red);
  border-radius: var(--radius); padding: .8rem 1rem;
}
.stat .n { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .82rem; }
.stat.warn { border-left-color: var(--asb-grey); }

/* ---------------------------------------------------------------- Tabelle */

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; font-weight: 700; font-size: .76rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); padding: .55rem 1rem;
  border-bottom: 2px solid var(--line); white-space: nowrap;
}
td { padding: .6rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFAF8; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.plate {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; background: var(--bg); border: 1px solid var(--line);
  border-radius: 3px; padding: .1rem .35rem; white-space: nowrap;
}
.delta { font-weight: 700; color: var(--asb-red); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.empty a { font-weight: 600; }

/* ------------------------------------------------------------- Steuerung */

.btn {
  display: inline-block; background: var(--asb-red); color: #fff; border: 1px solid var(--asb-red);
  padding: .45rem .9rem; border-radius: var(--radius); text-decoration: none;
  font-size: .9rem; font-weight: 600; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--asb-red-dark); border-color: var(--asb-red-dark); }
.btn.ghost { background: #fff; color: var(--asb-grey-dark); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); color: var(--asb-red); border-color: var(--asb-red); }
.btn.danger { background: #fff; color: var(--asb-red); border-color: #F1B8BF; }
.btn.danger:hover { background: var(--asb-red-soft); border-color: var(--asb-red); }
.btn.small { padding: .25rem .55rem; font-size: .8rem; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.actions form { display: inline; }

.filters {
  display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap;
  padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: #FAFAF8;
}
.filters label { font-size: .8rem; color: var(--muted); display: block; }

/* --------------------------------------------------------------- Formular */

.form { max-width: 620px; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month], select, textarea {
  width: 100%; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--asb-red); outline-offset: 1px; border-color: var(--asb-red); }
.row2 { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; }
.check label { margin: 0; font-weight: 400; }

/* --------------------------------------------------------------- Hinweise */

.msg { padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1.2rem; font-size: .9rem; border: 1px solid; border-left-width: 3px; }
.msg.ok { background: #F1F7F1; border-color: #C3DEC3; border-left-color: #4B8B4B; color: #2E5C2E; }
.msg.warn { background: #FDF6E8; border-color: #EEDBAE; border-left-color: #C08A16; color: #7A5410; }
.msg.error { background: var(--asb-red-soft); border-color: #F1B8BF; border-left-color: var(--asb-red); color: #96000F; }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: .12rem .4rem; border-radius: 3px;
}
.tag.admin { background: var(--asb-red-soft); color: var(--asb-red-dark); }
.tag.off { background: #EDEDEB; color: var(--muted); }
.tag.priv { background: #EDEDEB; color: var(--asb-grey-dark); }

/* ------------------------------------------------------------- Anmeldung */

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.2rem; }
.login-box {
  background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--asb-red);
  border-radius: var(--radius); padding: 1.8rem; width: 100%; max-width: 380px;
}
.login-box .logo { height: 62px; width: auto; display: block; margin-bottom: 1.2rem; }
.login-box .brand { color: var(--asb-grey-dark); font-size: 1.25rem; font-weight: 700; display: block; margin-bottom: .3rem; }
.login-box .lead { color: var(--muted); font-size: .88rem; margin-bottom: 1.4rem; }
.login-box .btn { width: 100%; text-align: center; }

/* ---------------------------------------------------------------- Fusszeile */

.site-foot {
  max-width: 1180px; margin: 0 auto; padding: 0 1.2rem 2rem;
  color: var(--muted); font-size: .8rem;
}
.site-foot span { color: var(--asb-red); font-weight: 600; }

@media (max-width: 640px) {
  .row2 { grid-template-columns: 1fr; }
  th, td { padding: .5rem .6rem; }
  main { padding: 1.1rem .7rem 3rem; }
  .hide-s { display: none; }
  .brand .logo { height: 32px; }
  .brand .brand-app { font-size: .9rem; padding-left: .6rem; }
  .top-inner { gap: .8rem; }
}

/* ------------------------------------- Erfassung ohne Login und QR-Aushang */

.oeffentlich { background: var(--bg); }
main.schmal { max-width: 560px; padding-top: 1.6rem; }

.erf-kopf { text-align: center; margin-bottom: 1.2rem; }
.erf-kopf .logo { height: 34px; width: auto; margin-bottom: .9rem; }
.erf-kopf h1 { font-size: 1.35rem; margin: 0 0 .5rem; }
.erf-fahrzeug { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.erf-fahrzeug .plate { font-size: 1rem; padding: .2rem .5rem; }
.erf-label { color: var(--muted); font-size: .9rem; }
.field .opt { font-weight: 400; color: var(--muted); }

/* Am Handy ausgefuellt: grosse Felder, gut treffbare Schaltflaeche. */
main.schmal input { padding: .7rem .6rem; font-size: 1rem; }
.btn.gross { width: 100%; text-align: center; padding: .8rem 1rem; font-size: 1rem; }

.erf-danke { text-align: center; padding: 2rem 1rem; }
.erf-danke .haken {
  width: 54px; height: 54px; margin: 0 auto 1rem; border-radius: 50%;
  background: var(--asb-red); color: #fff; font-size: 1.9rem; line-height: 54px;
}
.erf-danke h1 { font-size: 1.3rem; margin: 0 0 .6rem; }
.erf-danke p { color: var(--muted); margin: 0 0 1.2rem; }
.erf-danke .actions { justify-content: center; }

.aushang {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2.2rem 1.5rem; text-align: center; max-width: 520px; margin: 0 auto;
}
.aushang-logo { height: 40px; width: auto; margin-bottom: 1.4rem; }
.aushang-titel { font-size: 1.5rem; font-weight: 700; margin-bottom: .8rem; }
.aushang-plate {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 2rem; font-weight: 700; letter-spacing: .04em; margin-bottom: .2rem;
}
.aushang-label { color: var(--muted); margin-bottom: 1.4rem; }
.aushang-qr svg { width: 260px; height: 260px; display: block; margin: 0 auto; }
.aushang-fuss { margin-top: 1.4rem; font-size: .9rem; color: var(--asb-grey-dark); line-height: 1.5; }

@media print {
  .no-print, .top, .site-foot { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .aushang { border: none; max-width: none; padding: 0; }
  .aushang-qr svg { width: 320px; height: 320px; }
}

@media (max-width: 520px) {
  .row2 { grid-template-columns: 1fr; }
}
.tag.qr { background: var(--asb-red-soft); color: var(--asb-red-dark); }
