/* BMA World: gemeinsames Aussehen für Startseite und Verwaltung.
   Farben und Schrift wie im Lagertool und in der Stundenerfassung (gleiche Werte, Palette „Klar & Ruhig“). */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --fill: #eef0f4; --fill2: #e3e7ed;
  --hair: rgba(24, 32, 43, .10); --hair2: rgba(24, 32, 43, .17);
  --text: #18202b; --text2: #525c69; --text3: #6b7581;
  --accent: #2f62a8; --accent-hover: #285693; --accent-ink: #ffffff; --accent-soft: #e7eef8;
  --ok: #1f7a3d; --ok-soft: #e5f3e9;
  --warn: #9a5b0b; --warn-soft: #fbf0de;
  --err: #c0262d; --err-soft: #fbe8e8;
  --shadow-s: 0 1px 2px rgba(24, 32, 43, .05), 0 1px 1px rgba(24, 32, 43, .03);
  --shadow-m: 0 10px 30px -12px rgba(24, 40, 70, .18), 0 2px 6px rgba(24, 40, 70, .05);
  --shadow-l: 0 24px 60px -20px rgba(24, 40, 70, .30);
  --r-s: 8px; --r: 12px; --r-l: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16191e; --surface: #1e2228; --fill: #272c33; --fill2: #30363e;
    --hair: rgba(255, 255, 255, .08); --hair2: rgba(255, 255, 255, .14);
    --text: #e3e7ec; --text2: #a3acb7; --text3: #838d99;
    --accent: #86a9dd; --accent-hover: #9dbae4; --accent-ink: #16191e; --accent-soft: #24324a;
    --ok: #6fcf8e; --ok-soft: #1c3326; --warn: #e8b46a; --warn-soft: #3a2d18;
    --err: #f08a84; --err-soft: #3d2022;
    --shadow-s: none; --shadow-m: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 30px -12px rgba(0, 0, 0, .6); --shadow-l: 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16191e; --surface: #1e2228; --fill: #272c33; --fill2: #30363e;
  --hair: rgba(255, 255, 255, .08); --hair2: rgba(255, 255, 255, .14);
  --text: #e3e7ec; --text2: #a3acb7; --text3: #838d99;
  --accent: #86a9dd; --accent-hover: #9dbae4; --accent-ink: #16191e; --accent-soft: #24324a;
  --ok: #6fcf8e; --ok-soft: #1c3326; --warn: #e8b46a; --warn-soft: #3a2d18;
  --err: #f08a84; --err-soft: #3d2022;
  --shadow-s: none; --shadow-m: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 30px -12px rgba(0, 0, 0, .6); --shadow-l: 0 24px 60px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-soft); color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.mut { color: var(--text2); }
.klein { font-size: 13px; }
.versteckt { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Marke */
.marke { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.marke img { width: 36px; height: 36px; border-radius: 10px; display: block; }
.marke b { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid transparent;
  background: var(--fill); color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, box-shadow 160ms ease; }
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgba(0, 60, 140, .25), inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn.leise { background: transparent; border-color: var(--hair2); }
.btn.gross { min-height: 52px; font-size: 16px; padding: 0 22px; }
.btn.voll { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--fill2); }
  .btn.pri:hover { background: var(--accent-hover); }
  .btn.leise:hover { background: var(--fill); }
}
.btn .lade { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: dreh 600ms linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* Eingabefelder */
.feld { display: grid; gap: 6px; }
.feld > span { font-size: 13px; font-weight: 600; color: var(--text2); }
.in { width: 100%; min-height: 48px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--hair2); background: var(--surface); color: var(--text); font-size: 16px;
  transition: border-color 160ms ease, box-shadow 160ms ease; }
.in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Hinweise */
.hinweis { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 14px; line-height: 1.45; }
.hinweis .ic { margin-top: 1px; }
.hinweis.fehler { background: var(--err-soft); color: var(--err); }
.hinweis.warn { background: var(--warn-soft); color: var(--warn); }
.hinweis.gut { background: var(--ok-soft); color: var(--ok); }

/* Kopfzeile (angemeldet) */
.kopf { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px;
  padding: 0 max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--hair); }
.kopf .rechts { display: flex; align-items: center; gap: 8px; }
.ich { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  background: var(--accent-soft); color: var(--accent); flex: none; }
.ich .wer { display: grid; line-height: 1.2; }
.ich .wer b { font-size: 14px; }
.ich .wer span { font-size: 12px; color: var(--text2); }
@media (max-width: 560px) { .ich .wer { display: none; } }
.rund { width: 40px; height: 40px; padding: 0; border-radius: 50%; }

