/* joerki Büro. Ruhige Arbeitsfläche: Seitenleiste am großen Bildschirm (Docking), Leiste oben am Handy.
   Keine fremden Schriften, alles vom eigenen Server. */
:root {
  --bg: #f3f5f7; --flaeche: #ffffff; --linie: #dbe1e8; --text: #15202c; --leise: #5b6877;
  --akzent: #1f5f8b; --akzent-hell: #e2edf6; --auf-akzent: #ffffff;
  --gut: #2e7a4d; --gut-hell: #e0f0e6; --warn: #a35f00; --warn-hell: #fbeed8; --rot: #b42318; --rot-hell: #fde8e6;
  --ruhe: #6b7684; --ruhe-hell: #eceff3;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151c; --flaeche: #17202a; --linie: #2a3644; --text: #e5ecf2; --leise: #97a5b5;
    --akzent: #72b2de; --akzent-hell: #1b3245; --auf-akzent: #0f151c;
    --gut: #6cc690; --gut-hell: #173223; --warn: #f0b35a; --warn-hell: #3a2a12; --rot: #ff8a7f; --rot-hell: #3b1917;
    --ruhe: #9aa5b2; --ruhe-hell: #222c37; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--schrift); -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.05rem; margin-top: 8px; }
p { margin: 0; }
a { color: var(--akzent); }
.leise { color: var(--leise); }
.text { max-width: 65ch; }
.marke { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; margin: 0; }
.marke span { font-weight: 500; color: var(--akzent); }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Eingaben und Knöpfe */
label { font-size: .88rem; font-weight: 600; color: var(--leise); }
input, select { font: inherit; color: var(--text); background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
button, .knopf { font: inherit; font-weight: 600; border: 0; border-radius: 8px; padding: 10px 16px; min-height: 44px; cursor: pointer; background: var(--akzent); color: var(--auf-akzent); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button.schlicht, .knopf.schlicht { background: var(--akzent-hell); color: var(--akzent); }
button.warn { background: var(--rot); color: #fff; }
button:disabled { opacity: .55; cursor: default; }
code.kopier { font-family: var(--mono); background: var(--ruhe-hell); padding: 6px 8px; border-radius: 6px; display: block; overflow-wrap: anywhere; user-select: all; }
.fehler { color: var(--rot); background: var(--rot-hell); padding: 10px 12px; border-radius: 8px; }
.info { background: var(--akzent-hell); padding: 10px 12px; border-radius: 8px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.leer { color: var(--leise); }
.zeile { display: flex; gap: 8px; flex-wrap: wrap; }
.zeile input { flex: 1 1 220px; width: auto; }

/* Anmelden */
.tor { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.tor-karte { width: 100%; max-width: 400px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.tor-karte form { display: flex; flex-direction: column; gap: 8px; }
.tor-karte form button { margin-top: 8px; }
.tor-karte img { align-self: center; border-radius: 8px; background: #fff; padding: 8px; max-width: 100%; height: auto; }
details summary { cursor: pointer; color: var(--akzent); font-weight: 600; }

/* Büro: Handy zuerst */
.buero { min-height: 100vh; display: grid; grid-template-rows: auto auto 1fr; }
.kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 5; }
.kopf button { min-height: 36px; padding: 6px 12px; }
.nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); background: var(--flaeche); border-bottom: 1px solid var(--linie); scrollbar-width: none; }
.nav a, .nav .bald { white-space: nowrap; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 600; }
.nav a.aktiv { background: var(--akzent-hell); color: var(--akzent); }
.nav .bald { color: var(--leise); font-weight: 500; opacity: .7; }
.inhalt { padding: 20px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); width: 100%; max-width: 1180px; margin: 0 auto; min-width: 0; }
.sicht { display: flex; flex-direction: column; gap: 16px; }

/* Großer Bildschirm (Handy an der Docking-Station, PC) */
@media (min-width: 900px) {
  .buero { grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; }
  .kopf { grid-column: 1 / -1; }
  .nav { flex-direction: column; border-bottom: 0; border-right: 1px solid var(--linie); padding: 16px 12px; overflow: visible; }
  .nav a, .nav .bald { padding: 10px 12px; }
  .inhalt { padding: 28px 32px 48px; }
  h1 { font-size: 1.7rem; }
}

/* Lage */
.jetzt { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.jetzt-kopf { display: flex; align-items: center; gap: 10px; }
.jetzt-text { font-size: 1.05rem; }
.puls { width: 12px; height: 12px; border-radius: 50%; background: var(--ruhe); flex: none; }
.puls.an { background: var(--gut); animation: puls 1.8s infinite; }
@keyframes puls { 0% { box-shadow: 0 0 0 0 var(--gut-hell); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .puls.an { animation: none; } }
.spalten { display: grid; gap: 20px; }
@media (min-width: 1100px) { .spalten { grid-template-columns: 3fr 2fr; } }
.spalte { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.zahl { font-size: .8rem; background: var(--warn-hell); color: var(--warn); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.zahl:empty { display: none; }
.liste { list-style: none; margin: 0; padding: 0; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); }
.liste > li { padding: 12px 14px; border-top: 1px solid var(--linie); }
.liste > li:first-child { border-top: 0; }
.aufgabe, .dok { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.aufgabe > div, .dok > div:first-child { display: flex; flex-direction: column; min-width: 0; flex: 1 1 220px; overflow-wrap: anywhere; }
.verlauf { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .92rem; }
.verlauf li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 10px; border-top: 1px solid var(--linie); padding-top: 6px; min-width: 0; }
.verlauf time { color: var(--leise); font-variant-numeric: tabular-nums; font-size: .85rem; }
@media (max-width: 480px) { .verlauf li { grid-template-columns: 1fr; gap: 0; } }
.abteilungen { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.abteilung { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.ab-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pille { font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--ruhe-hell); color: var(--ruhe); white-space: nowrap; }
.arbeitet .pille { background: var(--gut-hell); color: var(--gut); }
.wartet .pille { background: var(--warn-hell); color: var(--warn); }
.abteilung .leise { font-size: .88rem; }

/* Dokumente */
.titelzeile { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.upload select { width: auto; }
.ordner { display: flex; flex-direction: column; gap: 10px; }
.mappe summary { padding: 10px 4px; font-size: 1rem; }
.tasten { display: flex; gap: 6px; flex-wrap: wrap; }
.tasten .knopf, .tasten button { min-height: 38px; padding: 6px 12px; font-size: .9rem; }

/* Rückfrage */
.dialog { position: fixed; inset: 0; background: rgb(0 0 0 / .45); display: grid; place-items: center; padding: 16px; z-index: 20; }
.dialog-karte { background: var(--flaeche); border-radius: 12px; padding: 20px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 16px; }
.dialog-karte .zeile { justify-content: flex-end; }
