/* LenkZentrale – Design nach jelivo.de: tiefes Navy, Cyan und Blau als Akzent, feine Linien */
:root {
  --bg: #02060a; --bg2: #06101a; --panel: #07131f; --panel2: #0b1a29; --hover: #0f2234;
  --text: #f4f8fb; --muted: #8394a2; --faint: #5b6b78;
  --cyan: #00cfff; --blue: #087cff; --line: rgba(142, 205, 235, .13); --line2: rgba(73, 201, 255, .28);
  --ok: #2fd08a; --warn: #ffb547; --bad: #ff5d6c;
  --r: 12px; --r-sm: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --stunde: 56px; /* Höhe einer Stunde im Kalender */
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); }
.laden { display: grid; place-items: center; height: 100vh; color: var(--muted); }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.muted { color: var(--muted); } .klein { font-size: 13px; } .mono { font-family: var(--mono); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }

/* ---------- Grundgerüst ---------- */
.shell { display: grid; grid-template-columns: 228px 1fr; height: 100vh; }
.nav { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px; gap: 4px; }
.marke { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.marke img { width: 32px; height: 32px; }
.marke b { font-size: 16px; letter-spacing: -.01em; }
.marke small { display: block; color: var(--muted); font-size: 11px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: var(--r-sm); color: var(--muted); cursor: pointer; text-align: left; }
.nav button:hover { background: var(--hover); color: var(--text); }
.nav button.aktiv { background: linear-gradient(90deg, rgba(0, 207, 255, .14), rgba(8, 124, 255, .04)); color: var(--text); box-shadow: inset 2px 0 0 var(--cyan); }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav .zahl { margin-left: auto; background: var(--warn); color: #241400; font-size: 11px; font-weight: 600; border-radius: 99px; padding: 0 7px; }
.nav .fuss { margin-top: auto; padding: 10px 8px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sync-punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; }
.sync-punkt.ok { background: var(--ok); } .sync-punkt.laeuft { background: var(--cyan); } .sync-punkt.fehler { background: var(--bad); }
main { overflow: auto; padding: 22px 28px 60px; }
.kopf { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.kopf h1 { margin-right: auto; }

/* ---------- Bausteine ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line2); background: var(--panel); color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primaer { background: linear-gradient(135deg, var(--cyan), var(--blue)); border: 0; color: #00131d; font-weight: 600; }
.btn.primaer:hover { filter: brightness(1.08); }
.btn.gefahr { border-color: rgba(255, 93, 108, .45); color: var(--bad); }
.btn.klein { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn.icon { padding: 6px 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.gruppe { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r-sm); overflow: hidden; }
.gruppe button { border: 0; background: var(--panel); padding: 7px 12px; cursor: pointer; color: var(--muted); }
.gruppe button.aktiv { background: var(--hover); color: var(--text); }
.karte { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.karte + .karte { margin-top: 14px; }
.karte h2 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.karte h2 .btn { margin-left: auto; }
.raster { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.zwei { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kachel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; cursor: pointer; transition: border-color .15s; }
.kachel:hover { border-color: var(--line2); }
.kachel .zeile { display: flex; align-items: center; gap: 10px; }
.punkt { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 99px; font-size: 12px; border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: rgba(47, 208, 138, .4); }
.chip.warn { color: var(--warn); border-color: rgba(255, 181, 71, .45); }
.chip.bad { color: var(--bad); border-color: rgba(255, 93, 108, .45); }
.chip.info { color: var(--cyan); border-color: rgba(0, 207, 255, .4); }
.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.zahl-kachel { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.zahl-kachel span { display: block; font-size: 12px; color: var(--muted); }
.zahl-kachel b { font-size: 22px; font-weight: 600; }
.leer { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--r); }
.hinweis { border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; border: 1px solid var(--line2); background: rgba(0, 207, 255, .06); }
.hinweis.warn { border-color: rgba(255, 181, 71, .5); background: rgba(255, 181, 71, .08); }
.hinweis.bad { border-color: rgba(255, 93, 108, .5); background: rgba(255, 93, 108, .08); }
.hinweis + .hinweis { margin-top: 8px; }
.suche { min-width: 220px; }
table.liste { width: 100%; border-collapse: collapse; font-size: 14px; }
table.liste th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.liste td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.liste tr.klickbar { cursor: pointer; } table.liste tr.klickbar:hover td { background: var(--hover); }
td.betrag, th.betrag { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fortschritt { height: 8px; background: var(--bg2); border-radius: 99px; overflow: hidden; }
.fortschritt > div { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--blue)); }

/* ---------- Formulare ---------- */
label.feld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 8px 10px; min-height: 38px; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(0, 207, 255, .5); outline-offset: 0; border-color: var(--cyan); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--cyan); }
input[type=color] { padding: 2px; height: 38px; }
textarea { min-height: 80px; resize: vertical; }
.formular { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.formular .voll { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.preistabelle input { min-width: 70px; text-align: right; padding: 6px 8px; min-height: 32px; }
.preistabelle td, .preistabelle th { padding: 4px 6px; }

/* ---------- Dialog ---------- */
dialog { border: 1px solid var(--line2); border-radius: 16px; background: var(--panel); color: var(--text); padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 90px rgba(0, 0, 0, .55); }
dialog::backdrop { background: rgba(1, 4, 8, .72); backdrop-filter: blur(3px); }
dialog.breit { width: min(860px, calc(100vw - 24px)); }
.dlg-kopf { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 1; }
.dlg-kopf h2 { margin-right: auto; }
.dlg-inhalt { padding: 18px 20px; }
.dlg-fuss { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }
.dlg-fuss .links { margin-right: auto; }
.x { border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; padding: 4px 8px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; transition: .2s; background: var(--panel2); border: 1px solid var(--line2); padding: 10px 16px; border-radius: 10px; z-index: 100; max-width: calc(100vw - 32px); }
#toast.sichtbar { opacity: 1; transform: translateX(-50%); }
#toast.warn { border-color: var(--warn); } #toast.bad { border-color: var(--bad); }

/* ---------- Unterschrift ---------- */
.unterschrift { position: relative; border: 1px solid var(--line2); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.unterschrift canvas { display: block; width: 100%; height: 170px; touch-action: none; cursor: crosshair; }
.unterschrift .linie { position: absolute; left: 16px; right: 16px; bottom: 34px; border-top: 1px dashed #b8c4ce; pointer-events: none; }
.unterschrift .platzhalter { position: absolute; left: 16px; bottom: 10px; font-size: 12px; color: #8a96a1; pointer-events: none; }
.unterschrift .weg { position: absolute; right: 8px; top: 8px; background: #eef3f7; color: #1b2b3a; border: 0; border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.unterschriften { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.stundenwahl label { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.stundenwahl label:last-child { border-bottom: 0; }
.themen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.themen button { cursor: pointer; background: var(--bg2); }
.themen button:hover { color: var(--text); border-color: var(--cyan); }
@media (max-width: 820px) { .unterschriften { grid-template-columns: 1fr; } }

/* ---------- Kalender ---------- */
.kal-leiste { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.kal-leiste .titel { font-weight: 600; font-size: 17px; margin-right: auto; min-width: 200px; }
.kal-leiste select { width: auto; min-width: 170px; }
.kal { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); overflow: auto; max-height: calc(100vh - 170px); }
.kal-grid { display: grid; min-width: 100%; position: relative; }
.kal-kopf { position: sticky; top: 0; z-index: 3; background: var(--panel2); border-bottom: 1px solid var(--line); padding: 8px 6px; font-size: 13px; text-align: center; min-height: 52px; }
.kal-kopf b { display: block; font-size: 14px; }
.kal-kopf.heute b { color: var(--cyan); }
.kal-kopf .punkt { display: inline-block; width: 9px; height: 9px; margin-right: 4px; }
.kal-ecke { position: sticky; top: 0; left: 0; z-index: 4; background: var(--panel2); border-bottom: 1px solid var(--line); }
.kal-zeiten { position: sticky; left: 0; z-index: 2; background: var(--panel); border-right: 1px solid var(--line); }
.kal-zeiten div { height: var(--stunde); font-size: 11px; color: var(--faint); text-align: right; padding: 0 6px; transform: translateY(-7px); font-family: var(--mono); }
.kal-spalte { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--stunde) - 1px), var(--line) calc(var(--stunde) - 1px), var(--line) var(--stunde)); cursor: copy; }
.kal-spalte.heute { background-color: rgba(0, 207, 255, .025); }
.jetzt { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.termin { position: absolute; border-radius: 7px; padding: 3px 6px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer; border: 1px solid; z-index: 1; }
.termin:hover { z-index: 5; filter: brightness(1.15); }
.termin b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.termin span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.termin.abgesagt { opacity: .45; text-decoration: line-through; }
.termin.durchgefuehrt::after { content: "✓"; position: absolute; right: 5px; top: 2px; font-weight: 700; }
.termin.unterschrieben::after { content: "✓✓"; }
.termin.blocker { background: repeating-linear-gradient(135deg, rgba(131, 148, 162, .18) 0 6px, rgba(131, 148, 162, .08) 6px 12px) !important; border-color: var(--faint) !important; color: var(--muted) !important; }
/* Ansicht-Umschalter oben rechts */
.kal-leiste { position: relative; padding-right: 112px; }
.kal-leiste > .ansicht-wahl { position: absolute; right: 0; top: 4px; }
#ansichtBtn svg { width: 16px; height: 16px; }
.ansicht-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 270px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); padding: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.ansicht-menu[hidden] { display: none; }
.ansicht-menu > button { display: block; width: 100%; text-align: left; border: 0; background: none; border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; color: var(--text); }
.ansicht-menu > button small { display: block; color: var(--muted); font-size: 12px; }
.ansicht-menu > button:hover { background: var(--hover); }
.ansicht-menu > button.aktiv { background: rgba(0, 207, 255, .12); box-shadow: inset 2px 0 0 var(--cyan); }
.ansicht-menu .trenner { height: 1px; background: var(--line); margin: 6px 4px 8px; }
.ansicht-menu .feld { padding: 0 6px 6px; }

/* Monatsansicht */
.monat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--panel); margin-bottom: 14px; }
.monat .wt { background: var(--panel2); padding: 8px 6px; font-size: 12px; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.mtag { min-height: 108px; padding: 4px 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; min-width: 0; transition: background .12s; }
.mtag:nth-child(7n + 7) { border-right: 0; }
.mtag:hover { background: var(--hover); }
.mtag.fremd { background: rgba(2, 6, 10, .35); }
.mtag.fremd .nr { color: var(--faint); }
.mtag .nr { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 99px; font-size: 13px; margin-bottom: 2px; }
.mtag.heute .nr { background: linear-gradient(135deg, var(--cyan), var(--blue)); color: #00131d; font-weight: 700; }
.mtag.gewaehlt { box-shadow: inset 0 0 0 2px var(--cyan); }
.mtag .e { font-size: 11.5px; line-height: 1.35; padding: 1px 5px; margin-top: 2px; border-left: 3px solid; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e6f4ff; }
.mtag .e:hover { filter: brightness(1.25); }
.mtag .e.abgesagt { text-decoration: line-through; opacity: .5; }
.mtag .mehr { font-size: 11px; color: var(--muted); margin-top: 2px; padding-left: 4px; }
.mtag .punkte { display: none; gap: 3px; flex-wrap: wrap; padding: 2px 2px 0; }
.mtag .punkte i { width: 6px; height: 6px; border-radius: 50%; }
.tagesliste h2 { flex-wrap: wrap; }
.tagesliste .agenda .eintrag:last-child { margin-bottom: 0; }

.agenda .tag { margin-bottom: 14px; }
.agenda .tag h3 { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.agenda .eintrag { display: flex; gap: 10px; align-items: stretch; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; margin-bottom: 6px; }
.agenda .eintrag .balken { width: 4px; border-radius: 4px; flex: none; }
.agenda .eintrag span { display: block; color: var(--muted); font-size: 13px; }
.agenda .zeit { font-family: var(--mono); font-size: 13px; min-width: 92px; color: var(--muted); }

/* ---------- Start / Anmeldung ---------- */
.start { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1000px 500px at 80% -10%, rgba(8, 124, 255, .18), transparent 60%), radial-gradient(700px 400px at 0% 110%, rgba(0, 207, 255, .1), transparent 60%), var(--bg); }
.start .box { width: min(460px, 100%); }
.start .logo-gross { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.start .logo-gross img { width: 52px; height: 52px; }
.start .logo-gross b { font-size: 26px; letter-spacing: -.02em; }
.start .logo-gross small { display: block; color: var(--muted); }
.start .karte { padding: 22px; }
.start form { display: grid; gap: 12px; }
.start .wechsel { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.link { background: none; border: 0; color: var(--cyan); cursor: pointer; padding: 4px; }

/* ---------- Mobil ---------- */
.mobil-nav { display: none; }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .nav { display: none; }
  main { padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); }
  .mobil-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--bg2); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mobil-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; color: var(--muted); font-size: 11px; padding: 4px 0; }
  .mobil-nav button.aktiv { color: var(--cyan); }
  .mobil-nav svg { width: 22px; height: 22px; }
  .zwei, .formular { grid-template-columns: 1fr; }
  .kal { max-height: none; }
  .kal-leiste .titel { min-width: 0; width: 100%; order: -1; }
  .mtag { min-height: 58px; padding: 3px; }
  .mtag .e, .mtag .mehr { display: none; }
  .mtag .punkte { display: flex; }
  .mtag .nr { font-size: 12px; min-width: 22px; height: 22px; }
  .suche { min-width: 0; width: 100%; }
  input, select, textarea { font-size: 16px; }
  dialog { max-height: calc(100dvh - 16px); }
}
