/* public/style.css — Diktura Redesign Variante A „Ruhig" */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap');

/* === Design Tokens === */
:root {
  --primary:        #0E4A38;
  --accent:         #2E9E6B;
  --green-tint:     #E7F3EC;
  --green-tint-bd:  #CFE7D9;
  --text-dark:      #16241E;
  --text-medium:    #3E4E47;
  --text-gray:      #5E6E66;
  --text-light:     #7A8780;
  --text-faint:     #9AA8A1;
  --bg-content:     #EFF4F1;
  --bg-alt:         #F4F7F5;
  --card-bg:        #FFFFFF;
  --card-border:    #E6ECE8;
  --divider:        #ECF0ED;
  --divider-alt:    #F1F4F2;
  --divider-light:  #EDF1EE;
  --field-border:   #E0E6E2;
  --progress-track: #EDF1EE;
  --shadow-ring:    #E2EFE8;

  /* Legacy compat — used in injected legal pages etc. */
  --brand-primary:  #0E4A38;
  --brand-accent:   #2E9E6B;
  --brand-bg-soft:  #E7F3EC;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-content);
  color: var(--text-dark);
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select {
  font-family: inherit;
  font-size: 16px; /* iOS: kein Auto-Zoom */
}

/* ═══════════════════════════════════════════
   APP HEADER
═══════════════════════════════════════════ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 18px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.tenant-badge {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font: 800 13px/1 'Hanken Grotesk', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-title {
  font: 800 15px/1 'Hanken Grotesk', sans-serif;
  letter-spacing: .04em;
  color: var(--text-dark);
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name-hidden { display: none; }

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-tint);
  color: var(--primary);
  font: 700 12px/1 'Hanken Grotesk', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--text-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.btn-icon:active { background: var(--divider); }

/* 3-px Akzentlinie unter dem Header */
.accent-line {
  height: 3px;
  background: var(--primary);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   APP LAYOUT — Sidebar + Main Column
═══════════════════════════════════════════ */
.app-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.main-column {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Sidebar: mobile versteckt */
.sidebar { display: none; }

/* Username-Anzeige im Header: mobile versteckt */
.user-display-name {
  display: none;
  font: 500 13px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-gray);
}

/* ═══════════════════════════════════════════
   MAIN LAYOUT
═══════════════════════════════════════════ */
main {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
  box-sizing: border-box;
}

.section     { display: none; }
.section.active { display: block; }

/* ═══════════════════════════════════════════
   CONTENT AREA (idle / recording / ready / loading / error)
═══════════════════════════════════════════ */
.content-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 20px 28px;
  background: var(--bg-content);
  text-align: center;
}

.eyebrow {
  font: 700 12px/1 'Hanken Grotesk', sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.section-title {
  font: 700 19px/1.3 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  margin: 0 0 28px;
  text-align: center;
}

/* ═══════════════════════════════════════════
   RECORD BUTTON
═══════════════════════════════════════════ */
.record-wrap {
  position: relative;
  width: 144px;
  height: 144px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.record-btn {
  position: relative;
  z-index: 2;
  width: 144px;
  height: 144px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 9px var(--shadow-ring), 0 14px 30px rgba(14,74,56,.26);
  transition: transform 0.12s, box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}
.record-btn:active { transform: scale(0.95); }

/* Weißer Kern (idle-Zustand) */
.record-btn-inner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
}

/* Recording-Zustand: roter Button */
.record-btn.recording {
  background: #c0392b;
  box-shadow: 0 0 0 9px rgba(192,57,43,.15), 0 14px 30px rgba(192,57,43,.22);
}

/* Pulsring (nur sichtbar in recording section) */
.pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 184px;
  height: 184px;
  margin-top: -92px;   /* -½ × 184px → zentriert in .record-wrap */
  margin-left: -92px;
  border-radius: 50%;
  background: rgba(192, 57, 43, 0.14);
  pointer-events: none;
  z-index: 1;
  animation: pulse 1.5s ease-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(0.82); opacity: .8; }
  100% { transform: scale(1.28); opacity: 0; }
}