.inhalt { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 16px 64px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------- Dialog (Personen, Kennwort ändern …) ---------- */
dialog.dlg { border: 0; padding: 0; border-radius: var(--r-l); background: var(--surface); color: var(--text); box-shadow: var(--shadow-l); width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); }
dialog.dlg::backdrop { background: rgba(10, 15, 25, .38); }
dialog.dlg[open] { animation: dlgEin 220ms var(--ease-out); }
@keyframes dlgEin { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.dlg-k { padding: 22px 22px 4px; } .dlg-k h2 { font-size: 19px; margin: 0; } .dlg-k p { margin: 6px 0 0; color: var(--text2); font-size: 14px; }
.dlg-i { padding: 12px 22px 4px; display: grid; gap: 14px; }
.dlg-f { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; flex-wrap: wrap; }
.btn.gefahr { background: var(--err); color: #fff; }
:root[data-theme="dark"] .btn.gefahr { color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.gefahr { color: var(--bg); } }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (prefers-reduced-motion: reduce) { dialog.dlg[open] { animation: none; } }

/* ---------- Glocke und Zähler ---------- */
.glocke-w { position: relative; }
.glocke { position: relative; }
.zahl { position: absolute; top: -2px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--err); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--bg); font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .zahl { color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .zahl { color: var(--bg); } }
.glocke-panel { position: absolute; right: -8px; top: calc(100% + 10px); width: min(400px, calc(100vw - 24px)); max-height: min(560px, calc(100dvh - 90px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-l); box-shadow: var(--shadow-l);
  transform-origin: top right; animation: gpRein 180ms var(--ease-out); overflow: hidden; z-index: 30; }
@keyframes gpRein { from { opacity: 0; transform: scale(.97) translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .glocke-panel { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; } }
.gp-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px 16px; min-height: 52px; }
.gp-kopf b { font-size: 16px; }
.btn.klein { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.klein .ic { width: 18px; height: 18px; }
.gp-filter { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--hair2); background: none;
  color: var(--text2); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color 150ms ease, color 150ms ease; }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.chip.an { background: var(--text); border-color: var(--text); color: var(--bg); }
.gp-liste { overflow-y: auto; border-top: 1px solid var(--hair); overscroll-behavior: contain; }
.gp-m { display: grid; grid-template-columns: 36px 1fr; gap: 12px; width: 100%; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--hair); background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; position: relative; transition: background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .gp-m:hover { background: var(--fill); } .chip:not(.an):hover { background: var(--fill); } }
.gp-m.neu::after { content: ""; position: absolute; right: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--f); }
.gp-m:not(.neu) { opacity: .72; }
.gp-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--f); background: color-mix(in srgb, var(--f) 14%, transparent); }
.gp-ic svg { width: 20px; height: 20px; }
.gp-t { min-width: 0; padding-right: 16px; }
.gp-wz { display: block; font-size: 12px; font-weight: 600; color: var(--f); }
.gp-t b { display: block; font-weight: 600; margin-top: 1px; }
.gp-t > span:last-child:not(.gp-wz) { display: block; font-size: 13px; color: var(--text2); margin-top: 2px; }
.gp-leer { display: grid; justify-items: center; gap: 6px; padding: 32px 24px; text-align: center; color: var(--text2); }
.gp-leer .ic { width: 32px; height: 32px; color: var(--text3); }
.gp-leer b { color: var(--text); }
.gp-leer span { font-size: 14px; max-width: 30ch; }
.gp-einst { display: grid; gap: 4px; padding: 10px 16px 12px; border-top: 1px solid var(--hair); background: var(--fill); }
.gp-schalter { display: flex; align-items: center; gap: 10px; min-height: 36px; font-size: 14px; cursor: pointer; }
.gp-schalter input { width: 18px; height: 18px; accent-color: var(--accent); }
.wz .bild { position: relative; }
.wz .zahl { top: -6px; right: -6px; box-shadow: 0 0 0 2px var(--surface); }
@media (max-width: 480px) { .kopf .marke b { display: none; } .kopf .rechts { gap: 6px; } }

/* ---------- Unterschrift am Handy ---------- */
.us-feld { position: relative; height: 210px; background: #fff; border: 1px solid var(--hair); border-radius: 12px; overflow: hidden; margin-bottom: 8px; }
.us-feld canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.us-linie { position: absolute; left: 18px; right: 18px; bottom: 26px; border-top: 1px solid #a3abb6; padding-top: 3px; font-size: 12px; color: #6b7280; pointer-events: none; }
.us-liste { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.us-k { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-l); padding: 14px 16px; display: grid; gap: 6px; justify-items: start; }
.us-k small { color: var(--text2); font-size: 12px; font-weight: 600; }
.us-k img { max-width: 100%; height: 70px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px 6px; }
.us-druck { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 34px; break-inside: avoid; }
.us-druck .bild { height: 64px; display: flex; align-items: flex-end; }
.us-druck img { max-height: 64px; max-width: 100%; }
.us-druck .l { border-top: 1px solid #111; padding-top: 4px; font-size: 11.5px; color: #111; }
