/* --------------------------------------------------------------
   max.pr57.de - Meldungen fuers Display
   Gestaltung: Regieraum. Ruhige, dunkle Umgebung, damit die
   Slides selbst die einzigen hellen Flaechen sind.
   -------------------------------------------------------------- */

:root {
  --ink:      #16191D;
  --panel:    #1F242A;
  --panel-2:  #272D34;
  --rule:     #363E46;
  --paper:    #FAFAF8;
  --text:     #E6E8EA;
  --muted:    #8B949D;
  --onair:    #16B364;
  --paused:   #6B7480;
  --danger:   #D2504A;
  --focus:    #7FB3FF;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* Kopf ------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--panel);
}

.brand {
  font-weight: 650;
  letter-spacing: .01em;
}
.brand span { color: var(--muted); font-weight: 400; }

.top nav { display: flex; gap: 8px; align-items: center; }

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

/* Knoepfe ---------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .12s, background .12s;
}
.btn:hover { border-color: var(--muted); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.btn-primary {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
  font-weight: 600;
}
.btn-primary:hover { background: #fff; }

.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

.btn-icon { padding: 8px 10px; line-height: 1; }
.btn[disabled] { opacity: .35; cursor: default; }

/* Meldungsliste ---------------------------------------------- */

.leer {
  border: 1px dashed var(--rule);
  border-radius: 10px;
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
}
.leer strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 17px; }

.karte {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  margin-bottom: 12px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--panel);
}
.karte.aus { opacity: .55; }

.karte-links { display: flex; gap: 16px; align-items: center; min-width: 0; }

/* Das Slide selbst - Bild links, Text rechts, wie auf dem TV */
.slide {
  flex: 0 0 240px;
  aspect-ratio: 16 / 9;
  display: grid;
  grid-template-columns: 55% 45%;
  border-radius: 6px;
  overflow: hidden;
  background: #0E1114;
  border: 1px solid var(--rule);
}
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide .kein-bild {
  display: grid; place-items: center;
  color: var(--muted); font-size: 11px; background: #0E1114;
}
.slide-text {
  padding: 8px 9px;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
}
.slide-text h3 {
  margin: 0;
  font: 600 13px/1.2 "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  letter-spacing: .01em;
  color: var(--paper);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.slide-text p {
  margin: 4px 0 0;
  font-size: 9px; line-height: 1.35; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta { min-width: 0; }
.meta h2 {
  margin: 0 0 5px;
  font-size: 16px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.meta .zeile { font-size: 13px; color: var(--muted); }
.meta .warnung { color: #E0A458; }

/* Tally-Licht: gruen = laeuft gerade auf dem Screen */
.tally {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; margin-bottom: 6px;
}
.punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--paused); }
.tally.live { color: var(--onair); }
.tally.live .punkt {
  background: var(--onair);
  box-shadow: 0 0 0 3px rgba(22,179,100,.18);
  animation: puls 2.4s ease-in-out infinite;
}
.tally.aus { color: var(--paused); }

@keyframes puls {
  0%, 100% { box-shadow: 0 0 0 3px rgba(22,179,100,.18); }
  50%      { box-shadow: 0 0 0 6px rgba(22,179,100,.05); }
}
@media (prefers-reduced-motion: reduce) {
  .tally.live .punkt { animation: none; }
}

.aktionen { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sortier { display: flex; flex-direction: column; gap: 3px; }
.sortier .btn { padding: 3px 8px; font-size: 11px; }

/* Formular --------------------------------------------------- */

.form-grid { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }

label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.feld { margin-bottom: 22px; }
.hinweis { font-size: 12px; color: var(--muted); margin-top: 6px; font-weight: 400; }

input[type=text], input[type=date], input[type=password], textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: transparent; }
textarea { resize: vertical; min-height: 92px; }

input[type=file] { color: var(--muted); font-size: 13px; }

.zaehler { float: right; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.zaehler.voll { color: var(--danger); font-weight: 600; }

/* Grosse Vorschau im Formular - das Herzstueck */
.vorschau-box { position: sticky; top: 24px; }
.vorschau-box > p { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.vorschau {
  aspect-ratio: 16 / 9;
  display: grid;
  grid-template-columns: 55% 45%;
  border-radius: 10px;
  overflow: hidden;
  background: #0E1114;
  border: 1px solid var(--rule);
}
.vorschau img { width: 100%; height: 100%; object-fit: cover; }
.vorschau .kein-bild { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.vorschau .v-text { padding: 20px 22px; display: flex; flex-direction: column; justify-content: center; }
.vorschau h3 {
  margin: 0;
  font: 600 28px/1.12 "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  color: var(--paper);
  word-break: break-word;
}
.vorschau p { margin: 12px 0 0; font-size: 13px; line-height: 1.45; color: #B9C0C7; }
.vorschau .credit { margin-top: auto; padding-top: 14px; font-size: 10px; color: var(--muted); }

/* Meldungen -------------------------------------------------- */

.hinweis-box {
  padding: 12px 15px; border-radius: 8px; margin-bottom: 22px; font-size: 14px;
  border: 1px solid var(--rule); background: var(--panel);
}
.hinweis-box.fehler { border-color: var(--danger); color: #F0A9A5; }
.hinweis-box.gut { border-color: var(--onair); color: #8FE3B8; }

/* Login ------------------------------------------------------ */

.login-wrap { max-width: 340px; margin: 14vh auto; padding: 0 24px; }
.login-wrap h1 { font-size: 20px; margin: 0 0 4px; }
.login-wrap .sub { color: var(--muted); font-size: 14px; margin: 0 0 28px; }

/* Fusszeile -------------------------------------------------- */

.fuss {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--rule);
  font-size: 13px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.fuss code { background: var(--panel); padding: 2px 6px; border-radius: 4px; font-size: 12px; }

@media (max-width: 780px) {
  .form-grid { grid-template-columns: 1fr; }
  .vorschau-box { position: static; }
  .karte { grid-template-columns: 1fr; }
  .karte-links { flex-direction: column; align-items: stretch; }
  .slide { flex: none; width: 100%; }
  .aktionen { justify-content: flex-start; }
}
