:root {
  --bg: #0f1218; --flaeche: #171b24; --flaeche2: #1e2330; --rand: #2a3040; --text: #e6e9ef; --leise: #8b93a7;
  --akzent: #4f8cff; --akzent2: #3b74e0; --gut: #2fbf71; --warn: #f0b429; --schlecht: #ef4d5a; --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 Inter, "Segoe UI", system-ui, sans-serif; }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }
.leise { color: var(--leise); }
.klein { font-size: 12px; }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }
.laden { display: grid; place-items: center; height: 100vh; color: var(--leise); }

/* Layout */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
aside { background: var(--flaeche); border-right: 1px solid var(--rand); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.marke { padding: 18px 20px; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--rand); }
.marke .logo { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--akzent), #8b5cf6); display: grid; place-items: center; font-size: 15px; }
nav { flex: 1; padding: 10px; overflow-y: auto; min-height: 0; }
nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); margin-bottom: 2px; }
nav a:hover { background: var(--flaeche2); text-decoration: none; }
nav a.aktiv { background: rgba(79, 140, 255, .15); color: #fff; box-shadow: inset 3px 0 0 var(--akzent); }
nav .gruppe { color: var(--leise); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; }
.ich { border-top: 1px solid var(--rand); padding: 12px 16px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.ich .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding: 28px 32px; min-width: 0; }
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.menue-knopf { display: none; }

/* Karten */
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 20px; }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 18px; }
.karte .wert { font-size: 26px; font-weight: 700; margin-top: 4px; }
.karte .titel { color: var(--leise); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.balken { height: 6px; background: var(--flaeche2); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.balken > div { height: 100%; background: var(--akzent); }
.abschnitt { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }

/* Tabellen */
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--leise); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--rand); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--rand); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.aktionen { text-align: right; white-space: nowrap; }
.umbruch { word-break: break-all; }

/* Marken */
.marke-k { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--flaeche2); color: var(--leise); white-space: nowrap; }
.marke-k.gut { background: rgba(47, 191, 113, .15); color: var(--gut); }
.marke-k.warn { background: rgba(240, 180, 41, .15); color: var(--warn); }
.marke-k.schlecht { background: rgba(239, 77, 90, .15); color: var(--schlecht); }
.marke-k.blau { background: rgba(79, 140, 255, .15); color: var(--akzent); }
.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--leise); }
.punkt.gut { background: var(--gut); } .punkt.schlecht { background: var(--schlecht); } .punkt.warn { background: var(--warn); }

/* Formulare */
.knopf { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rand); background: var(--flaeche2); color: var(--text); padding: 7px 13px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.knopf:hover { border-color: #3a4256; }
.knopf.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.knopf.haupt:hover { background: var(--akzent2); }
.knopf.gefahr { color: var(--schlecht); }
.knopf.gefahr.voll { background: var(--schlecht); border-color: var(--schlecht); color: #fff; }
.knopf.klein { padding: 4px 9px; font-size: 12.5px; }
.knopf:disabled { opacity: .5; cursor: not-allowed; }
.knopf.icon { padding: 6px 8px; }
label { display: block; margin-bottom: 14px; }
label > span { display: block; color: var(--leise); font-size: 12.5px; margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], input[type=url], select { width: 100%; background: var(--bg); border: 1px solid var(--rand); color: var(--text); border-radius: 8px; padding: 9px 11px; font: inherit; }
input:focus, select:focus { outline: none; border-color: var(--akzent); }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.check input { width: 16px; height: 16px; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.wahl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.wahl button { text-align: left; background: var(--bg); border: 1px solid var(--rand); border-radius: 10px; padding: 12px; color: var(--text); font: inherit; cursor: pointer; }
.wahl button b { display: block; margin-bottom: 3px; }
.wahl button small { color: var(--leise); }
.wahl button.aktiv { border-color: var(--akzent); background: rgba(79, 140, 255, .1); }
.hinweis { background: var(--flaeche2); border-left: 3px solid var(--akzent); padding: 10px 12px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.hinweis.warn { border-left-color: var(--warn); }
.hinweis.schlecht { border-left-color: var(--schlecht); }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 30% 20%, rgba(79, 140, 255, .15), transparent 50%), radial-gradient(circle at 80% 80%, rgba(139, 92, 246, .12), transparent 50%), var(--bg); }
.login-box { width: 100%; max-width: 380px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 14px; padding: 28px; }
.login-box .marke { border: 0; padding: 0 0 18px; font-size: 18px; }
.login-box .knopf { width: 100%; justify-content: center; padding: 10px; }
.trenner { text-align: center; color: var(--leise); margin: 16px 0; font-size: 12px; position: relative; }
.trenner::before, .trenner::after { content: ""; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--rand); }
.trenner::before { left: 0; } .trenner::after { right: 0; }
.discord { background: #5865f2 !important; border-color: #5865f2 !important; color: #fff !important; }
.code-eingabe { font-size: 22px !important; letter-spacing: .4em; text-align: center; }
.qr { background: #fff; padding: 10px; border-radius: 10px; width: fit-content; margin: 0 auto 12px; }
.qr img, .qr svg { display: block; }

/* Dialog, Meldungen, Protokoll */
.dialog { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; z-index: 50; }
.dialog.versteckt { display: none; }
.dialog-box { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 14px; padding: 22px; }
.dialog-fuss { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
#meldungen { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.meldung { background: var(--flaeche2); border: 1px solid var(--rand); border-left: 3px solid var(--gut); padding: 10px 14px; border-radius: 8px; max-width: 360px; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); }
.meldung.fehler { border-left-color: var(--schlecht); }
.protokoll { background: #0a0c10; border: 1px solid var(--rand); border-radius: 8px; padding: 12px; font-family: Consolas, monospace; font-size: 12.5px; max-height: 320px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.geheim { background: var(--bg); border: 1px dashed var(--rand); border-radius: 8px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.leer { text-align: center; color: var(--leise); padding: 30px; }

/* Handy */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  aside { position: fixed; left: 0; top: 0; width: 260px; height: 100dvh; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  aside.offen { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .6); }
  main { padding: 18px 16px; }
  .menue-knopf { display: inline-flex; }
  .zwei, .wahl { grid-template-columns: 1fr; }
  .nur-breit { display: none; }
}
