:root {
  --rot: #c32021;
  --rot-dunkel: #9e1a1b;
  --text: #1d2430;
  --muted: #5d6675;
  --line: #dfe3ea;
  --bg: #eef1f5;
  --panel: #fff;
  --akzent: #2a7a72;
  --akzent2: #7cc4bb;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); }
a { color: inherit; }
button, input { font: inherit; }

/* Gästeseiten */
body.guest { background: #000; color: #fff; min-height: 100vh; display: flex; justify-content: center; }
.card { width: 100%; max-width: 420px; padding: 28px 22px 20px; text-align: center; background: #111; }
.logo { width: 210px; max-width: 70%; height: auto; display: block; margin: 0 0 22px; }
.card h1 { font-weight: 400; font-size: 1.75rem; margin: 0 0 8px; }
.card h2 { font-size: 1.05rem; margin: 22px 0 6px; text-align: left; }
.lead { margin: 0 0 20px; font-size: .98rem; }
.small { font-size: .9rem; color: #ccc; }
.stack { display: grid; gap: 14px; text-align: left; }
.stack label { display: grid; gap: 4px; font-size: .92rem; }
.stack input:not([type=checkbox]) { width: 100%; padding: 12px; border: 1px solid #555; border-radius: 3px; background: #fff; color: #111; font-size: 1.05rem; }
.stack input.code { letter-spacing: .3em; font-size: 1.4rem; text-align: center; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-size: .98rem !important; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--rot); }
.btn { display: block; width: 100%; padding: 13px 16px; border: 0; border-radius: 2px; text-align: center; text-decoration: none; cursor: pointer; font-size: 1.1rem; }
.btn.primary { background: var(--rot); color: #fff; }
.btn.primary:hover, .btn.primary:focus { background: var(--rot-dunkel); }
.card hr { border: 0; border-top: 1px solid #777; margin: 20px 0; }
.back { display: inline-block; margin-top: 16px; color: #ccc; font-size: .92rem; }
.foot { margin-top: 26px; font-size: .85rem; color: #aaa; }
.foot a { color: #ccc; }
.msg { padding: 10px 12px; border-radius: 3px; text-align: left; font-size: .93rem; }
.msg.error { background: #4a1212; border-left: 4px solid var(--rot); }
.msg.info { background: #1d2b3a; border-left: 4px solid #5b8fc7; }
.text { text-align: left; font-size: .92rem; }
.text p { margin: 0 0 12px; }

/* Admin */
body.admin { background: var(--bg); }
body.admin .msg.error { background: #fdecec; color: #8a1c1c; border-left: 4px solid var(--rot); }
.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: #1f2a37; color: #fff; flex-wrap: wrap; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { padding: 6px 12px; border-radius: 3px; text-decoration: none; color: #cfd6df; }
.topbar nav a.on, .topbar nav a:hover { background: #33475c; color: #fff; }
.topbar form { margin: 0; }
.link { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }
.link.danger, .danger { color: #b3261e; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 20px 16px 40px; }
.wrap h1 { font-weight: 400; margin: 0 0 14px; color: #3a4757; }
.range { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-bottom: 16px; }
.range label { display: grid; gap: 2px; font-size: .85rem; color: var(--muted); }
.range input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.btn.small { display: inline-block; width: auto; padding: 7px 14px; font-size: .92rem; background: #2f6fb0; color: #fff; border-radius: 3px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--akzent); color: #fff; padding: 16px 18px; border-radius: 2px; display: grid; gap: 4px; }
.tile:nth-child(2) { background: #3fa59b; }
.tile:nth-child(3) { background: #8fb7b2; }
.tile:nth-child(4) { background: #7fc6d0; color: #10313a; }
.tile.warn { background: #b3261e; color: #fff; }
.tile span { font-size: .95rem; }
.tile b { font-size: 2.2rem; font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums; }
.panel { background: var(--panel); padding: 16px 18px; margin-bottom: 18px; border-radius: 2px; }
.panel h2 { font-size: .95rem; text-transform: uppercase; letter-spacing: .03em; color: #3d7fc1; margin: 0 0 12px; font-weight: 600; }
.chart { width: 100%; height: auto; display: block; }
.chart .b1 { fill: var(--akzent); }
.chart .b2 { fill: var(--akzent2); }
.chart .ax { font-size: 10px; fill: var(--muted); }
.chart .axl { stroke: var(--line); }
.legend { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 10px; vertical-align: -1px; }
.sw.b1 { background: var(--akzent); }
.sw.b2 { background: var(--akzent2); }
.grid { width: 100%; border-collapse: collapse; font-size: .92rem; background: #fff; }
.grid th { text-align: left; font-weight: 600; border-bottom: 2px solid var(--line); padding: 8px 10px; white-space: nowrap; }
.grid td { border-bottom: 1px solid var(--line); padding: 7px 10px; white-space: nowrap; }
.grid tr:hover td { background: #f6f8fb; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.scroll { overflow-x: auto; background: #fff; padding: 4px 8px; border-radius: 2px; }
.tabs { display: flex; gap: 2px; margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 16px; text-decoration: none; color: #3d7fc1; border: 1px solid transparent; border-bottom: 0; }
.tabs a.on { background: #fff; color: var(--text); border-color: var(--line); }
.pager { display: flex; gap: 14px; align-items: center; color: var(--muted); font-size: .9rem; }
.inline { display: inline; margin: 0; }
.meter { display: inline-block; width: 160px; height: 8px; background: #e8ecf1; border-radius: 4px; overflow: hidden; vertical-align: middle; }
.meter .fill { display: block; height: 100%; background: var(--akzent); }
.kv th { text-align: left; font-weight: 500; color: var(--muted); padding: 4px 18px 4px 0; vertical-align: top; }
.kv td { padding: 4px 0; }
.login { max-width: 360px; margin: 10vh auto; background: #fff; padding: 28px; border-radius: 3px; }
.login h1 { font-weight: 400; margin: 0 0 16px; }
.login input { padding: 10px; border: 1px solid var(--line); border-radius: 3px; }
@media (max-width: 640px) { .topbar { gap: 10px; } .meter { width: 80px; } }
.meter .w0 { width: 0%; }
.meter .w5 { width: 5%; }
.meter .w10 { width: 10%; }
.meter .w15 { width: 15%; }
.meter .w20 { width: 20%; }
.meter .w25 { width: 25%; }
.meter .w30 { width: 30%; }
.meter .w35 { width: 35%; }
.meter .w40 { width: 40%; }
.meter .w45 { width: 45%; }
.meter .w50 { width: 50%; }
.meter .w55 { width: 55%; }
.meter .w60 { width: 60%; }
.meter .w65 { width: 65%; }
.meter .w70 { width: 70%; }
.meter .w75 { width: 75%; }
.meter .w80 { width: 80%; }
.meter .w85 { width: 85%; }
.meter .w90 { width: 90%; }
.meter .w95 { width: 95%; }
.meter .w100 { width: 100%; }
.portal-link { color: #cfd6df; font-size: .9rem; }
body.admin .msg.ok { background: #e7f5ee; color: #155c3a; border-left: 4px solid #2f9e66; }
.settings .field { display: grid; grid-template-columns: minmax(180px, 320px) 1fr; gap: 6px 20px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.settings .field > label { padding-top: 7px; color: #3a4757; font-size: .93rem; text-align: right; }
.settings input:not([type=checkbox]):not([type=color]), .settings textarea, .settings select { width: 100%; max-width: 720px; padding: 7px 9px; border: 1px solid #c9d0da; border-radius: 3px; font: inherit; background: #fff; }
.settings textarea { resize: vertical; line-height: 1.45; }
.settings input.short { max-width: 140px; text-align: right; }
.colorrow { display: inline-flex; gap: 10px; align-items: center; }
.colorrow input { width: 48px; height: 32px; padding: 0; border: 1px solid #c9d0da; }
.reset, .inline-check { display: block; font-size: .82rem; color: var(--muted); margin-top: 4px; }
.inline-check { font-size: .93rem; color: var(--text); margin-top: 7px; }
.hint { color: var(--muted); font-size: .88rem; margin: 0 0 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row input[type=tel] { padding: 7px 9px; border: 1px solid #c9d0da; border-radius: 3px; }
.logo-preview { background: #111; display: inline-block; padding: 14px 18px; border-radius: 3px; margin-bottom: 10px; }
.logo-preview img { max-height: 90px; max-width: 280px; display: block; }
@media (max-width: 720px) { .settings .field { grid-template-columns: 1fr; } .settings .field > label { text-align: left; padding-top: 0; } }
.grid tr.inactive td { color: #9aa3ad; }
.grid tr.env td { color: var(--muted); font-style: italic; }
.map { height: 520px; border-radius: 3px; background: #e8ecf1; }
.map.setzen, .map.setzen .leaflet-interactive { cursor: crosshair; }
.nowrap { white-space: nowrap; }
.grid button.link:disabled { color: inherit; text-decoration: none; cursor: default; }
@media (max-width: 720px) { .map { height: 380px; } }
.langs { display: flex; justify-content: flex-end; gap: 4px; margin: -12px -6px 10px 0; font-size: .82rem; }
.langs a, .langs span { padding: 3px 6px; border-radius: 3px; color: #bbb; text-decoration: none; }
.langs a:hover, .langs a:focus { color: #fff; background: rgba(255,255,255,.12); }
.langs span { color: #fff; font-weight: 600; border: 1px solid rgba(255,255,255,.35); }