/* ═══════════════════════════════════════════
   HINT / TIMER TEXTS
═══════════════════════════════════════════ */
.hint {
  margin: 8px 0 0;
  color: var(--text-gray);
  font: 600 16px/1 'Hanken Grotesk', sans-serif;
}

.hint-large {
  margin: 20px 0 6px;
  font: 600 18px/1.3 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
}

.timer {
  margin: 0 0 28px;
  font: 700 38px/1 'Hanken Grotesk', sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--text-dark);
}

.audio-info {
  margin: 0 0 16px;
  font: 400 13px/1.3 'Hanken Grotesk', sans-serif;
  color: var(--text-light);
}

/* ═══════════════════════════════════════════
   DSGVO-KARTE
═══════════════════════════════════════════ */
.dsgvo-card {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-top: 20px;
  text-align: left;
}

.dsgvo-badge {
  flex-shrink: 0;
  font: 700 9px/1.5 'Hanken Grotesk', sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--green-tint);
  border-radius: 5px;
  padding: 4px 6px;
  margin-top: 1px;
}

.dsgvo-text {
  font: 400 12.5px/1.45 'Hanken Grotesk', sans-serif;
  color: var(--text-gray);
  margin: 0;
}

/* Legacy: genutzt in einladung.html */
.datenschutz-hinweis {
  margin: 20px 0 0;
  padding: 12px 14px;
  background: var(--green-tint);
  border: 1px solid var(--green-tint-bd);
  border-radius: 12px;
  font: 400 12.5px/1.45 'Hanken Grotesk', sans-serif;
  color: var(--text-gray);
}

/* ═══════════════════════════════════════════
   KONTINGENT-KARTE (Usage Box)
═══════════════════════════════════════════ */
.usage-box {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 15px;
  margin-top: 14px;
  text-align: left;
}

.usage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.usage-tarif {
  font: 700 14px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
}

.usage-refresh {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font: 600 12px/1 'Hanken Grotesk', sans-serif;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  user-select: none;
}
.usage-refresh:hover,
.usage-refresh:active { background: var(--green-tint); }

.usage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}
.usage-row:last-child { margin-bottom: 0; }

.usage-label {
  width: 50px;
  flex-shrink: 0;
  font: 500 13px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-gray);
}

.usage-bar {
  flex: 1;
  height: 6px;
  background: var(--progress-track);
  border-radius: 99px;
  overflow: hidden;
}

