:root {
  /* angelehnt an adventisten-bayern: Petrol, Türkis, helle Grautöne */
  --bg: #f6f8f9;
  --surface: #ffffff;
  --ink: #292929;
  --muted: #6b7280;
  --line: #e3e8ea;
  --primary: #00678b;
  --primary-dark: #005877;
  --accent: #01a0a0;
  --accent-ink: #ffffff;
  --tint: #e2fdfd;
  --danger: #b42318;
  --ok-bg: #e6f7f5; --ok-ink: #0f6e64;
  --err-bg: #fdecea; --err-ink: #8a1c13;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 10px rgba(0,60,80,.05);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 "Noto Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
a { color: inherit; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; color: var(--primary-dark); font-weight: 650; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .6rem; color: var(--primary-dark); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Navigation */
.topbar { background: #fff; color: var(--ink); border-bottom: 3px solid #34cdcd; box-shadow: var(--shadow); }
.topbar .inner { max-width: 1200px; margin: 0 auto; padding: .55rem 1rem; display: flex; gap: 1rem;
  align-items: center; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: .6rem; color: var(--primary); }
.brand-logo { height: 38px; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand small { font-weight: 400; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; padding: .4rem .7rem; border-radius: 6px; color: #4b5563; }
.nav a:hover { background: var(--tint); color: var(--primary-dark); }
.nav a.on { background: var(--tint); color: var(--primary-dark); font-weight: 600; }
.topbar form { margin: 0; }
.topbar .user { font-size: .85rem; color: var(--muted); display: flex; gap: .5rem; align-items: center; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font: inherit; padding: 0; }

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.head h1 { margin: 0; }

/* Buttons & Formulare */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); padding: .5rem .9rem; border-radius: 8px; cursor: pointer; text-decoration: none; font: inherit;
  font-size: .95rem; white-space: nowrap; }
.btn:hover { border-color: #c9c3b4; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.accent { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: .25rem .6rem; font-size: .85rem; }
.btn.compile { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:hover, .btn.compile:hover { background: var(--primary-dark); }
.inline { display: inline; margin: 0; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .8rem 0 .3rem; }
input[type=text], input[type=password], input[type=date], input[type=number], textarea, select {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  font: inherit; color: var(--ink); }
textarea { min-height: 9rem; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.check input { width: auto; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 1rem; }
.actions { display: flex; gap: .5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.hint { font-size: .85rem; color: var(--muted); margin: .25rem 0 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.2rem; }
.card + .card { margin-top: 1rem; }
.narrow { max-width: 720px; }

/* Meldungen */
.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok-ink); }
.flash.error { background: var(--err-bg); color: var(--err-ink); }

/* Tabelle */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f3f7f8; }
tr:last-child td { border-bottom: 0; }
td .excerpt { color: var(--muted); font-size: .88rem; margin-top: .15rem; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; max-width: 46ch; }
.td-actions { display: flex; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; }

.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.aktiv { background: #e3f4e6; color: #1e6b34; }
.badge.inaktiv { background: #eceff3; color: #5b6472; }
.badge.geplant { background: #e6effc; color: #1f4f9c; }
.badge.abgelaufen { background: #fbeee0; color: #8f4b0a; }
.badge.warn { background: #fdecea; color: #8a1c13; }

/* Folien-Editor */
.board { display: grid; grid-template-columns: 280px 1fr; gap: 1.2rem; align-items: start; }
@media (max-width: 860px) { .board { grid-template-columns: 1fr; } }
.pool { position: sticky; top: 1rem; }
.slides { display: grid; gap: 1rem; }
.slide { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.slide-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line);
  flex-wrap: wrap; }
.slide-head .handle { cursor: grab; color: var(--muted); font-size: 1.2rem; user-select: none; padding: 0 .2rem; }
.slide-no { font-weight: 700; min-width: 4.5rem; }
.slide-head input.title { flex: 1; min-width: 140px; padding: .3rem .5rem; }
.slide-head input.dur { width: 5rem; padding: .3rem .5rem; }
.slide-head .warns { display: flex; gap: .3rem; }
.items { min-height: 56px; padding: .6rem; display: flex; flex-direction: column; gap: .45rem; }
.items:empty::after { content: "Bekanntmachung hierher ziehen"; color: var(--muted); font-size: .85rem;
  border: 2px dashed var(--line); border-radius: 8px; padding: .8rem; text-align: center; }
.chip { background: #f6fafb; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem; cursor: grab;
  display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.chip.dim { opacity: .55; }
.chip .t { font-weight: 600; }
.chip .b { font-size: .8rem; color: var(--muted); }
.sortable-ghost { opacity: .35; }
.save-state { font-size: .85rem; color: var(--muted); }

/* Bilder */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.gallery .card { padding: .7rem; }
.gallery img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; display: block; }
.gallery .card.active { outline: 3px solid var(--accent); }
.gallery .meta { font-size: .8rem; color: var(--muted); margin: .4rem 0; word-break: break-all; }
.gallery .tools { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.gallery select { width: auto; padding: .25rem .4rem; font-size: .85rem; }

/* Export */
.variants { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.preview { aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column;
  margin-bottom: .8rem; border: 1px solid var(--line); }
.preview .img { background: linear-gradient(160deg, #6fa3b8, #b9d3d6 60%, #5f8f7a); position: relative; }
.preview .pv-logo { position: absolute; left: 2.2%; top: 4%; height: 22%; }
.preview .pv-head { display: flex; align-items: center; gap: 4%; padding: 3% 5% 2%; }
.preview .pv-head img { height: 18px; }
.preview .pv-head i { display: block; height: 8px; width: 40%; border-radius: 3px; }
.preview .bar { height: 3px; }
.preview .txt { flex: 1; padding: 5% 5%; }
.preview .txt i { display: block; height: 7px; border-radius: 3px; margin-bottom: 6px; }
.preview .txt i.a { width: 45%; height: 9px; }

/* Farbschemata */
.schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; }
.scheme { margin: 0; font-weight: 400; cursor: pointer; position: relative; }
.scheme input { position: absolute; opacity: 0; }
.scheme .swatch { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 8px; padding: .7rem;
  border-radius: 8px; border: 2px solid var(--line); min-height: 86px; }
.scheme .swatch img { height: 26px; grid-row: span 2; }
.scheme .swatch b { font-size: .95rem; }
.scheme .swatch i { grid-column: 1 / -1; height: 3px; border-radius: 2px; }
.scheme .swatch small { grid-column: 1 / -1; font-size: .78rem; }
.scheme .swatch.custom { display: flex; justify-content: center; color: var(--muted);
  background: repeating-linear-gradient(45deg, #fff, #fff 8px, #f1f5f6 8px, #f1f5f6 16px); }
.scheme .name { display: block; font-size: .82rem; margin-top: .3rem; color: var(--muted); }
.scheme input:checked + .swatch { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,103,139,.2); }
.scheme input:checked ~ .name { color: var(--primary-dark); font-weight: 600; }
.scheme input:focus-visible + .swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
details.colors { margin-top: 1rem; }
details.colors summary { cursor: pointer; color: var(--primary); font-weight: 600; }
input[type=color] { width: 100%; height: 2.4rem; padding: .15rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.copy { display: flex; gap: .4rem; margin-top: .4rem; }
.copy input { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

/* Login */
.login { max-width: 380px; margin: 10vh auto; }
.login .cross { text-align: center; margin-bottom: .5rem; }
