:root {
  /* Farben von meerfarbig.net */
  --sea-900: #06222c;
  --sea-700: #0a3a47;
  --sea-500: #0f7f8f;
  --sea-300: #7fd6df;
  --sea-100: #e6f2f1;
  --sand: #f8fbfa;
  --text: #10262e;
  --muted: #48626b;
  --line: #d3e2e1;
  --card: #ffffff;

  --ok: #1f9d6b;
  --maint: #3d7de0;
  --minor: #e0a21c;
  --major: #e3701e;
  --critical: #d4421a;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(6, 42, 58, .06), 0 4px 16px rgba(6, 42, 58, .06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--sand);
  line-height: 1.55;
  font-size: 15px;
}

a { color: var(--sea-500); }

/* ---------- Header ---------- */
.hero {
  background: linear-gradient(160deg, var(--sea-900) 0%, var(--sea-900) 40%, var(--sea-700) 75%, var(--sea-500) 100%);
  color: #fff;
  padding: 28px 20px 84px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  /* Welle */
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 48px;
  background: var(--sand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath d='M0 28c120 14 240 20 360 12S600 10 720 14s240 26 360 26 240-18 360-26V48H0z' fill='black'/%3E%3C/svg%3E") center/100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 48' preserveAspectRatio='none'%3E%3Cpath d='M0 28c120 14 240 20 360 12S600 10 720 14s240 26 360 26 240-18 360-26V48H0z' fill='black'/%3E%3C/svg%3E") center/100% 100% no-repeat;
}
.wrap { max-width: 860px; margin: 0 auto; }
.brand {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand a { color: #fff; text-decoration: none; }
.logo { font-size: 22px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.logo { gap: 14px; }
.logo-svg { height: 56px; width: auto; overflow: visible; color: #fff; display: block; }
.logo-label { font-size: 15px; font-weight: 500; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.3); opacity: .85; letter-spacing: .02em; }
.brand nav a { font-size: 14px; opacity: .85; }
.brand nav a:hover { opacity: 1; }

/* ---------- Gesamtstatus ---------- */
main { margin-top: -56px; padding: 0 20px 48px; position: relative; z-index: 1; }

.overall {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 24px; border-left: 6px solid var(--ok);
}
.overall .icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--ok); flex: none; }
.overall h1 { margin: 0; font-size: 20px; }
.overall p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.overall.s-maintenance { border-color: var(--maint); } .overall.s-maintenance .icon { background: var(--maint); }
.overall.s-minor       { border-color: var(--minor); } .overall.s-minor .icon       { background: var(--minor); }
.overall.s-major       { border-color: var(--major); } .overall.s-major .icon       { background: var(--major); }
.overall.s-critical    { border-color: var(--critical); } .overall.s-critical .icon { background: var(--critical); }

section { margin-top: 32px; }
section > h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; font-weight: 600; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }

/* ---------- Komponenten ---------- */
.group-title { padding: 12px 20px; font-weight: 600; font-size: 14px; background: var(--sea-100); color: var(--sea-700); }
.comp { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.group-title + .comp { border-top: 0; }
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; }
.s-none .dot, .dot.s-none { background: var(--ok); }
.s-maintenance .dot, .dot.s-maintenance { background: var(--maint); }
.s-minor .dot, .dot.s-minor { background: var(--minor); }
.s-major .dot, .dot.s-major { background: var(--major); }
.s-critical .dot, .dot.s-critical { background: var(--critical); }
.badge.s-none { color: var(--ok); }
.badge.s-maintenance { color: var(--maint); }
.badge.s-minor { color: #a87508; }
.badge.s-major { color: var(--major); }
.badge.s-critical { color: var(--critical); }

/* ---------- Ereignisse ---------- */
.incident { padding: 20px 24px; border-left: 5px solid var(--minor); }
.incident + .incident { border-top: 1px solid var(--line); }
.incident.i-major { border-left-color: var(--major); }
.incident.i-critical { border-left-color: var(--critical); }
.incident.i-maintenance { border-left-color: var(--maint); }
.incident.i-closed { border-left-color: var(--line); }
.incident h3 { margin: 0; font-size: 17px; }
.incident h3 a { color: inherit; text-decoration: none; }
.meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 99px; background: var(--sea-100); color: var(--sea-700); margin-right: 6px; vertical-align: 2px; }

.updates { list-style: none; margin: 16px 0 0; padding: 0; }
.updates li { position: relative; padding: 0 0 14px 22px; }
.updates li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--sea-300); }
.updates li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.updates li:last-child::after { display: none; }
.updates li:last-child { padding-bottom: 0; }
.updates strong { font-size: 14px; }
.updates .time { color: var(--muted); font-size: 12px; margin-left: 6px; }
.updates p { margin: 3px 0 0; }

/* ---------- Verlauf ---------- */
.day { padding: 16px 24px; border-top: 1px solid var(--line); }
.day:first-child { border-top: 0; }
.day h4 { margin: 0 0 6px; font-size: 14px; }
.day .none { color: var(--muted); font-size: 14px; margin: 0; }
.day ul { margin: 0; padding: 0; list-style: none; }
.day li { padding: 4px 0; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.day li .dot { transform: translateY(1px); }

.empty { padding: 20px 24px; color: var(--muted); }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 20px 40px; }
footer a { color: var(--muted); }

/* ---------- Admin ---------- */
.admin main { margin-top: -56px; }
form .row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
form label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 5px; }
input[type=text], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sea-300); border-color: var(--sea-500); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.checks label { font-weight: 400; margin: 0; display: flex; gap: 6px; align-items: center; }
.btn { display: inline-block; font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 10px 18px; background: var(--sea-500); color: #fff; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--sea-700); }
.btn.secondary { background: var(--sea-100); color: var(--sea-700); }
.btn.danger { background: #fbe9e9; color: var(--critical); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.pad { padding: 20px 24px; }
.flash { padding: 12px 18px; border-radius: 8px; background: #e7f6ef; color: #146c4a; margin-top: 20px; }
.flash.err { background: #fbe9e9; color: var(--critical); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
details.edit { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
details.edit summary { cursor: pointer; font-weight: 600; color: var(--sea-500); font-size: 14px; }
.tabs { display: flex; gap: 8px; margin-top: 24px; }
.hidden { display: none !important; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); border-top: 0; }

@media (max-width: 600px) {
  form .row { grid-template-columns: 1fr; }
  .comp { padding: 12px 16px; }
  .incident, .day, .pad { padding-left: 18px; padding-right: 18px; }
}