.usage-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 99px;
  transition: width 0.35s ease;
}
.usage-bar-fill.warn { background: #e8a33d; }
.usage-bar-fill.full { background: #c0392b; }

.usage-count {
  width: 72px;
  flex-shrink: 0;
  text-align: right;
  font: 700 13px/1 'Hanken Grotesk', sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--text-dark);
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  margin: 20px auto 0;
  height: 54px;
  background: var(--primary);
  color: #fff;
  font: 700 15px/1 'Hanken Grotesk', sans-serif;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(14,74,56,.24);
  transition: transform 0.1s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn-primary:active { transform: scale(0.97); opacity: .9; }

/* PROJ-10: Review-Screen (Vorschau vor dem Senden) */
.review-banner {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--green-tint);
  border: 1px solid var(--green-tint-bd);
  font: 700 15px/1.2 'Hanken Grotesk', sans-serif;
  color: var(--brand-primary);
}
.review-hinweis {
  font: 400 13px/1.45 'Hanken Grotesk', sans-serif;
  color: var(--text-light);
  margin: -4px 0 0;
}
.review-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.btn-text {
  display: block;
  margin: 12px auto 0;
  padding: 8px 16px;
  color: var(--accent);
  font: 600 14px/1 'Hanken Grotesk', sans-serif;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.btn-text:active { background: var(--green-tint); }

/* === Inline-Editor (Vorschau anpassen vor dem Senden) — mobile-first === */
.review-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 8px;
}
#edit-toggle-btn {
  font-size: 13px;
  padding: 6px 12px;
  margin: 0;
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: #fff;
}
#edit-toggle-btn[aria-pressed="true"],
#edit-toggle-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.doku-edit-input,
.doku-edit-textarea {
  width: 100%;
  box-sizing: border-box;
  font: 15px/1.4 'Hanken Grotesk', sans-serif;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 2px 0;
  -webkit-appearance: none;
  appearance: none;
}
.doku-edit-input:focus,
.doku-edit-textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-color: var(--accent);
}
.doku-edit-input::placeholder,
.doku-edit-textarea::placeholder { color: var(--text-faint); }
.doku-edit-textarea { resize: vertical; min-height: 96px; }
.doku-edit-list { list-style: none; padding: 0; margin: 6px 0; }
.doku-edit-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 4px;
}
.doku-edit-list li::before { display: none; }
.doku-edit-list li.doku-edit-add { padding-top: 4px; }
.doku-edit-mat input,
.doku-edit-wv input { min-width: 0; }
.doku-edit-fliesstext label {
  display: block;
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 2px;
}

/* Admin-Schaltfläche im Header */
.admin-btn {
  margin: 0;
  padding: 6px 10px;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  color: var(--primary);
  font: 600 12px/1 'Hanken Grotesk', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.admin-btn:active { background: var(--green-tint); }

/* ═══════════════════════════════════════════
   LOADING SPINNER
═══════════════════════════════════════════ */
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--divider-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   RESULT / ERGEBNIS
═══════════════════════════════════════════ */
.result-area {
  padding: 16px;
  background: var(--bg-content);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100dvh - 64px);
}

.success-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 12px;
  font: 500 13px/1.3 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
}
.success-banner.success {
  background: var(--green-tint);
  border: 1px solid var(--green-tint-bd);
}
.success-banner.warning {
  background: #fff3cd;
  border: 1px solid #ffd97d;
  color: #856404;
}

/* Doku-Output: Karten-Layout */
.doku-output {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.doku-section {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 14px 15px;
  margin: 0;
}

.doku-section > h2 {
  font: 700 11px/1 'Hanken Grotesk', sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 12px;
}

.doku-section > h3 {
  font: 700 11px/1 'Hanken Grotesk', sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 14px 0 8px;
}
.doku-section > h3:first-of-type { margin-top: 0; }

.doku-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.doku-section li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font: 400 13px/1.4 'Hanken Grotesk', sans-serif;
  color: var(--text-medium);
}
.doku-section li::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
}

.doku-zeit-gesamt {
  margin: 12px 0 0;
  font: 600 13px/1.4 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
}

.doku-projekt {
  display: grid;
  grid-template-columns: 74px 1fr;
  row-gap: 9px;
  column-gap: 10px;
}
.doku-projekt dt {
  font: 500 13px/1.3 'Hanken Grotesk', sans-serif;
  color: var(--text-light);
  margin: 0;
}
.doku-projekt dd {
  font: 600 13px/1.3 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  margin: 0;
}

.doku-mat {
  width: 100%;
  border-collapse: collapse;
}
.doku-mat thead tr {
  border-bottom: 1px solid var(--divider-light);
}
.doku-mat th {
  font: 700 11px/1 'Hanken Grotesk', sans-serif;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
  padding: 0 0 9px;
  text-align: left;
}
.doku-mat td {
  font: 500 13px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  padding: 10px 0;
  border-bottom: 1px solid var(--divider-alt);
}
.doku-mat td:first-child { color: var(--text-faint); width: 28px; }
.doku-mat td:last-child  { font-weight: 600; }
.doku-mat tbody tr:last-child td { border-bottom: none; }

