/* Aufbau der Verwaltungsseite: Kopfzeile mit Reitern, Inhalt darunter, Anmeldung in der Mitte */

.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
}
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.account-btn { display: inline-flex; align-items: center; gap: 8px; }
.account-btn .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.is-offline .account-btn .dot { background: var(--muted); }

main { width: min(1100px, 100%); margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 16px; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view-head h1 { font-size: 2rem; }
.view-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view-tools select { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }

/* Anmeldung (wie die Anmeldung im ScoreBoard) */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login {
  width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}
.login h1 { font-size: 1.9rem; }
.login .lead { margin: -6px 0 4px; color: var(--muted); font-size: .95rem; }
.login input { padding: 12px 14px; border-radius: 10px; background: #0a0d12; }
.login .btn-primary { width: 100%; padding: 12px; }
/* Hinweis gegen Verwechslung mit dem ScoreBoard (ähnlicher Name, gleiche Kundschaft) */
.login .other-app { margin: 4px 0 0; text-align: center; font-size: .85rem; color: var(--muted); }
.login .other-app a { color: var(--led); }

/* Konto */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card h2 { font-size: 1.3rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.card form { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }

/* Inhalte: Kacheln mit Vorschau im Format eines Bildschirms (16:9) */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.content-card {
  display: flex; flex-direction: column; gap: 10px; padding: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.content-info { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.content-info .name { font-weight: 600; overflow-wrap: anywhere; }
.preview {
  aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.preview-image, .preview-video { background: #000; }
.preview-video { position: relative; }
.preview :is(img, video) { width: 100%; height: 100%; }
.preview :is(img, video).fit-contain { object-fit: contain; }
.preview :is(img, video).fit-cover { object-fit: cover; }
/* Länge unten rechts auf der Vorschau, wie bei Videoplattformen */
.video-length {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 4px;
  background: rgb(0 0 0 / .75); color: #fff; font-size: .8rem; font-variant-numeric: tabular-nums;
}
.upload-progress { width: 100%; accent-color: var(--led); }
.preview-text { align-items: flex-start; justify-content: flex-start; gap: 4px; padding: 10px 12px; font-size: .75rem; }
.preview-text strong { font-family: var(--font-display); font-size: 1.1rem; overflow-wrap: anywhere; }
.preview-text span { white-space: pre-line; overflow: hidden; overflow-wrap: anywhere; opacity: .85; }
.preview-web { background: var(--panel-2); color: var(--muted); gap: 4px; font-size: .9rem; overflow-wrap: anywhere; text-align: center; padding: 8px; }
.preview-web span:first-child { font-size: 1.8rem; }
.preview-rooms { align-items: stretch; justify-content: flex-start; gap: 4px; padding: 10px 12px; font-size: .75rem; }
.preview-rooms strong { font-family: var(--font-display); font-size: 1.1rem; overflow-wrap: anywhere; }
.preview-rooms ul { margin: 0; padding: 0; list-style: none; }
.preview-rooms li { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.preview-rooms b { color: var(--led); }
.preview-rooms > span { color: var(--muted); }

/* Breiter Dialog (z. B. Garderobe mit Tabelle) */
dialog.modal.modal-wide { width: min(880px, calc(100% - 32px)); }

/* Zeilen der Garderobeneinteilung im Formular; im Wochenplan mit Spalte «Tag» vorne */
.rooms-editor { border: 0; padding: 0; margin: 0; gap: 6px; }
.rooms-editor legend { padding: 0; margin-bottom: 5px; font-size: .85rem; color: var(--muted); }
.rooms-rows { display: flex; flex-direction: column; gap: 6px; }
.rooms-row { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr) minmax(0, 2.2fr) minmax(0, 1.4fr) auto; gap: 6px; align-items: center; }
.rooms-editor.weekly .rooms-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr) minmax(0, 1fr) minmax(0, 2.2fr) minmax(0, 1.4fr) auto; }
.rooms-row select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 6px; min-width: 0; }
.rooms-head { font-size: .78rem; color: var(--muted); padding-right: 40px; }
.rooms-editor > .btn { align-self: flex-start; }

/* Uhr & Wetter: Ortssuche mit Trefferliste */
.place-search { display: flex; gap: 6px; }
.place-search input { flex: 1; min-width: 0; }
.place-chosen { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.place-chosen.missing { color: var(--muted); font-weight: 400; }
.place-results { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.place-results .btn { white-space: normal; text-align: left; max-width: 100%; }
.hint.error { color: var(--danger); }

/* Zeitpläne (TV-Zeitplan und Zeitplan eines Bildschirms, time-rules.js) */
.section-head { margin-top: 28px; }
.section-head h2 { font-size: 1.5rem; }
.time-editor { border: 0; padding: 0; margin: 0; gap: 8px; }
.time-editor legend { padding: 0; margin-bottom: 5px; font-size: .85rem; color: var(--muted); }
.time-rules { display: flex; flex-direction: column; gap: 8px; }
.time-rule { display: grid; grid-template-columns: max-content 90px 90px auto; justify-content: start; gap: 8px 12px; align-items: end; }
.time-rule.with-extra { grid-template-columns: max-content 80px 80px minmax(140px, 1fr) auto; justify-content: stretch; }
.time-rule select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; min-width: 0; }
.time-editor > .btn { align-self: flex-start; }
.day-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.time-field { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.time-field input { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color-scheme: dark; }
.day-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-chip span {
  display: inline-block; min-width: 38px; padding: 7px 0; text-align: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-weight: 600;
}
.day-chip input:checked + span { background: var(--led); border-color: var(--led); color: #1a1205; }
.day-chip input:focus-visible + span { outline: 2px solid var(--led); outline-offset: 2px; }
@media (max-width: 620px) {
  .rooms-row, .rooms-editor.weekly .rooms-row { grid-template-columns: 1fr 1fr; }
  .rooms-head { display: none; }
  .time-rule, .time-rule.with-extra { grid-template-columns: 1fr 1fr auto; justify-content: stretch; }
  .time-rule select { grid-column: 1 / -2; }
  .time-rule + .time-rule { border-top: 1px solid var(--line); padding-top: 10px; }
  .day-chips { grid-column: 1 / -1; }
}

/* Playlist bearbeiten: eine Zeile pro Eintrag, auf dem Handy umgebrochen */
.back { color: var(--muted); text-decoration: none; font-size: .9rem; }
.back:hover { color: var(--ink); }
.playlist-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.playlist-item {
  display: grid; grid-template-columns: 28px 64px minmax(0, 1fr) 90px 150px 150px auto; gap: 12px; align-items: center;
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.playlist-item .position { font-family: var(--font-display); font-size: 1.3rem; color: var(--led); text-align: center; }
.playlist-item .name { font-weight: 600; overflow-wrap: anywhere; }
.playlist-item .sub { color: var(--muted); font-size: .85rem; }
.thumb { width: 64px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 4px; background: #000; }
.thumb-icon { display: grid; place-items: center; background: var(--panel-2); font-size: 1.2rem; }
.item-field { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--muted); }
.item-field .video-until-end { padding: 6px 0; color: var(--ink); font-size: .9rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-field input { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color-scheme: dark; }
.item-actions { display: flex; gap: 6px; }
.item-actions .btn { padding: 6px 10px; }
@media (max-width: 900px) {
  .playlist-item { grid-template-columns: 28px 64px minmax(0, 1fr); }
  .item-field, .item-actions { grid-column: 3; }
}

/* Rückfrage beim Löschen: betroffene Playlists und Warnung */
.usage-list { margin: 0; padding-left: 20px; color: var(--ink); }
.modal p.warning { color: var(--led); border: 1px solid rgba(255, 178, 36, .5); border-radius: 8px; padding: 8px 12px; }

/* Kopplungscode: gross und in Grossbuchstaben, wie auf dem TV */
.field input.code-input { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: .2em; text-transform: uppercase; }
.hint a { color: var(--led); }

/* Status der Bildschirme */
.summary { margin: -4px 0 0; }
.row .now-showing { color: var(--ink); }
.row .now-showing .source { color: var(--led); }
.status-details { gap: 8px; }
.status-details .label { font-size: .85rem; color: var(--muted); }
.status-details .facts { font-size: .9rem; }
.status-details dd { overflow-wrap: anywhere; }
.problem-list { margin: 4px 0 0; padding-left: 18px; font-size: .85rem; }
.problem-list .when { color: var(--muted); }
