/* Kontarelo Status – Brillenauftrag-Stil aus Cardeluna, Akzent Tiefblau */
@font-face { font-family: "Roboto"; src: url("/static/fonts/Roboto.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/static/fonts/Manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --akzent: #1F4E8C; --akzent-dunkel: #183e70; --akzent-flaeche: #e9eef5; --akzent-schrift: #fff;
  --rand: #e8e8ee; --leiste: #f4f4f8; --kopf: #fafafa; --grau: #888; --text: #222;
  --rot: #c62828; --gelb: #e0a100; --gruen: #2e7d32;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 12px/1.4 "Roboto", system-ui, sans-serif; color: var(--text); background: #f6f6f9; }
a { color: var(--akzent); }

/* ── Rahmen der App ───────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }
.menue { width: 220px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--rand);
  font-family: "Manrope", "Roboto", sans-serif; display: flex; flex-direction: column; padding: 1rem 0.75rem; gap: 0.9rem;
  position: sticky; top: 0; height: 100vh; }
.marke { display: flex; align-items: baseline; gap: 0.4rem; padding: 0 0.4rem; }
.marke b { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; color: var(--akzent); }
.marke span { font-size: 0.7rem; font-weight: 600; color: var(--grau); text-transform: uppercase; letter-spacing: 0.08em; }
.karte { display: flex; align-items: center; gap: 0.55rem; padding: 0.5rem; border: 1px solid var(--rand); border-radius: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--akzent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 0.75rem; }
.karte .wer { font-weight: 700; font-size: 0.8rem; }
.karte .rolle { font-size: 0.65rem; color: var(--grau); }
.gruppe { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #9a9aa6; padding: 0 0.5rem; margin-bottom: 0.2rem; }
.menue nav { display: flex; flex-direction: column; gap: 2px; }
.menue nav a { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.55rem; border-radius: 6px; text-decoration: none; color: #333; font-size: 0.82rem; font-weight: 600; }
.menue nav a:hover { background: var(--leiste); }
.menue nav a.aktiv { background: var(--akzent-flaeche); color: var(--akzent); }
.menue nav a .punkt { width: 6px; height: 6px; border-radius: 50%; background: #c9c9d3; }
.menue nav a.aktiv .punkt { background: var(--akzent); }
.fuss { margin-top: auto; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.65rem; color: var(--grau); padding: 0 0.4rem; }
.fuss form { margin: 0; }

.inhalt { flex: 1; min-width: 0; padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.kopf { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.kopf h1 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.kopf .rechts { margin-left: auto; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }

/* ── Blöcke, Felder, Knöpfe ───────────────────────────────────────── */
.rahmen { background: #fff; border: 1px solid var(--rand); border-radius: 6px; overflow: hidden; }
.titel { background: var(--leiste); padding: 0.3rem 0.7rem; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #555; border-bottom: 1px solid var(--rand); display: flex; align-items: center; gap: 0.5rem; }
.titel .rechts { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.koerper { padding: 0.7rem; display: flex; flex-direction: column; gap: 0.6rem; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; align-items: start; }
label.lbl, .lbl { display: block; font-size: 0.6rem; color: var(--grau); margin-bottom: 2px; }
input[type=text], input[type=password], textarea, select { height: 26px; border: 1px solid #ccc; border-radius: 4px; padding: 0 6px; font: inherit; font-size: 0.75rem; background: #fff; width: 100%; }
textarea { height: auto; min-height: 52px; padding: 4px 6px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--akzent-flaeche); border-color: var(--akzent); }
.knopf { height: 26px; padding: 0 0.7rem; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; font: inherit; font-size: 0.75rem; color: #333; white-space: nowrap; display: inline-flex; align-items: center; text-decoration: none; }
.knopf:hover { background: var(--leiste); }
.knopf.haupt { background: var(--akzent); color: var(--akzent-schrift); border: none; font-weight: 600; }
.knopf.haupt:hover { background: var(--akzent-dunkel); }
.knopf.klein { height: 22px; padding: 0 0.45rem; font-size: 0.68rem; }
.knopf.gefahr { color: var(--rot); }
.knopf:disabled { opacity: 0.5; cursor: default; }
.link { background: none; border: none; padding: 0; color: var(--akzent); cursor: pointer; font: inherit; font-size: 0.65rem; text-decoration: underline; }

/* ── Tabellen ─────────────────────────────────────────────────────── */
table.tab { width: 100%; border-collapse: collapse; }
.tab th { text-align: left; font-size: 0.6rem; color: #666; font-weight: 600; padding: 0.35rem 0.5rem; background: var(--kopf); border-bottom: 1px solid var(--rand); white-space: nowrap; }
.tab td { font-size: 0.75rem; padding: 0.3rem 0.5rem; vertical-align: middle; border-bottom: 1px solid #f0f0f4; }
.tab tr:last-child td { border-bottom: none; }
.tab .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tab .grau, .grau { color: var(--grau); }
.tab .klein { font-size: 0.65rem; }
.leer { padding: 0.8rem; color: var(--grau); font-size: 0.78rem; margin: 0; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.68rem; }

/* ── Hinweise, Ampeln, Chips ──────────────────────────────────────── */
.box { border-radius: 6px; padding: 0.4rem 0.7rem; font-size: 0.75rem; }
.box.info { background: #fffbe6; border: 1px solid #f0e2a0; color: #6b5900; }
.box.fehler { background: #fff3f3; border: 1px solid #f1c0c0; color: #a33; }
.box.ok { background: #eef8f0; border: 1px solid #c8e6c9; color: #2e6b34; }
.meldung { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.7rem; border-bottom: 1px solid #f0f0f4; font-size: 0.75rem; }
.meldung:last-child { border-bottom: none; }
.ampel { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: #c9c9d3; }
.ampel.rot { background: var(--rot); } .ampel.gelb { background: var(--gelb); } .ampel.gruen { background: var(--gruen); }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--rand); background: #fff; border-radius: 12px; padding: 1px 9px; font-size: 0.7rem; color: #555; }
.chip b { color: var(--text); }
.pille { border-radius: 3px; padding: 1px 6px; font-size: 0.68rem; white-space: nowrap; display: inline-block; background: var(--leiste); color: #555; }
.pille.gruen { background: #e7f4e8; color: #2e6b34; } .pille.gelb { background: #fff4d6; color: #7a5a00; }

/* ── Anmeldung ────────────────────────────────────────────────────── */
.anmelde-seite { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.anmelde-karte { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 0.9rem; align-items: stretch; }
.anmelde-karte .marke { justify-content: center; font-family: "Manrope", sans-serif; }
.anmelde-karte .marke b { font-size: 1.8rem; }
.anmelde-karte form { display: flex; flex-direction: column; gap: 0.6rem; }
.anmelde-karte input { height: 34px; font-size: 0.85rem; }
.anmelde-karte .knopf { height: 34px; justify-content: center; font-size: 0.85rem; }

/* ── Upload ───────────────────────────────────────────────────────── */
.ablage { border: 2px dashed #cfd6e2; border-radius: 6px; padding: 1.2rem; text-align: center; color: #666; cursor: pointer; font-size: 0.78rem; }
.ablage.drueber { border-color: var(--akzent); background: var(--akzent-flaeche); }
.balken { height: 6px; background: var(--leiste); border-radius: 3px; overflow: hidden; }
.balken > div { height: 100%; width: 0; background: var(--akzent); transition: width 0.2s; }
.versteckt { display: none !important; }

/* ── Handy ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { font-size: 13px; }
  .app { flex-direction: column; }
  .menue { width: auto; height: auto; position: static; flex-direction: row; align-items: center; padding: 0.5rem 16px; gap: 0.6rem; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--rand); }
  .menue .karte, .menue .gruppe, .fuss .ver { display: none; }
  .menue nav { flex-direction: row; }
  .fuss { margin: 0 0 0 auto; }
  .inhalt { padding: 0.8rem 16px; }
  .zwei { grid-template-columns: 1fr; }
  .tabelle-scroll { overflow-x: auto; }
  input[type=text], input[type=password], textarea, select { font-size: 16px; }
}
.unterzeile { text-align: center; font-size: 0.65rem; }
.dialog-hg { position: fixed; inset: 0; background: rgba(20, 24, 40, 0.35); display: grid; place-items: center; z-index: 100; padding: 16px; }
.dialog { width: 100%; max-width: 380px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.dialog-text { font-size: 0.8rem; }
.dialog-knoepfe { display: flex; justify-content: flex-end; gap: 0.4rem; }
tr.inst { cursor: pointer; }
tr.inst:hover td { background: #fafbfd; }
tr.inst.offen td { background: var(--akzent-flaeche); }
tr.detail > td { background: #fcfcfe; border-bottom: 1px solid var(--rand); }
.detail-raster { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.3rem 0; }
.werte { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.4rem 0.8rem; }
.werte .lbl { margin-bottom: 0; }
.detail-meldungen { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.72rem; }
.zeile-form { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.zeile-form > div { min-width: 180px; }
.zeile-form .breit { flex: 1; }
.aktionen { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.aktionen form { margin: 0; display: flex; gap: 0.3rem; align-items: center; }
.aktionen .entfernen { margin-left: auto; }
.aktionen .entfernen input { width: 220px; height: 22px; font-size: 0.68rem; }
.meldung-domain { font-weight: 600; text-decoration: none; }
.klein-text { font-size: 0.75rem; } .klein-text p { margin: 0; }
.knopfreihe { display: flex; gap: 0.4rem; }