.doku-fliesstext {
  font: 400 13px/1.65 'Hanken Grotesk', sans-serif;
  color: var(--text-medium);
  margin: 0;
}

.doku-empty {
  font: 400 13px/1.4 'Hanken Grotesk', sans-serif;
  color: var(--text-light);
  font-style: italic;
  margin: 0;
}

/* ═══════════════════════════════════════════
   ERROR STATE
═══════════════════════════════════════════ */
.error-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fdecea;
  color: #c0392b;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.error-large {
  margin: 0 0 8px;
  font: 700 18px/1.3 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  text-align: center;
}

/* ═══════════════════════════════════════════
   PROJ-4: FOTO-ANHANG
═══════════════════════════════════════════ */
.foto-upload-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto 16px;
  text-align: center;
}

.foto-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 18px 16px;
  border: 1.5px dashed var(--card-border);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--primary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.foto-upload:active {
  background: var(--green-tint);
  border-color: var(--accent);
}

.foto-upload-icon { color: var(--accent); line-height: 1; }
.foto-upload-text { font: 600 14px/1.2 'Hanken Grotesk', sans-serif; color: var(--text-dark); }
.foto-upload-sub  { font: 400 12px/1 'Hanken Grotesk', sans-serif; color: var(--text-gray); }

.foto-input { display: none; }

.foto-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.foto-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-alt);
  border: 1px solid var(--card-border);
  overflow: hidden;
}

.foto-thumb-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.foto-thumb-remove:active { background: rgba(192,57,43,.85); }

.foto-hinweis {
  margin: 10px 0 0;
  font: 400 11px/1.5 'Hanken Grotesk', sans-serif;
  color: var(--text-light);
}

/* ═══════════════════════════════════════════
   LOGIN-SEITE
═══════════════════════════════════════════ */
.login-page {
  background: var(--card-bg);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

.login-wrap {
  flex: 1;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px 0;
}

.login-card {
  width: 100%;
  padding: 0 26px;
  display: flex;
  flex-direction: column;
}

/* Logo-Block */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 4px;
}
.login-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(14,74,56,.28);
  margin-bottom: 14px;
}
.login-wordmark {
  font: 800 19px/1 'Hanken Grotesk', sans-serif;
  letter-spacing: .04em;
  color: var(--text-dark);
}

/* Begrüßungstext */
.login-welcome { text-align: center; margin-bottom: 26px; }
.login-title   { font: 700 22px/1.2 'Hanken Grotesk', sans-serif; color: var(--text-dark); margin: 0 0 6px; }
.login-subtitle { font: 400 14px/1.4 'Hanken Grotesk', sans-serif; color: var(--text-light); margin: 0; }

/* Hinweis (Magic-Link etc.) */
.login-hinweis {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--green-tint);
  border: 1px solid var(--green-tint-bd);
  border-radius: 10px;
  color: var(--primary);
  font: 500 13px/1.4 'Hanken Grotesk', sans-serif;
  text-align: center;
}

/* Felder */
#login-form label {
  display: block;
  font: 600 12px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-gray);
  margin-bottom: 7px;
}
#login-form input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1.5px solid var(--field-border);
  border-radius: 13px;
  font: 500 15px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  background: var(--card-bg);
  margin-bottom: 15px;
  transition: border-color 0.15s;
}
#login-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.forgot-pw {
  text-align: right;
  margin-bottom: 22px;
  margin-top: -8px;
}
.forgot-pw span {
  font: 500 12.5px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-light);
  cursor: default;
}

.login-submit { max-width: 100%; margin: 0; }

.error {
  margin: 12px 0 0;
  color: #c0392b;
  font: 500 13px/1.3 'Hanken Grotesk', sans-serif;
  text-align: center;
  min-height: 1.2em;
}

