/* =============================================================
   NetzCloud Video — Stylesheet
   Dunkles Premium-Design, Glassmorphism, NetzCloud-Blau.
   Mit hellem Theme via [data-theme="light"].
   ============================================================= */

:root {
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: rgba(37, 99, 235, .15);

  --bg: #0f0f10;
  --bg-2: #161618;
  --bg-3: #1f1f23;
  --surface: rgba(30, 30, 34, .7);
  --surface-solid: #18181b;
  --elev: #202024;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .14);

  --text: #f3f4f6;
  --text-dim: #a1a1aa;
  --text-mute: #71717a;

  --danger: #ef4444;
  --green: #22c55e;
  --amber: #f59e0b;

  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --shadow-soft: 0 4px 18px rgba(0, 0, 0, .25);

  --topbar-h: 60px;
  --sidebar-w: 240px;
  --blur: saturate(160%) blur(14px);
}

[data-theme="light"] {
  --bg: #f5f6f8;
  --bg-2: #ffffff;
  --bg-3: #eef0f3;
  --surface: rgba(255, 255, 255, .8);
  --surface-solid: #ffffff;
  --elev: #ffffff;
  --border: rgba(0, 0, 0, .09);
  --border-strong: rgba(0, 0, 0, .16);
  --text: #18181b;
  --text-dim: #52525b;
  --text-mute: #71717a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .12);
  --shadow-soft: 0 4px 18px rgba(0, 0, 0, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
input, textarea, select, button { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: var(--blue); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: padding-box; }

.muted { color: var(--text-dim); }
.pad { padding: 16px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 14px; }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 8px; }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.5px; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), #4f46e5);
  color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 14px var(--blue-soft);
}
.brand-text span { color: var(--blue); }
.brand-text { white-space: nowrap; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: none; cursor: pointer; color: var(--text);
  transition: background .15s;
}
.icon-btn:hover { background: var(--bg-3); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn.danger:hover { background: rgba(239,68,68,.15); color: var(--danger); }

/* Suche */
.search { position: relative; display: flex; width: min(560px, 100%); }
.search input {
  flex: 1; height: 42px; padding: 0 48px 0 18px;
  background: var(--bg-2); border: 1px solid var(--border-strong);
  border-radius: 999px; outline: none; transition: border .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.search-btn {
  position: absolute; right: 4px; top: 4px; width: 38px; height: 34px;
  border: none; background: transparent; cursor: pointer; color: var(--text-dim); border-radius: 999px;
}
.search-btn:hover { color: var(--text); }
.search-suggest {
  position: absolute; top: 48px; left: 0; right: 0;
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; z-index: 60; display: none;
}
.search-suggest.show { display: block; }
.search-suggest a { display: block; padding: 10px 16px; cursor: pointer; }
.search-suggest a:hover, .search-suggest a.active { background: var(--bg-3); }

/* Badges */
.badge {
  position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
}
.notif-wrap, .menu-wrap { position: relative; }
.avatar-btn { border: none; background: none; cursor: pointer; padding: 0; border-radius: 50%; }

/* Avatare */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-initial { display: inline-grid; place-items: center; color: #fff; font-weight: 700; }

/* Dropdowns */
.dropdown {
  position: absolute; right: 0; top: 50px; min-width: 260px;
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); padding: 8px; z-index: 70;
  animation: pop .14s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; background: none; border: none; cursor: pointer; color: var(--text); font-size: 14px; }
.dropdown a:hover, .dropdown button:hover { background: var(--bg-3); }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dropdown-user { display: flex; gap: 10px; align-items: center; }
.dropdown-user small { display: block; color: var(--text-dim); }
.dropdown-logout { color: var(--danger) !important; }
.dropdown-head { padding: 8px 12px; font-weight: 700; }
.notif-dropdown { min-width: 340px; max-height: 460px; overflow-y: auto; }
.notif-list .notif-item { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; align-items: flex-start; }
.notif-list .notif-item:hover { background: var(--bg-3); }
.notif-item.unread { background: var(--blue-soft); }
.notif-item small { color: var(--text-dim); display: block; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 14px;
  transition: transform .12s, background .15s, border .15s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn svg { width: 18px; height: 18px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn-block { display: flex; width: 100%; margin-bottom: 10px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--bg-3); }
.btn-subscribe { background: var(--text); color: var(--bg); }
.btn-subscribe:hover { opacity: .85; }
.btn-subscribed { background: var(--bg-3); color: var(--text); border-color: var(--border-strong); }
.btn-chip { background: var(--bg-3); color: var(--text); height: 38px; }
.btn-chip:hover { background: var(--border-strong); }
.ghost-btn { background: var(--bg-3); border: none; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 18px; }
.danger { color: var(--danger); }
button.danger:hover { background: rgba(239,68,68,.12); }

/* Pills & chips */
.pill { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; background: var(--bg-3); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid transparent; }
.pill:hover { background: var(--border-strong); }
.pill.active { background: var(--text); color: var(--bg); }

.chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; position: sticky; top: var(--topbar-h); background: var(--bg); z-index: 20; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 34px; padding: 0 14px; display: inline-flex; align-items: center; background: var(--bg-3); border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s; }
.chip:hover { background: var(--border-strong); }
.chip.active { background: var(--text); color: var(--bg); }

.sort-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 18px; flex-wrap: wrap; }

/* ---------------- Layout ---------------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }
.content { padding: 18px 24px 60px; min-width: 0; }
.content.narrow { max-width: 860px; margin: 0 auto; width: 100%; }

/* Sidebar */
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: start;
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 12px 10px 30px; scrollbar-width: thin;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 18px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.side-link svg { width: 22px; height: 22px; }
.side-link:hover { background: var(--bg-3); }
.side-link.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.side-link.active svg { stroke: var(--blue); }
.side-sep { height: 1px; background: var(--border); margin: 12px 8px; }
.side-title { padding: 8px 12px 4px; font-size: 13px; font-weight: 700; color: var(--text-dim); }
.side-footer { padding: 12px; color: var(--text-mute); display: flex; flex-direction: column; gap: 6px; }
.side-footer p { font-weight: 700; color: var(--text-dim); }
.side-footer small { font-size: 11px; }
.footer-link { display: inline-flex; align-items: center; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--bg-3); font-size: 13px; font-weight: 600; transition: background .15s; }
.footer-link:hover { background: var(--border-strong); color: var(--blue); }
.studio-nav .side-footer, .admin-nav .side-footer { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.auth-imprint { text-align: center; margin-top: 14px; }
.auth-imprint a { color: var(--text-dim); font-size: 13px; }
.auth-imprint a:hover { color: var(--blue); }
.sidebar-backdrop { display: none; }

/* ---------------- Video-Grid & Karten ---------------- */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px 16px; }
.vcard { display: flex; flex-direction: column; }
.vcard-thumb { position: relative; display: block; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.vcard-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.vcard:hover .vcard-thumb img { transform: scale(1.04); }
.thumb-placeholder { width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(135deg, var(--bg-3), var(--elev)); }
.thumb-placeholder span { font-size: 42px; font-weight: 800; color: var(--text-mute); }
.thumb-placeholder.sm span { font-size: 18px; }
.vcard-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.85); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.vcard-badge { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.8); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 6px; }
.vcard-body { display: flex; gap: 12px; padding: 12px 2px 0; }
.vcard-avatar { flex-shrink: 0; }
.vcard-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vcard-title { font-weight: 600; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard-channel { font-size: 13px; color: var(--text-dim); }
.vcard-channel:hover { color: var(--text); }
.vcard-stats { font-size: 13px; color: var(--text-dim); display: flex; gap: 5px; }
.dot { opacity: .6; }
.pl-count { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.85); color: #fff; font-size: 12px; padding: 3px 8px; border-radius: 6px; }

.shorts-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.shorts-grid .vcard-thumb { aspect-ratio: 9/16; }

/* Pagination */
.pagination { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 30px 0; }

/* Empty state */
.empty { text-align: center; padding: 70px 20px; }
.empty-icon { font-size: 54px; margin-bottom: 10px; }
.empty h2 { margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }

/* ---------------- Suchergebnisse ---------------- */
.search-results { display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.srow { display: grid; grid-template-columns: 360px 1fr; gap: 16px; }
.srow-thumb { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.srow-thumb img { width: 100%; height: 100%; object-fit: cover; }
.srow-title { font-size: 18px; font-weight: 600; }
.srow-channel { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0; color: var(--text-dim); font-size: 13px; }
.srow-desc { font-size: 13px; }
.channel-results { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.channel-result { display: flex; gap: 16px; align-items: center; padding: 12px; border-radius: var(--radius); }
.channel-result:hover { background: var(--bg-2); }
.channel-result small { display: block; color: var(--text-dim); }

/* ---------------- Watch ---------------- */
.watch-layout { grid-template-columns: 1fr 402px; gap: 24px; padding: 24px; max-width: 1700px; margin: 0 auto; }
.watch-layout.theater { grid-template-columns: 1fr; }
.watch-main { min-width: 0; }
.player-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; box-shadow: var(--shadow); }
.watch-layout.theater .player-wrap { aspect-ratio: auto; height: min(78vh, 760px); border-radius: 0; margin: -24px -24px 0; }
.player-video { width: 100%; height: 100%; background: #000; display: block; }
.player-wrap.mini { position: fixed; bottom: 18px; right: 18px; width: 380px; aspect-ratio: 16/9; z-index: 200; border-radius: 12px; box-shadow: var(--shadow); }

/* Player controls */
.player-controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 12px 8px; background: linear-gradient(transparent, rgba(0,0,0,.75)); opacity: 0; transition: opacity .2s; }
.player-wrap:hover .player-controls, .player-wrap.paused .player-controls { opacity: 1; }
.progress { position: relative; height: 5px; background: rgba(255,255,255,.25); border-radius: 4px; cursor: pointer; margin-bottom: 8px; transition: height .1s; }
.progress:hover { height: 8px; }
.progress-buffer { position: absolute; height: 100%; background: rgba(255,255,255,.35); border-radius: 4px; width: 0; }
.progress-filled { position: absolute; height: 100%; background: var(--blue); border-radius: 4px; width: 0; }
.progress-knob { position: absolute; top: 50%; width: 14px; height: 14px; background: var(--blue); border-radius: 50%; transform: translate(-50%, -50%); left: 0; opacity: 0; transition: opacity .1s; }
.progress:hover .progress-knob { opacity: 1; }
.controls-row { display: flex; align-items: center; gap: 6px; color: #fff; }
.pctrl { width: 38px; height: 38px; display: grid; place-items: center; background: none; border: none; color: #fff; cursor: pointer; border-radius: 8px; }
.pctrl:hover { background: rgba(255,255,255,.15); }
.pctrl svg { width: 22px; height: 22px; }
.volume { width: 80px; accent-color: #fff; cursor: pointer; }
.time { font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spacer { flex: 1; }
.speed { background: rgba(0,0,0,.4); color: #fff; border: none; border-radius: 6px; height: 30px; padding: 0 6px; cursor: pointer; }

.watch-title { font-size: 20px; font-weight: 700; margin: 16px 0 12px; }
.watch-actions { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.watch-channel { display: flex; align-items: center; gap: 12px; }
.watch-channel-info { display: flex; flex-direction: column; }
.watch-channel-name { font-weight: 600; }
.watch-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.likebar { display: flex; align-items: center; background: var(--bg-3); border-radius: 999px; height: 38px; }
.likebtn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; background: none; border: none; cursor: pointer; color: var(--text); font-weight: 600; font-size: 14px; border-radius: 999px; }
.likebtn:hover { background: var(--border-strong); }
.likebtn.active { color: var(--blue); }
.likebtn.active svg { stroke: var(--blue); fill: var(--blue-soft); }
.likebtn svg { width: 20px; height: 20px; }
.likebar-sep { width: 1px; height: 22px; background: var(--border-strong); }

.watch-desc { background: var(--bg-2); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; font-size: 14px; position: relative; }
.watch-desc-stats { display: flex; gap: 12px; font-weight: 600; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.cat-tag { background: var(--blue-soft); color: var(--blue); padding: 2px 10px; border-radius: 999px; font-size: 12px; }
.watch-desc-text { white-space: pre-wrap; max-height: 80px; overflow: hidden; transition: max-height .2s; word-break: break-word; }
.watch-desc.open .watch-desc-text { max-height: none; }
.desc-toggle { background: none; border: none; color: var(--text-dim); font-weight: 600; cursor: pointer; margin-top: 8px; padding: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { color: var(--blue); font-size: 13px; }

/* Empfohlen */
.watch-side { display: flex; flex-direction: column; gap: 8px; }
.side-heading { font-size: 16px; margin-bottom: 6px; }
.rec { display: grid; grid-template-columns: 168px 1fr; gap: 10px; padding: 4px; border-radius: 10px; }
.rec:hover { background: var(--bg-2); }
.rec-thumb { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: var(--bg-3); }
.rec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-title { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- Kommentare ---------------- */
.comments { margin-top: 30px; }
.comments-head { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; flex-wrap: wrap; }
.comments-head h2 { font-size: 18px; }
.comment-form { display: flex; gap: 12px; margin-bottom: 24px; }
.comment-input-wrap { flex: 1; }
.comment-form textarea, .comment-input-wrap textarea { width: 100%; background: none; border: none; border-bottom: 1px solid var(--border-strong); padding: 8px 0; resize: none; outline: none; color: var(--text); }
.comment-form textarea:focus { border-color: var(--text); }
.comment-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.comment-list { display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 14px; }
.comment-avatar { flex-shrink: 0; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; gap: 8px; align-items: baseline; }
.comment-author { font-weight: 600; font-size: 13px; }
.comment-time { font-size: 12px; }
.comment-text { margin: 3px 0 6px; white-space: pre-wrap; word-break: break-word; }
.comment-actions { display: flex; gap: 6px; align-items: center; }
.clike { display: inline-flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer; color: var(--text-dim); padding: 4px; border-radius: 6px; }
.clike svg { width: 17px; height: 17px; }
.clike:hover { background: var(--bg-3); color: var(--text); }
.clike.active { color: var(--blue); }
.clike.active svg { stroke: var(--blue); }
.ctext-btn { background: none; border: none; color: var(--text-dim); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.ctext-btn:hover { background: var(--bg-3); color: var(--text); }
.replies-toggle { background: none; border: none; color: var(--blue); font-weight: 600; cursor: pointer; margin-top: 8px; padding: 4px 0; font-size: 13px; }
.replies { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.reply-form { display: flex; gap: 10px; margin: 10px 0; }
.reply-form textarea { flex: 1; background: none; border: none; border-bottom: 1px solid var(--border-strong); outline: none; color: var(--text); resize: none; padding: 6px 0; }

/* ---------------- Kanal ---------------- */
.ch-banner { aspect-ratio: 6/1; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 18px; background: var(--bg-3); }
.ch-banner img { width: 100%; height: 100%; object-fit: cover; }
.ch-head { display: flex; gap: 24px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.ch-meta h1 { font-size: 26px; }
.ch-sub { margin: 6px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.ch-desc { max-width: 600px; color: var(--text-dim); margin: 8px 0; }
.ch-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.ch-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.ch-tab { padding: 12px 18px; font-weight: 600; color: var(--text-dim); border-bottom: 2px solid transparent; white-space: nowrap; }
.ch-tab.active { color: var(--text); border-color: var(--text); }
.ch-tab:hover { color: var(--text); }
.about-list { list-style: none; margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.narrow-card { max-width: 680px; }

/* ---------------- Cards & Forms ---------------- */
.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-soft); margin-bottom: 20px; }
.card h2 { font-size: 17px; margin-bottom: 14px; }
.settings-card { max-width: 720px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin: 14px 0 6px; }
.input { width: 100%; height: 44px; background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 14px; outline: none; color: var(--text); transition: border .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.card form .btn { margin-top: 16px; margin-right: 8px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form .input { width: auto; flex: 1; min-width: 160px; }

.banner-edit { aspect-ratio: 6/1; border-radius: var(--radius); background: var(--bg-3) center/cover no-repeat; display: grid; place-items: center; margin-bottom: -45px; }
.avatar-edit { display: flex; align-items: center; gap: 16px; }
.upload-pill { background: rgba(0,0,0,.6); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
[data-theme="light"] .upload-pill { background: rgba(0,0,0,.7); }

/* Auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--blue-soft), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow); }
.auth-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 18px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card form { margin-top: 14px; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--text-dim); }
.auth-alt a, .auth-hint a { color: var(--blue); font-weight: 600; }
.auth-hint { margin-top: 14px; text-align: center; font-size: 12px; }
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; }
.alert-error { background: rgba(239,68,68,.12); color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
[data-theme="light"] .alert-error { color: #b91c1c; }

/* ---------------- Studio / Admin ---------------- */
.studio-layout { display: grid; grid-template-columns: 250px 1fr; }
.studio-nav { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 18px 12px; border-right: 1px solid var(--border); }
.studio-profile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 0 20px; text-align: center; }
.studio-profile strong { margin-top: 8px; }
.studio-profile small { color: var(--text-dim); }
.studio-nav nav { display: flex; flex-direction: column; gap: 3px; }
.studio-link { display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 10px; font-weight: 500; font-size: 14px; }
.studio-link svg { width: 20px; height: 20px; }
.studio-link:hover { background: var(--bg-3); }
.studio-link.active { background: var(--blue-soft); color: var(--blue); }
.studio-content { padding: 26px 32px 60px; min-width: 0; }
.studio-topbar { background: var(--surface-solid); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 18px 0 26px; }
.stat-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-soft); }
.stat-card.warn { border-color: var(--amber); }
.stat-num { display: block; font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.stat-label { color: var(--text-dim); font-size: 13px; }
.studio-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }

.mini-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.mini-list li { display: flex; gap: 12px; align-items: center; }
.mini-thumb { width: 100px; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; background: var(--bg-3); flex-shrink: 0; display: block; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-info a { font-weight: 600; font-size: 14px; }
.mini-info small { display: block; }
.upload-cta .btn { margin-bottom: 10px; }

/* Tabellen */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.data-table th { text-align: left; padding: 12px 16px; color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--border); font-size: 13px; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: var(--bg-3); }
.tcell-video { display: flex; align-items: center; gap: 12px; }
.tcell-info { display: flex; flex-direction: column; min-width: 0; }
.tcell-info small { color: var(--text-dim); }
.tcell-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.vis-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--border-strong); text-transform: capitalize; }
.vis-public { background: rgba(34,197,94,.15); color: var(--green); border-color: transparent; }
.vis-private { background: rgba(239,68,68,.15); color: #f87171; border-color: transparent; }
.vis-unlisted { background: rgba(245,158,11,.15); color: var(--amber); border-color: transparent; }
.muted-row { opacity: .5; }

.storage-list { list-style: none; }
.storage-list li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border); }
.storage-list li:last-child { border: none; }
.storage-total { font-size: 16px; }
.storage-total strong { color: var(--blue); }
.log-mini { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.log-type { display: inline-block; background: var(--bg-3); padding: 1px 7px; border-radius: 6px; font-size: 11px; color: var(--blue); font-weight: 600; }
.log-full { max-height: 70vh; overflow-y: auto; font-size: 13px; }
.log-row { display: grid; grid-template-columns: 180px 130px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); align-items: center; }
.log-time { font-variant-numeric: tabular-nums; }
.studio-comment { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border); }
.studio-comment:last-child { border: none; }
.studio-comment-body { flex: 1; }
.data-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.json-view { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; overflow: auto; max-height: 70vh; font-family: 'Courier New', monospace; font-size: 12px; white-space: pre; line-height: 1.6; }

/* Upload */
.upload-cols { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 40px 20px; text-align: center; cursor: pointer; transition: border .15s, background .15s; margin-bottom: 6px; }
.dropzone:hover, .dropzone.drag { border-color: var(--blue); background: var(--blue-soft); }
.dropzone-icon { font-size: 40px; margin-bottom: 8px; color: var(--blue); }
.dropzone-selected { font-weight: 600; }
.thumb-drop { display: grid; place-items: center; aspect-ratio: 16/9; border: 2px dashed var(--border-strong); border-radius: var(--radius); cursor: pointer; overflow: hidden; background: var(--bg-3); position: relative; }
.thumb-drop img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.thumb-drop:hover { border-color: var(--blue); }
.upload-preview { width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16/9; }
.upload-progress { margin: 16px 0; }
.progress-bar { height: 10px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), #4f46e5); transition: width .2s; }
.progress-info { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; font-weight: 600; }

/* Shorts */
.shorts-page { padding: 0; }
.shorts-feed { height: calc(100vh - var(--topbar-h)); overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; }
.shorts-feed::-webkit-scrollbar { display: none; }
.short { height: calc(100vh - var(--topbar-h)); scroll-snap-align: start; display: grid; place-items: center; position: relative; }
.short-video { height: 92%; aspect-ratio: 9/16; max-width: 95%; object-fit: cover; border-radius: var(--radius-lg); background: #000; cursor: pointer; box-shadow: var(--shadow); }
.short-overlay { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: min(420px, 92%); display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; }
.short-overlay a, .short-overlay button { pointer-events: auto; }
.short-info { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.short-channel { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: #fff; }
.short-title { display: block; font-weight: 600; margin-bottom: 4px; color: #fff; }
.short-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.short-play { width: 50px; height: 50px; border-radius: 50%; background: rgba(0,0,0,.5); border: none; color: #fff; font-size: 20px; cursor: pointer; backdrop-filter: blur(6px); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; z-index: 300; padding: 20px; backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-box { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 460px; box-shadow: var(--shadow); animation: pop .18s ease; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { font-size: 18px; }
.copy-row { display: flex; gap: 8px; margin-bottom: 12px; }
.copy-row input, .copy-row textarea { flex: 1; background: var(--bg-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); resize: none; outline: none; font-size: 13px; }
.playlist-pick { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; max-height: 220px; overflow-y: auto; }
.playlist-pick label { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.playlist-pick label:hover { background: var(--bg-3); }

/* Toasts */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow); animation: pop .2s ease; color: #fff; }
.toast-success { background: var(--green); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--blue); }

/* ---------------- Responsive ---------------- */
@media (max-width: 1300px) {
  .watch-layout { grid-template-columns: 1fr 340px; }
  .rec { grid-template-columns: 140px 1fr; }
}
@media (max-width: 1100px) {
  .watch-layout { grid-template-columns: 1fr; }
  .studio-cols { grid-template-columns: 1fr; }
  .srow { grid-template-columns: 240px 1fr; }
}
@media (max-width: 1000px) {
  .upload-cols { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .sidebar, .studio-nav { position: fixed; left: 0; top: var(--topbar-h); bottom: 0; width: 260px; background: var(--surface-solid); z-index: 90; transform: translateX(-100%); transition: transform .25s; border-right: 1px solid var(--border); }
  .sidebar.open, .studio-nav.open { transform: none; }
  .layout, .studio-layout { grid-template-columns: 1fr; }
  .sidebar-backdrop.show { display: block; position: fixed; inset: var(--topbar-h) 0 0; background: rgba(0,0,0,.5); z-index: 80; }
  .content, .studio-content { padding: 16px; }
  .brand-text { display: none; }
  .srow { grid-template-columns: 1fr; }
  .srow-thumb { max-width: 100%; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
  .ch-head { gap: 16px; }
  .form-2col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .search input { height: 40px; }
  .video-grid { grid-template-columns: 1fr; }
  .watch-actions { flex-direction: column; align-items: stretch; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 24px; }
}
