/* ============================================================
   Durchreiche — Base Styles
   Theme: Industrial/utilitarian. Dark steel, sharp edges,
   functional precision. Built for scan workflows on mobile.
   ============================================================ */



/* --- Variables -------------------------------------------- */
:root {
  --blue:       #1F4E79;
  --blue-mid:   #2563a8;
  --blue-light: #3b82d4;
  --blue-glow:  rgba(31, 78, 121, 0.35);

  --bg:         #0d1117;
  --bg-card:    #161b22;
  --bg-input:   #1c2330;
  --bg-hover:   #21293a;

  --border:     #2a3444;
  --border-mid: #3a4a60;

  --text:       #e6edf3;
  --text-mid:   #8b9ab0;
  --text-dim:   #4a5568;

  --success:    #2ea043;
  --error:      #f85149;
  --warning:    #d29922;

  --radius:     6px;
  --radius-lg:  12px;

  --font-ui:    'Sora', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:  'DM Mono', ui-monospace, 'SF Mono', 'Consolas', monospace;

  --transition: 180ms ease;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 48px rgba(0,0,0,0.6);
}

/* --- Reset ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* --- Typography -------------------------------------------- */
h1, h2, h3 { line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
h2 { font-size: clamp(1.1rem, 4vw, 1.4rem); }
h3 { font-size: 1rem; }

p { color: var(--text-mid); font-size: 0.9rem; }
a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--font-mono); font-size: 0.85em; }

/* --- Layout shell ----------------------------------------- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

#navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  height: 52px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.nav-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1rem; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none;
}
.nav-brand-icon {
  width: 24px; height: 24px;
}

.nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.nav-user {
  font-family: var(--font-mono); font-size: 0.75rem;
  color: var(--text-mid); padding: 0.25rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius);
}

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

.view { display: none; flex: 1; flex-direction: column; }
.view.active { display: flex; }

/* --- Buttons ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 0.6rem 1.1rem; border-radius: var(--radius);
  font-family: var(--font-ui); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: var(--transition);
  transition-property: background, box-shadow, opacity, transform;
  white-space: nowrap; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active   { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-primary  { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-mid); box-shadow: 0 0 16px var(--blue-glow); }

.btn-secondary { background: transparent; color: var(--text-mid); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-mid); }

.btn-danger { background: transparent; color: var(--error); border: 1px solid transparent; }
.btn-danger:hover { background: rgba(248,81,73,0.1); border-color: var(--error); }

.btn-full { width: 100%; }

.btn-icon { padding: 0.5rem; background: transparent; color: var(--text-mid); border: 1px solid transparent; border-radius: var(--radius); }
.btn-icon:hover { background: var(--bg-hover); color: var(--text); }

/* --- Form elements ---------------------------------------- */
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

label {
  font-size: 0.75rem; font-weight: 600; color: var(--text-mid);
  letter-spacing: 0.05em; text-transform: uppercase; font-family: var(--font-mono);
}

input[type="text"], input[type="email"], input[type="password"] {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font-ui); font-size: 0.95rem;
  padding: 0.65rem 0.85rem; width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none; -webkit-appearance: none;
}
input:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px var(--blue-glow); }
input::placeholder { color: var(--text-dim); }

/* --- Card -------------------------------------------------- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }

/* --- Alerts ----------------------------------------------- */
.alert { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.85rem; line-height: 1.5; }
.alert-error   { background: rgba(248,81,73,0.1);  border: 1px solid rgba(248,81,73,0.3);  color: #ff8080; }
.alert-success { background: rgba(46,160,67,0.1);  border: 1px solid rgba(46,160,67,0.3);  color: #6ee48a; }
.alert-info    { background: rgba(31,78,121,0.2);  border: 1px solid rgba(59,130,212,0.3); color: #7ab8f5; }

/* --- Spinner ---------------------------------------------- */
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.2); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Tab Bar ---------------------------------------------- */
#tabbar { display: flex; background: var(--bg-card); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); flex-shrink: 0; }

.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 0.6rem 0.5rem; background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 0.65rem; font-family: var(--font-ui); font-weight: 600;
  letter-spacing: 0.03em; text-transform: uppercase; transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.tab-btn svg { width: 22px; height: 22px; stroke-width: 1.8; }
.tab-btn.active { color: var(--blue-light); }
.tab-btn:active { opacity: 0.7; }

/* --- Utility ---------------------------------------------- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.view.active { animation: fadeIn 220ms ease; }

/* ============================================================
   LOGIN VIEW
   ============================================================ */
#view-login,
#view-register {
  align-items: center; justify-content: center;
  padding: 2rem 1.25rem; min-height: 100dvh;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(31,78,121,0.45) 0%, transparent 65%), var(--bg);
}

