/* schnellerfassung.css — EIN "+" → ein großes Feld → fertig.
   HSL/oklch-Tokens (Light + Dark erben automatisch über design-tokens.css),
   Loading-/Error-States, prefers-reduced-motion respektiert. */

/* ── FAB ──────────────────────────────────────────────────────────────── */
.se-fab {
  position: fixed;
  bottom: 84px;
  right: 20px;
  width: 60px;
  height: 60px;
  min-width: 48px;
  min-height: 48px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: var(--z-fab);
  transition: transform 0.16s var(--ease-out), box-shadow 0.16s var(--ease-out), background 0.16s var(--ease-out);
}
.se-fab:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.se-fab:active { transform: scale(0.94); }
.se-fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ── Backdrop ─────────────────────────────────────────────────────────── */
.se-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: var(--glass-blur-sm);
  -webkit-backdrop-filter: var(--glass-blur-sm);
  z-index: var(--z-modal);
  opacity: 0;
  transition: opacity 0.2s var(--ease-out);
}
.se-backdrop[data-offen='true'] { opacity: 1; }

/* ── Sheet ────────────────────────────────────────────────────────────── */
.se-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin-inline: auto;
  width: min(560px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 14px 18px max(24px, env(safe-area-inset-bottom));
  z-index: calc(var(--z-modal) + 1);
  box-shadow: var(--shadow-xl);
  transform: translateY(100%);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.se-sheet[data-offen='true'] { transform: translateY(0); }

@media (min-width: 640px) {
  .se-sheet {
    bottom: auto;
    top: 50%;
    transform: translateY(calc(-50% + 16px));
    border-radius: var(--radius-xl);
    border-bottom: 1px solid var(--border-strong);
    opacity: 0;
  }
  .se-sheet[data-offen='true'] { transform: translateY(-50%); opacity: 1; }
  .se-grip { display: none; }
}

.se-grip {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  margin: 0 auto 2px;
}

.se-titel {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ── Großes Freitext-Feld ─────────────────────────────────────────────── */
.se-freitext-zeile {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.se-freitext {
  flex: 1;
  min-width: 0;
  resize: none;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1.4;
  padding: 14px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.se-freitext::placeholder { color: var(--text-muted); }
.se-freitext:focus { border-color: var(--accent); box-shadow: 0 0 0 3px oklch(from var(--accent) l c h / 0.18); }
.se-freitext[data-fehler='true'] { border-color: var(--destructive); }

.se-mic {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-md);
}

/* ── Status / Loading / Error ─────────────────────────────────────────── */
.se-status {
  min-height: 1.1em;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.se-status[data-status='lade'] { color: var(--text-secondary); }
.se-status[data-status='lade']::before {
  content: '';
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: se-spin 0.7s linear infinite;
}
.se-status[data-status='ok'] { color: var(--accent); font-weight: 500; }
.se-status[data-status='fehler'] { color: var(--destructive); }

@keyframes se-spin { to { transform: rotate(360deg); } }

.se-controls { display: flex; flex-direction: column; gap: 14px; }
.se-feld-gruppe { display: flex; flex-direction: column; gap: 7px; }
.se-label { font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }

/* ── Segment (Typ-Umschalter) ─────────────────────────────────────────── */
.se-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.se-seg__btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 600;
  padding: 10px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.se-seg__btn[aria-pressed='true'] {
  background: var(--accent);
  color: var(--accent-foreground);
}

/* ── Personen-Avatare ─────────────────────────────────────────────────── */
.se-avatare { display: flex; gap: 8px; flex-wrap: wrap; }
.se-avatar {
  width: 48px; height: 48px; min-width: 48px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.1s ease;
}
.se-avatar:active { transform: scale(0.92); }
.se-avatar[aria-pressed='true'] {
  border-color: var(--accent);
  background: oklch(from var(--accent) l c h / 0.16);
  color: var(--text-primary);
}

/* ── Toggles ──────────────────────────────────────────────────────────── */
.se-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.se-toggle, .se-chip {
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.9rem;
  padding: 9px 14px;
  min-height: 44px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.se-toggle[aria-pressed='true'], .se-chip[aria-pressed='true'] {
  background: var(--accent);
  color: var(--accent-foreground);
  border-color: var(--accent);
}

.se-rhythmus { display: none; gap: 6px; flex-wrap: wrap; }
.se-rhythmus[data-sichtbar='true'] { display: flex; }

/* ── Datum / Zeit ─────────────────────────────────────────────────────── */
.se-datum { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.se-feld {
  font: inherit;
  padding: 9px 11px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
}
.se-feld:disabled { opacity: 0.45; cursor: not-allowed; }
.se-datum[data-ganztaegig='true'] .se-zeit-wrap { opacity: 0.5; }
.se-link {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 8px 4px;
  min-height: 44px;
}
.se-link:hover { color: var(--text-primary); }

/* ── Aktionen ─────────────────────────────────────────────────────────── */
.se-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.se-primary, .se-secondary {
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  min-height: 48px;
  min-width: 96px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.14s ease;
}
.se-primary { border: none; background: var(--accent); color: var(--accent-foreground); }
.se-primary:hover { filter: brightness(1.06); }
.se-primary:active { transform: scale(0.97); }
.se-secondary { border: 1px solid var(--border-strong); background: transparent; color: var(--text-secondary); }
.se-secondary:hover { color: var(--text-primary); }

/* ── prefers-reduced-motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .se-fab, .se-backdrop, .se-sheet,
  .se-seg__btn, .se-avatar, .se-toggle, .se-chip,
  .se-primary, .se-freitext {
    transition: none !important;
  }
  .se-status[data-status='lade']::before { animation: none; }
}
