/* Neuhaus Visuals Portal — v2
   Weiss, präzise, hochwertig. Farbe nur für Status. Bewegung nur als Antwort auf Aktionen. */

:root {
  --paper: #ffffff;
  --surface: #fafafa;
  --ink: #0d0d0d;
  --grey: #6b6b6b;
  --grey-light: #9c9c9c;
  --line: #ebebeb;
  --line-strong: #dcdcdc;
  --ok: #0f7a45;
  --ok-bg: #edf7f1;
  --ok-line: #bfe0cd;
  --warn: #b04a08;
  --warn-bg: #fdf3ea;
  --warn-line: #eed3ba;
  --pending: #8a8a8a;
  --pending-bg: #f4f4f4;
  --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --r-card: 14px;
  --r-ctrl: 9px;
  --t-fast: 150ms cubic-bezier(0.3, 0.7, 0.4, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: "Switzer", -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

::selection { background: var(--ink); color: var(--paper); }

a { color: inherit; }

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

input, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-ctrl);
  padding: 11px 14px;
  width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

input:hover, textarea:hover { border-color: #b9b9b9; }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.07);
}

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Kopfzeile ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 60px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 15px;
}

.wordmark .mono {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.wordmark span.sub { color: var(--grey); font-weight: 400; }

.topbar-right { display: flex; align-items: center; gap: 18px; }

.topbar-user { font-size: 14px; color: var(--grey); }

.btn-quiet {
  font-size: 14px;
  color: var(--grey);
  transition: color var(--t-fast);
}

.btn-quiet:hover { color: var(--ink); }

/* ---------- Layout ---------- */

.wrap { max-width: 980px; margin: 0 auto; padding: 44px 28px 120px; }

.view { animation: view-in 240ms cubic-bezier(0.25, 0.7, 0.3, 1); }

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.page-head { margin-bottom: 36px; }

.page-title {
  font-size: 33px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.12;
}

.page-sub { color: var(--grey); margin-top: 8px; font-size: 15.5px; max-width: 640px; }

.crumb {
  font-size: 14px;
  color: var(--grey);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  transition: color var(--t-fast);
}

.crumb:hover { color: var(--ink); }

/* ---------- Knöpfe ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  font-size: 14.5px;
  font-weight: 500;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--ink);
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
  white-space: nowrap;
}

.btn:hover { background: #262626; }
.btn:active { transform: scale(0.985); }

.btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--ink); background: var(--paper); }

.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.ok:hover { background: #0c6339; }

.btn.small { padding: 7px 13px; font-size: 13.5px; }

.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.btn .spinner {
  width: 13px; height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

/* ---------- Karten-Listen ---------- */

.cards { display: flex; flex-direction: column; gap: 12px; }

.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px 22px;
  text-decoration: none;
  background: var(--paper);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

a.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-hover); transform: translateY(-1px); }

.card-main { min-width: 0; }

.card-title { font-size: 17.5px; font-weight: 600; letter-spacing: -0.012em; }

.card-meta { font-size: 13.5px; color: var(--grey); margin-top: 4px; }

.card-side { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Status ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--grey);
  background: var(--paper);
  white-space: nowrap;
}

.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.chip.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.chip.pending { color: var(--pending); background: var(--pending-bg); border-color: var(--line-strong); }
.chip.plain::before { display: none; }

/* ---------- Login ---------- */

.login-stage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 500px at 50% -10%, #f6f6f6 0%, rgba(246, 246, 246, 0) 70%),
    var(--paper);
}

.login-box {
  width: 100%;
  max-width: 410px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 40px 36px 32px;
  background: var(--paper);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05);
}

.login-mark { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }

.login-mark .mono {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.login-mark .name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.login-mark .name span { color: var(--grey); font-weight: 400; }

.login-lead { color: var(--grey); font-size: 14.5px; margin-bottom: 26px; line-height: 1.5; }

.field { margin-bottom: 16px; }

.field label { display: block; font-size: 13.5px; color: var(--grey); margin-bottom: 7px; }

.login-box .btn { width: 100%; padding: 12px; }

.login-switch { margin-top: 22px; font-size: 13.5px; color: var(--grey); text-align: center; }

.key-input { letter-spacing: 0.1em; text-transform: uppercase; text-align: center; font-weight: 500; }

.error-note { color: var(--warn); font-size: 13.5px; margin-top: 10px; min-height: 18px; }

/* ---------- Formulare inline ---------- */

.inline-form { display: flex; gap: 10px; margin: 26px 0 30px; }
.inline-form input { flex: 1; }

/* ---------- Key-Anzeige ---------- */

.keybox {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.keybox-left .keybox-label { font-size: 12.5px; color: var(--grey); margin-bottom: 3px; }

.keybox-code { font-size: 19px; font-weight: 600; letter-spacing: 0.09em; }

.keybox-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Status-Übersicht (Episode) ---------- */

.stat-strip { display: flex; gap: 12px; margin: 0 0 8px; flex-wrap: wrap; }

.stat {
  flex: 1;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px 20px;
  background: var(--paper);
  transition: border-color var(--t-fast);
}

.stat-num { font-size: 27px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }

.stat-label { font-size: 13px; color: var(--grey); margin-top: 3px; }

.stat.s-open .stat-num { color: var(--ink); }
.stat.s-ok .stat-num { color: var(--ok); }
.stat.s-warn .stat-num { color: var(--warn); }

.stat.pulse { animation: stat-pulse 500ms ease; }

@keyframes stat-pulse {
  0% { background: var(--surface); }
  100% { background: var(--paper); }
}

/* ---------- Sektionen ---------- */

.section { margin-top: 44px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.section-title { font-size: 18px; font-weight: 600; letter-spacing: -0.012em; }

.section-count { font-size: 13px; color: var(--grey-light); }

.section-hint {
  font-size: 13.5px;
  color: var(--grey);
  margin: 10px 0 2px;
  max-width: 620px;
  line-height: 1.5;
}

/* ---------- Assets ---------- */

.asset {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px 22px;
  margin-top: 14px;
  background: var(--paper);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), opacity 300ms ease;
}

.asset.flash { animation: flash-in 500ms ease; }

@keyframes flash-in {
  0% { background: var(--surface); }
  100% { background: var(--paper); }
}

.asset.removing { opacity: 0; transform: scale(0.99); }

.asset-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.asset-label { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.asset-file { font-size: 12.5px; color: var(--grey-light); margin-top: 3px; word-break: break-all; }

.asset-text { font-size: 16.5px; margin-top: 12px; max-width: 660px; white-space: pre-wrap; line-height: 1.6; }

.asset-media { margin-top: 16px; }

.asset-media video {
  width: 100%;
  max-width: 720px;
  background: #000;
  display: block;
  border-radius: 10px;
}

.asset-media img {
  width: 100%;
  max-width: 460px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.asset-media.short video { max-width: 290px; }

.asset-actions { display: flex; align-items: center; gap: 9px; margin-top: 16px; flex-wrap: wrap; }

.comment-form { margin-top: 14px; max-width: 660px; overflow: hidden; }
.comment-form textarea { min-height: 88px; resize: vertical; }
.comment-form .btn { margin-top: 10px; }

.note {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  max-width: 660px;
  line-height: 1.5;
}

.note.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: #6d3410; }
.note.ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: #0b4f2e; }
.note strong { font-weight: 600; }

/* ---------- Upload ---------- */

.upload-zone { margin-top: 16px; }

.upload-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-card);
  padding: 26px 22px;
  text-align: center;
  color: var(--grey);
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.upload-drop:hover, .upload-drop.drag { border-color: var(--ink); color: var(--ink); background: var(--surface); }

.upload-drop .big { display: block; font-weight: 500; font-size: 14.5px; color: var(--ink); margin-bottom: 3px; }

.upload-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  margin-top: 10px;
  font-size: 13.5px;
  transition: opacity 400ms ease;
}

.upload-item.done { opacity: 0; }

.upload-item .upload-name { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); font-weight: 500; }
.upload-item .upload-pct { color: var(--grey); font-variant-numeric: tabular-nums; }

.progress { height: 4px; background: var(--line); border-radius: 999px; margin-top: 9px; overflow: hidden; }

.progress-bar { height: 100%; background: var(--ink); width: 0%; border-radius: 999px; transition: width 200ms linear; }

.upload-item.error { border-color: var(--warn-line); background: var(--warn-bg); }
.upload-item.error .upload-name { color: var(--warn); }

/* ---------- Aktivität ---------- */

.activity-list { border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }

.activity-item { padding: 15px 20px; font-size: 14.5px; border-bottom: 1px solid var(--line); background: var(--paper); }
.activity-item:last-child { border-bottom: none; }
.activity-when { font-size: 12.5px; color: var(--grey-light); margin-top: 3px; }
.activity-comment { color: var(--grey); margin-top: 2px; }

/* ---------- Leere Zustände ---------- */

.empty {
  padding: 34px 22px;
  color: var(--grey);
  font-size: 14.5px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-card);
  margin-top: 14px;
}

/* ---------- Episoden-Fussleiste ---------- */

.footer-bar {
  margin-top: 52px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-note { font-size: 14px; color: var(--grey); }

/* ---------- Skeleton ---------- */

.skeleton { display: flex; flex-direction: column; gap: 12px; }

.skel {
  border-radius: var(--r-card);
  background: linear-gradient(90deg, #f3f3f3 25%, #ececec 45%, #f3f3f3 65%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.skel.h-title { height: 36px; width: 45%; margin-bottom: 26px; }
.skel.h-card { height: 76px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 20px;
  font-size: 14px;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 50;
  max-width: min(90vw, 480px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

@media (max-width: 660px) {
  .wrap { padding: 30px 18px 90px; }
  .page-title { font-size: 26px; }
  .topbar { padding: 0 18px; }
  .card { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-side { justify-content: flex-start; }
  .login-box { padding: 30px 24px 26px; }
}
