/* clips – hell, Blautöne (bewusst kein Dunkelmodus) */
:root {
  --bg: #f4f8fd; --card: #fff; --text: #1a2433; --muted: #5a6b80; --faint: #8aa0b8;
  --line: #e1ecf8; --line2: #b5d4f4; --blue: #185fa5; --blue2: #378add; --blue-bg: #e6f1fb; --blue-dark: #0c447c;
  --ok: #3b6d11; --ok-bg: #eaf3de; --warn: #854f0b; --warn-bg: #faeeda; --bad: #a32d2d; --bad-bg: #fcebeb;
  --radius: 8px; color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 14px; font-weight: 600; }
h2 { font-size: 16px; margin: 22px 0 10px; font-weight: 600; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; vertical-align: -3px; flex-shrink: 0; }

/* Aufbau: Seitenleiste + Inhalt */
.app { display: flex; min-height: 100vh; }
.side { width: 200px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line); padding: 14px 10px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { font-weight: 700; color: var(--blue); font-size: 18px; display: flex; align-items: center; gap: 8px; padding: 2px 10px 14px; }
.brand.big { font-size: 22px; justify-content: center; padding-bottom: 6px; }
.nav a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius); color: var(--blue-dark); margin-bottom: 2px; }
.nav a:hover { background: var(--blue-bg); text-decoration: none; }
.nav a.on { background: var(--blue); color: #fff; }
.nav a .n { margin-left: auto; font-size: 12px; opacity: .85; }
.nav a .n.warn { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 0 7px; opacity: 1; }
.nav hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; }
.store { margin-top: auto; padding: 8px 10px; font-size: 12px; color: var(--muted); }
.store .bar { height: 5px; background: var(--blue-bg); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.store .bar > div { height: 5px; background: var(--blue2); }
.store .ver { color: var(--faint); margin-top: 6px; display: flex; justify-content: space-between; }
main { flex: 1; min-width: 0; padding: 20px 26px 60px; max-width: 1150px; }

/* Bedienelemente */
input[type=text], input[type=search], input[type=password], input[type=number], select {
  font: inherit; color: var(--text); background: #fff; border: 1px solid var(--line2);
  border-radius: var(--radius); padding: 6px 9px; min-height: 34px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--blue2); outline-offset: -1px; border-color: var(--blue2); }
.btn, button { font: inherit; cursor: pointer; border: 1px solid var(--line2); background: #fff; color: var(--blue); border-radius: var(--radius); padding: 6px 12px; min-height: 32px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover, button:hover { border-color: var(--blue2); background: var(--blue-bg); text-decoration: none; }
.btn.primary, button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover, button.primary:hover { background: var(--blue-dark); }
button.danger { color: var(--bad); border-color: #f0c2c2; }
button.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
button.small { padding: 2px 9px; min-height: 26px; font-size: 12px; }
button.on { background: var(--blue-bg); border-color: var(--blue2); }
button:disabled { opacity: .5; cursor: default; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.right { margin-left: auto; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12px; }
.small { font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 9px; border-radius: 12px; background: var(--blue-bg); color: var(--blue-dark); margin: 1px 4px 1px 0; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.grey { background: #eef2f6; color: var(--muted); }
.pill button { border: 0; background: none; padding: 0; min-height: 0; color: inherit; font-size: 13px; line-height: 1; }
.err { color: var(--bad); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.empty { padding: 40px 10px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar h1 { margin: 0; }
.toolbar input[type=search] { max-width: 260px; }

/* Vorschaubild */
.thumb { width: 160px; height: 90px; border-radius: var(--radius); background: var(--line2) center/cover no-repeat; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--blue-dark); position: relative; overflow: hidden; }
.thumb.sm { width: 112px; height: 63px; }
.thumb .dur { position: absolute; right: 5px; bottom: 4px; background: rgba(12,68,124,.85); color: #fff; font-size: 11px; padding: 0 5px; border-radius: 4px; }

/* Inbox-Karten */
.inbox-card { display: flex; gap: 14px; margin-bottom: 12px; }
.inbox-card.processing { border-style: dashed; }
.inbox-card .body { flex: 1; min-width: 0; }
.lab { color: var(--muted); font-size: 12px; margin: 9px 0 3px; }
.tagbox { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; border: 1px solid var(--line2); border-radius: var(--radius); padding: 3px 6px; min-height: 34px; background: #fff; }
.tagbox input { border: 0 !important; outline: 0 !important; min-height: 26px !important; padding: 2px 4px !important; flex: 1; min-width: 120px; width: auto !important; }
.sugg { margin-top: 5px; font-size: 12px; color: var(--muted); }
.sugg button.pill { border: 1px dashed var(--line2); background: #fff; cursor: pointer; }

/* Listen */
.list { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.item { display: flex; gap: 14px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #eef3f9; cursor: pointer; }
.item:last-child { border-bottom: 0; }
.item:hover { background: #f7fafe; }
.item .body { flex: 1; min-width: 0; }
.item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog { height: 4px; background: var(--blue-bg); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.prog > div { height: 4px; background: var(--blue2); }
.meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 3px; }

/* Player */
.player { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .player { grid-template-columns: 1fr; } }
video { width: 100%; background: #0f1824; border-radius: 12px; display: block; max-height: 70vh; }
.syncline { margin-top: 8px; padding: 7px 12px; border-radius: var(--radius); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.syncline.ok { background: var(--ok-bg); color: var(--ok); }
.syncline.wait { background: var(--warn-bg); color: var(--warn); }
.syncline.idle { background: var(--blue-bg); color: var(--blue-dark); }
.syncline.bad { background: var(--bad-bg); color: var(--bad); }
.conflict { border: 1px solid var(--blue2); background: #f7fafe; border-radius: 12px; padding: 12px; margin-top: 10px; }
.conflict label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-top: 6px; cursor: pointer; }
.conflict label:has(input:checked) { border-color: var(--blue2); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 10px; font-size: 13px; }
.kv > div:nth-child(odd) { color: var(--muted); }

/* Tabellen */
table.t { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 13px; }
table.t th { text-align: left; font-weight: 600; color: var(--muted); background: #f4f8fd; padding: 7px 10px; font-size: 12px; }
table.t td { padding: 7px 10px; border-top: 1px solid #eef3f9; vertical-align: top; }
table.t tr.hl td { background: #fff8ec; }
.events .ev { display: flex; gap: 12px; padding: 7px 12px; border-bottom: 1px solid #eef3f9; font-size: 13px; }
.events .ev:last-child { border-bottom: 0; }
.events .ev .at { color: var(--muted); white-space: nowrap; width: 110px; flex-shrink: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
pre { background: #f4f8fd; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; overflow: auto; font-size: 12px; }

/* Meldung unten */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--blue-dark); color: #fff; padding: 9px 16px; border-radius: var(--radius); font-size: 13px; z-index: 50; }
.toast.bad { background: var(--bad); }

/* Anmeldung */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login { width: 300px; display: flex; flex-direction: column; gap: 12px; padding: 26px; }
.login .btn { justify-content: center; }

/* schmale Bildschirme (iPad hochkant, Handy) */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .side { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; }
  .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav hr, .store { display: none; }
  main { padding: 14px; }
  .thumb { width: 112px; height: 63px; }
  .inbox-card { flex-direction: column; }
}
