:root {
  --bg: #0a0e14;
  --bg-mid: #0f1624;
  --card: rgba(22, 32, 48, 0.72);
  --text: #eef2f8;
  --muted: #8b9cb3;
  --accent: #4d8fff;
  --accent-soft: rgba(77, 143, 255, 0.14);
  --gold: #d4b87a;
  --gold-soft: rgba(212, 184, 122, 0.12);
  --danger: #f07178;
  --ok: #3ecf8e;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  font-family: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.55;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, rgba(77, 143, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 90% 70% at 0% 100%, rgba(212, 184, 122, 0.1), transparent 50%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-mid) 45%, #0c121c 100%);
  background-attachment: fixed;
}

.shell {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.shell-wide {
  max-width: 980px;
}

.dashboard-layout {
  padding-top: 2.25rem;
  padding-bottom: 3rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem 1.65rem;
  margin-bottom: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card-elevated {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.card-elevated h2 {
  position: relative;
  padding-bottom: 0.65rem;
  margin-bottom: 1.1rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.card-elevated h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2.5rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  opacity: 0.85;
}

.card-narrow { margin-top: 4rem; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.topbar-dashboard {
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 1.35rem 1.5rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(22, 32, 48, 0.85) 0%, rgba(18, 26, 40, 0.75) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  gap: 1.25rem 2rem;
}

.topbar-intro {
  flex: 1 1 280px;
  min-width: 0;
}

.topbar-intro h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(105deg, #fff 0%, #c8d4e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.topbar-meta {
  margin: 0;
  max-width: 52ch;
}

.topbar-aside {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.85rem;
  margin-left: auto;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem 0.45rem 0.55rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(145deg, var(--gold-soft), var(--accent-soft));
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.brand-badge--proud {
  padding: 0.15rem 0.35rem;
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Feste Maximalgröße: HTML-Attribute am Bild sind nur Aspect-Ratio-Hinweis */
.brand-badge__logo {
  display: block;
  width: auto;
  height: auto;
  max-height: 22px;
  max-width: min(90px, 26vw);
  object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4));
}

.brand-badge:hover {
  border-color: rgba(77, 143, 255, 0.35);
  box-shadow: 0 8px 28px rgba(77, 143, 255, 0.12);
  transform: translateY(-1px);
}

.brand-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.brand-badge__mark {
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.brand-badge__text {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  text-align: right;
}

.brand-badge__name {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #f5f0e4 0%, #fff 45%, #c8d8f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-badge__tagline {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.15rem;
}

.topbar h1 { margin: 0 0 0.25rem; }

h2 { margin-top: 0; font-size: 1.1rem; }

.muted { color: var(--muted); font-size: 0.9rem; }
.hint { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }

.error { color: var(--danger); }

.stack label {
  display: block;
  margin-bottom: 1rem;
}

.stack input[type="text"],
.stack input[type="password"],
.stack input[type="file"] {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0d1117;
  color: var(--text);
}

.row { display: flex; align-items: center; gap: 0.5rem; }

.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn.primary {
  background: linear-gradient(135deg, #5b94ff 0%, var(--accent) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(77, 143, 255, 0.25);
}

.btn.primary:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.btn.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

code { font-size: 0.85em; background: rgba(0,0,0,0.25); padding: 0.1em 0.35em; border-radius: 4px; }

.msg { margin-top: 0.5rem; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }

.upload-progress {
  margin: 0.35rem 0 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upload-progress__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}

.upload-progress__pct {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.upload-progress__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.upload-progress__fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #8ab4ff);
  transition: width 0.12s ease-out;
}

.upload-progress__track--indeterminate .upload-progress__fill {
  width: 35% !important;
  transition: none;
  animation: upload-shimmer 1.1s ease-in-out infinite;
}

@keyframes upload-shimmer {
  0% { transform: translateX(-100%); opacity: 0.6; }
  50% { opacity: 1; }
  100% { transform: translateX(320%); opacity: 0.6; }
}

.upload-progress__bytes {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
}

@media (prefers-reduced-motion: reduce) {
  .upload-progress__fill {
    transition: none;
  }
  .upload-progress__track--indeterminate .upload-progress__fill {
    animation: none;
    width: 50% !important;
  }
}

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table.data th, table.data td {
  text-align: left;
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

table.data tbody tr {
  transition: background 0.15s ease;
}

table.data tbody tr:hover {
  background: rgba(77, 143, 255, 0.06);
}

table.data th {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

table.data a { color: var(--accent); }

table.data a:hover {
  color: #8ab4ff;
}

.inline.loop-form { margin: 0; }
.switch { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .brand-badge {
    transition: none;
  }
  .brand-badge:hover {
    transform: none;
  }
  table.data tbody tr {
    transition: none;
  }
}

/* ——— Video-Kacheln & Vorschau ——— */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.video-tile {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(14, 20, 32, 0.65);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.video-tile:hover {
  border-color: rgba(77, 143, 255, 0.28);
  box-shadow: 0 12px 36px rgba(77, 143, 255, 0.1);
}

.video-tile__figure {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #1a2438 0%, #0e1522 100%);
  overflow: hidden;
}

.video-tile__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-tile__fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(77, 143, 255, 0.15), rgba(0, 0, 0, 0.4));
}

.video-tile__figure--fallback .video-tile__fallback {
  display: flex;
}

.video-tile__play-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 0.25rem;
}

.video-tile__preview-btn {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.video-tile__preview-btn:hover {
  background: rgba(77, 143, 255, 0.45);
  border-color: rgba(77, 143, 255, 0.5);
}

.video-tile__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.video-tile__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.video-tile__slug {
  margin: 0;
  font-size: 0.8rem;
  word-break: break-all;
}

.video-tile__slug a {
  color: var(--accent);
}

.video-tile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-top: 0.25rem;
}

.switch--tile {
  font-size: 0.85rem;
}

.video-tile__views {
  font-size: 0.8rem;
  color: var(--muted);
}

.video-tile__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.35rem;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.preview-modal[hidden] {
  display: none !important;
}

.preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.preview-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: min(85vh, 100%);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.preview-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.preview-modal__close:hover {
  background: rgba(240, 113, 120, 0.5);
}

.preview-modal__video {
  display: block;
  width: 100%;
  max-height: min(80vh, 720px);
  vertical-align: middle;
}

.player-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 0;
}

.player-page video {
  width: 100%;
  max-height: 100vh;
  outline: none;
}

/* ——— Login ——— */
.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .login-layout {
    grid-template-columns: minmax(280px, 1.05fr) minmax(360px, 0.95fr);
  }
}

.login-art {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 3.5rem);
  display: flex;
  align-items: flex-end;
  background: linear-gradient(145deg, #121a2a 0%, #0a101c 50%, #0d1524 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (min-width: 900px) {
  .login-art {
    align-items: center;
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
  }
}

.login-art__glow {
  position: absolute;
  inset: -40% -20% auto -30%;
  height: 85%;
  background: radial-gradient(ellipse at 30% 20%, rgba(77, 143, 255, 0.35), transparent 55%),
    radial-gradient(ellipse at 70% 60%, rgba(212, 184, 122, 0.18), transparent 45%);
  pointer-events: none;
}

.login-art__grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 100%);
  pointer-events: none;
}

.login-art__content {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}

.login-art__badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--gold);
  margin-bottom: 0.85rem;
  line-height: 1.35;
}

