@import url("https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,400;0,600;1,400&family=Oswald:wght@400;500;600;700&display=swap");

:root {
  --bg: #050505;
  --bg-2: #0c0c0c;
  --surface: #121010;
  --surface-2: #181414;
  --line: #3a2a2a;
  --text: #f4efe8;
  --muted: #a89f96;
  --red: #c41212;
  --red-hot: #e01c1c;
  --red-dim: #6a0c0c;
  --ok: #3d7a4a;
  --warn: #b58a2a;
  --info: #3a6d8c;
  --radius: 0;
  --font: "Barlow", "Segoe UI", sans-serif;
  --display: "Oswald", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; }

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: .11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app-body, .auth-body, .public-body { position: relative; }
.app-body::before, .auth-body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red-dim), var(--red-hot), var(--red-dim));
  z-index: 20;
}
.app-body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: .05;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.1) 0,
    rgba(255,255,255,.1) 1px,
    transparent 1px,
    transparent 4px
  );
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 1.2rem;
  background: rgba(5,5,5,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.brand img {
  height: 42px;
  width: auto;
  mix-blend-mode: normal;
  filter: drop-shadow(0 0 12px rgba(196,18,18,.4));
}
.brand-text {
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: .95rem;
  line-height: 1;
}
.brand-kicker {
  font-size: .58rem;
  letter-spacing: .22em;
  color: var(--red);
  margin-bottom: .2rem;
}
.main-nav { display: flex; flex-wrap: wrap; gap: .15rem; align-items: center; }
.main-nav a {
  font-family: var(--display);
  padding: .5rem .7rem;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.is-active { color: #fff; border-bottom-color: var(--red); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  padding: .35rem .6rem;
}

.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 1.6rem 1.2rem 3rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; }
.page-head h1, h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0;
}
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: .95; }
.kicker {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .68rem;
  color: var(--red);
  margin: 0 0 .35rem;
}
.lede { color: var(--muted); margin: .35rem 0 0; max-width: 40rem; }
.muted { color: var(--muted); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  padding: .55rem 1rem;
  border-radius: 0;
  cursor: pointer;
  font-family: var(--display);
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.btn:hover { border-color: #6a4040; background: #241414; color: #fff; }
.btn-primary {
  background: var(--red);
  border-color: #8a1010;
  color: #fff;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.btn-primary:hover { background: var(--red-hot); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: #6a2020; color: #e07a7a; }
.btn-danger:hover { background: #3a1010; }
.btn-sm { padding: .3rem .6rem; font-size: .7rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 1.15rem 1.2rem;
  box-shadow: inset 3px 0 0 var(--red);
}
.card h2 { font-size: 1.05rem; margin-bottom: .8rem; }

.flash { padding: .7rem .9rem; margin-bottom: .8rem; border: 1px solid var(--line); border-left: 3px solid var(--line); }
.flash-error { border-left-color: var(--red-hot); background: #1a0c0c; }
.flash-success { border-left-color: var(--ok); background: #0d1610; }
.flash-warn { border-left-color: var(--warn); background: #16120a; color: #e8d7a8; }

.dash-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.dash-layout.has-overlap {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
}
.dash-rail { position: sticky; top: 4.6rem; }
.overlap-card { border-color: #6a5020; box-shadow: inset 3px 0 0 var(--warn); }
.overlap-card h2 {
  color: var(--warn);
  font-size: .95rem;
  letter-spacing: .08em;
  margin-bottom: .7rem;
}

label {
  display: grid;
  gap: .35rem;
  font-family: var(--display);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
input, select, textarea {
  font-family: var(--font);
  color: var(--text);
  background: #0a0a0a;
  border: 0;
  border-bottom: 1px solid #4a3a3a;
  border-radius: 0;
  padding: .55rem .7rem;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--red);
  box-shadow: none;
  background: #160808;
}
.check { display: flex; align-items: center; gap: .5rem; }
.check input { width: auto; }
.stack { display: grid; gap: .85rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.rule { border: 0; border-top: 1px solid var(--line); width: 100%; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1.2rem; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem 1rem .9rem;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}
.stat:hover { border-color: var(--red); }
.stat-n {
  display: block;
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
}
.stat-l {
  display: block;
  margin-top: .4rem;
  font-family: var(--display);
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list a { display: flex; flex-direction: column; gap: .15rem; padding: .7rem 0; }
.list a span { color: var(--muted); font-size: .82rem; }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; min-width: 160px; flex: 1; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th {
  font-family: var(--display);
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: #0e0a0a;
}
table.data tr.is-new { background: #1a1010; }
.sub { color: var(--muted); font-size: .8rem; }
.right { text-align: right; }
.status-select-form { margin: 0; }
.status-select {
  width: auto;
  max-width: 15.5rem;
  min-width: 9.5rem;
  padding: .28rem .5rem;
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: #111;
  border: 1px solid var(--line);
  border-radius: 0;
  cursor: pointer;
}
.status-select:focus {
  border-color: currentColor;
  background: #160808;
}
.status-btns { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.status-btns .pill, .status-btns button.pill {
  cursor: pointer;
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: #111;
  color: inherit;
  border-radius: 0;
}
.status-btns input { position: absolute; opacity: 0; pointer-events: none; }
.status-btns .pill.is-on, .status-field .pill:has(input:checked) {
  background: #2a1212;
  box-shadow: 0 0 0 1px currentColor inset;
  font-weight: 650;
}
.status-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.status-field legend {
  font-family: var(--display);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

.pill {
  display: inline-block;
  padding: .18rem .5rem;
  border-radius: 0;
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: #111;
}
.pill-entwurf, .pill-archiv { color: var(--muted); }
.pill-gesendet, .pill-bearbeitung { color: #8ec4e0; border-color: #2a4a5c; }
.pill-warte_versand { color: #c4b08e; border-color: #5c4a2a; }
.pill-klaerung, .pill-verschoben { color: #e0c98e; border-color: #5c4a2a; }
.pill-zusage { color: #9ed6aa; border-color: #2a5c38; }
.pill-absage, .pill-abgesagt, .pill-neu { color: #f0a0a0; border-color: #5c2a2a; background: #1a1010; }

.badge {
  display: inline-flex;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 .3rem;
  margin-left: .25rem;
  border-radius: 0;
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  align-items: center;
  justify-content: center;
}

.auth-body, .public-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}
.auth-body {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(196,18,18,.18), transparent 55%),
    #050505;
}
.auth-card { width: min(440px, 100%); position: relative; z-index: 1; }
.auth-card h1 {
  font-size: clamp(2rem, 7vw, 3rem);
  text-align: center;
}
.auth-logo, .public-logo {
  display: block;
  margin: 0 auto 1rem;
  width: min(320px, 80vw);
  mix-blend-mode: normal;
  filter: drop-shadow(0 8px 24px rgba(196,18,18,.35));
}
.auth-card .kicker, .public-hero .kicker, .auth-card .lede, .public-hero .lede { text-align: center; }
.auth-foot { text-align: center; margin-top: 1.2rem; }
.auth-foot a {
  font-family: var(--display);
  color: var(--muted);
  font-size: .75rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.auth-card .btn-primary { width: 100%; padding: .85rem 1rem; }

.login-link {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  z-index: 5;
  color: var(--muted);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.public-hero { text-align: center; margin-bottom: 1.5rem; position: relative; z-index: 1; }
.public-form-wrap { width: min(820px, 100%); position: relative; z-index: 1; }
.thank-you { text-align: center; padding: 2.4rem 1.2rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.meta { display: grid; grid-template-columns: 9rem 1fr; gap: .4rem 1rem; margin: 0 0 1rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.message-body { white-space: pre-wrap; background: #0c0c0c; padding: .9rem; border: 1px solid var(--line); }
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #6d6660;
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 0 1rem 2rem;
}

.cal-nav { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.cal-now {
  font-family: var(--display);
  letter-spacing: .12em;
  text-transform: uppercase;
  min-width: 9rem;
  text-align: center;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1.2rem;
}
.cal-wd {
  background: #101010;
  color: var(--muted);
  font-family: var(--display);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .45rem .4rem;
  text-align: center;
}
.cal-day {
  background: var(--surface);
  min-height: 7.2rem;
  padding: .35rem .4rem .5rem;
}
.cal-day.is-out { background: #0c0c0c; opacity: .55; }
.cal-day.is-today { box-shadow: inset 0 0 0 1px var(--red); }
.cal-day.has-clash { background: #1c1010; }
.cal-num { font-size: .78rem; color: var(--muted); margin-bottom: .3rem; }
.cal-item {
  display: flex;
  flex-direction: column;
  gap: .05rem;
  font-size: .72rem;
  padding: .25rem .35rem;
  margin-bottom: .25rem;
  border-left: 2px solid currentColor;
  background: #0c0c0c;
  line-height: 1.25;
}
.cal-item span { color: var(--muted); }
.cal-hint { margin-top: 1rem; }
.cal-legend-wrap h2 { margin-bottom: .6rem; }

@media (max-width: 860px) {
  .cal-grid { font-size: .8rem; }
  .cal-day { min-height: 5.4rem; }
  .stats, .grid-2, .form-grid, .dash-layout.has-overlap { grid-template-columns: 1fr; }
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 100%; right: 0; left: 0; background: #0e0a0a; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: .5rem; }
  .main-nav.is-open { display: flex; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .meta { grid-template-columns: 1fr; }
}
