:root {
  --bg: #f5f6f8; --panel: #fff; --text: #1d2330; --muted: #6b7385; --line: #e3e6ec;
  --accent: #3156d3; --accent-weak: #e8edfc; --ok: #1a8a4a; --ok-weak: #e3f5ea; --warn: #b26a00; --warn-weak: #fff3dc;
  --bad: #c1352b; --bad-weak: #fde8e6; --fb: #1877f2; --ig: #d6249f; --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
.hidden { display: none !important; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 16px; margin: 0 0 12px; } h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); } .small { font-size: 12px; } .error { color: var(--bad); } .mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
a { color: var(--accent); }

.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: #161b26; color: #cfd5e2; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.brand { color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 18px; } .brand small { color: #8c95a8; font-weight: 400; font-size: 12px; }
.sidebar a { color: inherit; text-decoration: none; padding: 9px 10px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.sidebar a:hover { background: #222a39; } .sidebar a.active { background: #2b3550; color: #fff; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
main { padding: 26px 30px; max-width: 1400px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; gap: 12px; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 13px; border-radius: 8px; cursor: pointer; font: inherit; }
.btn:hover { border-color: #c5cad6; } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn.ghost { background: transparent; color: inherit; border-color: #3a4459; }
.btn.block { width: 100%; } .btn.sm { padding: 4px 9px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.grid { display: grid; gap: 14px; }
.tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; }
.tile .num { font-size: 26px; font-weight: 700; } .tile .lbl { color: var(--muted); font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.two { grid-template-columns: 1fr 1fr; } @media (max-width: 1100px) { .two { grid-template-columns: 1fr; } }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 10px; border: 1px solid; }
.alert.warn { background: var(--warn-weak); border-color: #f0d49a; } .alert.bad { background: var(--bad-weak); border-color: #f3b9b3; }
.alert.ok { background: var(--ok-weak); border-color: #a9dcbc; } .alert.info { background: var(--accent-weak); border-color: #c3cff5; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: #eef0f4; color: var(--muted); white-space: nowrap; }
.badge.draft { background: #eef0f4; } .badge.in_review { background: var(--warn-weak); color: var(--warn); }
.badge.approved { background: var(--accent-weak); color: var(--accent); } .badge.rejected, .badge.failed { background: var(--bad-weak); color: var(--bad); }
.badge.published { background: var(--ok-weak); color: var(--ok); } .badge.publishing, .badge.pending { background: #f1eafd; color: #6a3fc4; }
.pill { background: var(--warn); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; } .pill:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; color: #fff; }
.chip.facebook_page { background: var(--fb); } .chip.instagram { background: var(--ig); }

.board { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; }
.col { background: #eceef2; border-radius: var(--radius); padding: 10px; min-height: 120px; }
.col h3 { display: flex; justify-content: space-between; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; }
.pcard:hover { border-color: #b9c2d6; }
.pcard .t { font-weight: 600; margin-bottom: 4px; } .pcard .b { color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .thumb { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; background: #ddd; }
.pcard .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 6px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafbfc; }

.acc-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: #ddd; object-fit: cover; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpi { background: #f7f8fa; border-radius: 8px; padding: 8px 10px; } .kpi .v { font-weight: 700; font-size: 17px; } .kpi .k { font-size: 11px; color: var(--muted); }
.recent { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.recent a { position: relative; display: block; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #e9ebef; color: var(--muted); font-size: 11px; text-decoration: none; }
.recent img { width: 100%; height: 100%; object-fit: cover; } .recent .txt { padding: 6px; display: block; }
.recent .stats { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; padding: 2px 5px; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal .dow { background: #fafbfc; padding: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.cal .day { background: #fff; min-height: 104px; padding: 6px; } .cal .day.other { background: #fafbfc; color: #aab; } .cal .day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal .d { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.cal .ev { font-size: 11px; padding: 3px 5px; border-radius: 4px; margin-bottom: 3px; cursor: pointer; background: #eef0f4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; border-left: 3px solid #999; }
.cal .ev.approved { border-color: var(--accent); } .cal .ev.published { border-color: var(--ok); } .cal .ev.in_review { border-color: var(--warn); } .cal .ev.failed, .cal .ev.rejected { border-color: var(--bad); }

.modal { position: fixed; inset: 0; background: rgba(15,20,30,.45); display: flex; justify-content: center; align-items: flex-start; padding: 30px 16px; overflow-y: auto; z-index: 10; }
.modal-card { background: #fff; border-radius: 12px; width: min(1100px, 100%); padding: 22px; }
.editor { display: grid; grid-template-columns: 1.1fr .9fr; gap: 20px; } @media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
label { display: block; font-weight: 600; font-size: 12px; margin: 12px 0 4px; }
input[type=text], input[type=url], input[type=password], input[type=datetime-local], textarea, select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
textarea { min-height: 170px; resize: vertical; }
.counter { text-align: right; font-size: 11px; color: var(--muted); }
.dropzone { border: 2px dashed var(--line); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; }
.dropzone.over { border-color: var(--accent); background: var(--accent-weak); }
.media-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.media-item { position: relative; width: 92px; } .media-item img, .media-item video { width: 92px; height: 92px; object-fit: cover; border-radius: 6px; background: #222; }
.media-item .ops { display: flex; justify-content: space-between; font-size: 11px; } .media-item .ops button { border: 0; background: none; cursor: pointer; padding: 2px; color: var(--muted); }
.target { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; }
.target select { width: auto; margin-left: auto; }

.preview { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 14px; background: #fff; max-width: 420px; }
.preview .ph { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-weight: 600; font-size: 13px; }
.preview .ph .dot { width: 28px; height: 28px; border-radius: 50%; }
.preview .pm { width: 100%; background: #111; display: block; max-height: 420px; object-fit: contain; }
.preview .pm.ig { aspect-ratio: 4/5; object-fit: cover; }
.preview .pt { padding: 8px 10px; white-space: pre-wrap; font-size: 13px; word-break: break-word; }
.preview .more { position: relative; } .preview .count { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6); color: #fff; border-radius: 99px; font-size: 11px; padding: 2px 8px; }

.timeline { list-style: none; padding: 0; margin: 0; font-size: 12px; } .timeline li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.copy { display: flex; gap: 6px; } .copy input { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.steps { padding-left: 18px; margin: 6px 0; line-height: 1.6; }

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 28px; width: 360px; display: flex; flex-direction: column; gap: 10px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #161b26; color: #fff; padding: 12px 16px; border-radius: 8px; max-width: 460px; z-index: 20; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }
.empty { color: var(--muted); font-size: 12px; text-align: center; padding: 16px 4px; }

/* ---- Auswertung (Diagramm nach dataviz-Vorgaben: eine Reihe, Slot-1-Blau, Haarlinien-Raster) ---- */
.viz-root { --surface-1: #ffffff; --text-primary: #1d2330; --text-secondary: #6b7385; --grid: #eceef2; --series-1: #257de0; position: relative; }
.viz-root svg { display: block; width: 100%; }
.viz-root .bar { fill: var(--series-1); }
.viz-root .grid-line { stroke: var(--grid); stroke-width: 1; }
.viz-root .base-line { stroke: #c9ced8; stroke-width: 1; }
.viz-root .avg-line { stroke: var(--text-secondary); stroke-width: 1; opacity: .6; }
.viz-root .axis-text { fill: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-root .value-text { fill: var(--text-primary); font-size: 12px; font-weight: 600; }
.viz-root .hit { fill: transparent; cursor: pointer; }
.viz-root .hit:hover { fill: rgba(37, 125, 224, .06); }
.viz-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  box-shadow: 0 6px 20px rgba(20, 30, 50, .12); width: 240px; font-size: 12px; z-index: 2; }
.viz-tip .tip-text { margin: 3px 0 5px; }
.viz-tip .tip-row { display: flex; align-items: center; gap: 6px; }
.viz-tip .key { width: 10px; height: 10px; border-radius: 3px; background: #257de0; display: inline-block; }
.filters { margin-bottom: 4px; }
.btn.seg.on { border-color: var(--accent); background: var(--accent-weak); }
.tile.static { cursor: default; }
.perf-table th[data-sort] { cursor: pointer; user-select: none; }
.perf-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.perf-post { display: flex; gap: 10px; align-items: center; }
.perf-post img, .perf-post .ph-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: #e9ebef; flex: none; }
.nowrap { white-space: nowrap; }

/* Videos-Anleitung */
.steps { margin: 0; padding-left: 20px; line-height: 1.6; } .steps li { margin-bottom: 6px; }
.prompt { white-space: pre-wrap; background: #f7f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 12px/1.5 ui-monospace, Consolas, monospace; margin: 0 0 8px; }
