/* werbetv Admin – Design Wiersch v2 (Tiefgrün/Creme, Anton + Karla), mobil zuerst */
@font-face { font-family: "Anton"; src: url("fonts/Anton-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Karla"; src: url("fonts/Karla-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Karla"; src: url("fonts/Karla-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --creme: #F7F3EB; --warm: #EFE7D6; --sand: #E4D9C4; --gruen: #142D20;
  --bordeaux: #5E241F; --gold: #C9A25B; --messing: #A67C3D; --kraft: #2A2620;
  --ok: #2F6B3A; --rot: #5E241F;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--gruen); font: 18px/1.45 "Karla", Calibri, sans-serif; }
a { color: var(--gruen); }
h1, h2 { font-family: "Anton", "Oswald", "Arial Narrow", sans-serif; font-weight: 400; letter-spacing: .01em; line-height: 1.1; margin: .2em 0 .5em; }
h1 { font-size: 2.3rem; }
h2 { font-size: 1.5rem; margin-top: 1.4em; }
.label { font-weight: 700; font-size: .78rem; letter-spacing: .14em; color: var(--bordeaux); margin-top: .6rem; }
.klein, small { font-size: .88rem; color: #4b5a50; }
.gruen { color: var(--ok); } .rot { color: var(--rot); }
code.adresse { display: block; font: 600 1rem/1.4 ui-monospace, Consolas, monospace; background: #fff; border: 1px solid var(--sand); border-radius: 8px; padding: .6rem .7rem; word-break: break-all; margin: .3rem 0 .6rem; }

/* Kopf */
.kopf { background: var(--gruen); display: flex; align-items: center; justify-content: space-between; padding: .55rem 1rem; border-bottom: 2px solid var(--gold); }
.kopf-logo img { display: block; width: 160px; height: auto; }
.kopf-titel { font-family: "Anton", sans-serif; color: var(--creme); font-size: 1.3rem; letter-spacing: .08em; }
.leiste { display: flex; background: var(--warm); border-bottom: 1px solid var(--sand); position: sticky; top: 0; z-index: 5; }
.leiste a { flex: 1; text-align: center; padding: .85rem .2rem; text-decoration: none; font-weight: 700; font-size: .95rem; border-bottom: 3px solid transparent; }
.leiste a.an { border-bottom-color: var(--gold); background: var(--creme); }

.inhalt { max-width: 680px; margin: 0 auto; padding: .8rem 1rem 2rem; }
.fuss { max-width: 680px; margin: 0 auto; padding: 1rem; border-top: 1px solid var(--gold); display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .8rem; color: #4b5a50; }
.fuss form { margin: 0; }

/* Meldungen */
.meldung { padding: .8rem 1rem; border-radius: 10px; margin: .6rem 0; border: 1px solid var(--gold); background: var(--warm); font-weight: 700; }
.meldung.fehler { border-color: var(--bordeaux); color: var(--bordeaux); background: #f6e9e4; }
.meldung.ok { border-color: var(--ok); }

/* Knöpfe */
.knopf { display: block; width: 100%; min-height: 54px; padding: .8rem 1rem; margin: .6rem 0; border-radius: 12px; border: 2px solid var(--gruen); background: var(--creme); color: var(--gruen); font: 700 1.05rem "Karla", sans-serif; text-align: center; text-decoration: none; cursor: pointer; }
.knopf.haupt { background: var(--gruen); color: var(--creme); }
.knopf.warnung { border-color: var(--bordeaux); color: var(--bordeaux); }
.knopf.klein { min-height: 46px; padding: .5rem .8rem; font-size: .95rem; margin: .3rem 0; }
.knopf:active { transform: translateY(1px); }
.knopf[disabled] { opacity: .5; }
button.link { background: none; border: 0; color: var(--gruen); text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }

/* Formulare */
.formular label { display: block; font-weight: 700; margin: .9rem 0 .2rem; }
.formular input[type=text], .formular input[type=password], .formular input[type=email], .formular input[type=number],
.formular input[type=date], .formular input[type=file], .formular select, .formular textarea {
  display: block; width: 100%; margin-top: .3rem; min-height: 52px; padding: .6rem .7rem; font: 400 1.05rem "Karla", sans-serif;
  color: var(--gruen); background: #fff; border: 1.5px solid var(--sand); border-radius: 10px; }
.formular input:focus, .formular select:focus, .formular textarea:focus { outline: 3px solid var(--gold); outline-offset: 1px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.zwei > * { min-width: 0; }
.zwei form { margin: 0; }
label.haken { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; margin: .25rem .9rem .25rem 0; min-height: 44px; }
label.haken input { width: 26px; height: 26px; accent-color: var(--gruen); }
label.haken.gross { display: flex; margin-top: 1rem; }
.tv-wahl { border: 1.5px solid var(--sand); border-radius: 12px; padding: .5rem .9rem .8rem; margin: 1rem 0 0; background: #fff; }
.tv-wahl legend { font-weight: 700; padding: 0 .3rem; }
.schnell { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.schnell .knopf { margin: 0; }
.tv-gruppe { border-top: 1px solid var(--sand); margin-top: .6rem; padding-top: .3rem; }
.tv-gruppe-name { font-size: .9rem; color: var(--bordeaux); font-weight: 700; }

.fortschritt { margin: 1rem 0 0; }
.balken { height: 18px; background: var(--warm); border: 1px solid var(--gold); border-radius: 9px; overflow: hidden; }
.balken span { display: block; height: 100%; width: 0; background: var(--gruen); transition: width .2s; }
.fortschritt-text { font-weight: 700; margin: .4rem 0 0; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: .4rem 0 .6rem; }
.kachel { background: var(--warm); border: 1px solid var(--sand); border-radius: 12px; padding: .7rem .4rem; text-align: center; }
.kachel b { display: block; font-family: "Anton", sans-serif; font-weight: 400; font-size: 2rem; line-height: 1.1; }
.kachel span { font-size: .85rem; }

/* TV-Ampel */
.tv-liste { display: grid; gap: .5rem; }
.tv-karte { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ampel name" "ampel info"; column-gap: .8rem; align-items: center; text-decoration: none; background: #fff; border: 1.5px solid var(--sand); border-radius: 12px; padding: .75rem .9rem; }
.tv-karte .ampel { grid-area: ampel; width: 26px; height: 26px; border-radius: 50%; background: #b9b3a6; }
.tv-karte.online .ampel { background: #3c8a48; box-shadow: 0 0 0 4px #dcebd9; }
.tv-karte.offline { border-color: var(--bordeaux); }
.tv-karte.offline .ampel { background: #b33b2e; box-shadow: 0 0 0 4px #f3dcd7; }
.tv-name { grid-area: name; font-weight: 700; font-size: 1.1rem; }
.tv-name small { margin-left: .5rem; font-weight: 400; }
.tv-info { grid-area: info; font-size: .95rem; }
.tv-info small { display: block; }
.tv-karte.offline .tv-info { color: var(--bordeaux); font-weight: 700; }
.status-punkt { display: inline-block; width: .7em; height: .7em; border-radius: 50%; background: #b9b3a6; vertical-align: middle; }
.status-punkt.online { background: #3c8a48; } .status-punkt.offline { background: #b33b2e; }

/* Kästen */
.kasten { background: var(--warm); border: 1px solid var(--gold); border-radius: 12px; padding: .8rem 1rem; margin: .8rem 0; }
.kasten p { margin: .3rem 0; }
.kasten h2 { margin-top: .2rem; }
details.kasten summary { cursor: pointer; min-height: 32px; list-style-position: inside; }

/* Spots */
.spot-karte { display: grid; grid-template-columns: 42% 1fr; gap: .8rem; background: #fff; border: 1.5px solid var(--sand); border-radius: 12px; padding: .6rem; margin: .7rem 0; }
.spot-karte.aus, .spot-karte.abgelaufen, .spot-zeile.aus, .spot-zeile.abgelaufen, .spot-zeile.geplant { opacity: .55; }
.spot-bild { position: relative; display: block; }
.spot-bild img, .ohne-bild { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; display: block; background: var(--sand); }
.ohne-bild { display: flex; align-items: center; justify-content: center; font-weight: 700; }
.spot-daten { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.spot-daten a { text-decoration: none; }
.spot-daten b { font-size: 1.05rem; overflow-wrap: anywhere; }
.abzeichen { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 6px; background: var(--sand); color: var(--gruen); }
.spot-bild .abzeichen { position: absolute; left: .35rem; top: .35rem; }
.spot-bild .abzeichen.typ { left: auto; right: .35rem; background: var(--kraft); color: var(--creme); }
.abzeichen.laeuft { background: var(--gruen); color: var(--creme); }
.abzeichen.geplant { background: var(--gold); color: var(--kraft); }
.abzeichen.abgelaufen, .abzeichen.aus { background: #d8d2c6; }
.spot-zeile { display: grid; grid-template-columns: 96px 1fr auto; gap: .6rem; align-items: center; background: #fff; border: 1.5px solid var(--sand); border-radius: 12px; padding: .45rem; margin: .5rem 0; }
.spot-zeile img, .spot-zeile .ohne-bild { width: 96px; border-radius: 6px; aspect-ratio: 16/9; object-fit: cover; }
.spot-text { text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.pfeile { display: flex; gap: .3rem; }
.pfeile form { margin: 0; }
.pfeile .knopf { width: 48px; margin: 0; padding: .3rem; }
.vorschau { background: #000; border-radius: 12px; overflow: hidden; border: 2px solid var(--gold); }
.vorschau img, .vorschau video { width: 100%; display: block; aspect-ratio: 16/9; object-fit: contain; }

/* Tabellen */
.tabelle-wrap { overflow-x: auto; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--creme); }
.tabelle th { background: var(--gruen); color: var(--creme); text-align: left; padding: .5rem .55rem; font-weight: 700; }
.tabelle td { padding: .45rem .55rem; border-bottom: 1px solid var(--sand); }
.tabelle tbody tr:nth-child(even) td { background: var(--warm); }
.tabelle tfoot td { font-weight: 700; border-top: 2px solid var(--gold); border-bottom: 0; }
.tabelle .zahl { text-align: right; white-space: nowrap; }
.monat-wahl label { margin-top: 0; }

/* Login */
.login { max-width: 420px; margin: 2rem auto; text-align: center; }
.login .formular { text-align: left; }
.login-logo { width: 220px; height: auto; }

/* Druck-Nachweis */
body.druck { background: #fff; }
.blatt { max-width: 800px; margin: 0 auto; padding: 1.5rem 1.2rem; }
.druck-kopf { display: flex; justify-content: space-between; align-items: center; border-bottom: 1.5px solid var(--gold); padding-bottom: .6rem; margin-bottom: 1.2rem; gap: 1rem; }
.druck-kopf img { width: 170px; height: auto; }
.druck-kopf-text { font-size: .75rem; letter-spacing: .12em; font-weight: 700; color: var(--bordeaux); text-align: right; }
.druck-zeitraum { font-size: 1.1rem; }
.druck-summen { display: flex; gap: 1rem; margin: 1rem 0 1.2rem; }
.druck-summen div { flex: 1; border: 1px solid var(--gold); background: var(--warm); border-radius: 10px; padding: .7rem 1rem; }
.druck-summen b { display: block; font-family: "Anton", sans-serif; font-weight: 400; font-size: 2.2rem; }
.druck .tabelle { background: #fff; }
.druck .tabelle tbody tr:nth-child(even) td { background: var(--warm); }
.druck-fuss { border-top: 1.5px solid var(--gold); margin-top: 2rem; padding-top: .5rem; font-size: .8rem; color: #4b5a50; }
@media print {
  .nicht-drucken { display: none !important; }
  .blatt { padding: 0; max-width: none; }
  .tabelle th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tabelle tbody tr:nth-child(even) td, .druck-summen div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* v2: Ton-Schalter, Kurzadresse */
.tv-reihe { display: grid; grid-template-columns: 1fr 88px; gap: .45rem; align-items: stretch; }
.tv-reihe .tv-karte { min-width: 0; }
.ton-form { margin: 0; }
.ton-knopf { width: 100%; height: 100%; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; border-radius: 12px; border: 2px solid var(--sand); background: #fff; color: var(--gruen); font: 700 .85rem "Karla", sans-serif; cursor: pointer; padding: .3rem; }
.ton-knopf .ton-symbol { font-size: 1.9rem; line-height: 1; }
.ton-knopf.an { background: var(--gruen); border-color: var(--gruen); color: var(--creme); }
.ton-knopf:active { transform: translateY(1px); }
.ton-zeile { display: grid; grid-template-columns: 120px 1fr; gap: .6rem; align-items: center; margin: .6rem 0 .2rem; }
.ton-zeile .ton-knopf { min-height: 72px; }
.ton-warnung { color: var(--bordeaux); font-weight: 700; margin: 0; }
small.ton-warnung { display: block; }
code.adresse.gross { font-size: 1.35rem; text-align: center; color: var(--gruen); }
.kurzname-form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; margin: .4rem 0; }
.kurzname-form label { font-weight: 700; font-size: .9rem; margin: 0; }
.kurzname-form input { display: block; width: 100%; box-sizing: border-box; font: 600 1.1rem ui-monospace, Consolas, monospace; padding: .55rem .6rem; border: 1.5px solid var(--sand); border-radius: 10px; background: #fff; margin-top: .2rem; }
.kurzname-form .knopf { margin: 0; width: auto; }
.alt-adresse { margin-top: .6rem; font-size: .9rem; }
.alt-adresse summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; color: #4b5a50; }
.kasten.hinweis { background: #fff; }

/* v2.2: Reihenfolge ziehen, Laden-TV, Füller */
.zieh-liste { list-style: none; margin: .4rem 0; padding: 0; }
.zieh-zeile { display: grid; grid-template-columns: 34px 64px minmax(0, 1fr) auto; grid-template-areas: "griff bild text schalter" "griff bild text pfeile";
  gap: .2rem .5rem; align-items: center; background: #fff; border: 1.5px solid var(--sand); border-radius: 12px; padding: .4rem .45rem .4rem .2rem; margin: .45rem 0; }
.zieh-zeile.aus, .zieh-zeile.abgelaufen, .zieh-zeile.geplant { opacity: .6; }
.zieh-zeile .griff { grid-area: griff; align-self: stretch; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; line-height: 1;
  color: var(--messing); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 8px; }
.zieh-zeile .griff:active { background: var(--warm); }
.zieh-zeile img, .zieh-zeile .ohne-bild { grid-area: bild; width: 64px; border-radius: 6px; aspect-ratio: 16/9; object-fit: cover; user-select: none; }
.zieh-zeile .spot-text { grid-area: text; }
.zieh-zeile .spot-text b { font-size: .95rem; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.zieh-zeile .spot-text small { font-size: .8rem; line-height: 1.3; }
.zieh-zeile .abzeichen { font-size: .7rem; padding: .05rem .4rem; }
.zieh-zeile .schalter-form { grid-area: schalter; margin: 0; justify-self: end; }
.zieh-zeile .pfeile { grid-area: pfeile; justify-self: end; }
.zieh-zeile .pfeile { gap: .25rem; }
.zieh-zeile .pfeile .knopf { width: 34px; min-height: 34px; padding: .1rem; font-size: .8rem; border-radius: 9px; }
.zieh-zeile.zieht { position: fixed; z-index: 50; margin: 0; pointer-events: none; box-shadow: 0 10px 28px rgba(0,0,0,.25); border-color: var(--gold); opacity: .97; }
.zieh-platz { list-style: none; border: 2px dashed var(--gold); border-radius: 12px; margin: .45rem 0; background: var(--warm); box-sizing: border-box; }
.zieh-liste .leer { list-style: none; padding: .6rem 0; }
.schalter { min-width: 58px; min-height: 40px; border-radius: 20px; border: 2px solid var(--sand); background: #fff; color: #4b5a50; font: 700 .9rem "Karla", sans-serif; cursor: pointer; }
.schalter.an { background: var(--gruen); border-color: var(--gruen); color: var(--creme); }
.abzeichen.laden { background: var(--gold); color: var(--kraft); }
.fueller-hinweis { color: var(--messing); font-weight: 700; }
small.fueller-hinweis { display: block; }

@media (min-width: 700px) {
  .tv-liste { grid-template-columns: repeat(3, 1fr); }
  h1 { font-size: 2.8rem; }
}