.login-footer {
  text-align: center;
  padding: 28px 0 8px;
  font: 400 12.5px/1.4 'Hanken Grotesk', sans-serif;
  color: var(--text-faint);
}

/* Einladungs-Seite nutzt login-card-Struktur mit eigenen Klassen */
.einladung-invalid      { margin: 0 0 16px; }
.einladung-invalid-text { font: 500 14px/1.5 'Hanken Grotesk', sans-serif; color: #c0392b; margin: 0 0 8px; }
.einladung-support      { font: 400 13px/1.5 'Hanken Grotesk', sans-serif; color: var(--text-gray); margin: 0 0 16px; }
.einladung-meta         { margin: 0 0 20px; }
.einladung-firma        { font: 700 15px/1 'Hanken Grotesk', sans-serif; color: var(--primary); margin: 0 0 8px; }
.einladung-hint         { font: 400 12px/1.5 'Hanken Grotesk', sans-serif; color: var(--text-gray); margin: 8px 0 0; }

#accept-form label {
  display: block;
  font: 600 12px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-gray);
  margin-bottom: 6px;
  margin-top: 16px;
}
#accept-form input {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border: 1.5px solid var(--field-border);
  border-radius: 13px;
  font: 500 15px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  background: var(--card-bg);
}
#accept-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ═══════════════════════════════════════════
   PROJ-5: ADMIN — NUTZER VERWALTEN (Screen 4)
═══════════════════════════════════════════ */

/* Sub-Header (Mobile-only, ersetzt den app-header) */
.admin-header-bar {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.admin-header-back {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #F1F4F2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.admin-header-back:active { background: var(--divider); }

.admin-header-title {
  font: 800 16px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
}

/* Content-Fläche */
.admin-content {
  background: var(--bg-alt);
  padding: 16px;
  flex: 1;
  overflow-y: auto;
}

/* Einladen-Button (Outline) */
.admin-invite-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  background: var(--card-bg);
  border: 1.5px solid var(--primary);
  border-radius: 13px;
  color: var(--primary);
  font: 700 14px/1 'Hanken Grotesk', sans-serif;
  margin-bottom: 18px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.admin-invite-btn:active { background: var(--green-tint); }

.admin-invite-plus {
  font: 700 18px/1 'Hanken Grotesk', sans-serif;
  line-height: 1;
}

/* Abschnittslabel */
.admin-section-label {
  font: 700 11px/1 'Hanken Grotesk', sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 11px;
  padding-left: 2px;
}
.admin-section-label-sep { margin-top: 22px; }

/* Error */
.admin-error {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #fdecea;
  border: 1px solid #f5c6cb;
  border-radius: 12px;
  color: #b71c1c;
  font: 500 13px/1.4 'Hanken Grotesk', sans-serif;
}

/* Invite-Formular */
.admin-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}
.admin-form-title {
  font: 700 15px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  margin: 0 0 6px;
}
.admin-form-hint {
  font: 400 12px/1.5 'Hanken Grotesk', sans-serif;
  color: var(--text-gray);
  margin: 0 0 14px;
}

.admin-field {
  display: block;
  margin-bottom: 12px;
}
.admin-field span {
  display: block;
  font: 600 12px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-gray);
  margin-bottom: 6px;
}
.admin-field input,
.admin-field select {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1.5px solid var(--field-border);
  border-radius: 12px;
  font: 500 15px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  background: var(--card-bg);
  transition: border-color 0.15s;
}
.admin-field input:focus,
.admin-field select:focus {
  outline: none;
  border-color: var(--accent);
}
.admin-submit { width: 100%; max-width: 100%; }

/* Nutzer-Karte */
.admin-row {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  margin-bottom: 10px;
  overflow: hidden;
}

