/* Gemeinsame Grundlage für Mitarbeiter-App und Bürobereich */
:root {
  --navy: #1f2c51;
  --navy-2: #2b3c6b;
  --navy-soft: #e8ebf3;
  --lime: #c0cd0b;
  --lime-2: #d3df3a;
  --lime-soft: #f4f7d4;
  --bg: #f3f5f9;
  --card: #ffffff;
  --text: #1a2238;
  --muted: #6b7386;
  --line: #e2e6ee;
  --ok: #3f9b4b;
  --warn: #d98a00;
  --warn-soft: #fff3d6;
  --danger: #d93b3b;
  --danger-soft: #fde4e3;
  --info-soft: #e7f0fd;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(31, 44, 81, .06), 0 8px 24px rgba(31, 44, 81, .08);
  --shadow-lg: 0 20px 50px rgba(31, 44, 81, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Hintergrundfarbe liegt auf <html> (siehe unten) – body bleibt durchsichtig,
     sonst verdeckt er die Hintergrund-Grafik der App */
  background: transparent;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
/* Platz für die Scrollleiste immer reservieren – sonst springt die Seite, wenn sie kurz erscheint */
html { scrollbar-gutter: stable; background: var(--bg); overflow-x: hidden; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 0; border-radius: 14px; padding: .8em 1.3em;
  font-weight: 650; letter-spacing: .01em;
  background: var(--navy); color: #fff;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s;
  box-shadow: 0 4px 14px rgba(31, 44, 81, .25);
  position: relative; overflow: hidden;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.lime { background: var(--lime); color: var(--navy); box-shadow: 0 4px 16px rgba(192, 205, 11, .45); }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: none; border: 1.5px solid var(--line); }
.btn.danger { background: var(--danger); box-shadow: 0 4px 14px rgba(217, 59, 59, .3); }
.btn.small { padding: .45em .8em; font-size: .9rem; border-radius: 10px; }

.ripple {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255, 255, 255, .45); animation: ripple .6s linear; pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .9rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.input {
  width: 100%; padding: .75em .9em; border-radius: 12px; border: 1.5px solid var(--line);
  background: #fff; transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(31, 44, 81, .1); }
textarea.input { resize: vertical; min-height: 70px; }

.chip {
  display: inline-flex; align-items: center; gap: .35em; padding: .25em .65em; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: var(--navy-soft); color: var(--navy); white-space: nowrap;
}
.chip.warn { background: var(--warn-soft); color: #8a5300; }
.chip.danger { background: var(--danger-soft); color: #a42222; }
.chip.ok { background: #e2f3e4; color: #24692e; }
.chip.lime { background: var(--lime-soft); color: #5d6400; }
.chip.info { background: var(--info-soft); color: #22508f; }

/* Toast */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast {
  background: var(--navy); color: #fff; padding: .85em 1.1em; border-radius: 14px; box-shadow: var(--shadow-lg);
  animation: toastIn .4s var(--spring); font-weight: 550;
}
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { transform: translateY(20px) scale(.95); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(10px); opacity: 0; } }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(20, 28, 52, .45); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 500; animation: fade .25s;
}
@media (min-width: 640px) { .modal-bg { align-items: center; } }
.modal {
  background: #fff; width: min(100%, 520px); max-height: 92vh; overflow: auto;
  border-radius: 24px 24px 0 0; padding: 1.4rem 1.3rem 1.6rem; box-shadow: var(--shadow-lg);
  animation: sheetUp .4s var(--ease);
}
@media (min-width: 640px) { .modal { border-radius: 24px; animation: pop .35s var(--spring); } }
.modal h2 { margin: 0 0 .3rem; font-size: 1.3rem; color: var(--navy); }
.modal .sub { color: var(--muted); margin: 0 0 1.1rem; font-size: .95rem; }
.modal .actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); }
}
.shake { animation: shake .45s; }

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