.login-art__lead {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(238, 242, 248, 0.92);
}

.login-art__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.login-art__list li {
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.75rem, 4vw, 3rem) 1.25rem 2.5rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: clamp(1.75rem, 4vw, 2.25rem);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(18, 26, 40, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1.75rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: opacity 0.2s ease;
}

.login-brand:hover {
  opacity: 0.92;
}

.login-brand__mark {
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.login-brand__text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.login-brand__name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #f5f0e4 0%, #e8eef8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-brand__suffix {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-header {
  margin-bottom: 1.5rem;
}

.login-title {
  margin: 0 0 0.4rem;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  background: linear-gradient(105deg, #fff 0%, #c8d4e8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-sub {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
}

.login-alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 10px;
  font-size: 0.88rem;
  color: #ffc9c9;
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.28);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.field__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.field__input {
  width: 100%;
  padding: 0.75rem 0.95rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: rgba(10, 14, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field__input::placeholder {
  color: rgba(139, 156, 179, 0.55);
}

.field__input:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.field__input:focus {
  outline: none;
  border-color: rgba(77, 143, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(77, 143, 255, 0.18);
}

.btn-login {
  margin-top: 0.35rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #6a9fff 0%, var(--accent) 45%, #3d7aed 100%);
  box-shadow: 0 6px 24px rgba(77, 143, 255, 0.32);
  transition: filter 0.2s ease, transform 0.15s ease;
}

.btn-login:hover {
  filter: brightness(1.05);
}

.btn-login:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .btn-login {
    transition: none;
  }
  .btn-login:active {
    transform: none;
  }
}