.admin-row-main-wrap {
  padding: 13px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Avatar 40px */
.admin-user-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 700 14px/1 'Hanken Grotesk', sans-serif;
}
.admin-user-avatar.is-admin  { background: var(--primary); color: #fff; }
.admin-user-avatar.is-member { background: var(--green-tint); color: var(--primary); }
.admin-user-avatar.is-invite { background: #fff3cd; color: #856404; }

.admin-row-main { flex: 1; min-width: 0; }
.admin-row-name {
  font: 600 14px/1.2 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  margin-bottom: 3px;
}
.admin-row-user {
  font: 400 12.5px/1.3 'Hanken Grotesk', sans-serif;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin-Badge */
.admin-badge {
  flex: none;
  display: inline-block;
  padding: 5px 8px;
  border-radius: 6px;
  font: 700 10.5px/1 'Hanken Grotesk', sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.admin-badge.admin      { background: var(--green-tint); color: var(--primary); }
.admin-badge.inaktiv    { background: var(--bg-alt); color: var(--text-light); }
.admin-badge.eingeladen { background: #fff3cd; color: #856404; }

/* ⋯-Menü-Button */
.admin-row-menu-btn {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 18px/1 'Hanken Grotesk', sans-serif;
  color: #B6C2BC;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s, color 0.12s;
}
.admin-row-menu-btn:hover { background: var(--bg-alt); color: var(--text-gray); }
.admin-row-menu-btn.open  { background: var(--bg-alt); color: var(--text-gray); }

/* Ausgeklapptes Aktions-Panel */
.admin-row-actions-panel {
  display: none;
  border-top: 1px solid var(--divider-light);
  padding: 10px 14px;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-row-actions-panel.open { display: flex; }

.admin-action {
  padding: 7px 11px;
  border: 1.5px solid var(--card-border);
  border-radius: 9px;
  font: 500 12px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-dark);
  background: var(--card-bg);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}
.admin-action:active { background: var(--bg-alt); }
.admin-action.danger { color: #c0392b; border-color: #f5c6cb; }

/* Leer-Zustand */
.admin-empty {
  font: 400 13px/1 'Hanken Grotesk', sans-serif;
  color: var(--text-light);
  font-style: italic;
  padding: 10px 2px;
}

/* Desktop: Admin-Sub-Header ausblenden (Topbar übernimmt) */
@media (min-width: 640px) {
  .admin-header-bar { display: none; }
  .admin-content { min-height: calc(100dvh - 64px); }
}

/* Mobile: app-header + accent-line verstecken wenn Admin-Sektion aktiv */
.admin-mode .app-header  { display: none; }
.admin-mode .accent-line { display: none; }
@media (min-width: 640px) {
  .admin-mode .app-header  { display: flex; }
}

/* ═══════════════════════════════════════════
   LEGAL FOOTER & PAGES
═══════════════════════════════════════════ */
.legal-footer {
  text-align: center;
  font: 400 12.5px/1.4 'Hanken Grotesk', sans-serif;
  color: var(--text-faint);
  padding: 16px;
  width: 100%;
  align-self: stretch;
  box-sizing: border-box;
}
.legal-footer a            { color: var(--accent); text-decoration: none; }
.legal-footer a:hover,
.legal-footer a:focus      { text-decoration: underline; }

.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  background: var(--card-bg);
  min-height: 100vh;
}
.legal-page h1          { font: 800 22px/1.2 'Hanken Grotesk', sans-serif; color: var(--text-dark); margin: 0 0 4px; }
.legal-page .legal-sub  { font: 400 13px/1 'Hanken Grotesk', sans-serif; color: var(--text-gray); margin: 0 0 8px; }
.legal-page h2          { font: 700 16px/1.3 'Hanken Grotesk', sans-serif; color: var(--accent); margin: 28px 0 8px; }
.legal-page h3          { font: 700 14px/1.2 'Hanken Grotesk', sans-serif; color: var(--text-dark); margin: 18px 0 6px; }
.legal-page p,
.legal-page li          { font: 400 14px/1.6 'Hanken Grotesk', sans-serif; color: var(--text-dark); margin: 8px 0; }
.legal-page ul,
.legal-page ol          { padding-left: 24px; margin: 8px 0; }
.legal-page .legal-back { display: inline-block; margin: 0 0 16px; color: var(--accent); text-decoration: none; font: 500 14px/1 'Hanken Grotesk', sans-serif; }
.legal-page .legal-disclaimer {
  margin-top: 32px;
  padding: 12px 14px;
  background: #fff8e1;
  border-left: 3px solid #f0ad4e;
  border-radius: 4px;
  font: 400 12px/1.5 'Hanken Grotesk', sans-serif;
  color: var(--text-gray);
}

/* ═══════════════════════════════════════════
   DESKTOP — ab 640px (Sidebar-Layout)
═══════════════════════════════════════════ */
@media (min-width: 640px) {

  /* ── Layout ── */
  .app-layout {
    flex-direction: row;
    min-height: 100dvh;
  }

  .main-column {
    overflow-y: auto;
  }

  /* ── Sidebar ── */
  .sidebar {
    display: flex;
    flex-direction: column;
    width: 248px;
    flex-shrink: 0;
    background: var(--primary);
    padding: 20px 12px;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    box-sizing: border-box;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 24px;
  }

  .sidebar-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,.14);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .sidebar-brand {
    font: 800 18px/1 'Hanken Grotesk', sans-serif;
    color: #fff;
    letter-spacing: .04em;
  }

  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 11px;
    font: 500 14px/1 'Hanken Grotesk', sans-serif;
    color: #BFE0CF;
    text-align: left;
    transition: background 0.12s, color 0.12s;
    -webkit-tap-highlight-color: transparent;
  }
  .sidebar-nav-item:hover:not(:disabled) { background: rgba(255,255,255,.08); color: #fff; }
  .sidebar-nav-item.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }
  .sidebar-nav-item:disabled { opacity: .45; cursor: default; }

  /* Quota-Karte am unteren Ende der Sidebar */
  .sidebar-quota {
    margin-top: auto;
    padding: 14px;
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.08);
  }

  .sidebar-quota-label {
    font: 700 10px/1 'Hanken Grotesk', sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #BFE0CF;
    margin-bottom: 12px;
  }

  .sidebar-quota-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
  }

  .sidebar-quota-key {
    font: 500 12px/1 'Hanken Grotesk', sans-serif;
    color: #BFE0CF;
  }

  .sidebar-quota-val {
    font: 600 12px/1 'Hanken Grotesk', sans-serif;
    font-variant-numeric: tabular-nums;
    color: #fff;
  }

  .sidebar-quota-bar {
    height: 4px;
    background: rgba(255,255,255,.18);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
  }

  .sidebar-quota-fill {
    height: 100%;
    width: 0%;
    background: #7FD3A6;
    border-radius: 99px;
    transition: width 0.35s ease;
  }

  /* ── Topbar (app-header auf Desktop) ── */
  .app-header {
    height: 64px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  /* Accent-Line nicht auf Desktop */
  .accent-line { display: none; }

  /* Mobile-only Elemente ausblenden */
  .mobile-only { display: none !important; }

  /* Username anzeigen */
  .user-display-name { display: block; }

  /* ── Content ── */
  main { max-width: 560px; }
  .content-area { padding: 40px 32px 40px; }

  .record-btn { width: 168px; height: 168px; box-shadow: 0 0 0 11px var(--shadow-ring), 0 18px 40px rgba(14,74,56,.26); }
  .record-wrap { width: 168px; height: 168px; }
  .record-btn-inner { width: 54px; height: 54px; }
  .pulse-ring { width: 216px; height: 216px; margin-top: -108px; margin-left: -108px; }

  .hint { font-size: 17px; }
  .section-title { font-size: 22px; }

  .btn-primary { height: 56px; font-size: 16px; }

  .result-area { padding: 24px 32px; }
}
