/* CI Obersteirische Rundschau – siehe design/CI.md */
:root {
  --green: #228822;
  --green-dark: #1b6e1b;
  --green-soft: rgba(34, 136, 34, 0.08);
  --text: #0a0a0a;
  --text-2: #474747;
  --muted: #636363;
  --line: #e3e5e3;
  --bg: #f5f6f5;
  --card: #ffffff;
  --danger: #c62828;
  --warn: #c77700;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  --radius: 8px;
  --font: "Cabin", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --title: "Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.45 var(--font); color: var(--text); background: var(--bg); }
h1, h2, h3 { font-family: var(--title); font-weight: 600; margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
a { color: var(--green); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- Kopf & Navigation ---------- */
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; gap: 16px; padding: 10px 20px; }
.top img { height: 34px; display: block; }
.top .tag { font-family: var(--title); font-weight: 600; color: var(--green); font-size: 13px;
  border: 1.5px solid var(--green); border-radius: 4px; padding: 1px 6px; letter-spacing: .5px; }
.top .spacer { flex: 1; }
.top .who { color: var(--muted); font-size: 13px; }
.nav { background: var(--green); display: flex; padding: 0 12px; overflow-x: auto; }
.nav a { color: #fff; text-decoration: none; padding: 9px 14px; font-weight: 600; white-space: nowrap; }
.nav a:hover, .nav a.active { background: #fff; color: var(--green); }
main { padding: 20px; max-width: 1400px; margin: 0 auto; }

/* ---------- Bausteine ---------- */
.btn { font: 600 14px var(--font); border: 1.5px solid var(--green); background: var(--green); color: #fff;
  padding: 7px 14px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.ghost { background: #fff; color: var(--green); }
.btn.ghost:hover { background: var(--green-soft); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: #fdecec; }
.btn.sm { padding: 4px 9px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
label.f { display: block; margin-bottom: 10px; font-size: 13px; color: var(--text-2); font-weight: 600; }
label.f > span.hint { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font: 14px var(--font); width: 100%; padding: 7px 9px; border: 1px solid #cfd3cf;
  border-radius: 6px; background: #fff; color: var(--text); margin-top: 3px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(34,136,34,.35); border-color: var(--green); }
input[type=checkbox] { width: auto; margin: 0 6px 0 0; }
input[type=color] { padding: 2px; height: 34px; }
input[type=range] { padding: 0; }
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 10px;
  background: #eceeec; color: var(--text-2); }
.badge.live { background: var(--green); color: #fff; }
.badge.ad { background: #fff4e0; color: var(--warn); }
.badge.warn { background: #fff4e0; color: var(--warn); }
.badge.off { background: #f3e0e0; color: var(--danger); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-family: var(--title); font-weight: 600; font-size: 13px; color: var(--text-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login img { width: 220px; display: block; margin: 0 auto 6px; }
.login p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- Ausgaben ---------- */
.split { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.issues a { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 6px;
  text-decoration: none; color: var(--text); }
.issues a:hover { background: var(--green-soft); }
.issues a.active { background: var(--green); color: #fff; }
.issues a.active .muted { color: #e6f3e6; }
.head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.head h1 { margin: 0; }
.head .spacer { flex: 1; }
.drop { border: 2px dashed #b9c9b9; border-radius: var(--radius); padding: 18px; text-align: center; background: #fff;
  color: var(--text-2); margin-bottom: 16px; }
.drop.over { border-color: var(--green); background: var(--green-soft); }
.drop .opts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.drop .opts label { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.drop .opts input, .drop .opts select { width: auto; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tcard { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none;
  color: var(--text); display: flex; flex-direction: column; transition: transform .1s; }
.tcard:hover { transform: translateY(-2px); }
.tcard .thumb { aspect-ratio: 4/3; background: #e9ece9 center/contain no-repeat; }
.tcard .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.tcard .title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .badges { display: flex; gap: 5px; flex-wrap: wrap; }
.qbar { height: 5px; background: #eceeec; border-radius: 3px; overflow: hidden; }
.qbar > i { display: block; height: 100%; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* ---------- Bild-Editor ---------- */
.ed { display: grid; grid-template-columns: 1fr 330px; gap: 16px; align-items: start; }
.ed-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.ed-toolbar .title { font-family: var(--title); font-weight: 600; font-size: 17px; margin-right: 6px; }
.ed-toolbar .spacer { flex: 1; }
.addbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.stage { background: #d9ddd9; background-image: linear-gradient(45deg,#d2d6d2 25%,transparent 25%,transparent 75%,#d2d6d2 75%),
  linear-gradient(45deg,#d2d6d2 25%,transparent 25%,transparent 75%,#d2d6d2 75%); background-size: 20px 20px;
  background-position: 0 0, 10px 10px; border-radius: var(--radius); padding: 60px; display: flex; justify-content: center;
  overflow: hidden; }
.canvas { position: relative; box-shadow: 0 4px 20px rgba(0,0,0,.25); user-select: none; touch-action: none; }
.canvas > img { display: block; width: 100%; pointer-events: none; }
.box { position: absolute; cursor: move; outline: 1px dashed rgba(255,255,255,.7); overflow: hidden; }
.box.sel { outline: 2px solid #2f8cff; overflow: visible; z-index: 1000; }
.box .handle { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; background: #2f8cff;
  border: 2px solid #fff; border-radius: 50%; cursor: nwse-resize; display: none; }
.box.sel .handle { display: block; }
.box .inner { width: 100%; height: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center;
  pointer-events: none; }
.box .txt { width: 100%; height: 100%; padding: .3em .5em; white-space: pre-wrap; word-break: break-word; display: flex;
  align-items: center; line-height: 1.2; font-family: var(--font); }
.box .bt { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-weight: 700;
  font-family: var(--font); text-align: center; padding: 0 .4em; }
.box img, .box video { width: 100%; height: 100%; display: block; }
.box .ph { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; text-align: center; gap: 4px; padding: 6px; font-size: 13px; }
.box .ph small { font-weight: 400; opacity: .85; font-size: 11px; word-break: break-all; }
.ph.yt { background: #111 center/cover no-repeat; }
.ph.yt .play { width: 54px; height: 38px; background: #f00; border-radius: 10px; display: grid; place-items: center; }
.ph.yt .play::after { content: ""; border-left: 15px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; margin-left: 4px; }
.ph.ig { background: linear-gradient(45deg,#f9a825,#e1306c 50%,#833ab4); }
.ph.fb { background: #1877f2; }
.ph.vid { background: #333; }
.ph.img { background: #889; }

.side .tabs { display: flex; border-bottom: 1px solid var(--line); margin: -16px -16px 14px; }
.side .tabs button { flex: 1; background: none; border: 0; padding: 11px; font: 600 14px var(--font); color: var(--muted);
  cursor: pointer; border-bottom: 3px solid transparent; }
.side .tabs button.on { color: var(--green); border-bottom-color: var(--green); }
.side { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.layers { list-style: none; padding: 0; margin: 0; }
.layers li { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.layers li:hover { background: var(--green-soft); }
.layers li.sel { background: #e3efff; }
.layers li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layers li button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 2px 4px; font-size: 13px; }
.layers li button:hover { color: var(--text); }
.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.dirty-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); display: inline-block; }
.kbd { font-size: 12px; color: var(--muted); margin-top: 10px; }

/* ---------- Statistik ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi .v { font-family: var(--title); font-size: 28px; font-weight: 600; color: var(--green); }
.kpi .l { color: var(--muted); font-size: 13px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.chart > div { flex: 1; background: var(--green); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.chart > div:hover { background: var(--green-dark); }

/* ---------- Toasts & Dialog ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 5000; }
.toast { background: #222; color: #fff; padding: 10px 14px; border-radius: 6px; box-shadow: var(--shadow); max-width: 380px;
  font-size: 14px; animation: tin .2s; }
.toast.ok { background: var(--green); } .toast.err { background: var(--danger); } .toast.warn { background: var(--warn); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }
dialog { border: 0; border-radius: var(--radius); padding: 22px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 10px 40px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

@media (max-width: 900px) {
  .split, .ed { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .stage { padding: 20px; }
  main { padding: 16px; }
}