.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 1.75rem; }

.login-header { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }

.login-logo {
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 16px rgba(31,78,121,0.7));
}
.login-logo img { width: 72px; height: 72px; }

.login-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.login-subtitle { font-size: 0.8rem; color: var(--text-dim); font-family: var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-form .btn-primary { margin-top: 0.25rem; height: 46px; font-size: 0.95rem; }
.login-footer { text-align: center; font-size: 0.75rem; color: var(--text-dim); font-family: var(--font-mono); }

/* ============================================================
   HOME VIEW
   ============================================================ */
#view-home { padding: 1.25rem; gap: 1.25rem; overflow-y: auto; }

.home-header { display: flex; flex-direction: column; gap: 0.2rem; }
.home-header h2 { font-size: 1.1rem; font-weight: 700; }
.home-header p  { font-size: 0.8rem; }
.home-actions { display: flex; flex-direction: column; gap: 0.75rem; }

.action-card {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer; transition: border-color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.action-card:hover, .action-card:active { border-color: var(--blue-mid); background: var(--bg-hover); }

.action-icon { width: 42px; height: 42px; border-radius: 10px; background: rgba(31,78,121,0.3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.action-icon svg { width: 22px; height: 22px; color: var(--blue-light); }
.action-text { flex: 1; }
.action-text strong { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.action-text span   { font-size: 0.75rem; color: var(--text-mid); }
.action-arrow { color: var(--text-dim); }
.action-arrow svg { width: 16px; height: 16px; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.section-title h3 { font-size: 0.75rem; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mid); }

.scan-list { display: flex; flex-direction: column; gap: 0.5rem; }

.scan-item { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: border-color var(--transition); }
.scan-item:hover { border-color: var(--border-mid); }

.scan-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-done       { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-processing { background: var(--warning); box-shadow: 0 0 6px var(--warning); animation: pulse 1.5s infinite; }
.status-error      { background: var(--error);   box-shadow: 0 0 6px var(--error); }
.status-pending    { background: var(--text-dim); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.scan-info { flex: 1; overflow: hidden; }
.scan-info strong { display: block; font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-info span   { font-size: 0.72rem; color: var(--text-dim); font-family: var(--font-mono); }

.scan-badge { font-family: var(--font-mono); font-size: 0.65rem; padding: 0.15rem 0.45rem; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; }
.badge-done       { background: rgba(46,160,67,0.15);  color: #6ee48a; }
.badge-processing { background: rgba(210,153,34,0.15); color: #f0c060; }
.badge-error      { background: rgba(248,81,73,0.15);  color: #ff8080; }
.badge-pending    { background: rgba(74,85,104,0.2);   color: var(--text-mid); }

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--text-dim); font-size: 0.8rem; font-family: var(--font-mono); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ============================================================
   KAMERA-VIEW  (Schritt 16)
   ============================================================ */

#view-scan {
  position: relative;
  overflow: hidden;
  background: #000;
  /* Kein padding — voller Viewport-Füller */
}

/* Im Kamera-View: Navbar + Tabbar verstecken */
body.cam-active #navbar,
body.cam-active #tabbar { display: none; }

/* Video-Feed */
#cam-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Overlay-Canvas (Eck-Rahmen) */
#cam-overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}

/* Flash */
#cam-flash {
  position: absolute; inset: 0;
  background: #fff; z-index: 10;
  pointer-events: none; opacity: 0;
}
#cam-flash.flashing { animation: cam-flash 280ms ease-out forwards; }
@keyframes cam-flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

/* Top-HUD */
.cam-hud-top {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0; right: 0; z-index: 2;
  padding: 0.75rem 1rem 0.5rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.72) 0%, transparent 100%);
  display: flex; flex-direction: column; gap: 0.4rem;
}

.cam-hud-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }

.cam-score-wrap { display: flex; align-items: baseline; gap: 0.3rem; }
#cam-score { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 500; color: #fff; min-width: 3ch; text-align: right; line-height: 1; }
.cam-score-label { font-family: var(--font-mono); font-size: 0.65rem; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.08em; }

.cam-page-wrap { display: flex; align-items: center; gap: 0.4rem; font-family: var(--font-mono); font-size: 0.75rem; color: rgba(255,255,255,0.7); }
.cam-page-wrap svg { width: 14px; height: 14px; }

.cam-bar-track { height: 4px; background: rgba(255,255,255,0.12); border-radius: 2px; overflow: hidden; }
.cam-bar-fill { height: 100%; border-radius: 2px; transition: width 300ms ease, background 300ms ease; width: 0%; }
.cam-bar-fill.blurry { background: #f85149; }
.cam-bar-fill.medium { background: #d29922; }
.cam-bar-fill.sharp  { background: #2ea043; box-shadow: 0 0 8px rgba(46,160,67,0.6); }

#cam-status { font-family: var(--font-mono); font-size: 0.7rem; text-align: center; min-height: 1em; padding: 0 0.5rem; letter-spacing: 0.04em; }
.cam-status-info    { color: #7ab8f5; }
.cam-status-success { color: #6ee48a; }
.cam-status-error   { color: #ff8080; }

/* Bottom-Controls */
.cam-controls {
  position: absolute;
  bottom: env(safe-area-inset-bottom, 0px);
  left: 0; right: 0; z-index: 2;
  padding: 1rem 1.25rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  display: flex; flex-direction: column; gap: 1rem;
}

.cam-action-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cam-secondary-row { display: flex; align-items: center; justify-content: center; }

/* Auslöser */
#btn-capture {
  width: 68px; height: 68px; border-radius: 50%; background: #fff; border: none;
  cursor: pointer; position: relative; flex-shrink: 0;
  transition: transform 120ms ease, box-shadow 120ms ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 0 4px rgba(255,255,255,0.2);
}
#btn-capture::after { content: ''; position: absolute; inset: 5px; border-radius: 50%; border: 2px solid rgba(0,0,0,0.15); }
#btn-capture:active  { transform: scale(0.92); box-shadow: 0 0 0 6px rgba(255,255,255,0.15); }
#btn-capture:disabled { opacity: 0.5; transform: none; }

/* Abbrechen & Fertig */
.cam-side-btn {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius); color: #fff;
  font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600;
  padding: 0.5rem 0.9rem; cursor: pointer; transition: background var(--transition);
  -webkit-tap-highlight-color: transparent; min-width: 80px; text-align: center;
}
.cam-side-btn:hover  { background: rgba(255,255,255,0.18); }
.cam-side-btn:active { background: rgba(255,255,255,0.08); }

#btn-cam-done { background: rgba(31,78,121,0.6); border-color: rgba(59,130,212,0.4); }
#btn-cam-done:hover { background: rgba(37,99,168,0.7); }

/* Auto-Toggle */
#btn-auto-toggle {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px; color: rgba(255,255,255,0.6);
  font-family: var(--font-mono); font-size: 0.7rem;
  padding: 0.35rem 0.75rem; cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
#btn-auto-toggle svg { width: 13px; height: 13px; }
#btn-auto-toggle.auto-active { background: rgba(46,160,67,0.2); border-color: rgba(46,160,67,0.5); color: #6ee48a; }

/* Unsichtbarer Mess-Canvas */
#cam-canvas { display: none; }

/* ============================================================
   PAGES-VIEW  (Schritt 17)
   ============================================================ */

#view-pages {
  overflow: hidden;
}

/* Header */
.pages-header {
  padding: 1.1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pages-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pages-header-top h2 {
  font-size: 1rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.pages-count-wrap {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-mid);
}

.pages-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.pages-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  min-height: 1em;
}
.pages-status-success { color: #6ee48a; }
.pages-status-error   { color: #ff8080; }
.pages-status-info    { color: #7ab8f5; }

/* Scrollbare Seiten-Liste */
.pages-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  align-content: start;
}

.pages-loading,
.pages-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Seiten-Karte */
.page-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  cursor: grab;
  transition: border-color var(--transition), box-shadow var(--transition), opacity var(--transition);
  user-select: none;
  -webkit-user-select: none;
}

.page-card:active  { cursor: grabbing; }
.page-card.dragging {
  opacity: 0.45;
  box-shadow: var(--shadow-lg);
}
.page-card.drag-over {
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 2px var(--blue-glow);
}

/* Thumbnail-Bereich */
.page-thumb-wrap {
  position: relative;
  aspect-ratio: 3/4;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-thumb-placeholder {
  color: var(--text-dim);
}
.page-thumb-placeholder svg {
  width: 32px;
  height: 32px;
}

/* Seiten-Nummer Badge */
.page-number {
  position: absolute;
  top: 5px;
  left: 6px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  line-height: 1.4;
}

/* Meta-Zeile unter Thumbnail */
.page-meta {
  padding: 0.4rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.page-meta-row {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  flex: 1;
}

.btn-page-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 3px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn-page-delete svg { width: 14px; height: 14px; }
.btn-page-delete:hover { color: var(--error); background: rgba(248,81,73,0.1); }

/* Drag-Handle oben rechts */
.page-drag-handle {
  position: absolute;
  top: 5px;
  right: 6px;
  color: rgba(255,255,255,0.55);
  cursor: grab;
  padding: 2px;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}
.page-drag-handle svg { width: 14px; height: 14px; }
.page-drag-handle:active { cursor: grabbing; }

/* Footer: Aktions-Buttons */
.pages-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.pages-footer .btn {
  flex: 1;
  max-width: 160px;
}

/* ============================================================
   RECIPIENTS-VIEW  (Schritt 18)
   ============================================================ */

#view-recipients {
  position: relative;
  overflow: hidden;
}

/* Header */
.rec-header {
  padding: 1.1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rec-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rec-header-top h2 { font-size: 1rem; font-weight: 700; }

.rec-count-badge {
  background: var(--blue);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.rec-hint { font-size: 0.75rem; color: var(--text-dim); }

.rec-status { font-family: var(--font-mono); font-size: 0.72rem; min-height: 1em; }
.rec-status-success { color: #6ee48a; }
.rec-status-error   { color: #ff8080; }
.rec-status-info    { color: #7ab8f5; }

/* Neuer-Empfänger-Formular */
.rec-add-form {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-shrink: 0;
}

.rec-add-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

@media (max-width: 380px) {
  .rec-add-fields { grid-template-columns: 1fr; }
}

.rec-add-btns {
  display: flex;
  gap: 0.5rem;
}

/* Versand-Overlay */
.rec-sending {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(13,17,23,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-mid);
  flex-direction: column;
  backdrop-filter: blur(4px);
}

.rec-sending .spinner { width: 28px; height: 28px; border-width: 3px; }
.rec-sending-success  { color: #6ee48a; }
.rec-sending-success .spinner { display: none; }

/* Empfänger-Liste */
.rec-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rec-loading,
.rec-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Empfänger-Karte */
.rec-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.rec-item:hover  { border-color: var(--border-mid); }
.rec-item.selected {
  border-color: var(--blue-mid);
  background: rgba(31,78,121,0.15);
}

/* Checkmark-Button */
.rec-check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border-mid);
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.rec-check svg { width: 13px; height: 13px; color: transparent; transition: color var(--transition); }

.rec-item.selected .rec-check {
  border-color: var(--blue-light);
  background: var(--blue);
}
.rec-item.selected .rec-check svg { color: #fff; }

/* Info */
.rec-info { flex: 1; overflow: hidden; }
.rec-info strong { display: block; font-size: 0.875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-info span   { font-size: 0.72rem; color: var(--text-mid); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* Aktions-Buttons */
.rec-actions { display: flex; gap: 0.15rem; flex-shrink: 0; }
.rec-actions .btn-icon svg { width: 15px; height: 15px; }
.rec-actions .btn-rec-delete:hover { color: var(--error); }

/* Inline-Edit-Zeile */
.rec-item-edit {
  padding: 0.7rem 0.85rem;
  background: var(--bg-hover);
  border: 1px solid var(--blue-mid);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: -4px;
}

.rec-edit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
@media (max-width: 380px) { .rec-edit-fields { grid-template-columns: 1fr; } }

.rec-edit-btns { display: flex; gap: 0.5rem; }

/* Footer */
.rec-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
}

.rec-footer .btn { flex: 1; }
.rec-footer #btn-rec-send { max-width: 140px; }

/* =============================================================
   Durchreiche — CSS-Ergänzungen Schritt 19 (History) + 20 (PWA)
   Diese Blöcke ans Ende der bestehenden style.css anhängen.
   ============================================================= */

/* ------------------------------------------------------------------
   HISTORY VIEW
   ------------------------------------------------------------------ */

#view-history {
  overflow: hidden;
}

.hist-header {
  padding: var(--space-4) var(--space-4) var(--space-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.hist-header h2 {
  margin: 0 0 var(--space-3) 0;
  font-size: 1.2rem;
  color: var(--text-primary);
}

/* Suchfeld */
.hist-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: var(--space-3);
}

.hist-search-wrap svg {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  pointer-events: none;
}

.hist-search {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.25rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s;
}

.hist-search::placeholder {
  color: var(--text-muted);
}

.hist-search:focus {
  border-color: var(--accent);
}

/* Filter-Tabs */
.hist-filters {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}

.hist-filter-btn {
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.hist-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Status-Zeile */
.hist-status {
  font-size: 0.8rem;
  padding: 0.2rem 0;
  min-height: 1.2rem;
}

.hist-status-error { color: var(--color-error, #e05c5c); }

/* Liste */
.hist-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-2) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hist-loading,
.hist-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: var(--space-6) 0;
}

/* Einzelner Eintrag */
.hist-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.hist-item:hover,
.hist-item:focus-visible {
  background: var(--surface-3, var(--surface-2));
  border-color: var(--accent);
  outline: none;
}

.hist-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hist-item-info strong {
  font-size: 0.9rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-item-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hist-item-sent {
  font-size: 0.72rem;
  color: var(--color-success, #6ee48a);
  font-family: var(--font-mono);
}

/* "Mehr laden"-Wrapper */
.hist-more-wrap {
  padding: var(--space-3) var(--space-4);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

/* ------------------------------------------------------------------
   HISTORY DETAIL-OVERLAY
   ------------------------------------------------------------------ */

.hist-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.hist-overlay.active {
  display: flex;
}

.hist-overlay-box {
  background: var(--surface-1);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 540px;
  max-height: 80dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.22s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.hist-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.hist-overlay-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.hist-overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  -webkit-overflow-scrolling: touch;
}

.hist-overlay-loading,
.hist-overlay-error {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: var(--space-6) 0;
}

.hist-overlay-error { color: var(--color-error, #e05c5c); }

/* Detail-DL (Definition List) */
.hist-detail-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin: 0 0 var(--space-4) 0;
}

.hist-detail-dl dt {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  padding-top: 0.1rem;
}

.hist-detail-dl dd {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-primary);
  word-break: break-word;
}

/* Sektionen im Overlay */
.hist-detail-section {
  margin-top: var(--space-4);
}

.hist-detail-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 var(--space-2) 0;
}

/* Empfänger-Liste im Detail */
.hist-detail-rec-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hist-detail-rec {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hist-detail-rec-name {
  font-size: 0.875rem;
  color: var(--text-primary);
}

.hist-detail-rec-email {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Seiten-Metadaten im Detail */
.hist-detail-pages {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.hist-detail-page {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.82rem;
  color: var(--text-primary);
}

.hist-detail-page-nr {
  color: var(--text-muted);
  min-width: 1.4rem;
  font-family: var(--font-mono);
}

.hist-detail-page-fmt {
  flex: 1;
}

.hist-empty-inline {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* =============================================================
   PWA — INSTALL-BANNER (optional, falls SW "beforeinstallprompt" feuert)
   ============================================================= */

.pwa-install-banner {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 4.5rem);
  left: var(--space-4);
  right: var(--space-4);
  background: var(--blue);
  color: #fff;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: 0.875rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  z-index: 150;
  animation: slideUp 0.25s ease-out;
}

.pwa-install-banner p {
  margin: 0;
  flex: 1;
}

.pwa-install-banner .btn-install {
  background: #fff;
  color: var(--blue);
  border: none;
  border-radius: var(--radius);
  padding: 0.4rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.pwa-install-banner .btn-dismiss {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
}

/* ===========================================================
   ADMIN VIEW
   Ans Ende von style.css anhängen
   =========================================================== */

.admin-header {
  padding: var(--space-lg) var(--space-md) var(--space-sm);
}

.admin-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.2rem;
}

.admin-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0;
}

.admin-body {
  padding: var(--space-sm) var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.admin-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.admin-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-row {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
}

.form-group-check {
  display: flex;
  align-items: center;
  padding-bottom: 0.5rem;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.check-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.admin-actions {
  display: flex;
  gap: var(--space-sm);
  padding-top: var(--space-xs);
}

.admin-actions .btn {
  flex: 1;
}

.admin-status {
  min-height: 1.2rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  padding: 0;
  transition: all 0.2s;
}

.admin-status-info {
  color: var(--color-text-muted);
}

.admin-status-success {
  color: var(--color-success, #2d7a3a);
  padding: 0.4rem 0.6rem;
  background: color-mix(in srgb, var(--color-success, #2d7a3a) 10%, transparent);
}

.admin-status-error {
  color: var(--color-error, #b91c1c);
  padding: 0.4rem 0.6rem;
  background: color-mix(in srgb, var(--color-error, #b91c1c) 10%, transparent);
}

/* =============================================================
   KAMERA-VIEW — fehlende Row-Layouts (KON7)
   ============================================================= */

.cam-secondary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cam-capture-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-done-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* =============================================================
   HISTORY — Löschen im Detail-Overlay (KON7)
   ============================================================= */

.hist-detail-delete-wrap {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.hist-delete-status {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  min-height: 1em;
}

.hist-delete-status-info  { color: var(--text-mid); }
.hist-delete-status-error { color: var(--error); }


/* Thumbnail-Bild in page-card */
.page-thumb-wrap img.page-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* ============================================================
   Mandantenverwaltung (Admin-View)
   ============================================================ */

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.admin-section-head-toggle {
  margin-bottom: 0;
  padding: 0.25rem 0;
  border-radius: var(--radius);
  user-select: none;
}
.admin-section-head-toggle:hover { opacity: 0.8; }
.smtp-collapsible-body { padding-top: 0.75rem; }

.admin-inline-form {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}

.admin-loading {
  color: var(--text-mid);
  font-size: 0.875rem;
  padding: 0.5rem 0;
}

/* Tenant-Cards */
.tenant-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tenant-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tenant-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}

.tenant-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.tenant-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tenant-slug {
  font-size: 0.75rem;
  color: var(--text-mid);
  font-family: var(--font-mono);
}

.tenant-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Status-Badges */
.status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-active {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.badge-inactive {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* User-Panel (aufgeklappt) */
.tenant-users-panel {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  background: var(--bg);
}

.user-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.user-panel-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.user-row-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.user-email {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 0.7rem;
  color: var(--text-mid);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* Kleine Button-Varianten */
.btn-xs {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  min-height: unset;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  min-height: unset;
}

/* ============================================================
   Tenant-SMTP-Panel
   ============================================================ */

.tenant-smtp-panel {
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  background: var(--bg);
}

.smtp-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.smtp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Danger-Button (Löschen) */
.btn-danger {
  background: transparent;
  color: var(--error, #f87171);
  border: 1px solid var(--error, #f87171);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

.panel-flash-status {
  font-size: 0.8rem;
  min-height: 1em;
}

/* ============================================================
   Admin Master-Detail
   ============================================================ */

/* Zurück-Button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: none;
  color: var(--blue-light);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0;
  margin-bottom: 0.5rem;
}
.btn-back:hover { color: var(--text); }

/* Detail-Header */
.detail-header {
  margin-bottom: 0.75rem;
}
.detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.detail-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

/* Admin-Hint */
.admin-hint {
  font-size: 0.8rem;
  color: var(--text-mid);
  margin: 0 0 0.75rem;
}

/* Tenant-Zeilen (Level 1 Liste) */
.tenant-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.tenant-row:hover { background: var(--bg-hover); }

.tenant-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}
.tenant-row-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.chevron-right { color: var(--text-mid); }

/* User-Cards (Level 2) */
.user-list-admin {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
}
.user-card-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.user-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* Empfänger-Panel (pro User) */
.user-recipients-panel {
  border-top: 1px solid var(--border);
  padding: 0.65rem 0.875rem;
  background: var(--bg);
}
.rec-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.rec-panel-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.rec-list-admin {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.rec-row-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.rec-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.rec-name {
  font-size: 0.8rem;
  font-weight: 500;
}
.rec-email-text {
  font-size: 0.78rem;
  color: var(--text-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Register View (Einladungs-Token, KON8)
   ============================================================ */

/* Readonly-Input (vorausgefüllte E-Mail) */
.input-readonly {
  background: var(--bg-card);
  color: var(--text-mid);
  cursor: default;
  opacity: 0.75;
}

/* Pending-Badge (Einladung ausstehend) */
.badge-pending {
  background: color-mix(in srgb, var(--warning, #e6a817) 15%, transparent);
  color: var(--warning, #e6a817);
  border-color: color-mix(in srgb, var(--warning, #e6a817) 40%, transparent);
}

/* Name + E-Mail nebeneinander in SMTP-Absender-Zeile */
.smtp-addr-row {
  display: flex;
  gap: 0.5rem;
}
.smtp-addr-row input:first-child {
  flex: 0 0 40%;
}
.smtp-addr-row input:last-child {
  flex: 1;
}

/* Hint-Text neben SMTP-Absender-Labels */
.smtp-from-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-mid);
  margin-left: 0.25rem;
}

/* Login-Alert (für Register-View wiederverwendet) */
.login-alert {
  background: color-mix(in srgb, var(--error) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 40%, transparent);
  color: var(--error);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
