@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/fonts/barlow/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/fonts/barlow/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-condensed/barlow-condensed-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url("/fonts/barlow-condensed/barlow-condensed-latin-800-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #0b1017;
  --bg-2: #101722;
  --panel: #151d29;
  --panel-2: #1b2534;
  --line: #2a3648;
  --text: #edf1f6;
  --muted: #9aa7b8;
  --red: #e0263f;
  --red-strong: #f0425a;
  --blue: #3b8cf5;
  --blue-soft: #8cbcfa;
  --amber: #f0ad4e;
  --green: #3fbf80;
  --discord: #5865f2;
  --radius: 4px;
  --mono: ui-monospace, "Cascadia Mono", "Consolas", monospace;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 400 17px/1.6 "Barlow", system-ui, sans-serif; }
main { flex: 1; }
a { color: var(--blue-soft); }
a:hover { color: #fff; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0 0 .5em; letter-spacing: .005em; }
h1 { font-size: clamp(2.3rem, 5vw, 3.4rem); text-transform: uppercase; }
h2 { font-size: 1.9rem; text-transform: uppercase; }
h3 { font-size: 1.35rem; font-weight: 600; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 2px; }

.wrap { width: min(1180px, 100%); margin-inline: auto; padding-inline: 20px; }
.section { padding-block: 56px; }
.page { padding-block: 44px 72px; }
.narrow { width: min(720px, 100%); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.eyebrow { font: 600 .95rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--red-strong); margin-bottom: 12px; display: block; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.hidden { display: none; }

.checker { height: 16px; background: repeating-conic-gradient(var(--red) 0 25%, #f5f6f8 0 50%) 0 0 / 16px 16px; }

/* Navigation */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11, 16, 23, .93); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.topbar .wrap { display: flex; align-items: center; gap: 22px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 1.5rem/1 var(--display); text-transform: uppercase; white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 8px 11px; border-radius: var(--radius); white-space: nowrap; }
.nav a:hover { color: #fff; background: var(--panel); }
.nav a.active { color: #fff; box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }
.nav-side { display: flex; align-items: center; gap: 8px; }
.nav-side form { margin: 0; }
.menu { display: none; margin-left: auto; }
.menu summary { list-style: none; cursor: pointer; padding: 8px 13px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 12px 20px 20px; display: grid; gap: 4px; }
.menu-panel a:not(.btn) { color: var(--text); text-decoration: none; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.menu-panel .btn { margin-top: 10px; }
.menu-panel form { margin: 0; }
.menu-panel form .btn { width: 100%; }
@media (max-width: 1000px) {
  .nav, .nav-side { display: none; }
  .menu { display: block; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); color: var(--text); font: 600 1rem/1.1 "Barlow", sans-serif; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: #26344a; color: #fff; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-strong); border-color: var(--red-strong); }
.btn-discord { background: var(--discord); border-color: var(--discord); color: #fff; }
.btn-discord:hover { background: #6d78f5; }
.btn-danger { color: #ff9aa8; border-color: #6d2b36; background: transparent; }
.btn-danger:hover { background: #4a1c25; }
.btn-small { min-height: 32px; padding: 4px 11px; font-size: .88rem; }
.btn-big { min-height: 52px; padding: 10px 28px; font: 800 1.25rem/1 var(--display); text-transform: uppercase; letter-spacing: .03em; }

/* Meldungen */
.flash-area { padding-top: 18px; }
.flash { padding: 12px 16px; border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); background: var(--panel); margin-bottom: 10px; overflow-wrap: anywhere; }
.flash-success { border-left-color: var(--green); }
.flash-error { border-left-color: var(--red); }
.flash-warn { border-left-color: var(--amber); }

/* Startseite */
.hero { position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(180deg, #080c12 0%, #101a2a 72%, #16263c 100%); }
.hero-content { position: relative; z-index: 2; padding-block: clamp(56px, 10vw, 120px) clamp(150px, 20vw, 240px); }
.hero h1 { font-size: clamp(4.2rem, 15vw, 11rem); line-height: .85; margin-bottom: 22px; }
.hero h1 span { color: var(--red); }
.hero-tagline { font-size: clamp(1.15rem, 2.4vw, 1.5rem); max-width: 34em; color: #d3dbe6; margin-bottom: 30px; }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; min-height: 150px; z-index: 1; }
.skyline .city { fill: #05080d; }
.skyline .water { fill: #05080d; }
.skyline .window { fill: var(--amber); opacity: .7; }
.skyline .wave { stroke: #1f3755; stroke-width: 2; fill: none; }
.beacon { position: absolute; z-index: 0; width: 60vw; height: 60vw; max-width: 760px; max-height: 760px; border-radius: 50%; filter: blur(60px); opacity: 0; pointer-events: none; }
.beacon-blue { background: var(--blue); right: 2%; top: -14%; animation: flash-blue 2.4s infinite; }
.beacon-red { background: var(--red); right: 26%; top: 8%; animation: flash-red 2.4s infinite; }
@keyframes flash-blue { 0%, 8%, 16%, 100% { opacity: .05; } 4%, 12% { opacity: .55; } }
@keyframes flash-red { 0%, 50%, 58%, 66%, 100% { opacity: .03; } 54%, 62% { opacity: .38; } }
@media (prefers-reduced-motion: reduce) {
  .beacon { animation: none; opacity: .2; }
  html { scroll-behavior: auto; }
}

.statbar { border-block: 1px solid var(--line); background: var(--bg-2); }
.statbar .wrap { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: 20px 0; }
.stat + .stat { border-left: 1px solid var(--line); padding-left: 24px; }
.stat strong { display: block; font: 800 2.5rem/1 var(--display); }
.stat span { color: var(--muted); font-size: .92rem; }

.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }

.services { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.service { display: grid; grid-template-columns: 8px 1fr; background: var(--panel); }
.service::before { content: ""; background: var(--accent); }
.service > div { padding: 15px 20px; }
.service h3 { margin-bottom: 3px; }
.service p { margin: 0; color: var(--muted); font-size: .96rem; }
.s-police { --accent: var(--blue); }
.s-fire { --accent: var(--red); }
.s-ems { --accent: var(--amber); }
.s-civil { --accent: var(--green); }

.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.news-card { display: block; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); }
.news-card:hover { border-color: var(--blue); color: var(--text); }
.news-card h3 { margin-bottom: 8px; }

.cta { background: var(--panel); border-block: 1px solid var(--line); }
.cta .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; padding-block: 38px; }
.cta h2 { margin: 0; }

/* Inhalte */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; font-size: 1.7rem; }
.prose h3 { margin-top: 1.3em; }
.prose blockquote { margin: 0 0 1.4em; padding: 12px 18px; background: var(--panel); border-left: 4px solid var(--amber); color: #dce3ec; }
.prose blockquote p { margin: 0; }
.prose li { margin-bottom: .3em; }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose pre { overflow-x: auto; background: var(--panel); padding: 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel > :last-child { margin-bottom: 0; }
.panel h2 { font-size: 1.45rem; }
.panel-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-title h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 400px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.empty { padding: 30px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }

/* Formulare */
.auth-box { width: min(440px, 100%); margin: 0 auto; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; margin-bottom: 5px; }
.field small { display: block; margin-top: 5px; color: var(--muted); }
input[type=text], input[type=password], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 12px; color: var(--text); background: var(--bg); border: 1px solid #3a4960; border-radius: var(--radius); font: inherit;
}
textarea { min-height: 130px; resize: vertical; }
.textarea-tall { min-height: 340px; font-family: var(--mono); font-size: .92rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
.check { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 14px; cursor: pointer; }
.check input { margin-top: 6px; accent-color: var(--red); }
.or { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: .9rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.full { width: 100%; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; width: auto; }
.filters select { flex: 0 1 200px; width: auto; }
.filters .check { margin: 0; }

/* Tabellen und Status */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.data { border-collapse: collapse; width: 100%; font-size: .96rem; }
table.data th { text-align: left; font: 600 .86rem/1.2 "Barlow", sans-serif; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); padding: 10px 14px; white-space: nowrap; }
table.data td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
table.data tr:hover td { background: #1a2331; }
.clip { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-details { min-width: 220px; max-width: 460px; }
.log-details summary { max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.log-details pre { max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.4; }
.log-details a { display: inline-block; margin-top: 6px; }
.nowrap { white-space: nowrap; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: .8rem; font-weight: 600; white-space: nowrap; background: #2a3648; color: #d3dbe6; }
.tag-red { background: #4f1722; color: #ff9eab; }
.tag-amber { background: #4b3513; color: #ffcf88; }
.tag-green { background: #143c2a; color: #84e2b1; }
.tag-blue { background: #15345f; color: #a9cefc; }
.pager { display: flex; justify-content: center; gap: 12px; align-items: center; margin-top: 18px; color: var(--muted); }

/* Team */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.member { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.member > div { min-width: 0; overflow-wrap: anywhere; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font: 800 1.2rem/1 var(--display); text-transform: uppercase; object-fit: cover; }

/* Tickets */
.thread { display: grid; gap: 12px; margin-bottom: 18px; }
.msg { padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.msg-staff { border-left: 4px solid var(--blue); }
.msg-internal { border-left: 4px solid var(--amber); background: #231e14; }
.msg header { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; font-size: .92rem; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .ticket-layout { grid-template-columns: minmax(0, 1fr); } }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .95rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.code-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 14px; background: var(--bg); border: 1px dashed var(--amber); border-radius: var(--radius); margin-bottom: 14px; }
.code-box code { font-size: 1.15rem; color: var(--amber); }
.linked { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: calc(100vh - 67px); }
.admin-nav { background: var(--bg-2); border-right: 1px solid var(--line); padding: 22px 12px; }
.admin-nav .label { font: 600 .85rem/1 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--red-strong); padding: 0 11px; margin-bottom: 12px; }
.admin-nav a { display: block; padding: 9px 11px; color: var(--muted); text-decoration: none; font-weight: 500; border-radius: var(--radius); white-space: nowrap; }
.admin-nav a:hover { background: var(--panel); color: #fff; }
.admin-nav a.active { background: var(--panel-2); color: #fff; box-shadow: inset 3px 0 0 var(--red); }
.admin-main { padding: 28px clamp(16px, 3vw, 36px) 60px; min-width: 0; }
.admin-main h1 { font-size: 2.3rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); display: block; }
.kpi:hover { border-color: var(--blue); color: var(--text); }
.kpi strong { display: block; font: 800 2.7rem/1 var(--display); }
.kpi span { color: var(--muted); }
.notice { padding: 13px 16px; background: #2d2412; border: 1px solid #66501f; border-radius: var(--radius); margin-bottom: 20px; }
details.create { margin-bottom: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
details.create summary { cursor: pointer; padding: 13px 18px; font-weight: 600; }
details.create form { padding: 4px 18px 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.inline { display: inline-flex; gap: 6px; margin: 0; align-items: center; }
.inline select { width: auto; min-height: 32px; padding: 3px 6px; font-size: .88rem; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { display: flex; overflow-x: auto; gap: 2px; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-nav .label { display: none; }
  .admin-nav a.active { box-shadow: inset 0 -2px 0 var(--red); }
}

/* Fußzeile */
.footer { background: var(--bg-2); border-top: 1px solid var(--line); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 26px; padding-block: 26px; color: var(--muted); font-size: .93rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.footer a { color: var(--muted); }
.error-page { text-align: center; padding-block: 90px; }
.error-code { font: 800 7rem/1 var(--display); color: var(--red); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .section { padding-block: 40px; }
  .stat strong { font-size: 2rem; }
  .stat + .stat { padding-left: 12px; }
  .stat span { font-size: .82rem; }
  .hero .btn-big { width: 100%; }
}
